exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Representing the EXI grammars in EXIP

For a sample grammar G:

NonTerminal_0 :
Terminal_1 NonTerminal_0 0
Terminal_2 NonTerminal_1 1.0
Terminal_3 NonTerminal_1 1.1.0
NonTerminal_1 :
Terminal_4 NonTerminal_1 0
Terminal_5 NonTerminal_1 1
EE

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.

Event codes representation

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