A template grammar can contain assembler code insertions enclosed in ‘{’ and ‘}’, for example:
A: . { push_random
set_random true } ( { pop_random } .
| { pop_random } . .
| { pop_random } . . .
)
;
Note: processing a template grammar with assembler code insertions usually requires changing parser source code to define corresponding instruction meta-classes and register corresponding instruction classes in the instruction class set (for
push_random,set_random, andpop_randomin the above example).