exip
Alpha 0.5.4
|
For a sample grammar G:
A grammar production is for example "NonTerminal_0 : Terminal_1 NonTerminal_0 0". All grammar productions with the same left-hand side define a grammar rule. Therefore, the grammar G has 2 grammar rules and 6 grammar productions.
A single grammar production is represented by the struct Production. The [Terminal] is represented by the event type, the type of the value content if any and a fully qualified name. The [NonTerminal] is a non-negative integer value. The last part of the production (the event code) is implicitly encoded as a position of the production in the grammar rule.
The event codes in a production are represented as follow:
For every grammar rule there is an array of grammar productions. It contains the productions with event codes with length 1 (having only one part). The last production in the production array has event code 0, the production before it 1 etc. - that is they are stored in reverse order