Search in sources :

Example 1 with DPattern

use of com.sun.tools.rngom.digested.DPattern in project jaxb-ri by eclipse-ee4j.

the class RELAXNGCompiler method promoteElementDefsToClasses.

private void promoteElementDefsToClasses() {
    // look for elements among named patterns
    for (DDefine def : defs) {
        DPattern p = def.getPattern();
        if (p instanceof DElementPattern) {
            DElementPattern ep = (DElementPattern) p;
            mapToClass(ep);
        }
    }
    // also look for root elements
    grammar.accept(new DPatternWalker() {

        @Override
        public Void onRef(DRefPattern p) {
            // stop recursion
            return null;
        }

        @Override
        public Void onElement(DElementPattern p) {
            mapToClass(p);
            return null;
        }
    });
}
Also used : DPatternWalker(com.sun.tools.rngom.digested.DPatternWalker) DPattern(com.sun.tools.rngom.digested.DPattern) DDefine(com.sun.tools.rngom.digested.DDefine) DElementPattern(com.sun.tools.rngom.digested.DElementPattern) DRefPattern(com.sun.tools.rngom.digested.DRefPattern)

Example 2 with DPattern

use of com.sun.tools.rngom.digested.DPattern in project jaxb-ri by eclipse-ee4j.

the class TypeUseBinder method onContainer.

private TypeUse onContainer(DContainerPattern p) {
    TypeUse t = null;
    for (DPattern child : p) {
        TypeUse s = child.accept(this);
        if (t != null && t != s)
            // heterogenous
            return CBuiltinLeafInfo.STRING;
        t = s;
    }
    return t;
}
Also used : TypeUse(com.sun.tools.xjc.model.TypeUse) DPattern(com.sun.tools.rngom.digested.DPattern)

Aggregations

DPattern (com.sun.tools.rngom.digested.DPattern)2 DDefine (com.sun.tools.rngom.digested.DDefine)1 DElementPattern (com.sun.tools.rngom.digested.DElementPattern)1 DPatternWalker (com.sun.tools.rngom.digested.DPatternWalker)1 DRefPattern (com.sun.tools.rngom.digested.DRefPattern)1 TypeUse (com.sun.tools.xjc.model.TypeUse)1