private ProgramNode program() { SymbolTable.CreateGlobalScope(); statementList(); StatementListNode statementListNode = (StatementListNode)_stack.Pop(); ProgramNode program = new ProgramNode(statementListNode.Statements, _filename); return(program); }
private void statementList() { int line = _line; int position = _position; List <Node> statements = new List <Node>(); while (statement()) { statements.Add(_stack.Pop()); } StatementListNode node = new StatementListNode(statements, _filename, line, position); _stack.Push(node); }