Declarations

 

SYMBOL TABLE:

variable Symbol-Table is an array of Symbol

 

RULE TABLE:

variable Rule-Table is an array of Rule-State

 

INPUT-STACK
The Input-stack is used to store tokens either created by the developer or LexerGetToken( ) function. Tokens can be pushed and popped from the Token-Stack to recover from syntax and lexical errors.  As a result, this variable could be made public or an interface can be built to the push and pop methods. This can also be implemented as a stack/queue. It depends if your implementation will read multiple tokens at a time.

variable input-stack is a stack of Token

 

DFA TOKENIZER:
These variables are used to store information about the DFA State Graph.

variable DFA-Table is an array of DFA-State

variable Initial-DFA-State is a DFA-State

 

LALR PARSER:
The following variables are used primarily by the ParseToken( ) function to implement the LALR parser. All three should be made private.

variable LALR-Table is an array of LALR-State

variable Initial-LALR-State is a LALR-State

variable LALR-Token-Stack is a stack of Token

 

MISCELLANEOUS:
The Comment-Level variable is used by the Parse( ) function to keep track of the depth of the block comments.

variable Comment-Level is an integer