dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java
static public CEConstraint
    compile(String sce, DapDataset dmr)
            throws DapException
    {
        // Process any constraint
        if(sce == null || sce.length() == 0)
            return CEConstraint.getUniversal(dmr);
        CEParserImpl ceparser = new CEParserImpl(dmr);
        if(PARSEDEBUG)
            ceparser.setDebugLevel(1);
        if(DEBUG) {
            System.err.println("Dap4Servlet: parsing constraint: |" + sce + "|");
        }
        boolean ok;
        try {
            ok = ceparser.parse(sce);
        } catch (ParseException pe) {
            ok = false;
        }
        if(!ok)
            throw new DapException("Constraint parse failed: " + sce);
        CEAST root = ceparser.getCEAST();
        CECompiler compiler = new CECompiler();
        CEConstraint ce = compiler.compile(dmr, root);
        ce.expand();
        ce.finish();
        return ce;
    }
static public CEConstraint
    compile(String sce, DapDataset dmr)
            throws DapException
    {
        // Process any constraint
        if(sce == null || sce.length() == 0)
            return CEConstraint.getUniversal(dmr);
        CEParserImpl ceparser = new CEParserImpl(dmr);
        if(PARSEDEBUG)
            ceparser.setDebugLevel(1);
        if(DEBUG) {
            System.err.println("Dap4Servlet: parsing constraint: |" + sce + "|");
        }
        boolean ok;
        try {
            ok = ceparser.parse(sce);
        } catch (ParseException pe) {
            ok = false;
        }
        if(!ok)
            throw new DapException("Constraint parse failed: " + sce);
        CEAST root = ceparser.getCEAST();
        CECompiler compiler = new CECompiler();
        CEConstraint ce = compiler.compile(dmr, root);
        ce.expand();
        ce.finish();
        return ce;
    }
static public CEConstraint compile ( String sce , DapDataset dmr ) throws DapException { // Process any constraint if ( sce == null || sce . length ( ) == 0 ) return CEConstraint . getUniversal ( dmr ) ; CEParserImpl ceparser = new CEParserImpl ( dmr ) ; if ( PARSEDEBUG ) ceparser . setDebugLevel ( 1 ) ; if ( DEBUG ) { System . err . println ( "Dap4Servlet: parsing constraint: |" + sce + "|" ) ; } boolean ok ; try { ok = ceparser . parse ( sce ) ; } catch ( ParseException pe ) { ok = false ; } if ( ! ok ) throw new DapException ( "Constraint parse failed: " + sce ) ; CEAST root = ceparser . getCEAST ( ) ; CECompiler compiler = new CECompiler ( ) ; CEConstraint ce = compiler . compile ( dmr , root ) ; ce . expand ( ) ; ce . finish ( ) ; return ce ; }
Static Utility for compiling a constraint string
Static Utility for compiling a constraint string