Package com.sun.msv.grammar

Examples of com.sun.msv.grammar.ReferenceExp


                // append it to attribute list.
                contentModel = grammar.pool.createSequence( contentModel, exp );
            }
        }
           
        ReferenceExp er = grammar.namedPatterns.getOrCreate(elementName);
        er.exp = new ElementPattern(
            getNameClass(elementName,false),
            grammar.pool.createSequence(contentModel,
                (Expression)elementDecls.get(elementName) ) );
       
View Full Code Here


            // minOccurs/maxOccurs is processed through interception
            return ep;
        }
       
        // "lax"/"strict" has to be back-patched later.
        final ReferenceExp exp = new ReferenceExp("any("+process+":"+namespace+")");
        reader.addBackPatchJob( new GrammarReader.BackPatch(){
            public State getOwnerState() { return AnyElementState.this; }
            public void patch() {

                if( !process.equals("lax")
View Full Code Here

        prevNamedPattern = reader.currentNamedPattern;    // push
        previousDirectRefernce = reader.directRefernce;
       
        reader.directRefernce = true;
       
        ReferenceExp exp = getReference();
        if(exp==null)
            //abort. there was an error in this declaration
            reader.currentNamedPattern = null;
        else {
            reader.currentNamedPattern = reader.getRefExpParseInfo(exp);
View Full Code Here

    protected Expression annealExpression( Expression exp ) {
        final String name = startTag.getAttribute("name");
       
        if(name!=null) {
            // name attribute is optional.
            ReferenceExp ref = getReader().grammar.namedPatterns.getOrCreate(name);
            ref.exp = exp;
            exp = ref;
        }
       
        getReader().grammar.exp = exp;
View Full Code Here

        // TODO: shall I memorize this as a backward reference?
        // reader.backwardReference.memorizeLink(???);
       
        // symbol may not be defined at this moment.
        // so just return an empty ReferenceExp and back-patch the actual definition later.
        final ReferenceExp ref = new ReferenceExp("elementType("+typeQName+")");
       
        final String[] s = reader.splitQName(typeQName);
        if(s==null) {
            reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, typeQName );
            ref.exp = Expression.nullSet;    // recover by setting a dummy definition.
View Full Code Here

     */
    public String printRefContainer( ReferenceContainer cont ) {
        String r="";
        java.util.Iterator itr = cont.iterator();
        while( itr.hasNext() ) {
            ReferenceExp exp = (ReferenceExp)itr.next();
           
            r += exp.name + "  : " + exp.exp.visit(this) + "\n";
        }
        return r;
    }
View Full Code Here

            // ReferenceExp object is created when it is first referenced or defined.
            // its exp field is supplied when it is defined.
            // therefore, ReferenceExp with its exp field null means
            // it is referenced but not defined.
           
            ReferenceExp ref = (ReferenceExp)itr.next();
            if( !ref.isDefined() ) {
                reportError( backwardReference.getReferer(ref),
                            errMsg, new Object[]{ref.name} );
                ref.exp=Expression.nullSet;
                // recover by assuming a null definition.
            }
View Full Code Here

           
            Vector locs = new Vector();
           
            for( ; i<sz; i++ ) {
                if( refStack.elementAt(i) instanceof ReferenceExp ) {
                    ReferenceExp e = (ReferenceExp)refStack.elementAt(i);
                    if( e.name==null )    continue;    // skip anonymous ref.
                   
                    if( s.length()!=0 )     s += " > ";
                    s += e.name;
                   
View Full Code Here

    static final public class RefContainer extends ReferenceContainer {
        public ReferenceExp getOrCreate( String name ) {
            return super._getOrCreate(name);
        }
        protected ReferenceExp createReference( String name ) {
            return new ReferenceExp(name);
        }
View Full Code Here

            // ReferenceExp object is created when it is first referenced or defined.
            // its exp field is supplied when it is defined.
            // therefore, ReferenceExp with its exp field null means
            // it is referenced but not defined.
           
            ReferenceExp ref = (ReferenceExp)itr.next();
            if( !ref.isDefined() ) {
                reportError( backwardReference.getReferer(ref),
                            errMsg, new Object[]{ref.name} );
                ref.exp=Expression.nullSet;
                // recover by assuming a null definition.
            }
View Full Code Here

TOP

Related Classes of com.sun.msv.grammar.ReferenceExp

Copyright © 2018 www.massapicom. 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.