Providing hands-on examples for a GUI interface is not as straight forward as for static, command-line examples or single HTML-page examples. apg.html requires several different types of input, including manual keyboard actions. The approach here is that for each example, a grammar and one or more parser input files will be provided, along with a “README.html” file to provide instructions and suggestions for completing the example. General instructions that can be followed for each of the examples are given here and not repeated in each specific example.
grammar.bnf file and paste it into the
Generator panel. Click
Parser panel will open and display the generated parser. You may find it instructive to click on the
Attributes panels to see specific details about the grammar. But if this were your own grammar and the parser were all you wanted, at this point you would simply copy the contents of the
Parser panel <textarea> and paste it into your application. For the examples, however, click
Input to open up the input <textarea>.
Open one of the input (*.txt) files in a text editor. Copy and paste it into the
Input <textarea> and click
Parse Input. The
Phrases panel will open and you can use the drop-down menu to select a phrase name and the arrow buttons to peruse the matched phrases. For more detail, click the
Configure panel. Here you can choose to show the trace and select which rules and operators to display.