File Content: Rules

Structure

cgt-rule.gif (1752 bytes)

Each record describing a rule in the Rule Table is preceded by a byte field containing the value 82 - the ASCII code for 'R'. The file will contain one of these records for each rule in the grammar. The Table Count record, which precedes any rule records, will contain the total number of rules.

Fields

Item Type Description
Index Integer This parameter holds the index of the rule in the Rule Table. The resulting rule should be stored at this Index.
Nonterminal Integer Each rule derives a single nonterminal symbol. This field contains the index of the symbol in the Symbol Table.
(Reserved) Empty This field is reserved for future use.
Symbol 0 ... n Integer The remaining entries in the record will contain a series of indexes to symbols in the Symbol Table. These constitute the symbols, both terminals and nonterminals, that define the rule. There can be 0 or more total symbols.