Antlr4.Codegen.ParserFactory.GetChoiceBlock C# (CSharp) Method

GetChoiceBlock() public method

public GetChoiceBlock ( BlockAST blkAST, IList alts, GrammarAST labelAST ) : Choice
blkAST Antlr4.Tool.Ast.BlockAST
alts IList
labelAST Antlr4.Tool.Ast.GrammarAST
return Antlr4.Codegen.Model.Choice
        public override Choice GetChoiceBlock(BlockAST blkAST, IList<CodeBlockForAlt> alts, GrammarAST labelAST)
        {
            int decision = ((DecisionState)blkAST.atnState).decision;
            Choice c;
            if (!g.tool.force_atn && AnalysisPipeline.Disjoint(g.decisionLOOK[decision]))
            {
                c = GetLL1ChoiceBlock(blkAST, alts);
            }
            else
            {
                c = GetComplexChoiceBlock(blkAST, alts);
            }

            if (labelAST != null)
            { // for x=(...), define x or x_list
                string label = labelAST.Text;
                Decl d = GetTokenLabelDecl(label);
                c.label = d;
                GetCurrentRuleFunction().AddContextDecl(labelAST.GetAltLabel(), d);
                if (labelAST.Parent.Type == ANTLRParser.PLUS_ASSIGN)
                {
                    string listLabel = GetTarget().GetListLabel(label);
                    TokenListDecl l = new TokenListDecl(this, listLabel);
                    GetCurrentRuleFunction().AddContextDecl(labelAST.GetAltLabel(), l);
                }
            }

            return c;
        }