예제 #1
0
        public override void Parse(Parser parser)
        {
            var token = parser.Lexer.ReadNext();

            if (token.TokenType == TokenType.Identifier)
            {
                Left  = new IdentifierNode(token);
                token = parser.ReadNext();
                while (!(token.TokenType == TokenType.Eos) && !(token.TokenType == TokenType.Fail))
                {
                    Right = new BehaviorsNode(token);
                    Right.Parse(parser);
                    token = parser.Lexer.ReadNext();
                }
            }
        }
예제 #2
0
        public override void Parse(Parser parser)
        {
            Left = new BehaviorNode(Token);
            Left.Parse(parser);
            var token = parser.Peek();

            if (token.TokenType == TokenType.Eos)
            {
                return;
            }
            if (token.TokenType == TokenType.Fail)
            {
                Right = new FailNode(token);
                return;
            }
            Right = new BehaviorsNode(token);
            Right.Parse(parser);
        }