public void outAFile(AFile node) { // not not pop members; they have been taken care of. List implementsList = null; String superClass = null; String classType = null; if (node.getImplementsClause() != null) { implementsList = (List) mProductions.removeLast(); } if (node.getExtendsClause() != null) { superClass = (String) mProductions.removeLast(); } classType = (String) mProductions.removeLast(); int modifierCount = node.getModifier().size(); int modifierFlags = processModifiers(node.getModifier()); if (classType.equals("interface")) { modifierFlags |= Modifier.INTERFACE; } mSootClass.setModifiers(modifierFlags); if (superClass != null) { mSootClass.setSuperclass(mResolver.makeClassRef(superClass)); } if (implementsList != null) { Iterator implIt = implementsList.iterator(); while (implIt.hasNext()) { SootClass interfaceClass = mResolver.makeClassRef((String) implIt.next()); mSootClass.addInterface(interfaceClass); } } mProductions.addLast(mSootClass); }
public void outAFile(AFile node) { List implementsList = null; String superClass = null; String classType = null; if (node.getImplementsClause() != null) { implementsList = (List) mProductions.removeLast(); } if (node.getExtendsClause() != null) { superClass = (String) mProductions.removeLast(); } classType = (String) mProductions.removeLast(); int modifierFlags = processModifiers(node.getModifier()); if (classType.equals("interface")) { modifierFlags |= Modifier.INTERFACE; } mSootClass.setModifiers(modifierFlags); if (superClass != null) { mSootClass.setSuperclass(mResolver.makeClassRef(superClass)); } if (implementsList != null) { Iterator implIt = implementsList.iterator(); while (implIt.hasNext()) { SootClass interfaceClass = mResolver.makeClassRef((String) implIt.next()); mSootClass.addInterface(interfaceClass); } } mProductions.addLast(mSootClass); }
tclass.setModifiers(Modifier.PUBLIC | Modifier.FINAL); tclass.setSuperclass(Scene.v().getObjectType().getSootClass()); tclass.addInterface(functionalInterfaceToImplement); tclass.addInterface(RefType.v("java.io.Serializable").getSootClass()); tclass.addInterface(((RefType) AsmUtil.toBaseType(markerInterfaces.get(i).getValue())).getSootClass());
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { name = AsmUtil.toQualifiedName(name); if (!name.equals(klass.getName())) { throw new RuntimeException("Class names not equal! " + name + " != " + klass.getName()); } klass.setModifiers(access & ~Opcodes.ACC_SUPER); if (superName != null) { superName = AsmUtil.toQualifiedName(superName); addDep(RefType.v(superName)); klass.setSuperclass(SootResolver.v().makeClassRef(superName)); } for (String intrf : interfaces) { intrf = AsmUtil.toQualifiedName(intrf); addDep(RefType.v(intrf)); SootClass interfaceClass = SootResolver.v().makeClassRef(intrf); interfaceClass.setModifiers(interfaceClass.getModifiers() | Modifier.INTERFACE); klass.addInterface(interfaceClass); } if (signature != null) { klass.addTag(new SignatureTag(signature)); } }
sc.addInterface(interfaceClass); deps.typesToHierarchy.add(interfaceClass.getType());
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:186 */ public void jimplify1phase2() { SootClass sc = getSootClassDecl(); sc.setResolvingLevel(SootClass.DANGLING); sc.setModifiers(sootTypeModifiers()); sc.setApplicationClass(); SourceFileTag st = new soot.tagkit.SourceFileTag(sourceNameWithoutPath()); st.setAbsolutePath(compilationUnit().pathName()); sc.addTag(st); sc.setSuperclass(typeObject().getSootClassDecl()); for(Iterator iter = superinterfacesIterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(typeDecl != typeObject() && !sc.implementsInterface(typeDecl.getSootClassDecl().getName())) sc.addInterface(typeDecl.getSootClassDecl()); } if(isNestedType()) sc.setOuterClass(enclosingType().getSootClassDecl()); sc.setResolvingLevel(SootClass.HIERARCHY); super.jimplify1phase2(); sc.setResolvingLevel(SootClass.SIGNATURES); } /**
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:163 */ public void jimplify1phase2() { SootClass sc = getSootClassDecl(); sc.setResolvingLevel(SootClass.DANGLING); sc.setModifiers(sootTypeModifiers()); sc.setApplicationClass(); SourceFileTag st = new soot.tagkit.SourceFileTag(sourceNameWithoutPath()); st.setAbsolutePath(compilationUnit().pathName()); sc.addTag(st); if(hasSuperclass()) { sc.setSuperclass(superclass().getSootClassDecl()); } for(Iterator iter = interfacesIterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(!sc.implementsInterface(typeDecl.getSootClassDecl().getName())) sc.addInterface(typeDecl.getSootClassDecl()); } if(isNestedType()) sc.setOuterClass(enclosingType().getSootClassDecl()); sc.setResolvingLevel(SootClass.HIERARCHY); super.jimplify1phase2(); sc.setResolvingLevel(SootClass.SIGNATURES); } /**
SootClass interfaceClass = SootResolver.v().makeClassRef(interfaceName); interfaceClass.setModifiers(interfaceClass.getModifiers() | Modifier.INTERFACE); bclass.addInterface(interfaceClass);
while (interfacesIt.hasNext()) { polyglot.ast.TypeNode next = (polyglot.ast.TypeNode) interfacesIt.next(); sootClass.addInterface(((soot.RefType) Util.getSootType(next.type())).getSootClass());
sootClass.addInterface(typeClass); sootClass.setSuperclass(soot.Scene.v().getSootClass("java.lang.Object")); } else {
bclass.addInterface(interfaceClass);
bclass.addInterface(interfaceClass);