Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://gplex.codeplex.com/" rel="nofollow">Gardens Point LEX</a> and the <a href="http://gppg.codeplex.com/" rel="nofollow">Gardens Point Parser Generator</a> are strongly influenced by LEX and YACC, and output C# code.</p> <p>Your grammar is simple enough that I think your current approach is fine, but kudos for wanting to learn the "real" way of doing it. :-) So here's my suggestion for a grammar (just the production rules; this is far from a full example. The actual GPPG file needs to replace the <code>...</code> by C# code for building the syntax tree, and you need token declarations etc. - read the GPPG examples in the documentation. And you also need the GPLEX file that describes the tokens):</p> <pre><code>/* Your input file is a list of "top level elements" */ TopLevel : TopLevel TopLevelElement { ... } | /* (empty) */ /* A top level element is either a comment or a block. The COMMENT token must be described in the GPLEX file as any line that starts with -- . */ TopLevelElement: Block { ... } | COMMENT { ... } /* A block starts with the token START (which, in the GPLEX file, is defined as the string "Start"), continues with some identifier (the block name), then has a list of elements, and finally the token END followed by an identifier. If you want to validate that the END identifier is the same as the START identifier, you can do that in the C# code that analyses the syntax tree built by GPPG. The token Identifier is also defined with a regular expression in GPLEX. */ Block: START Identifier BlockElementList END Identifier { ... } BlockElementList: BlockElementList BlockElement { ... } | /* empty */ BlockElement: (NAME | ADDRESS) QuotedString { ... } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload