Symbol Record

Structure

Each record describing a symbol in the Symbol Table is preceded by a byte containing the value 83 - the ASCII value of "S". The file will contain one of these records for each symbol in the grammar. The Table Count record, which precedes any symbol records, will contain the total number of symbols.

Fields

Item Type Description
Index Integer This parameter holds the index of the symbol in the Symbol Table. The symbol should be stored directly at this Index.
Name String The name of the symbol is stored as a Unicode string.
Kind Integer This number denotes the kind (or type) of the symbol.  The description of each constant is described below:

Symbol 'Type' Constants

Value Name Description
0 Nonterminal Normal Nonterminal
1 Terminal Normal Terminal
2 Noise Noise terminal. These are ignored by the parser. Comments and whitespace are considered 'noise'.
3 End of File End Character - End of File. This symbol is used to represent the end of the file or the end of the source input.
4 Group Start Lexical group start.
5 Ground End Lexical group end. Groups can end with normal terminals as well.
6 Decremented This was used in the CGT file format. It is not used in EGT.
7 Error Error Terminal. If the parser encounters an error reading a token, this kind of symbol can used to differentiate it from other terminal types.