| java.lang.Object xtc.tree.Utility xtc.tree.Printer xtc.tree.LineupPrinter
LineupPrinter | public class LineupPrinter extends Printer (Code) | | A printer that guarantees that each Node is printed at the exact
file, line, and column specified by its location. Where necessary, this
printer prints line markers (similar to those used by the C preprocessor:
# line "file"
Reproducing exact source locations helps downstream tools track symbolic
information for error messages, debugging, and exception backtraces. Even
though this printer makes a best effort to print nodes without locations
nicely, experience shows that the generated code is usually harder to read
for humans (less "pretty") than with the superclass xtc.tree.Printer.
|
Field Summary | |
protected boolean | blankLine Is the current line blank? If yes, the printer delays any indentation until
it encounters the first non-blank character on the line. | protected boolean | currentNodeHasLocation | protected String | lastFile File name specified by the last node that had a location. | protected long | lastLine Line number specified by the last node that had a location. | protected String | markedFile File name specified by the last emitted line marker. | protected long | markedLine Line number specified by the last emitted line marker. | protected long | markedPhysical Line number in the actual output after the last emitted line marker. | protected boolean | showFilePaths |
blankLine | protected boolean blankLine(Code) | | Is the current line blank? If yes, the printer delays any indentation until
it encounters the first non-blank character on the line.
|
currentNodeHasLocation | protected boolean currentNodeHasLocation(Code) | | Does the node currently being visited have a location?
|
lastFile | protected String lastFile(Code) | | File name specified by the last node that had a location.
|
lastLine | protected long lastLine(Code) | | Line number specified by the last node that had a location.
|
markedFile | protected String markedFile(Code) | | File name specified by the last emitted line marker.
|
markedLine | protected long markedLine(Code) | | Line number specified by the last emitted line marker.
|
markedPhysical | protected long markedPhysical(Code) | | Line number in the actual output after the last emitted line marker.
|
showFilePaths | protected boolean showFilePaths(Code) | | |
LineupPrinter | public LineupPrinter(Writer out, boolean showFilePaths)(Code) | | |
effectiveLine | protected long effectiveLine()(Code) | | Current line in the output adjusted for line markers.
|
endBlank | protected void endBlank()(Code) | | If blankLine is true, print any deferred line breaks and blank characters.
|
ensureLocation | protected void ensureLocation(Node n)(Code) | | If the given node has a location, ensure that the output file, line, and
column is at exactly that location, by emitting some combination of line
markers, line breaks, and blanks.
|
printLineMarker | public void printLineMarker(String file, long line)(Code) | | |
|
|