Skip to content
Ashish Agarwal edited this page Jun 8, 2014 · 1 revision

Level

Levels take parts of Camlp4 Grammar Extensions, expressed with the <EXTEND> syntax.

Merely an <entry> is a list of levels. And a <level> is an optional name, an optional associativity (left by default) and a list of rules.

Example:

 EXTEND Gram
   expression:
   [ "top"
     [ ... ]
   | "+"
     [ ... ]
   | "*"
     [ ... ]
   | "**" RIGHTA
     [ ... ]
   ...
   | "simple"
     [ ... ] ]
   ;
 END;;

Here "top", "+", "*", "**", and "simple" are level names.