aspect Inheritance { // collect all children of a type declaration A, i.e. all types B that extend A or one of its parameterizations coll Collection TypeDecl.childTypes() circular [new HashSet()] with add root Program; ClassDecl contributes this when hasSuperclass() to TypeDecl.childTypes() for superclass().sourceTypeDecl(); ClassDecl contributes this to TypeDecl.childTypes() for each interfacesSourceDecls(); InterfaceDecl contributes this to TypeDecl.childTypes() for each superInterfacesSourceDecls(); public Iterable ClassDecl.interfacesSourceDecls() { Collection res = new LinkedList(); for(Iterator iter=interfacesIterator();iter.hasNext();) res.add((InterfaceDecl)iter.next().sourceTypeDecl()); return res; } public Iterable InterfaceDecl.superInterfacesSourceDecls() { Collection res = new LinkedList(); for(Iterator iter=superinterfacesIterator();iter.hasNext();) res.add((InterfaceDecl)iter.next().sourceTypeDecl()); return res; } }