|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.gate.yam.translate.Cursor
class Cursor
Helper class for pretty-printer. Represents a position in a tree traversal, and provides manipulation of spacing at that position.
Field Summary | |
---|---|
static boolean |
DEBUG
Debug mode. |
SimpleNode |
hereNode
First node in current position. |
NodeKind |
kind
Position type. |
static Logger |
log
Logger |
int |
nextChildNumber
The next node after the current one. |
NodeKind |
nextKind
Position type. |
SimpleNode |
nextNode
Next node from current position. |
int |
numChildren
Number of children below the root node. |
NodeKind |
previousKind
Previous position type. |
SimpleNode |
rootNode
Root node of the parse tree. |
Constructor Summary | |
Cursor(SimpleNode rootNode, int leadingMin, int leadingMax)
Construction from parse tree root node. |
Method Summary | |
---|---|
void
|
advance()
Advance to the next Unit or Word sequence. |
boolean
|
atEnd()
Finished the document? |
void
|
blanksAfter(int min, int max)
Set the number of blank lines following this position. |
void
|
blanksAfter(int norm, int min, int max)
Set the number of blank lines following this position. |
void
|
blanksAfter(Token gapStart, Token gapEnd, int norm, int min, int max)
Set the number of blank lines in a token sequence. |
NodeKind
|
findNodeKind(SimpleNode n)
Type of the next node after the current Sep sequence. |
String
|
getBlanks(int i)
Get a newline string for a particular number of blanks. |
SimpleNode
|
getHereNode()
First node in current position. |
NodeKind
|
getKind()
Position type. |
NodeKind
|
getNextKind()
Next position type. |
SimpleNode
|
getNextNode()
Next node from current position. |
NodeKind
|
getPreviousKind()
Previous position type. |
void
|
init(SimpleNode rootNode, int leadingMin, int leadingMax)
Initialisation from parse tree root node. |
String
|
sedNls(String s)
Helper |
String
|
tokDetails(Token t)
Helper |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Field Detail |
---|
static final boolean DEBUG
SimpleNode hereNode
NodeKind kind
static Logger log
int nextChildNumber
NodeKind nextKind
SimpleNode nextNode
int numChildren
NodeKind previousKind
SimpleNode rootNode
Constructor Detail |
---|
public Cursor(SimpleNode rootNode, int leadingMin, int leadingMax)
Method Detail |
---|
public void advance()
public boolean atEnd()
public void blanksAfter(int min, int max)
public void blanksAfter(int norm, int min, int max)
public void blanksAfter(Token gapStart, Token gapEnd, int norm, int min, int max)
public NodeKind findNodeKind(SimpleNode n)
public String getBlanks(int i)
public SimpleNode getHereNode()
public NodeKind getKind()
public NodeKind getNextKind()
public SimpleNode getNextNode()
public NodeKind getPreviousKind()
public void init(SimpleNode rootNode, int leadingMin, int leadingMax)
public String sedNls(String s)
public String tokDetails(Token t)
Groovy Documentation