|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.gate.yam.translate.AbstractTranslator
java.gate.yam.translate.PrettyTranslator
class PrettyTranslator extends AbstractTranslator
This class is a pretty-printer for YAM documents. It takes a parse tree as input, munges the whitespace in the Token images, and prints it to the supplied writer.
Nested Class Summary | |
---|---|
class |
PrettyTranslator.AnnotationData
A help class for storing annotation data before creating real annotations. |
Field Summary | |
---|---|
boolean |
identityFunction
Are we munging, or just recreating the original? |
static boolean |
pleaseLeakLotsOfMemory
For debugging, set this true and the GATE docs that the translator creates will not be deleted. |
Constructor Summary | |
PrettyTranslator()
Construction. |
Method Summary | |
---|---|
String
|
getCommentImage(Token t)
Get the image of a comment. |
String[][]
|
getConstantsTable()
Array mapping node type name to start/end strings. |
String
|
getPlainNodeImage(SimpleNode n, boolean setOffsets, int offset)
Get a plain node's image from its tokens. |
String
|
getPlainNodeImage(SimpleNode n, boolean setOffsets, int offset, List annotations)
Get a plain node's image from its tokens. |
String
|
getPreamblePath()
Get the path to the preamble resource. |
Object[][]
|
getPredicatesTable()
Array mapping predicate type name to attributes. |
int
|
processToken(Token t, int offset, StringBuilder s, boolean setOffsets, List annotations)
|
void
|
processURLs(SimpleNode node)
Process URLs and Anchors. |
Writer
|
translate()
Translation. |
void
|
traverse(SimpleNode n, StringBuilder content, List annotations, boolean firstPass, boolean nestedUnit)
Collect annotation data and content dominated by the input node. |
Field Detail |
---|
boolean identityFunction
static boolean pleaseLeakLotsOfMemory
Constructor Detail |
---|
public PrettyTranslator()
Method Detail |
---|
public String getCommentImage(Token t)
public String[][] getConstantsTable()
public String getPlainNodeImage(SimpleNode n, boolean setOffsets, int offset)
public String getPlainNodeImage(SimpleNode n, boolean setOffsets, int offset, List annotations)
public String getPreamblePath()
public Object[][] getPredicatesTable()
public int processToken(Token t, int offset, StringBuilder s, boolean setOffsets, List annotations)
public void processURLs(SimpleNode node)
public Writer translate()
public void traverse(SimpleNode n, StringBuilder content, List annotations, boolean firstPass, boolean nestedUnit)
Groovy Documentation