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

for_stmt() protected method

protected for_stmt ( ) : ForStatement
return ForStatement
        protected ForStatement for_stmt()
        {
            ForStatement fs;

            IToken  f = null;
            IToken  or = null;
            IToken  et = null;

                fs = null;
                Expression iterator = null;
                DeclarationCollection declarations = null;
                Block body = null;

            try {      // for error handling
            f = LT(1);
            match(FOR);
            if (0==inputState.guessing)
            {

                        fs = new ForStatement(ToLexicalInfo(f));
                        declarations = fs.Declarations;
                        body = fs.Block;

            }
            declaration_list(declarations);
            match(IN);
            iterator=array_or_expression();
            if (0==inputState.guessing)
            {
                fs.Iterator = iterator;
            }
            compound_stmt(body);
            {
                switch ( LA(1) )
                {
                case OR:
                {
                    or = LT(1);
                    match(OR);
                    if (0==inputState.guessing)
                    {
                        fs.OrBlock = new Block(ToLexicalInfo(or));
                    }
                    compound_stmt(fs.OrBlock);
                    break;
                }
                case EOF:
                case DEDENT:
                case ESEPARATOR:
                case ASSEMBLY_ATTRIBUTE_BEGIN:
                case MODULE_ATTRIBUTE_BEGIN:
                case ABSTRACT:
                case BREAK:
                case CONTINUE:
                case CALLABLE:
                case CAST:
                case CHAR:
                case CLASS:
                case DEF:
                case ENUM:
                case EVENT:
                case FINAL:
                case FOR:
                case FALSE:
                case GOTO:
                case INTERFACE:
                case INTERNAL:
                case IF:
                case NEW:
                case NULL:
                case OVERRIDE:
                case PARTIAL:
                case PUBLIC:
                case PROTECTED:
                case PRIVATE:
                case RAISE:
                case RETURN:
                case SELF:
                case SUPER:
                case STATIC:
                case STRUCT:
                case THEN:
                case TRY:
                case TRANSIENT:
                case TRUE:
                case TYPEOF:
                case UNLESS:
                case VIRTUAL:
                case WHILE:
                case YIELD:
                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 COLON:
                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:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            {
                if ((LA(1)==THEN) && (LA(2)==COLON))
                {
                    et = LT(1);
                    match(THEN);
                    if (0==inputState.guessing)
                    {
                        fs.ThenBlock = new Block(ToLexicalInfo(et));
                    }
                    compound_stmt(fs.ThenBlock);
                }
                else if ((tokenSet_82_.member(LA(1))) && (tokenSet_48_.member(LA(2)))) {
                }
                else
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }

            }
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex, "for_stmt");
                recover(ex,tokenSet_82_);
            }
            else
            {
                throw ex;
            }
            }
            return fs;
        }
BooParserBase