1 20 21 26 27 package org.jacorb.idl; 28 29 import java.util.*; 30 31 public class MemberList 32 extends SymbolList 33 { 34 Vector extendVector = new Vector(); 35 private TypeDeclaration containingType; 36 private boolean parsed = false; 37 38 public MemberList( int num ) 39 { 40 super( num ); 41 } 42 43 public void setContainingType( TypeDeclaration t ) 44 { 45 containingType = t; 46 Enumeration e = v.elements(); 47 for( ; e.hasMoreElements(); ) 48 { 49 Member m = (Member)e.nextElement(); 50 m.setContainingType( t ); 51 } 52 } 53 54 public void parse() 55 { 56 if( parsed ) 57 throw new RuntimeException ( "Compiler error: MemberList already parsed!" ); 58 59 Enumeration e = v.elements(); 60 for( ; e.hasMoreElements(); ) 61 { 62 Member m = (Member)e.nextElement(); 63 m.setExtendVector( extendVector ); 64 m.parse(); 65 } 66 67 70 71 v = extendVector; 72 parsed = true; 73 74 } 75 76 public void setEnclosingSymbol( IdlSymbol s ) 77 { 78 79 if( enclosing_symbol != null && enclosing_symbol != s ) 80 { 81 logger.error("was " + enclosing_symbol.getClass().getName() + 82 " now: " + s.getClass().getName() ); 83 84 throw new RuntimeException ( "Compiler Error: trying to reassign container" ); 85 } 86 87 enclosing_symbol = s; 88 89 for( Enumeration e = v.elements(); e.hasMoreElements(); ) 90 { 91 Member m = (Member)e.nextElement(); 92 m.setEnclosingSymbol( s ); 93 } 94 } 95 96 } 97 | Popular Tags |