1 24 25 package org.aspectj.compiler.crosscuts; 26 27 import org.aspectj.compiler.base.*; 28 import org.aspectj.compiler.base.ast.*; 29 import org.aspectj.compiler.crosscuts.ast.*; 30 import org.aspectj.util.CollectionUtil; 31 32 import org.aspectj.tools.ide.Declaration; 33 import org.aspectj.tools.ide.SymbolManager; 34 35 import org.aspectj.compiler.base.JavaCompiler; 36 import org.aspectj.compiler.base.CompilerObject; 37 38 39 40 import java.io.*; 41 47 48 import java.util.*; 49 50 import java.util.Vector ; 53 54 55 58 public class Correspondences extends CompilerObject { 59 private Map corrs = new HashMap(); 60 61 public Correspondences(JavaCompiler compiler) { 62 super(compiler); 63 } 64 65 public CompilationUnitCorrespondences getCompilationUnitCorrespondences(ASTObject node) { 66 CompilationUnit cu = node.getCompilationUnit(); 67 68 CompilationUnitCorrespondences cuCorrs = (CompilationUnitCorrespondences)corrs.get(cu); 69 if (cuCorrs == null) { 70 cuCorrs = new CompilationUnitCorrespondences(cu); 71 corrs.put(cu, cuCorrs); 72 } 73 return cuCorrs; 74 } 75 76 77 public File makeSymFile(File javaFile) { 78 return SymbolManager.mapFilenameToSymbolFile(javaFile.getPath()); 79 } 80 81 public void dump(CompilationUnit cu, CompilationUnitCorrespondences cucorr) { 83 dump(cu.getSourceFile(), cu, cucorr); 89 } 91 92 public void dump(File file, CompilationUnit cu, CompilationUnitCorrespondences cucorr) { 93 if (file == null) return; 94 } 107 108 public void addPointsTo(ASTObject node1, ASTObject node2) { 110 112 if (node1 == null || node2 == null) return; 113 114 getCompilationUnitCorrespondences(node1).addPointsTo(node1, node2); 116 getCompilationUnitCorrespondences(node2).addPointedToBy(node2, node1); 117 118 119 } 120 121 126 127 130 public Set getAffects(ASTObject astObject) { 131 return getCompilationUnitCorrespondences(astObject).getPointsToSet(astObject); 132 } 133 134 137 public Set getAffectedBy(ASTObject astObject) { 138 return getCompilationUnitCorrespondences(astObject).getPointedToBySet(astObject); 139 } 140 } 141 | Popular Tags |