示例#1
0
        private AstItem ReadIndexerAssignment(TokenIterator tokens)
        {
            var name = tokens.PopExpected(TokenKind.Word);

            tokens.PopExpected(TokenKind.SquareBracketOpen);
            var indexExpression = ReadExpression(tokens, TokenKind.SquareBracketClose);

            tokens.PopExpected(TokenKind.SquareBracketClose);

            tokens.PopExpected(TokenKind.AssigmnentOperator);

            var valueExpression = ReadExpression(tokens, TokenKind.SemiColon);

            tokens.PopExpected(TokenKind.SemiColon);

            return(AstItem.PointerIndexAssignment(name.Value, indexExpression, valueExpression));
        }