Package com.sun.msv.grammar

Examples of com.sun.msv.grammar.ReferenceExp


       
            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


        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

     */
    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

                // 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

   
    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

            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

            atts.put(p,current);
        }
    }
   
    public void onAttPool( AttPoolClause exp ) {
        ReferenceExp old = current;
        current = exp;
        exp.exp.visit(this);
        current = old;
    }
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.