Package antlr
Class TreeBlockContext
- java.lang.Object
-
- antlr.BlockContext
-
- antlr.TreeBlockContext
-
class TreeBlockContext extends BlockContext
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
Fields Modifier and Type Field Description protected boolean
nextElementIsRoot
-
Fields inherited from class antlr.BlockContext
altNum, block, blockEnd
-
-
Constructor Summary
Constructors Constructor Description TreeBlockContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlternativeElement(AlternativeElement e)
-
Methods inherited from class antlr.BlockContext
currentAlt, currentElement
-
-
-
-
Method Detail
-
addAlternativeElement
public void addAlternativeElement(AlternativeElement e)
- Overrides:
addAlternativeElement
in classBlockContext
-
-