1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.*; 28 29 import java.util.*; 30 import java.io.File ; 31 32 public abstract class SourceLocation { 33 public abstract JavaCompiler getCompiler(); 34 35 public int getStartPosition() { return -1; } 36 public int getEndPosition() { return -1; } 37 38 public int getBeginLine() { return -1; } 39 40 public int getEndLine() { return -1; } 41 42 public int getBeginColumn() { return -1; } 43 44 public int getEndColumn() { return -1; } 45 46 public Comment getComment() { 47 return null; 48 } 49 50 public void addComment(Comment _comment) { 51 throw new RuntimeException ("can't add a comment to this source location"); 52 } 53 54 public void clearComment() { } 55 56 public void setFormalComment(String comment) { 57 addComment(new FormalComment(comment)); 59 } 60 61 public String getFormalComment() { return ""; } 62 63 64 public CompilationUnit getCompilationUnit() { 65 return getCompiler().getWorld().missingCompilationUnit; 66 } 67 68 public java.io.File getSourceFile() { 69 return getCompilationUnit().getSourceFile(); 70 } 71 72 public String getSourceFileName() { 73 return getCompilationUnit().getSourceCanonicalPath(); 74 } 75 76 public String getSourceDirectoryName() { 77 return getCompilationUnit().getSourceDirectory(); 78 } 79 80 81 public void showError(String message) { 82 getCompiler().showError(new IntLiteralExpr(this, 1), message); 83 } 84 85 public boolean hasSource() { 86 return false; 87 } 88 public boolean fromSource() { 89 return hasSource() && getCompilationUnit().getDecs() != null; 90 } 91 92 public boolean isSynthetic() { 93 return true; 94 } 95 96 public ASTObject getSourceObject() { return null; } 97 } 98 | Popular Tags |