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

assignment_or_method_invocation_with_block_stmt() protected method

protected assignment_or_method_invocation_with_block_stmt ( ) : Statement
return Statement
        protected Statement assignment_or_method_invocation_with_block_stmt()
        {
            Statement stmt;

            IToken  op = null;

                stmt = null;
                Expression lhs = null;
                Expression rhs = null;
                StatementModifier modifier = null;
                BinaryOperatorType binaryOperator = BinaryOperatorType.None;
                IToken token = null;

            try {      // for error handling
            lhs=slicing_expression();
            {
                switch ( LA(1) )
                {
                case DEF:
                case DO:
                case COLON:
                {
                    {
                        lhs=method_invocation_block(lhs);
                        if (0==inputState.guessing)
                        {
                            stmt = new ExpressionStatement(lhs);
                        }
                    }
                    break;
                }
                case ASSIGN:
                {
                    {
                        {
                            op = LT(1);
                            match(ASSIGN);
                            if (0==inputState.guessing)
                            {
                                token = op; binaryOperator = OperatorParser.ParseAssignment(op.getText());
                            }
                            {
                                if (((tokenSet_68_.member(LA(1))) && (tokenSet_90_.member(LA(2))))&&(_compact))
                                {
                                    rhs=array_or_expression();
                                }
                                else {
                                    bool synPredMatched490 = false;
                                    if (((LA(1)==DEF||LA(1)==DO||LA(1)==COLON)))
                                    {
                                        int _m490 = mark();
                                        synPredMatched490 = true;
                                        inputState.guessing++;
                                        try {
                                            {
                                                switch ( LA(1) )
                                                {
                                                case COLON:
                                                {
                                                    match(COLON);
                                                    break;
                                                }
                                                case DEF:
                                                {
                                                    match(DEF);
                                                    break;
                                                }
                                                case DO:
                                                {
                                                    match(DO);
                                                    break;
                                                }
                                                default:
                                                {
                                                    throw new NoViableAltException(LT(1), getFilename());
                                                }
                                                 }
                                            }
                                        }
                                        catch (RecognitionException)
                                        {
                                            synPredMatched490 = false;
                                        }
                                        rewind(_m490);
                                        inputState.guessing--;
                                    }
                                    if ( synPredMatched490 )
                                    {
                                        rhs=callable_expression();
                                    }
                                    else if ((tokenSet_68_.member(LA(1))) && (tokenSet_91_.member(LA(2)))) {
                                        {
                                            rhs=array_or_expression();
                                            {
                                                switch ( LA(1) )
                                                {
                                                case DEF:
                                                case DO:
                                                case COLON:
                                                {
                                                    rhs=method_invocation_block(rhs);
                                                    break;
                                                }
                                                case IF:
                                                case UNLESS:
                                                case WHILE:
                                                {
                                                    {
                                                        modifier=stmt_modifier();
                                                        eos();
                                                    }
                                                    break;
                                                }
                                                case EOL:
                                                case EOS:
                                                {
                                                    eos();
                                                    break;
                                                }
                                                default:
                                                {
                                                    throw new NoViableAltException(LT(1), getFilename());
                                                }
                                                 }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        throw new NoViableAltException(LT(1), getFilename());
                                    }
                                    }
                                }
                            }
                            if (0==inputState.guessing)
                            {

                                                stmt = new ExpressionStatement(
                                                        new BinaryExpression(ToLexicalInfo(token),
                                                            binaryOperator,
                                                            lhs, rhs));
                                                stmt.Modifier = modifier;

                            }
                        }
                        break;
                    }
                    default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                     }
                }
            }
            catch (RecognitionException ex)
            {
                if (0 == inputState.guessing)
                {
                    reportError(ex, "assignment_or_method_invocation_with_block_stmt");
                    recover(ex,tokenSet_82_);
                }
                else
                {
                    throw ex;
                }
            }
            return stmt;
        }
BooParserBase