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

conditional_expression() protected method

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

            IToken  t = null;
            IToken  tgt = null;
            IToken  tlt = null;
            IToken  tnot = null;
            IToken  tis = null;
            IToken  tnint = null;
            IToken  tin = null;
            IToken  tisa = null;

                e = null;
                Expression r = null;
                BinaryOperatorType op = BinaryOperatorType.None;
                IToken token = null;
                TypeReference tr = null;

            try {      // for error handling
            e=sum();
            {    // ( ... )*
                for (;;)
                {
                    if ((tokenSet_113_.member(LA(1))))
                    {
                        {
                            switch ( LA(1) )
                            {
                            case IS:
                            case IN:
                            case NOT:
                            case CMP_OPERATOR:
                            case GREATER_THAN:
                            case LESS_THAN:
                            {
                                {
                                    {
                                        switch ( LA(1) )
                                        {
                                        case CMP_OPERATOR:
                                        {
                                            {
                                                t = LT(1);
                                                match(CMP_OPERATOR);
                                                if (0==inputState.guessing)
                                                {
                                                    op = OperatorParser.ParseComparison(t.getText()); token = t;
                                                }
                                            }
                                            break;
                                        }
                                        case GREATER_THAN:
                                        {
                                            {
                                                tgt = LT(1);
                                                match(GREATER_THAN);
                                                if (0==inputState.guessing)
                                                {
                                                    op = BinaryOperatorType.GreaterThan; token = tgt;
                                                }
                                            }
                                            break;
                                        }
                                        case LESS_THAN:
                                        {
                                            {
                                                tlt = LT(1);
                                                match(LESS_THAN);
                                                if (0==inputState.guessing)
                                                {
                                                    op = BinaryOperatorType.LessThan; token = tlt;
                                                }
                                            }
                                            break;
                                        }
                                        case NOT:
                                        {
                                            {
                                                tnint = LT(1);
                                                match(NOT);
                                                match(IN);
                                                if (0==inputState.guessing)
                                                {
                                                    op = BinaryOperatorType.NotMember; token = tnint;
                                                }
                                            }
                                            break;
                                        }
                                        case IN:
                                        {
                                            {
                                                tin = LT(1);
                                                match(IN);
                                                if (0==inputState.guessing)
                                                {
                                                    op = BinaryOperatorType.Member; token = tin;
                                                }
                                            }
                                            break;
                                        }
                                        default:
                                            if ((LA(1)==IS) && (LA(2)==NOT))
                                            {
                                                {
                                                    tnot = LT(1);
                                                    match(IS);
                                                    match(NOT);
                                                    if (0==inputState.guessing)
                                                    {
                                                        op = BinaryOperatorType.ReferenceInequality; token = tnot;
                                                    }
                                                }
                                            }
                                            else if ((LA(1)==IS) && (tokenSet_114_.member(LA(2)))) {
                                                {
                                                    tis = LT(1);
                                                    match(IS);
                                                    if (0==inputState.guessing)
                                                    {
                                                        op = BinaryOperatorType.ReferenceEquality; token = tis;
                                                    }
                                                }
                                            }
                                        else
                                        {
                                            throw new NoViableAltException(LT(1), getFilename());
                                        }
                                        break; }
                                    }
                                    r=sum();
                                }
                                break;
                            }
                            case ISA:
                            {
                                {
                                    tisa = LT(1);
                                    match(ISA);
                                    tr=type_reference();
                                    if (0==inputState.guessing)
                                    {

                                                    op = BinaryOperatorType.TypeTest;
                                                    token = tisa;
                                                    r = new TypeofExpression(tr.LexicalInfo, tr);

                                    }
                                }
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        if (0==inputState.guessing)
                        {

                                    BinaryExpression be = new BinaryExpression(ToLexicalInfo(token));
                                    be.Operator = op;
                                    be.Left = e;
                                    be.Right = r;
                                    e = be;

                        }
                    }
                    else
                    {
                        goto _loop523_breakloop;
                    }

                }
            _loop523_breakloop:				;
            }    // ( ... )*
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex, "conditional_expression");
                recover(ex,tokenSet_115_);
            }
            else
            {
                throw ex;
            }
            }
            return e;
        }
BooParserBase