1 20 21 package org.jacorb.idl; 22 23 import java.io.PrintWriter ; 24 import java.util.*; 25 26 30 31 public class Definitions 32 extends SymbolList 33 { 34 35 public Definitions( int num ) 36 { 37 super( num ); 38 v = new Vector(); 39 } 40 41 public void setPackage( String s ) 42 { 43 s = parser.pack_replace( s ); 44 Enumeration e = getElements(); 45 for( ; e.hasMoreElements(); ) 46 { 47 IdlSymbol i = (IdlSymbol)e.nextElement(); 48 i.setPackage( s ); 49 } 50 } 51 52 public void setEnclosingSymbol( IdlSymbol s ) 53 { 54 if( enclosing_symbol != null && enclosing_symbol != s ) 55 { 56 logger.error("was " + enclosing_symbol.getClass().getName() + 57 " now: " + s.getClass().getName() ); 58 throw new RuntimeException ( "Compiler Error: trying to reassign container for " + 59 name ); 60 } 61 enclosing_symbol = s; 62 for( Enumeration e = getElements(); e.hasMoreElements(); ) 63 ( (IdlSymbol)e.nextElement() ).setEnclosingSymbol( s ); 64 } 65 66 public void set_included( boolean i ) 67 { 68 included = i; 69 Enumeration e = getElements(); 70 for( ; e.hasMoreElements(); ) 71 ( (IdlSymbol)e.nextElement() ).set_included( i ); 72 } 73 74 public Enumeration getElements() 75 { 76 return v.elements(); 77 } 78 79 public void print( PrintWriter ps ) 80 { 81 Enumeration e = getElements(); 82 for( ; e.hasMoreElements(); ) 83 ( (IdlSymbol)e.nextElement() ).print( ps ); 84 } 85 86 88 89 public void accept( IDLTreeVisitor visitor ) 90 { 91 visitor.visitDefinitions( this ); 92 } 93 } 94 | Popular Tags |