예제 #1
0
        private ExpressionList ParseExpressionList()
        {
            ExpressionList list = new ExpressionList();
            TokenId        last = TokenId.Eof;

            while (true)
            {
                switch (_curtok.TokenId)
                {
                case TokenId.Comma:
                {
                    list.Add(new NullPrimitive(_curtok));
                    break;
                }

                case TokenId.RBracket:
                {
                    if (last == TokenId.Comma)
                    {
                        list.Add(new NullPrimitive(_curtok));
                    }
                    break;
                }

                default:
                {
                    list.Add(ParseExpression());
                    break;
                }
                }

                if (_curtok.TokenId != TokenId.Comma)
                {
                    break;
                }

                last = _curtok.TokenId;
                Advance();
            }

            return(list);
        }
예제 #2
0
 public ElementAccessExpression(ExpressionNode leftSide, ExpressionList expressions)
     : base(leftSide.RelatedToken)
 {
     _leftSide    = leftSide;
     _expressions = expressions;
 }