Extended BNF
Syntactic Rules
- Use the standard ::= separator
- E.g., <source> ::= <general_term>
Semantic Rules
- Used when only a subset of the syntax makes semantic sense
- Use a :== separator
- E.g., <source> :== <dag_source> | <internal_source> | , etc.
- Extended to rules reachable from only such rules
Token Rules
- Used for rules that produce tokens
- Use a ::- separator
- E.g., <lower_word> ::- <lower_alpha><alpha_numeric>*
Character Macros
- Define character classes with regular expressions
- Use a ::: separator
- E.g., <lower_alpha> ::: [a-z]