Example #1
0
 protected String getName() {
   Source parent = getParent();
   while (parent != null) {
     String name = parent.getName();
     if (name != null) return name;
     parent = parent.getParent();
   }
   return null;
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 /**
  * 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;
 }
Example #4
0
 /** Returns the current column number within this Source. */
 public int getColumn() {
   Source parent = getParent();
   if (parent == null) return 0;
   return parent.getColumn();
 }