public class LexicalPreservingPrinter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<Node,NodeText> |
textForNodes
For each node we setup and update a NodeText, containing all the lexical information about such node
|
Constructor and Description |
---|
LexicalPreservingPrinter(Node node) |
Modifier and Type | Method and Description |
---|---|
private static AstObserver |
createObserver(LexicalPreservingPrinter lpp) |
(package private) java.util.List<TokenTextElement> |
findIndentation(Node node) |
private static ObservableProperty |
findNodeListName(NodeList nodeList) |
(package private) NodeText |
getOrCreateNodeText(Node node) |
(package private) NodeText |
getTextForNode(Node node) |
private NodeText |
interpret(Node node,
CsmElement csm,
NodeText nodeText) |
private static boolean |
isReturningOptionalNodeList(java.lang.reflect.Method m) |
private NodeText |
prettyPrintingTextNode(Node node,
NodeText nodeText) |
java.lang.String |
print(Node node)
Print a Node into a String, preserving the lexical information.
|
void |
print(Node node,
java.io.Writer writer)
Print a Node into a Writer, preserving the lexical information.
|
static <N extends Node> |
setup(ParseStart<N> parseStart,
Provider provider)
Deprecated.
just use the other constructor.
|
private void |
storeInitialText(Node root) |
private void |
storeInitialTextForOneNode(Node node,
java.util.List<JavaToken> nodeTokens) |
private java.util.Iterator<TokenTextElement> |
tokensPreceeding(Node node) |
java.lang.String |
toString() |
public LexicalPreservingPrinter(Node node)
public static <N extends Node> Pair<ParseResult<N>,LexicalPreservingPrinter> setup(ParseStart<N> parseStart, Provider provider)
private static AstObserver createObserver(LexicalPreservingPrinter lpp)
private void storeInitialText(Node root)
private void storeInitialTextForOneNode(Node node, java.util.List<JavaToken> nodeTokens)
private java.util.Iterator<TokenTextElement> tokensPreceeding(Node node)
public java.lang.String print(Node node)
public void print(Node node, java.io.Writer writer) throws java.io.IOException
java.io.IOException
private NodeText interpret(Node node, CsmElement csm, NodeText nodeText)
java.util.List<TokenTextElement> findIndentation(Node node)
private static boolean isReturningOptionalNodeList(java.lang.reflect.Method m)
private static ObservableProperty findNodeListName(NodeList nodeList)
public java.lang.String toString()
toString
in class java.lang.Object