1 19 20 package soot.javaToJimple; 21 import java.util.*; 22 23 public class InnerClassInfoFinder extends polyglot.visit.NodeVisitor { 24 25 private ArrayList localClassDeclList; 26 private ArrayList anonBodyList; 27 private ArrayList memberList; 28 31 public ArrayList memberList(){ 32 return memberList; 33 } 34 35 42 43 public ArrayList localClassDeclList(){ 44 return localClassDeclList; 45 } 46 47 public ArrayList anonBodyList(){ 48 return anonBodyList; 49 } 50 51 public InnerClassInfoFinder(){ 52 localClassDeclList = new ArrayList(); 54 anonBodyList = new ArrayList(); 55 memberList = new ArrayList(); 56 } 59 60 public polyglot.visit.NodeVisitor enter(polyglot.ast.Node parent, polyglot.ast.Node n) { 61 62 if (n instanceof polyglot.ast.LocalClassDecl) { 63 localClassDeclList.add(n); 64 } 65 if (n instanceof polyglot.ast.New) { 66 if (((polyglot.ast.New)n).anonType() != null){ 67 anonBodyList.add(n); 68 } 69 73 } 74 75 if (n instanceof polyglot.ast.ProcedureDecl) { 76 memberList.add(n); 77 81 } 82 if (n instanceof polyglot.ast.FieldDecl) { 83 memberList.add(n); 84 88 } 89 if (n instanceof polyglot.ast.Initializer) { 90 memberList.add(n); 91 } 92 93 111 112 113 return enter(n); 114 } 115 } 116 | Popular Tags |