/** * Returns the human-readable name of the current Source. */ /* pp */ String getName() { Source parent = getParent(); if (parent != null) return parent.getName(); return null; }
/** * Returns true if this Source is expanding the given macro. * * This is used to prevent macro recursion. */ /* pp */ boolean isExpanding(Macro m) { Source parent = getParent(); if (parent != null) return parent.isExpanding(m); return false; }
/** * Returns the human-readable name of the current Source. */ @CheckForNull public String getName() { Source parent = getParent(); if (parent != null) return parent.getName(); return null; }
/** * Returns true if this Source is expanding the given macro. * * This is used to prevent macro recursion. */ /* pp */ boolean isExpanding(@Nonnull Macro m) { Source parent = getParent(); if (parent != null) return parent.isExpanding(m); return false; }
/** * Returns the current column number within this Source. */ public int getColumn() { Source parent = getParent(); if (parent == null) return 0; return parent.getColumn(); }
/** * Returns the current column number within this Source. */ public int getColumn() { Source parent = getParent(); if (parent == null) return 0; return parent.getColumn(); }
/** * Returns true if this Source is expanding the given macro. * * This is used to prevent macro recursion. */ /* pp */ boolean isExpanding(Macro m) { Source parent = getParent(); if (parent != null) return parent.isExpanding(m); return false; }
/** * Returns the current line number within this Source. */ @Nonnegative public int getLine() { Source parent = getParent(); if (parent == null) return 0; return parent.getLine(); }
/** * Returns the current line number within this Source. */ public int getLine() { Source parent = getParent(); if (parent == null) return 0; return parent.getLine(); }
/** * Returns the human-readable name of the current Source. */ /* pp */ String getName() { Source parent = getParent(); if (parent != null) return parent.getName(); return null; }
/** * Returns the current line number within this Source. */ public int getLine() { Source parent = getParent(); if (parent == null) return 0; return parent.getLine(); }
/** * Returns the File currently being lexed. * * 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. */ public String getPath() { Source parent = getParent(); if (parent != null) return parent.getPath(); return null; }
/** * Returns the File currently being lexed. * * 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. */ public String getPath() { Source parent = getParent(); if (parent != null) return parent.getPath(); return null; }
/** * Returns the current column number within this Source. */ public int getColumn() { Source parent = getParent(); if (parent == null) return 0; return parent.getColumn(); }
/** * Returns the File currently being lexed. * * 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. */ @CheckForNull public String getPath() { Source parent = getParent(); if (parent != null) return parent.getPath(); return null; }
/** * Sets the PreprocessorListener which handles events for * this Preprocessor. * * The listener is notified of warnings, errors and source * changes, amongst other things. */ public void setListener(PreprocessorListener listener) { this.listener = listener; Source s = source; while (s != null) { // s.setListener(listener); s.init(this); s = s.getParent(); } }
@Override public String toString() { StringBuilder buf = new StringBuilder(); Source s = getSource(); while (s != null) { buf.append(" -> ").append(String.valueOf(s)).append("\n"); s = s.getParent(); } Map<String, Macro> macros = new TreeMap<String, Macro>(getMacros()); for (Macro macro : macros.values()) { buf.append("#").append("macro ").append(macro).append("\n"); } return buf.toString(); }
public void close() throws IOException { { Source s = source; while (s != null) { s.close(); s = s.getParent(); } } for (Source s : inputs) { s.close(); } }
public void close() throws IOException { { Source s = source; while (s != null) { s.close(); s = s.getParent(); } } for (Source s : inputs) { s.close(); } }
@Override public void close() throws IOException { { Source s = source; while (s != null) { s.close(); s = s.getParent(); } } for (Source s : inputs) { s.close(); } }