7.1.3.2 Sequences and Groupings ¶
A sequence consists of elements usually separated by space or newline characters.
A sequence element can be:
- An input sequence where each element can be a terminal symbol, terminal symbol placeholder, or terminal symbol class.
See Input.
The input sequence can be a named terminal symbol segment.
- A put-back sequence where each element can be a terminal symbol, terminal symbol placeholder, or terminal symbol class.
See Put-Back.
The put-back sequence can be a named terminal symbol segment.
- An output terminal symbol.
See Output.
- A nonterminal symbol defined anywhere in the grammar by a production or copying assignment.
See Nonterminal Symbols.
- A specifier.
See Specifiers.
- An expression grouped by ‘(’ … ‘)’.
Use ‘(’ … ‘)’ to group elements into a single unit.
You can use ‘(’ … ‘)’ to group:
- sequence elements;
- sets of alternatives separated by ‘|’;
- loop bodies quantified by ‘*’;
- optional expression bodies quantified by ‘?’.
A grouped expression provides context for the specifiers #su… and #d.
They do not affect expressions outside of a group ( … ) containing the specifiers.
See Switching Spur Update Mode and Deferring a Terminal Symbol, for more information on the specifiers.