/* RIDL needs to be able to get some information from the class file. The easiest solution appears to be to ask demeterj to read it and then acess it like an abstract datatype. The exported operations are given first, then the private ones Also, The following classes have been made public: ClassDef, PartName, Program, ClassName */ Program { public static Program readClassDictionaryFromFile(File cdfile) throws ParseException, IOException (@ Program.cdfile = cdfile; readClassDictionary(); // from simplifyClassDictionary();, but that writes, which I don't need. // log.println("Expanding parameterized classes..."); prog.expandParamDefs(); // log.println("Converting repetition classes..."); prog.convertRepetition(); // log.println("Filling in part names..."); prog.fillInPartNames(); // log.println("Setting inheritance links..."); prog.setInheritanceLinks(); return Program.prog; @) } // Fixxes to work around non-public methods and parts Program { public ClassName repdictget(ClassName cn) (@ return (ClassName) this.repdict.get(cn); @) public boolean public_definesClass(ClassName name) (@ return this.definesClass(name); @) public ClassDef public_findClassDef(ClassName name) (@ return this.findClassDef(name); @) public java.util.Vector public_allClassDefs() to ClassDef { start (@ return_val = new java.util.Vector(); @) before ClassDef (@ return_val.addElement(host); @) } } ClassDef { public ClassName public_get_superclass_name() (@ return this.get_superclass_name(); @) public ClassName public_getPartClass(PartName name) (@ return this.getPartClass(name); @) public java.util.Vector public_findSubclasses() via Subclass bypassing -> *, actual_parameters,* to ClassSpec { start (@ return_val = new java.util.Vector(); @) before ClassSpec (@ return_val.addElement(host.get_classname()); @) } public ClassName public_get_classname() (@ return this.get_classname(); @) public boolean public_isConcreteClass() (@ return !this.isAlternationClass(); @) } // Debugging: ClassDef { public void public_printparts() to {PartName, ClassSpec}{ before ClassDef (@ System.err.print(" "+host.get_classname()+" = "); @) before PartName (@ System.err.print("<"+host.toString()+"> "); @) before ClassSpec (@ System.err.print(host.toString()+" "); @) finish (@ System.err.println(""); @) } } Program { public void public_printclasses() to ClassDef { start (@ System.err.println("Program has Classes: "); @) before ClassDef (@ host.public_printparts(); @) } }