1 20 21 package org.jacorb.idl; 22 23 27 28 import java.io.PrintWriter ; 29 30 31 public class Definition 32 extends IdlSymbol 33 { 34 private Declaration declaration; 35 36 public Definition( int num ) 37 { 38 super( num ); 39 pack_name = ""; 40 } 41 42 public Definition (Declaration d) 43 { 44 super (new_num()); 45 pack_name = ""; 46 this.declaration = d; 47 } 48 49 public void setPackage( String s ) 50 { 51 s = parser.pack_replace( s ); 52 super.setPackage( s ); 53 declaration.setPackage( s ); 54 } 55 56 public void setEnclosingSymbol( IdlSymbol s ) 57 { 58 if( enclosing_symbol != null && enclosing_symbol != s ) 59 { 60 logger.error("was " + enclosing_symbol.getClass().getName() + " now: " + s.getClass().getName() ); 61 throw new RuntimeException ( "Compiler Error: trying to reassign container for " + name ); 62 } 63 enclosing_symbol = s; 64 declaration.setEnclosingSymbol( s ); 65 } 66 67 public Declaration get_declaration() 68 { 69 return declaration; 70 } 71 72 public void set_declaration( Declaration d ) 73 { 74 declaration = d; 75 } 76 77 public void set_included( boolean i ) 78 { 79 included = i; 80 declaration.set_included( i ); 81 } 82 83 public void print( PrintWriter ps ) 84 { 85 declaration.print( ps ); 86 } 87 88 public void parse() 89 { 90 declaration.parse(); 91 } 92 93 95 96 public void accept( IDLTreeVisitor visitor ) 97 { 98 visitor.visitDefinition( this ); 99 } 100 101 102 } 103 | Popular Tags |