A bottom-up template grammar can contain nonterminal symbol classes. They are similar to terminal symbol classes with the following differences:
Nonterminal symbol classes can take part in symbol class expressions. See Symbol Class Expressions, for more information.
Example 1
[ A B C3 D ]This is a nonterminal symbol class containing the nonterminal symbols
A,B,C3, andD. The grammar should contain their definitions anywhere in its text using productions of the formA: ... ; B: ... ; C3: ... ; D: ... ;Example 2
[ L2_0 L2_1 :L1: :W: ]This is a nonterminal symbol class containing the nonterminal symbols
L2_0andL2_1and the named nonterminal symbol classesL1andW. The grammar must contain definitions of the named nonterminal symbol classes earlier in its text.
A bottom-up template grammar can contain nonterminal symbol classes instead of ordinary nonterminal symbols in production right-hand sides.
Example
S: [ A B ] [ C D ] | [:W:] [:W:] [:W:] ;