Package org.antlr.v4.codegen.model
Class Choice
- java.lang.Object
-
- org.antlr.v4.codegen.model.OutputModelObject
-
- org.antlr.v4.codegen.model.SrcOp
-
- org.antlr.v4.codegen.model.RuleElement
-
- org.antlr.v4.codegen.model.Choice
-
public abstract class Choice extends RuleElement
The class hierarchy underneath SrcOp is pretty deep but makes sense that, for example LL1StarBlock is a kind of LL1Loop which is a kind of Choice. The problem is it's impossible to figure out how to construct one of these deeply nested objects because of the long super constructor call chain. Instead, I decided to in-line all of this and then look for opportunities to re-factor code into functions. It makes sense to use a class hierarchy to share data fields, but I don't think it makes sense to factor code using super constructors because it has too much work to do.
-
-
Field Summary
Fields Modifier and Type Field Description List<CodeBlockForAlt>
alts
int
decision
Decl
label
List<SrcOp>
preamble
-
Fields inherited from class org.antlr.v4.codegen.model.RuleElement
stateNumber
-
Fields inherited from class org.antlr.v4.codegen.model.SrcOp
enclosingBlock, enclosingRuleRunction, uniqueID
-
Fields inherited from class org.antlr.v4.codegen.model.OutputModelObject
ast, factory
-
-
Constructor Summary
Constructors Constructor Description Choice(OutputModelFactory factory, GrammarAST blkOrEbnfRootAST, List<CodeBlockForAlt> alts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TestSetInline
addCodeForLookaheadTempVar(IntervalSet look)
void
addPreambleOp(SrcOp op)
List<TokenInfo[]>
getAltLookaheadAsStringLists(IntervalSet[] altLookSets)
ThrowNoViableAlt
getThrowNoViableAlt(OutputModelFactory factory, GrammarAST blkAST, IntervalSet expecting)
-
Methods inherited from class org.antlr.v4.codegen.model.SrcOp
getContextName, getOuterMostAltCodeBlock
-
-
-
-
Field Detail
-
decision
public int decision
-
label
public Decl label
-
alts
public List<CodeBlockForAlt> alts
-
-
Constructor Detail
-
Choice
public Choice(OutputModelFactory factory, GrammarAST blkOrEbnfRootAST, List<CodeBlockForAlt> alts)
-
-
Method Detail
-
addPreambleOp
public void addPreambleOp(SrcOp op)
-
getAltLookaheadAsStringLists
public List<TokenInfo[]> getAltLookaheadAsStringLists(IntervalSet[] altLookSets)
-
addCodeForLookaheadTempVar
public TestSetInline addCodeForLookaheadTempVar(IntervalSet look)
-
getThrowNoViableAlt
public ThrowNoViableAlt getThrowNoViableAlt(OutputModelFactory factory, GrammarAST blkAST, IntervalSet expecting)
-
-