Next: , Up: topdown   [Contents][Index]


7.3.1 Template Grammar Format

A template grammar consists of productions. Every production ends with ‘;’. The left-hand side of a production is a nonterminal symbol. The right-hand side of a production is normally a regular expression containing nonterminal symbols, terminal symbols, terminal symbol placeholders ‘.’, and terminal symbol classes. If specific terminal symbols or terminal symbol classes do not act as look-ahead symbols, the parser treats them as ‘.’.

Empty lines and extra spaces between the tokens of a template grammar do not affect its interpretation. The template grammar can contain end-of-line comments starting with ‘//’ and comments enclosed in ‘/*’ and ‘*/’.

Warning: if a template grammar is expandable to the empty sequence, the parser may get into an infinite loop.