Example #1
0
        public Parser()
        {
            lexicalAnalyzer = new LexicalAnalyzer();
            symbolTable     = new SymbolTable();
            tacGenerator    = new TACGenerator();

            lexicalAnalyzer.GetNextToken();
        }
Example #2
0
 /// <summary>
 /// Name: Parser
 /// Input: LexicalAnalyzer
 /// Output: N/A
 /// Description: Constructor for the parser class. Takes in and initalizes the
 /// lexical analyzer and also primes the parser with the first token.
 /// </summary>
 /// <param name="lex"></param>
 public Parser(LexicalAnalyzer lex, SymbolTable symTab)
 {
     mySymTab = symTab;
     myLex    = lex;
     myLex.GetNextToken(); //Prime the parser
 }