UnityScript.Parser.UnityScriptParser.array_literal C# (CSharp) Method

array_literal() public method

public array_literal ( ) : Expression
return Expression
        public Expression array_literal()
        {
            Expression expression = null;
            IToken token = null;
            try
            {
                token = this.LT(1);
                this.match(0x44);
                bool flag = false;
                if (tokenSet_16_.member(this.LA(1)) && tokenSet_59_.member(this.LA(2)))
                {
                    int num = this.mark();
                    flag = true;
                    base.inputState.guessing++;
                    try
                    {
                        this.expression();
                        this.match(0x12);
                    }
                    catch (RecognitionException)
                    {
                        flag = false;
                    }
                    this.rewind(num);
                    base.inputState.guessing--;
                }
                if (flag)
                {
                    IToken token2;
                    Declaration declaration;
                    Expression expression4;
                    Expression projection = this.expression();
                    this.match(0x12);
                    this.match(0x3f);
                    int num2 = this.LA(1);
                    switch (num2)
                    {
                        case 12:
                        case 0x10:
                        case 0x21:
                        case 0x3b:
                            token2 = this.identifier();
                            break;

                        default:
                            if (num2 != 0x2d)
                            {
                                throw new NoViableAltException(this.LT(1), this.getFilename());
                            }
                            declaration = this.declaration();
                            break;
                    }
                    this.match(0x18);
                    Expression expression3 = this.expression();
                    this.match(0x40);
                    switch (this.LA(1))
                    {
                        case 0x15:
                            this.match(0x15);
                            expression4 = this.expression();
                            break;

                        case 0x45:
                            break;

                        default:
                            throw new NoViableAltException(this.LT(1), this.getFilename());
                    }
                    if (base.inputState.guessing == 0)
                    {
                        if (token2 != null)
                        {
                            Declaration declaration2;
                            Declaration declaration1 = declaration2 = new Declaration(ToLexicalInfo(token2));
                            declaration2.set_Name(token2.getText());
                            declaration = declaration2;
                        }
                        expression = CodeFactory.NewArrayComprehension(ToLexicalInfo(token), projection, declaration, expression3, expression4);
                    }
                }
                else
                {
                    ExpressionCollection expressions;
                    if (!tokenSet_60_.member(this.LA(1)) || !tokenSet_20_.member(this.LA(2)))
                    {
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                    }
                    if (base.inputState.guessing == 0)
                    {
                        ArrayLiteralExpression expression5;
                        expression = expression5 = new ArrayLiteralExpression(ToLexicalInfo(token));
                        expressions = expression5.get_Items();
                    }
                    this.expression_list(expressions);
                }
                this.match(0x45);
            }
            catch (RecognitionException exception2)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception2);
                this.recover(exception2, tokenSet_20_);
                return expression;
            }
            return expression;
        }
UnityScriptParser