예제 #1
0
        private ProgramNode program()
        {
            SymbolTable.CreateGlobalScope();
            statementList();
            StatementListNode statementListNode = (StatementListNode)_stack.Pop();
            ProgramNode       program           = new ProgramNode(statementListNode.Statements, _filename);

            return(program);
        }
예제 #2
0
        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);
        }