Inheritance: OutputModelObject
Exemplo n.º 1
0
 public virtual void AddIterationOp(SrcOp op)
 {
     if (iteration == null)
     {
         iteration = new List <SrcOp>();
     }
     iteration.Add(op);
 }
        public IList<SrcOp> followExpr; // might not work in template if size>1

        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);
        }
Exemplo n.º 3
0
        public IList <SrcOp> followExpr; // might not work in template if size>1

        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);
        }
Exemplo n.º 4
0
 public virtual void AddPreambleOp(SrcOp op)
 {
     preamble.Add(op);
 }
Exemplo n.º 5
0
 public virtual void AddIterationOp(SrcOp op)
 {
     if (iteration == null)
         iteration = new List<SrcOp>();
     iteration.Add(op);
 }
Exemplo n.º 6
0
 public virtual void AddPreambleOp(SrcOp op)
 {
     preamble.Add(op);
 }