Examples of Expr


Examples of org.jostraca.tree.path.expr.Expr

import org.jostraca.tree.Node;

public class ExprTest extends TestCase {

  public void testHappy() {
    Expr expr = new Expr() {
      public Object eval(Node pNode) {
        return null;
      }
    };

    assertEquals( false, expr.convertToBoolean(null) );
   
    assertEquals( false, expr.convertToBoolean(false) );
    assertEquals( true,  expr.convertToBoolean(true) );
    assertEquals( false, expr.convertToBoolean(new Boolean(false)));
    assertEquals( true,  expr.convertToBoolean(new Boolean(true)));
   
    assertEquals( true,  expr.convertToBoolean(new Long(-1)));
    assertEquals( false, expr.convertToBoolean(new Long(0)));
    assertEquals( true,  expr.convertToBoolean(new Long(1)));

    assertEquals( true,  expr.convertToBoolean(new Double(-1.0)));
    assertEquals( false, expr.convertToBoolean(new Double(0.0)));
    assertEquals( true,  expr.convertToBoolean(new Double(1.0)));

    assertEquals( true,  expr.convertToBoolean("a"));
    assertEquals( false, expr.convertToBoolean(""));
    assertEquals( true,  expr.convertToBoolean("true"));
    assertEquals( false, expr.convertToBoolean("false"));
  }
View Full Code Here

Examples of org.openquark.cal.compiler.SourceModel.Expr

        if (marshaler == null) {
            throw (new NullPointerException ("The marshaler must be non-null for an OutputPolicy."));
        }
       
        //parse the marshaler
        Expr marshalerExpr = SourceModelUtilities.TextParsing.parseExprIntoSourceModel(marshaler);
       
        if (marshalerExpr == null) {
            throw (new IllegalArgumentException("The marshaler cannot be parsed: " + marshaler));
        }
       
View Full Code Here

Examples of org.papoose.core.filter.Expr

    public ServiceReference[] getAllServiceReferences(BundleController bundleController, String clazz, String filter) throws InvalidSyntaxException
    {
        synchronized (lock)
        {
            Expr expr = (filter == null ? null : framework.getParser().parse(filter));
            List<ServiceReference> result = new ArrayList<ServiceReference>();

            for (ServiceEntry entry : serviceEntries.values())
            {
                ServiceRegistrationImpl registration = entry.getRegistration();
                ServiceRegistrationImpl.ServiceReferenceImpl reference = (ServiceRegistrationImpl.ServiceReferenceImpl) registration.getReference();
                Dictionary<String, Object> p = reference.getProperties();

                boolean found = true;
                if (clazz != null)
                {
                    found = false;
                    for (String objectClass : (String[]) p.get(Constants.OBJECTCLASS))
                    {
                        if (objectClass.equals(clazz))
                        {
                            found = true;
                            break;
                        }
                    }
                }
                if (!found) continue;

                boolean secure = true;
                for (String objectClass : (String[]) p.get(Constants.OBJECTCLASS))
                {
                    try
                    {
                        SecurityUtils.checkServicePermission(objectClass, ServicePermission.GET);
                    }
                    catch (SecurityException e)
                    {
                        secure = false;
                        break;
                    }
                }
                if (!secure) continue;

                if (expr != null && !expr.match(p)) continue;

                result.add(reference);
            }

            return sortedReferences(result);
View Full Code Here

Examples of org.python.antlr.ast.Expr

        set(new Name(node, tmp_append, expr_contextType.Store));

        java.util.List<expr> args = new ArrayList<expr>();
        args.add(node.getInternalElt());
        stmt n = new Expr(node, new Call(node, new Name(node, tmp_append, expr_contextType.Load),
                args,
                new ArrayList<keyword>(), null, null));

        for (int i = node.getInternalGenerators().size() - 1; i >= 0; i--) {
            comprehension lc = node.getInternalGenerators().get(i);
View Full Code Here

Examples of org.python.antlr.base.expr

            defaultStartsFromIndex = defaultStartsFromIndex - defaults.size();

        List<Argument> argsList = new ArrayList<Argument>();
        if (args.size() > 0) {
            for (int i = 0; i < args.size(); i++) {
                expr argNode = args.get(i);
                expr defaultValue = null;
                if (i >= defaultStartsFromIndex) {
                    defaultValue = defaults.get(i - defaultStartsFromIndex);
                }
                Argument arg = makeArgFromNode(argNode, defaultValue);
                argsList.add(arg);
View Full Code Here

Examples of org.python.parser.ast.Expr

        String tmp_append = "_[" + (++list_comprehension_count) + "]";

        set(new Name(tmp_append, Name.Store, node));

        stmtType n = new Expr(new Call(new Name(tmp_append, Name.Load, node), new exprType[] { node.elt },
                new keywordType[0], null, null, node), node);

        for (int i = node.generators.length - 1; i >= 0; i--) {
            listcompType lc = node.generators[i];
            for (int j = lc.ifs.length - 1; j >= 0; j--) {
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.Expr

            return null;
        }
        stmtType[] body = astNode.body;

        if (body.length > 0 && body[0] instanceof Expr) {
            Expr expr = (Expr) body[0];
            return expr.value;
        }
        return null;
    }
View Full Code Here

Examples of org.teavm.javascript.ast.Expr

        }
        if (!invoke.getMethod().getName().equals("wrap") ||
                !invoke.getMethod().getDescriptor().parameterType(0).isObject("java.lang.String")) {
            return null;
        }
        Expr arg = invoke.getArguments().get(0);
        if (!(arg instanceof ConstantExpr)) {
            return null;
        }
        ConstantExpr constant = (ConstantExpr)arg;
        return constant.getValue() instanceof String ? (String)constant.getValue() : null;
View Full Code Here

Examples of soot.jimple.Expr

                        bodyList.add(Jimple.v().newAssignStmt(
                                counterLocal,
                                Jimple.v().newAddExpr(counterLocal,
                                        IntConstant.v(1))));

                        Expr conditionalExpr = Jimple.v().newLtExpr(
                                counterLocal, expr.getArg(1));
                        List loop = SootUtilities.createForLoopBefore(body,
                                stmt, initializerList, bodyList,
                                conditionalExpr);
                        body.getUnits().insertBefore(loop, stmt);
View Full Code Here

Examples of stp.Expr

  //VC.setFlags('a');
  //VC.setFlags('w');
  //VC.setFlags('r');
  VC vc = new VC();
  //vc.push();
  Expr e12866 = vc.varExpr( "at", vc.bvType( 5));
  Expr e12867 = e12866;
  Expr e12868 = vc.bvConstExprFromStr( "10000");
  Expr e12869 = vc.eqExpr( e12867, e12868);
  Expr e12870 = vc.varExpr( "x", vc.bvType( 8));
  Expr e12871 = e12870;
  Expr e12872 = vc.bvConstExprFromStr( "00000000");
  Expr e12873 = vc.sbvGtExpr( e12871, e12872);
  Expr e12874 = vc.andExpr( e12869, e12873);
  Expr e12875 = vc.varExpr( "lambda", vc.bvType( 8));
  Expr e12876 = e12875;
  Expr e12877 = e12870;
  Expr e12878 = vc.iteExpr( vc.bvBoolExtract( e12876, 0), vc.bvRightShiftExpr( 1 << 0, e12877), e12877);
  Expr e12879 = vc.iteExpr( vc.bvBoolExtract( e12876, 1), vc.bvRightShiftExpr( 1 << 1, e12878), e12878);
  Expr e12880 = vc.iteExpr( vc.bvBoolExtract( e12876, 2), vc.bvRightShiftExpr( 1 << 2, e12879), e12879);
  Expr e12881 = vc.bvConstExprFromStr( "00000001");
  Expr e12882 = vc.eqExpr( e12880, e12881);
  Expr e12883 = vc.impliesExpr( e12874, e12882);
  Expr e12884 = e12866;
  Expr e12885 = vc.eqExpr( vc.bvExtract( e12884, 0, 0), vc.bvConstExprFromStr( "1"));
  Expr e12886 = vc.varExpr( "k", vc.bvType( 8));
  Expr e12887 = e12886;
  Expr e12888 = vc.eqExpr( vc.bvExtract( e12887, 7, 7), vc.bvConstExprFromStr( "1"));
  Expr e12889 = vc.notExpr( e12888);
  Expr e12890 = e12866;
  Expr e12891 = vc.eqExpr( vc.bvExtract( e12890, 4, 4), vc.bvConstExprFromStr( "1"));
  Expr e12892 = vc.orExpr( e12889, e12891);
  Expr e12893 = vc.orExpr( e12885, e12892);
  Expr e12894 = vc.trueExpr();
  Expr e12895 = vc.andExpr( e12893, e12894);
  Expr e12896 = vc.andExpr( e12883, e12895);
  Expr e12897 = e12866;
  Expr e12898 = vc.bvConstExprFromStr( "00001");
  Expr e12899 = vc.eqExpr( e12897, e12898);
  Expr e12900 = e12886;
  Expr e12901 = vc.bvConstExprFromStr( "00000000");
  Expr e12902 = vc.sbvGeExpr( e12900, e12901);
  Expr e12903 = vc.andExpr( e12899, e12902);
  Expr e12904 = vc.varExpr( "_at", vc.bvType( 5));
  Expr e12905 = e12904;
  Expr e12906 = vc.bvConstExprFromStr( "00010");
  Expr e12907 = vc.eqExpr( e12905, e12906);
  Expr e12908 = vc.varExpr( "_lambda", vc.bvType( 8));
  Expr e12909 = e12908;
  Expr e12910 = e12875;
  Expr e12911 = vc.eqExpr( e12909, e12910);
  Expr e12912 = vc.andExpr( e12907, e12911);
  Expr e12913 = vc.varExpr( "_x", vc.bvType( 8));
  Expr e12914 = e12913;
  Expr e12915 = e12870;
  Expr e12916 = vc.eqExpr( e12914, e12915);
  Expr e12917 = vc.andExpr( e12912, e12916);
  Expr e12918 = vc.varExpr( "_y", vc.bvType( 8));
  Expr e12919 = e12918;
  Expr e12920 = vc.varExpr( "y", vc.bvType( 8));
  Expr e12921 = e12920;
  Expr e12922 = vc.eqExpr( e12919, e12921);
  Expr e12923 = vc.andExpr( e12917, e12922);
  Expr e12924 = vc.varExpr( "_k", vc.bvType( 8));
  Expr e12925 = e12924;
  Expr e12926 = e12886;
  Expr e12927 = vc.eqExpr( e12925, e12926);
  Expr e12928 = vc.andExpr( e12923, e12927);
  Expr e12929 = vc.andExpr( e12903, e12928);
  Expr e12930 = e12866;
  Expr e12931 = vc.bvConstExprFromStr( "00001");
  Expr e12932 = vc.eqExpr( e12930, e12931);
  Expr e12933 = e12886;
  Expr e12934 = vc.bvConstExprFromStr( "00000000");
  Expr e12935 = vc.sbvGeExpr( e12933, e12934);
  Expr e12936 = vc.notExpr( e12935);
  Expr e12937 = vc.andExpr( e12932, e12936);
  Expr e12938 = e12904;
  Expr e12939 = vc.bvConstExprFromStr( "10000");
  Expr e12940 = vc.eqExpr( e12938, e12939);
  Expr e12941 = e12908;
  Expr e12942 = e12875;
  Expr e12943 = vc.eqExpr( e12941, e12942);
  Expr e12944 = vc.andExpr( e12940, e12943);
  Expr e12945 = e12913;
  Expr e12946 = e12870;
  Expr e12947 = vc.eqExpr( e12945, e12946);
  Expr e12948 = vc.andExpr( e12944, e12947);
  Expr e12949 = e12918;
  Expr e12950 = e12920;
  Expr e12951 = vc.eqExpr( e12949, e12950);
  Expr e12952 = vc.andExpr( e12948, e12951);
  Expr e12953 = e12924;
  Expr e12954 = e12886;
  Expr e12955 = vc.eqExpr( e12953, e12954);
  Expr e12956 = vc.andExpr( e12952, e12955);
  Expr e12957 = vc.andExpr( e12937, e12956);
  Expr e12958 = vc.orExpr( e12929, e12957);
  Expr e12959 = e12866;
  Expr e12960 = vc.bvConstExprFromStr( "00010");
  Expr e12961 = vc.eqExpr( e12959, e12960);
  Expr e12962 = e12920;
  Expr e12963 = e12886;
  Expr e12964 = vc.bvLeftShiftExpr( 3, e12963);
  Expr e12965 = vc.bvConstExprFromStr( "111100001100110010101010");
  Expr e12966 = vc.iteExpr( vc.bvBoolExtract( e12964, 0), vc.bvRightShiftExpr( 1 << 0, e12965), e12965);
  Expr e12967 = vc.iteExpr( vc.bvBoolExtract( e12964, 1), vc.bvRightShiftExpr( 1 << 1, e12966), e12966);
  Expr e12968 = vc.iteExpr( vc.bvBoolExtract( e12964, 2), vc.bvRightShiftExpr( 1 << 2, e12967), e12967);
  Expr e12969 = vc.iteExpr( vc.bvBoolExtract( e12964, 3), vc.bvRightShiftExpr( 1 << 3, e12968), e12968);
  Expr e12970 = vc.bvExtract( e12969, 7, 0);
  Expr e12971 = vc.bvAndExpr( e12962, e12970);
  Expr e12972 = vc.bvConstExprFromStr( "00000000");
  Expr e12973 = vc.eqExpr( e12971, e12972);
  Expr e12974 = vc.notExpr( e12973);
  Expr e12975 = vc.andExpr( e12961, e12974);
  Expr e12976 = e12904;
  Expr e12977 = vc.bvConstExprFromStr( "00100");
  Expr e12978 = vc.eqExpr( e12976, e12977);
  Expr e12979 = e12908;
  Expr e12980 = e12875;
  Expr e12981 = vc.eqExpr( e12979, e12980);
  Expr e12982 = vc.andExpr( e12978, e12981);
  Expr e12983 = e12913;
  Expr e12984 = e12870;
  Expr e12985 = vc.eqExpr( e12983, e12984);
  Expr e12986 = vc.andExpr( e12982, e12985);
  Expr e12987 = e12918;
  Expr e12988 = e12920;
  Expr e12989 = vc.eqExpr( e12987, e12988);
  Expr e12990 = vc.andExpr( e12986, e12989);
  Expr e12991 = e12924;
  Expr e12992 = e12886;
  Expr e12993 = vc.eqExpr( e12991, e12992);
  Expr e12994 = vc.andExpr( e12990, e12993);
  Expr e12995 = vc.andExpr( e12975, e12994);
  Expr e12996 = vc.orExpr( e12958, e12995);
  Expr e12997 = e12866;
  Expr e12998 = vc.bvConstExprFromStr( "00010");
  Expr e12999 = vc.eqExpr( e12997, e12998);
  Expr e13000 = e12920;
  Expr e13001 = e12886;
  Expr e13002 = vc.bvLeftShiftExpr( 3, e13001);
  Expr e13003 = vc.bvConstExprFromStr( "111100001100110010101010");
  Expr e13004 = vc.iteExpr( vc.bvBoolExtract( e13002, 0), vc.bvRightShiftExpr( 1 << 0, e13003), e13003);
  Expr e13005 = vc.iteExpr( vc.bvBoolExtract( e13002, 1), vc.bvRightShiftExpr( 1 << 1, e13004), e13004);
  Expr e13006 = vc.iteExpr( vc.bvBoolExtract( e13002, 2), vc.bvRightShiftExpr( 1 << 2, e13005), e13005);
  Expr e13007 = vc.iteExpr( vc.bvBoolExtract( e13002, 3), vc.bvRightShiftExpr( 1 << 3, e13006), e13006);
  Expr e13008 = vc.bvExtract( e13007, 7, 0);
  Expr e13009 = vc.bvAndExpr( e13000, e13008);
  Expr e13010 = vc.bvConstExprFromStr( "00000000");
  Expr e13011 = vc.eqExpr( e13009, e13010);
  Expr e13012 = vc.andExpr( e12999, e13011);
  Expr e13013 = e12904;
  Expr e13014 = vc.bvConstExprFromStr( "01000");
  Expr e13015 = vc.eqExpr( e13013, e13014);
  Expr e13016 = e12908;
  Expr e13017 = e12875;
  Expr e13018 = vc.eqExpr( e13016, e13017);
  Expr e13019 = vc.andExpr( e13015, e13018);
  Expr e13020 = e12913;
  Expr e13021 = e12870;
  Expr e13022 = vc.eqExpr( e13020, e13021);
  Expr e13023 = vc.andExpr( e13019, e13022);
  Expr e13024 = e12918;
  Expr e13025 = e12920;
  Expr e13026 = vc.eqExpr( e13024, e13025);
  Expr e13027 = vc.andExpr( e13023, e13026);
  Expr e13028 = e12924;
  Expr e13029 = e12886;
  Expr e13030 = vc.eqExpr( e13028, e13029);
  Expr e13031 = vc.andExpr( e13027, e13030);
  Expr e13032 = vc.andExpr( e13012, e13031);
  Expr e13033 = vc.orExpr( e12996, e13032);
  Expr e13034 = e12866;
  Expr e13035 = vc.bvConstExprFromStr( "00100");
  Expr e13036 = vc.eqExpr( e13034, e13035);
  Expr e13037 = e12908;
  Expr e13038 = e12875;
  Expr e13039 = e12886;
  Expr e13040 = vc.bvConstExprFromStr( "00000001");
  Expr e13041 = vc.iteExpr( vc.bvBoolExtract( e13039, 0), vc.bvExtract( vc.bvLeftShiftExpr( 1, e13040), 8, 1), e13040);
  Expr e13042 = vc.iteExpr( vc.bvBoolExtract( e13039, 1), vc.bvExtract( vc.bvLeftShiftExpr( 2, e13041), 9, 2), e13041);
  Expr e13043 = vc.iteExpr( vc.bvBoolExtract( e13039, 2), vc.bvExtract( vc.bvLeftShiftExpr( 4, e13042), 11, 4), e13042);
  Expr e13044 = vc.bvPlusExpr( 8, e13038, e13043);
  Expr e13045 = vc.eqExpr( e13037, e13044);
  Expr e13046 = e12918;
  Expr e13047 = e12886;
  Expr e13048 = vc.bvConstExprFromStr( "00000001");
  Expr e13049 = vc.iteExpr( vc.bvBoolExtract( e13047, 0), vc.bvExtract( vc.bvLeftShiftExpr( 1, e13048), 8, 1), e13048);
  Expr e13050 = vc.iteExpr( vc.bvBoolExtract( e13047, 1), vc.bvExtract( vc.bvLeftShiftExpr( 2, e13049), 9, 2), e13049);
  Expr e13051 = vc.iteExpr( vc.bvBoolExtract( e13047, 2), vc.bvExtract( vc.bvLeftShiftExpr( 4, e13050), 11, 4), e13050);
  Expr e13052 = e12920;
  Expr e13053 = vc.iteExpr( vc.bvBoolExtract( e13051, 0), vc.bvRightShiftExpr( 1 << 0, e13052), e13052);
  Expr e13054 = vc.iteExpr( vc.bvBoolExtract( e13051, 1), vc.bvRightShiftExpr( 1 << 1, e13053), e13053);
  Expr e13055 = vc.iteExpr( vc.bvBoolExtract( e13051, 2), vc.bvRightShiftExpr( 1 << 2, e13054), e13054);
  Expr e13056 = vc.eqExpr( e13046, e13055);
  Expr e13057 = vc.andExpr( e13045, e13056);
  Expr e13058 = e12904;
  Expr e13059 = vc.bvConstExprFromStr( "01000");
  Expr e13060 = vc.eqExpr( e13058, e13059);
  Expr e13061 = vc.andExpr( e13057, e13060);
  Expr e13062 = e12913;
  Expr e13063 = e12870;
  Expr e13064 = vc.eqExpr( e13062, e13063);
  Expr e13065 = vc.andExpr( e13061, e13064);
  Expr e13066 = e12924;
  Expr e13067 = e12886;
  Expr e13068 = vc.eqExpr( e13066, e13067);
  Expr e13069 = vc.andExpr( e13065, e13068);
  Expr e13070 = vc.andExpr( e13036, e13069);
  Expr e13071 = vc.orExpr( e13033, e13070);
  Expr e13072 = e12866;
  Expr e13073 = vc.bvConstExprFromStr( "01000");
  Expr e13074 = vc.eqExpr( e13072, e13073);
  Expr e13075 = e12924;
  Expr e13076 = e12886;
  Expr e13077 = vc.bvConstExprFromStr( "00000001");
  Expr e13078 = vc.bvMinusExpr( 8, e13076, e13077);
  Expr e13079 = vc.eqExpr( e13075, e13078);
  Expr e13080 = e12904;
  Expr e13081 = vc.bvConstExprFromStr( "00001");
  Expr e13082 = vc.eqExpr( e13080, e13081);
  Expr e13083 = vc.andExpr( e13079, e13082);
  Expr e13084 = e12908;
  Expr e13085 = e12875;
  Expr e13086 = vc.eqExpr( e13084, e13085);
  Expr e13087 = vc.andExpr( e13083, e13086);
  Expr e13088 = e12913;
  Expr e13089 = e12870;
  Expr e13090 = vc.eqExpr( e13088, e13089);
  Expr e13091 = vc.andExpr( e13087, e13090);
  Expr e13092 = e12918;
  Expr e13093 = e12920;
  Expr e13094 = vc.eqExpr( e13092, e13093);
  Expr e13095 = vc.andExpr( e13091, e13094);
  Expr e13096 = vc.andExpr( e13074, e13095);
  Expr e13097 = vc.orExpr( e13071, e13096);
  Expr e13098 = e12866;
  Expr e13099 = vc.bvConstExprFromStr( "10000");
  Expr e13100 = vc.eqExpr( e13098, e13099);
  Expr e13101 = e12904;
  Expr e13102 = e12866;
  Expr e13103 = vc.eqExpr( e13101, e13102);
  Expr e13104 = e12908;
  Expr e13105 = e12875;
  Expr e13106 = vc.eqExpr( e13104, e13105);
  Expr e13107 = vc.andExpr( e13103, e13106);
  Expr e13108 = e12913;
  Expr e13109 = e12870;
  Expr e13110 = vc.eqExpr( e13108, e13109);
  Expr e13111 = vc.andExpr( e13107, e13110);
  Expr e13112 = e12918;
  Expr e13113 = e12920;
  Expr e13114 = vc.eqExpr( e13112, e13113);
  Expr e13115 = vc.andExpr( e13111, e13114);
  Expr e13116 = e12924;
  Expr e13117 = e12886;
  Expr e13118 = vc.eqExpr( e13116, e13117);
  Expr e13119 = vc.andExpr( e13115, e13118);
  Expr e13120 = vc.andExpr( e13100, e13119);
  Expr e13121 = vc.orExpr( e13097, e13120);
  Expr e13122 = vc.andExpr( e12896, e13121);
  Expr e13123 = e12886;
  Expr e13124 = vc.eqExpr( vc.bvExtract( e13123, 7, 7), vc.bvConstExprFromStr( "1"));
  Expr e13125 = vc.notExpr( e13124);
  Expr e13126 = e12924;
  Expr e13127 = vc.eqExpr( vc.bvExtract( e13126, 7, 7), vc.bvConstExprFromStr( "1"));
  Expr e13128 = vc.notExpr( e13127);
  Expr e13129 = vc.notExpr( e13128);
  Expr e13130 = vc.andExpr( e13125, e13129);
  Expr e13131 = vc.andExpr( e13122, e13130);
  vc.assertFormula( e13131);
  //vc.push();
  Expr e13132 = vc.falseExpr();
  vc.query( e13132);
  //vc.pop();
  //vc.pop();
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.