ParseList() protected method

protected ParseList ( Token token, ICodeNode parentNode, PascalTokenType terminator, PascalErrorCode errorCode ) : void
token Token
parentNode ICodeNode
terminator PascalTokenType
errorCode PascalErrorCode
return void
コード例 #1
0
        // Parse a compound statement.
        public override ICodeNode Parse(Token token)
        {
            token = NextToken();

            // Create the compound node.
            ICodeNode compoundNode = ICodeFactory.CreateICodeNode(ICodeNodeTypeImplementation.COMPOUND);

            // Parse the statement list terminated by the END token.
            StatementParser statementParser = new StatementParser(this);
            statementParser.ParseList(token, compoundNode, PascalTokenType.END, PascalErrorCode.MISSING_END);

            return compoundNode;
        }
コード例 #2
0
        // Parse a compound statement.
        public override ICodeNode Parse(Token token)
        {
            token = NextToken();

            // Create the compound node.
            ICodeNode compoundNode = ICodeFactory.CreateICodeNode(ICodeNodeTypeImplementation.COMPOUND);

            // Parse the statement list terminated by the END token.
            StatementParser statementParser = new StatementParser(this);

            statementParser.ParseList(token, compoundNode, PascalTokenType.END, PascalErrorCode.MISSING_END);

            return(compoundNode);
        }