In this contrived example we can see that we could apply repetitions (*, +, ?) and separators to subexpression in between (). Thus (B C)* means zero or more sequences of B C, and (B C)*[COMMA] is the same but requires comma separator between any two B C match.
Also, assignments could accept a group instead a rule reference. Groups can be nested at an arbitrary level.
Idea is to be able to use parentheses in place of symbol references. This would make grammars more compact and natural for some syntactic constructs.
For example:
In this contrived example we can see that we could apply repetitions (
*
,+
,?
) and separators to subexpression in between()
. Thus(B C)*
means zero or more sequences ofB C
, and(B C)*[COMMA]
is the same but requires comma separator between any twoB C
match.Also, assignments could accept a group instead a rule reference. Groups can be nested at an arbitrary level.