Boo.Lang.Parser.BooParserBase.typed_array C# (CSharp) Method

typed_array() protected method

protected typed_array ( ) : Expression
return Expression
        protected Expression typed_array()
        {
            Expression e;

            IToken  t = null;

                e = null;
                ArrayLiteralExpression tle = null;
                TypeReference tr = null;
                Expression item = null;

            try {      // for error handling
            t = LT(1);
            match(LPAREN);
            match(OF);
            tr=type_reference();
            match(COLON);
            if (0==inputState.guessing)
            {

                        e = tle = new ArrayLiteralExpression(ToLexicalInfo(t));
                        tle.Type = new ArrayTypeReference(tr.LexicalInfo, tr);

            }
            {
                switch ( LA(1) )
                {
                case COMMA:
                {
                    match(COMMA);
                    break;
                }
                case ESEPARATOR:
                case CAST:
                case CHAR:
                case FALSE:
                case NOT:
                case NULL:
                case SELF:
                case SUPER:
                case THEN:
                case TRUE:
                case TYPEOF:
                case TRIPLE_QUOTED_STRING:
                case LPAREN:
                case DOUBLE_QUOTED_STRING:
                case SINGLE_QUOTED_STRING:
                case ID:
                case MULTIPLY:
                case LBRACK:
                case SPLICE_BEGIN:
                case DOT:
                case LBRACE:
                case QQ_BEGIN:
                case SUBTRACT:
                case LONG:
                case INCREMENT:
                case DECREMENT:
                case ONES_COMPLEMENT:
                case INT:
                case BACKTICK_QUOTED_STRING:
                case RE_LITERAL:
                case DOUBLE:
                case FLOAT:
                case TIMESPAN:
                {
                    {
                        item=expression();
                        if (0==inputState.guessing)
                        {
                            tle.Items.Add(item);
                        }
                        {    // ( ... )*
                            for (;;)
                            {
                                if ((LA(1)==COMMA) && (tokenSet_5_.member(LA(2))))
                                {
                                    match(COMMA);
                                    item=expression();
                                    if (0==inputState.guessing)
                                    {
                                        tle.Items.Add(item);
                                    }
                                }
                                else
                                {
                                    goto _loop570_breakloop;
                                }

                            }
            _loop570_breakloop:							;
                        }    // ( ... )*
                        {
                            switch ( LA(1) )
                            {
                            case COMMA:
                            {
                                match(COMMA);
                                break;
                            }
                            case RPAREN:
                            {
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                    }
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            match(RPAREN);
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex, "typed_array");
                recover(ex,tokenSet_41_);
            }
            else
            {
                throw ex;
            }
            }
            return e;
        }
BooParserBase