| |
|
| java.lang.Object oscript.visitor.DepthFirstVisitor oscript.visitor.TreeDumper
All known Subclasses: oscript.visitor.TranslatedTreeDumper,
TreeDumper | public class TreeDumper extends DepthFirstVisitor (Code) | | Dumps the syntax tree to a Writer using the location information in
each NodeToken.
|
Method Summary | |
public void | flushWriter() Flushes the OutputStream or Writer that this TreeDumper is using. | public void | printSpecials(boolean b) Allows you to specify whether or not to print special tokens. | public void | resetPosition() Resets the position of the output "cursor" to the first line and
column. | public void | startAtNextToken() Starts the tree dumper on the line containing the next token
visited. | public void | visit(NodeToken n) Dumps the current NodeToken to the output stream being used.
throws: IllegalStateException - if the token position is invalidrelative to the current position, i.e. |
TreeDumper | public TreeDumper()(Code) | | The default constructor uses System.out as its output location.
You may specify your own Writer or OutputStream using one of the
other constructors.
|
flushWriter | public void flushWriter()(Code) | | Flushes the OutputStream or Writer that this TreeDumper is using.
|
printSpecials | public void printSpecials(boolean b)(Code) | | Allows you to specify whether or not to print special tokens.
|
resetPosition | public void resetPosition()(Code) | | Resets the position of the output "cursor" to the first line and
column. When using a dumper on a syntax tree more than once, you
either need to call this method or startAtNextToken() between each
dump.
|
startAtNextToken | public void startAtNextToken()(Code) | | Starts the tree dumper on the line containing the next token
visited. For example, if the next token begins on line 50 and the
dumper is currently on line 1 of the file, it will set its current
line to 50 and continue printing from there, as opposed to
printing 49 blank lines and then printing the token.
|
visit | public void visit(NodeToken n)(Code) | | Dumps the current NodeToken to the output stream being used.
throws: IllegalStateException - if the token position is invalidrelative to the current position, i.e. its location places itbefore the previous token. |
|
|
|