1 package org.jacorb.idl; 2 3 22 23 24 import java.io.PrintWriter ; 25 import java.util.Enumeration ; 26 27 31 32 class TypeDeclarator 33 extends IdlSymbol 34 { 35 36 public TypeSpec type_spec; 37 public SymbolList declarators; 38 39 public TypeDeclarator( int num ) 40 { 41 super( num ); 42 } 43 44 public void setPackage( String s ) 45 { 46 s = parser.pack_replace( s ); 47 type_spec.setPackage( s ); 48 for( Enumeration e = declarators.v.elements(); 49 e.hasMoreElements(); ) 50 { 51 Declarator d = (Declarator)e.nextElement(); 52 d.setPackage( s ); 53 } 54 } 55 56 public void parse() 57 { 58 throw new RuntimeException ( "This method may not be used!" ); 59 63 } 64 65 public TypeSpec type_spec() 66 { 67 return type_spec.typeSpec(); 68 } 69 70 public String typeName() 71 { 72 return type_spec.typeName(); 73 } 74 75 public void print( PrintWriter ps ) 76 { 77 type_spec.print( ps ); 78 for( Enumeration e = declarators.v.elements(); e.hasMoreElements(); ) 79 ( (Declarator)e.nextElement() ).print( ps ); 80 } 81 82 public void setEnclosingSymbol( IdlSymbol s ) 83 { 84 enclosing_symbol = s; 85 type_spec.setEnclosingSymbol( s ); 86 for( Enumeration e = declarators.v.elements(); e.hasMoreElements(); ) 87 ( (Declarator)e.nextElement() ).setEnclosingSymbol( s ); 88 } 89 90 public String toString() 91 { 92 StringBuffer sb = new StringBuffer (); 93 sb.append( type_spec.toString() ); 94 for( Enumeration e = declarators.v.elements(); e.hasMoreElements(); ) 95 sb.append( (Declarator)e.nextElement() ); 96 return sb.toString(); 97 } 98 99 } 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | Popular Tags |