예제 #1
0
        public IExpression relationalExpression()
        {
            IExpression exp1 = null;
            IExpression exp2 = null;
            exp1 = orEqualExpression();
            while (true)
            {
                if (jj_2_6(3))
                {
                    ;
                }
                else
                {
                    //UPGRADE_NOTE: Labeled break statement was changed to a goto statement. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1012_3"'
                    goto label_2_brk;
                }
                if (jj_2_7(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_LT);
                    exp2 = orEqualExpression();
                    exp1 = new ArithCompareOp(ArithCompareOpImpl.LT, exp1, exp2);
                }
                else if (jj_2_8(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_GT);
                    exp2 = orEqualExpression();
                    exp1 = new ArithCompareOp(ArithCompareOpImpl.GT, exp1, exp2);
                }
                else
                {
                    jj_consume_token(- 1);
                    throw new ParseException();
                }
            }
            //UPGRADE_NOTE: Label 'label_2_brk' was added. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1011_3"'

            label_2_brk: ;

            {
                if (true)
                    return exp1;
            }
            throw new System.ApplicationException("Missing return statement in function");
        }
예제 #2
0
        public IExpression equalExpression()
        {
            IExpression exp1 = null;
            IExpression exp2 = null;
            IExpression exp3 = null;
            SupportClass.SetSupport set_Renamed = null;
            exp1 = additiveExpression();
            while (true)
            {
                if (jj_2_12(3))
                {
                    ;
                }
                else
                {
                    //UPGRADE_NOTE: Labeled break statement was changed to a goto statement. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1012_3"'
                    goto label_4_brk;
                }
                if (jj_2_13(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_NE);
                    exp2 = additiveExpression();
                    if (exp1 is IExpressionNumeric || exp2 is IExpressionNumeric)
                        exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new ArithCompareOp(ArithCompareOpImpl.EQ, exp1, exp2));
                    else if (exp1 is IExpressionBool || exp2 is IExpressionBool)
                        exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new OpBoolEQ(exp1, exp2));
                    else if (exp1 is IExpressionString || exp2 is IExpressionString)
                        exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new OpStringEQ(exp1, exp2));
                    else
                    {
                        if (exp1 is Identifier && exp2 is Identifier)
                        {
                            if (true)
                                throw new ParseException("Syntax error: LHS (" + ((Identifier)exp1).ToString() + ") and RHS (" + ((Identifier)exp2).ToString() + ") cannot both be identifiers");
                        }
                        else
                        {
                            if (true)
                                throw new ParseException("Syntax error: " + ((Identifier)exp1).ToString() + " <> " + ((Identifier)exp2).ToString());
                        }
                    }
                }
                else if (jj_2_14(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_EQ);
                    exp2 = additiveExpression();
                    if (exp1 is IExpressionNumeric || exp2 is IExpressionNumeric)
                        exp1 = new ArithCompareOp(ArithCompareOpImpl.EQ, exp1, exp2);
                    else if (exp1 is IExpressionBool || exp2 is IExpressionBool)
                        exp1 = new OpBoolEQ(exp1, exp2);
                    else if (exp1 is IExpressionString || exp2 is IExpressionString)
                        exp1 = new OpStringEQ(exp1, exp2);
                    else
                    {
                        if (exp1 is Identifier && exp2 is Identifier)
                        {
                            if (true)
                                throw new ParseException("Syntax error: LHS (" + exp1.ToString() + ") and RHS (" + exp2.ToString() + ") cannot both be identifiers");
                        }
                        else
                        {
                            if (true)
                                throw new ParseException("Syntax error: " + exp1.ToString() + " = " + exp2.ToString());
                        }
                    }
                }
                else if (jj_2_15(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_IS);
                    exp1 = nullExp(exp1);
                }
                else if (jj_2_16(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_BETWEEN);
                    exp2 = additiveExpression();
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_AND);
                    exp3 = additiveExpression();
                    exp1 = new OpBETWEEN(exp1, exp2, exp3);
                }
                else if (jj_2_17(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_IS);
                    exp1 = nullExp(exp1);
                }
                else if (jj_2_18(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_NOT);
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_BETWEEN);
                    exp2 = additiveExpression();
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_AND);
                    exp3 = additiveExpression();
                    exp1 = new OpBETWEEN(exp1, exp2, exp3);
                    exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, exp1);
                }
                else if (jj_2_19(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_LIKE);
                    exp1 = likeExp(exp1);
                }
                else if (jj_2_20(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_NOT);
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_LIKE);
                    exp1 = likeExp(exp1);
                    exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, exp1);
                }
                else if (jj_2_21(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_IN);
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_LPAREN);
                    //UPGRADE_TODO: Class 'java.util.HashSet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilHashSet_3"'
                    set_Renamed = new SupportClass.HashSetSupport();
                    stringList(set_Renamed);
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_RPAREN);
                    exp1 = new OpIN(exp1, set_Renamed);
                }
                else if (jj_2_22(3))
                {
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_NOT);
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_IN);
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_LPAREN);
                    //UPGRADE_TODO: Class 'java.util.HashSet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilHashSet_3"'
                    set_Renamed = new SupportClass.HashSetSupport();
                    stringList(set_Renamed);
                    jj_consume_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_RPAREN);
                    exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new OpIN(exp1, set_Renamed));
                }
                else
                {
                    jj_consume_token(- 1);
                    throw new ParseException();
                }
            }
            //UPGRADE_NOTE: Label 'label_4_brk' was added. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1011_3"'

            label_4_brk: ;

            {
                if (true)
                    return exp1;
            }
            throw new System.ApplicationException("Missing return statement in function");
        }