|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.BlockContext | +--antlr.TreeBlockContext
The context needed to add root,child elements to a Tree. There is only one alternative (i.e., a list of children). We subclass to specialize. MakeGrammar.addElementToCurrentAlt will work correctly now for either a block of alts or a Tree child list. The first time addAlternativeElement is called, it sets the root element rather than adding it to one of the alternative lists. Rather than have the grammar duplicate the rules for grammar atoms etc... we use the same grammar and same refToken behavior etc... We have to special case somewhere and here is where we do it.
Field Summary | |
(package private) int |
altNum
|
(package private) AlternativeBlock |
block
|
(package private) BlockEndElement |
blockEnd
|
protected boolean |
nextElementIsRoot
|
Constructor Summary | |
(package private) |
TreeBlockContext()
|
Method Summary | |
void |
addAlternativeElement(AlternativeElement e)
|
Alternative |
currentAlt()
|
AlternativeElement |
currentElement()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean nextElementIsRoot
AlternativeBlock block
int altNum
BlockEndElement blockEnd
Constructor Detail |
TreeBlockContext()
Method Detail |
public void addAlternativeElement(AlternativeElement e)
addAlternativeElement
in class BlockContext
public Alternative currentAlt()
public AlternativeElement currentElement()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |