|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.antlr.runtime.misc.FastQueue<T>
org.antlr.runtime.misc.LookaheadStream<Object>
org.antlr.runtime.tree.CommonTreeNodeStream
public class CommonTreeNodeStream
| Field Summary | |
|---|---|
protected IntArray |
calls
Stack of indexes used for push/pop calls |
static int |
DEFAULT_INITIAL_BUFFER_SIZE
|
protected boolean |
hasNilRoot
Tree (nil A B C) trees like flat A B C streams |
static int |
INITIAL_CALL_STACK_SIZE
|
protected TreeIterator |
it
The tree iterator we using |
protected int |
level
Tracks tree depth. |
protected Object |
root
Pull nodes from which tree? |
protected TokenStream |
tokens
If this tree (root) was created from a token stream, track it. |
| Fields inherited from class org.antlr.runtime.misc.LookaheadStream |
|---|
currentElementIndex, eof, lastMarker, markDepth, prevElement, UNINITIALIZED_EOF_ELEMENT_INDEX |
| Fields inherited from class org.antlr.runtime.misc.FastQueue |
|---|
data, p, range |
| Constructor Summary | |
|---|---|
CommonTreeNodeStream(Object tree)
|
|
CommonTreeNodeStream(TreeAdaptor adaptor,
Object tree)
|
|
| Method Summary | |
|---|---|
Object |
get(int i)
Get a tree node at an absolute index i; 0..n-1. |
String |
getSourceName()
Where are you getting symbols from? Normally, implementations will pass the buck all the way to the lexer who can ask its input stream for the file name or whatever. |
TokenStream |
getTokenStream()
If the tree associated with this stream was created from a TokenStream, you can specify it here. |
TreeAdaptor |
getTreeAdaptor()
What adaptor can tell me how to interpret/navigate nodes and trees. |
Object |
getTreeSource()
Where is this stream pulling nodes from? This is not the name, but the object that provides node objects. |
boolean |
isEOF(Object o)
|
int |
LA(int i)
Get int at current input pointer + i ahead where i=1 is next int. |
Object |
nextElement()
Pull elements from tree iterator. |
int |
pop()
Seek back to previous index saved during last push() call. |
void |
push(int index)
Make stream jump to a new location, saving old location. |
void |
replaceChildren(Object parent,
int startChildIndex,
int stopChildIndex,
Object t)
Replace from start to stop child index of parent with t, which might be a list. |
void |
reset()
Reset the tree node stream in such a way that it acts like a freshly constructed stream. |
void |
setTokenStream(TokenStream tokens)
|
void |
setTreeAdaptor(TreeAdaptor adaptor)
|
void |
setUniqueNavigationNodes(boolean uniqueNavigationNodes)
As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. |
String |
toString(Object start,
Object stop)
Return the text of all nodes from start to stop, inclusive. |
String |
toTokenTypeString()
For debugging; destructive: moves tree iterator to end. |
| Methods inherited from class org.antlr.runtime.misc.LookaheadStream |
|---|
consume, fill, index, LB, LT, mark, release, remove, rewind, rewind, seek, size, syncAhead |
| Methods inherited from class org.antlr.runtime.misc.FastQueue |
|---|
add, clear, elementAt, head, range, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.antlr.runtime.tree.TreeNodeStream |
|---|
LT |
| Methods inherited from interface org.antlr.runtime.IntStream |
|---|
consume, index, mark, release, rewind, rewind, seek, size |
| Field Detail |
|---|
public static final int DEFAULT_INITIAL_BUFFER_SIZE
public static final int INITIAL_CALL_STACK_SIZE
protected Object root
protected TokenStream tokens
protected TreeIterator it
protected IntArray calls
protected boolean hasNilRoot
protected int level
| Constructor Detail |
|---|
public CommonTreeNodeStream(Object tree)
public CommonTreeNodeStream(TreeAdaptor adaptor,
Object tree)
| Method Detail |
|---|
public void reset()
TreeNodeStream
reset in interface TreeNodeStreamreset in class LookaheadStream<Object>public Object nextElement()
nextElement in class LookaheadStream<Object>public boolean isEOF(Object o)
isEOF in class LookaheadStream<Object>public void setUniqueNavigationNodes(boolean uniqueNavigationNodes)
TreeNodeStream
setUniqueNavigationNodes in interface TreeNodeStreampublic Object getTreeSource()
TreeNodeStream
getTreeSource in interface TreeNodeStreampublic String getSourceName()
IntStream
getSourceName in interface IntStreampublic TokenStream getTokenStream()
TreeNodeStream
getTokenStream in interface TreeNodeStreampublic void setTokenStream(TokenStream tokens)
public TreeAdaptor getTreeAdaptor()
TreeNodeStream
getTreeAdaptor in interface TreeNodeStreampublic void setTreeAdaptor(TreeAdaptor adaptor)
public Object get(int i)
TreeNodeStream
get in interface TreeNodeStreampublic int LA(int i)
IntStream
LA in interface IntStreampublic void push(int index)
public int pop()
public void replaceChildren(Object parent,
int startChildIndex,
int stopChildIndex,
Object t)
TreeNodeStream
replaceChildren in interface TreeNodeStream
public String toString(Object start,
Object stop)
TreeNodeStream
toString in interface TreeNodeStreampublic String toTokenTypeString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||