예제 #1
0
파일: Source.java 프로젝트: tvernum/terebi
 protected String getName() {
   Source parent = getParent();
   while (parent != null) {
     String name = parent.getName();
     if (name != null) return name;
     parent = parent.getParent();
   }
   return null;
 }
예제 #2
0
파일: Source.java 프로젝트: tvernum/terebi
 /**
  * Returns the File currently being lexed.
  *
  * <p>If this Source is not a {@link FileLexerSource}, then it will ask the parent Source, and so
  * forth recursively. If no Source on the stack is a FileLexerSource, returns null.
  */
 protected String getPath() {
   Source parent = getParent();
   while (parent != null) {
     String path = parent.getPath();
     if (path != null) return path;
     parent = parent.getParent();
   }
   return null;
 }
예제 #3
0
파일: Source.java 프로젝트: tvernum/terebi
 /**
  * Returns true if this Source is expanding the given macro.
  *
  * <p>This is used to prevent macro recursion.
  */
 /* pp */ boolean isExpanding(Macro m) {
   Source parent = getParent();
   if (parent != null) return parent.isExpanding(m);
   return false;
 }
예제 #4
0
파일: Source.java 프로젝트: tvernum/terebi
 /** Returns the current column number within this Source. */
 public int getColumn() {
   Source parent = getParent();
   if (parent == null) return 0;
   return parent.getColumn();
 }