Package com.sun.msv.grammar

Examples of com.sun.msv.grammar.ReferenceExp


        found = null;
        super.connect(pool,others);
       
        NameClass rest = new DifferenceNameClass(namespaces,found).simplify();
        // build up lax content model
        ReferenceExp r = new ReferenceExp("lax");
        r.exp = pool.createZeroOrMore(pool.createChoice(
            pool.createAnyString(),
            pool.createChoice(
                pool.createAttribute(NameClass.ALL),
                new ElementPattern(NameClass.ALL,r))));
View Full Code Here


       
        final XMLSchemaSchema schema = reader.grammar.getByNamespace(baseTypeName[0]);
       
        // we don't know whether it's a complex type or a simple type.
        // so back patch it
        final ReferenceExp ref = new ReferenceExp(null);
        reader.addBackPatchJob( new GrammarReader.BackPatch(){
            public State getOwnerState() {
                return SimpleContentExtensionState.this;
            }
            public void patch() {
View Full Code Here

            atts.put(p,current);
        }
    }
   
    public void onAttPool( AttPoolClause exp ) {
        ReferenceExp old = current;
        current = exp;
        exp.exp.visit(this);
        current = old;
    }
View Full Code Here

            c.exp = exp;    // exp holds a sequence of AttributeExp
            getReader().setDeclaredLocationOf(c);    // remember where this AttPool is declared
        } else {
            // this attPool has @combine
           
            ReferenceExp e = getReader().combinedAttPools._getOrCreate(role);
            if( e.exp==null )    e.exp = Expression.epsilon;
            // append newly found attributes.
            e.exp = reader.pool.createSequence( exp, e.exp );
            reader.setDeclaredLocationOf(e);
        }
View Full Code Here

       
        // by putting them into ReferenceExp, # of expressions usually gets smaller
        // because createSequence are right-associative and any attempt to extend
        // this sequence will end up creating new SequenceExps.
        // It's also good for writer: it can generate more compact XML representation.
        ReferenceExp exp = new ReferenceExp( XMLSchemaSchemaLocationAttributes );
        xsiSchemaLocationExp = exp;
        exp.exp =
            pool.createSequence(
            pool.createOptional(
                pool.createAttribute(
View Full Code Here

                return Expression.nullSet;
                // recover by returning something that can be interpreted as Pattern
            }
        }
       
        ReferenceExp r = grammar.namedPatterns.getOrCreate(name);
        wrapUp(r);
        return r;
    }
View Full Code Here

        items.push(node);
       
        // test direct references
        Iterator itr = getRefExpParseInfo(node).directRefs.iterator();
        while( itr.hasNext() ) {
            ReferenceExp child = (ReferenceExp)itr.next();
           
            int idx = items.lastIndexOf(child);
            if(idx!=-1) {
                // find a cycle.
               
                String s = "";
                Vector locs = new Vector();
           
                for( ; idx<items.size(); idx++ ) {
                    ReferenceExp e = (ReferenceExp)items.get(idx);
                    if( e.name==null )    continue;    // skip anonymous ref.
                   
                    if( s.length()!=0 )     s += " > ";
                    s += e.name;
                   
View Full Code Here

   
    private void detectCollision( ReferenceContainer col1, ReferenceContainer col2, String errMsg ) {
        Iterator itr = col1.iterator();
        while( itr.hasNext() ) {
            ReferenceExp r1    = (ReferenceExp)itr.next();
            ReferenceExp r2    = col2._get( r1.name );
            // if the grammar references elementRule by hedgeRef,
            // (or hedgeRule by ref),  HedgeRules object and ElementRules object
            // are created under the same name.
            // And it is inappropriate to report this situation as "label collision".
            // Therefore, we have to check both have definitions before reporting an error.
View Full Code Here

       
            Iterator itr = heads.iterator();
            while( itr.hasNext() ) {
                Expression exp = (Expression)itr.next();
                if( exp instanceof ReferenceExp ) {
                    ReferenceExp rexp = (ReferenceExp)exp;
                    if( rexp.name == null ) {
                        // generate unique name
                        while( name2exp.containsKey("anonymous"+cnt) )
                            cnt++;
                        name2exp.put( "anonymous"+cnt, exp );
View Full Code Here

public class ElementDeclExp extends ReferenceExp
{
    public ElementDeclExp( XMLSchemaSchema schema, String typeLocalName ) {
        super(typeLocalName);
        this.parent = schema;
        this.substitutions = new ReferenceExp( typeLocalName+":substitutions" );
        this.substitutions.exp = Expression.nullSet;
    }
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.