Top Description Fields Constructors Methods
org.antlr.v4.codegen.model

public abstract Class Choice

extends RuleElement
Class Inheritance
Known Direct Subclasses
org.antlr.v4.codegen.model.LL1Choice, org.antlr.v4.codegen.model.LL1Loop, org.antlr.v4.codegen.model.Loop, org.antlr.v4.codegen.model.AltBlock
Imports
org.antlr.v4.codegen.OutputModelFactory, .Target, org.antlr.v4.codegen.model.decl.Decl, .TokenTypeDecl, org.antlr.v4.misc.Utils, org.antlr.v4.runtime.misc.IntegerList, .IntervalSet, org.antlr.v4.tool.Grammar, org.antlr.v4.tool.ast.GrammarAST, java.util.ArrayList, .List

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

Modifier and TypeField and Description
public List<CodeBlockForAlt>
public int
public Decl
public List<SrcOp>
Inherited from org.antlr.v4.codegen.model.RuleElement:
stateNumber

Constructor Summary

AccessConstructor and Description
public
Choice(OutputModelFactory factory, GrammarAST blkOrEbnfRootAST, List<CodeBlockForAlt> alts)

Method Summary

Modifier and TypeMethod and Description
public TestSetInline
public void
public List<TokenInfo[]>
public ThrowNoViableAlt

Field Detail

altsback to summary
public List<CodeBlockForAlt> alts
Annotations
@ModelElement
decisionback to summary
public int decision
labelback to summary
public Decl label
preambleback to summary
public List<SrcOp> preamble
Annotations
@ModelElement

Constructor Detail

Choiceback to summary
public Choice(OutputModelFactory factory, GrammarAST blkOrEbnfRootAST, List<CodeBlockForAlt> alts)

Method Detail

addCodeForLookaheadTempVarback to summary
public TestSetInline addCodeForLookaheadTempVar(IntervalSet look)
addPreambleOpback to summary
public void addPreambleOp(SrcOp op)
getAltLookaheadAsStringListsback to summary
public List<TokenInfo[]> getAltLookaheadAsStringLists(IntervalSet[] altLookSets)
getThrowNoViableAltback to summary
public ThrowNoViableAlt getThrowNoViableAlt(OutputModelFactory factory, GrammarAST blkAST, IntervalSet expecting)