Add some assertions

This commit is contained in:
Sam Harwell 2013-05-14 09:58:02 -05:00
parent c0d1fcc110
commit 35ef516e28
2 changed files with 3 additions and 0 deletions

View File

@ -92,6 +92,8 @@ public class AnalysisPipeline {
look = anal.getDecisionLookahead(s);
g.tool.log("LL1", "look=" + Arrays.toString(look));
}
assert s.decision + 1 >= g.decisionLOOK.size();
Utils.setSize(g.decisionLOOK, s.decision+1);
g.decisionLOOK.set(s.decision, look);
g.tool.log("LL1", "LL(1)? " + disjoint(look));

View File

@ -46,6 +46,7 @@ public class LL1StarBlockSingleAlt extends LL1Loop {
loopBackStateNumber = star.loopBackState.stateNumber;
this.decision = star.decision;
IntervalSet[] altLookSets = factory.getGrammar().decisionLOOK.get(decision);
assert altLookSets.length == 2;
IntervalSet enterLook = altLookSets[0];
IntervalSet exitLook = altLookSets[1];
loopExpr = addCodeForLoopLookaheadTempVar(enterLook);