Class DefaultASTPrinter
java.lang.Object
com.oracle.truffle.api.instrument.impl.DefaultASTPrinter
- All Implemented Interfaces:
ASTPrinter
A language-agnostic for printing out various pieces of a Truffle AST.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
protected static String
protected void
printChild
(PrintWriter p, int maxDepth, Node markNode, int level, NodeUtil.NodeField field, Object value) protected void
printChildren
(PrintWriter p, int maxDepth, Node markNode, int level, NodeUtil.NodeField field, Object value) protected static void
printNewLine
(PrintWriter p, int level) protected static void
printNewLine
(PrintWriter p, int level, boolean mark) void
printTree
(PrintWriter p, Node node, int maxDepth, Node markNode) Prints a textual AST display, one line per node, with nesting.protected void
printTree
(PrintWriter p, Node node, int maxDepth, Node markNode, int level) printTreeToString
(Node node, int maxDepth) Creates a textual AST display, one line per node, with nesting.printTreeToString
(Node node, int maxDepth, Node markNode) Creates a textual AST display, one line per node, with nesting.protected static String
sourceInfo
(Node node)
-
Constructor Details
-
DefaultASTPrinter
public DefaultASTPrinter()
-
-
Method Details
-
printTree
Description copied from interface:ASTPrinter
Prints a textual AST display, one line per node, with nesting.- Specified by:
printTree
in interfaceASTPrinter
node
- the root node of the display.maxDepth
- the maximum number of levels to print below the rootmarkNode
- a node to mark with a textual arrow prefix, if present.
-
printTreeToString
Description copied from interface:ASTPrinter
Creates a textual AST display, one line per node, with nesting.- Specified by:
printTreeToString
in interfaceASTPrinter
- Parameters:
node
- the root node of the display.maxDepth
- the maximum number of levels to print below the rootmarkNode
- a node to mark with a textual arrow prefix, if present.
-
printTreeToString
Description copied from interface:ASTPrinter
Creates a textual AST display, one line per node, with nesting.- Specified by:
printTreeToString
in interfaceASTPrinter
- Parameters:
node
- the root node of the display.maxDepth
- the maximum number of levels to print below the root
-
printTree
-
printChildren
protected void printChildren(PrintWriter p, int maxDepth, Node markNode, int level, NodeUtil.NodeField field, Object value) -
printChild
protected void printChild(PrintWriter p, int maxDepth, Node markNode, int level, NodeUtil.NodeField field, Object value) -
printNewLine
-
printNewLine
-
nodeName
-
sourceInfo
-
instrumentInfo
-