The reference parser service is hosted at parser.cgi. You should POST to this endpoint over HTTP using the documented interface. We also provide a convenient command-line client script that lets you specify a grammar file and inputs to parse.
Query Parameter | Description |
---|---|
grammar |
The grammar from which to generate a parser. This grammar should include semantic actions so that you may generate meaningful output. |
server_grammar |
A file on the server that contains a grammar from which to generate a
parser. This parameter is only used if the grammar
parameter is unspecified or its value is empty.
|
input |
The input to parse. You may specify multiple inputs to parse in a
batch run; simply include the input parameter multiple
times in your POST request.
|
After the service successfully parses your inputs, it will return a
JSON-encoded response, whose keys are
the inputs and values are strings of Python code that will execute your
grammar's semantic actions on each respective input. You can think of
this process as lazily evaluating the semantic actions; the
server promises that its response will evaluate to your input's semantic
value, but you do not get the result of the computation until you
forcefully eval()
the promise.
You may get an error message if you forget to provide a grammar or the server is otherwise unable to handle your request. If you are unlucky (mainly if the server crashes), you may only receive some sort of HTTP error code.
All requests are logged, so don't submit any personal information. But you wouldn't do that over plain HTTP anyway, would you?