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

for_in() public method

public for_in ( Block container ) : Statement
container Block
return Statement
        public Statement for_in(Block container)
        {
            Statement stmt = null;
            try
            {
                Declaration declaration2;
                Block block;
                int num = this.LA(1);
                switch (num)
                {
                    case 12:
                    case 0x10:
                    case 0x21:
                    case 0x3b:
                    {
                        IToken token = this.identifier();
                        if (base.inputState.guessing == 0)
                        {
                            Declaration declaration;
                            Declaration declaration1 = declaration = new Declaration(ToLexicalInfo(token));
                            declaration.set_Name(token.getText());
                            declaration2 = declaration;
                        }
                        break;
                    }
                    default:
                        if (num != 0x2d)
                        {
                            throw new NoViableAltException(this.LT(1), this.getFilename());
                        }
                        declaration2 = this.declaration();
                        if (base.inputState.guessing == 0)
                        {
                            DeclarationAnnotations.ForceNewVariable(declaration2);
                        }
                        break;
                }
                this.match(0x18);
                Expression expression = this.expression();
                if (base.inputState.guessing == 0)
                {
                    ForStatement statement2;
                    ForStatement statement1 = statement2 = new ForStatement();
                    statement2.set_Iterator(expression);
                    ForStatement statement3 = statement2;
                    statement3.get_Declarations().Add(declaration2);
                    block = statement3.get_Block();
                    stmt = statement3;
                    container.Add(stmt);
                    this.EnterLoop(stmt);
                }
                this.match(0x40);
                this.compound_or_single_stmt(block);
                if (base.inputState.guessing == 0)
                {
                    this.LeaveLoop(stmt);
                }
            }
            catch (RecognitionException exception)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception);
                this.recover(exception, tokenSet_15_);
                return stmt;
            }
            return stmt;
        }
UnityScriptParser