1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.Declaration; 31 32 33 import org.objectweb.openccm.ast.api.DeclarationKind; 34 35 36 import org.objectweb.openccm.ast.api.FileScope; 37 38 49 50 public class FileScopeImpl 51 extends ScopeImpl 52 implements FileScope 53 { 54 60 61 protected String file_name_; 62 63 64 protected java.util.List included_files_; 65 66 72 79 public 80 FileScopeImpl(Repository rep, 81 ScopeImpl parent, 82 java.util.List decls) 83 { 84 super(rep, parent); 86 87 file_name_ = null; 89 setName(""); 90 contained_decls_ = decls; 91 included_files_ = new java.util.ArrayList (); 92 } 93 94 100 106 112 protected org.omg.CORBA.Contained 113 getContained() 114 { 115 return null; 116 } 117 118 124 130 protected org.omg.CORBA.Container 131 getContainer() 132 { 133 return the_parent_.getContainer(); 134 } 135 136 141 protected org.omg.CORBA.ComponentIR.Container 142 getComponentContainer() 143 { 144 return the_parent_.getComponentContainer(); 145 } 146 147 153 159 166 public long 167 getDeclKind() 168 { 169 return DeclarationKind.dk_null; 170 } 171 172 179 public java.lang.String 180 getAbsoluteName() 181 { 182 java.lang.String result = ""; 183 if(the_parent_ != null) 184 result = the_parent_.getAbsoluteName(); 185 return result; 186 } 187 188 191 public void 192 destroy() 193 { 194 197 for (int i=0; i<included_files_.size(); i++) 200 { 201 FileScope fs = (FileScope)(included_files_.get(i)); 202 fs.destroy(); 203 } 204 205 super.destroy(); 208 209 215 } 216 217 223 229 235 240 public void 241 setFileName(String name) 242 { 243 file_name_ = name; 244 } 245 246 251 public String 252 getFileName() 253 { 254 return file_name_; 255 } 256 257 262 public void 263 addIncluded(FileScope fs) 264 { 265 included_files_.add(fs); 266 } 267 268 273 public String [] 274 getIncluded() 275 { 276 String [] filenames = new String [included_files_.size()]; 277 for (int i=0;i<filenames.length;i++) 278 filenames[i] = ((Declaration)included_files_.get(i)).getName(); 279 280 return filenames; 281 } 282 } 283 | Popular Tags |