Antlr4.Codegen.Model.LL1OptionalBlockSingleAlt.LL1OptionalBlockSingleAlt C# (CSharp) Method

LL1OptionalBlockSingleAlt() public method

public LL1OptionalBlockSingleAlt ( OutputModelFactory factory, GrammarAST blkAST, IList alts ) : System.Collections.Generic
factory OutputModelFactory
blkAST Antlr4.Tool.Ast.GrammarAST
alts IList
return System.Collections.Generic
        public LL1OptionalBlockSingleAlt(OutputModelFactory factory,
                                         GrammarAST blkAST,
                                         IList<CodeBlockForAlt> alts)
            : base(factory, blkAST, alts)
        {
            this.decision = ((DecisionState)blkAST.atnState).decision;

            /* Lookahead for each alt 1..n */
            //		IntervalSet[] altLookSets = LinearApproximator.getLL1LookaheadSets(dfa);
            IntervalSet[] altLookSets = factory.GetGrammar().decisionLOOK[decision];
            altLook = GetAltLookaheadAsStringLists(altLookSets);
            IntervalSet look = altLookSets[0];
            IntervalSet followLook = altLookSets[1];

            IntervalSet expecting = look.Or(followLook);
            this.error = GetThrowNoViableAlt(factory, blkAST, expecting);

            expr = AddCodeForLookaheadTempVar(look);
            followExpr = factory.GetLL1Test(followLook, blkAST);
        }
    }
LL1OptionalBlockSingleAlt