public LL1StarBlockSingleAlt(OutputModelFactory factory, GrammarAST starRoot, List<CodeBlockForAlt> alts) { super(factory, starRoot, alts); StarLoopEntryState star = (StarLoopEntryState)starRoot.atnState; 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); } }
@Override public Choice getLL1EBNFBlock(GrammarAST ebnfRoot, List<CodeBlockForAlt> alts) { int ebnf = 0; if ( ebnfRoot!=null ) ebnf = ebnfRoot.getType(); Choice c = null; switch ( ebnf ) { case ANTLRParser.OPTIONAL : if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts); else c = new LL1OptionalBlock(this, ebnfRoot, alts); break; case ANTLRParser.CLOSURE : if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; case ANTLRParser.POSITIVE_CLOSURE : if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; } return c; }
@Override public Choice getLL1EBNFBlock(GrammarAST ebnfRoot, List<CodeBlockForAlt> alts) { int ebnf = 0; if ( ebnfRoot!=null ) ebnf = ebnfRoot.getType(); Choice c = null; switch ( ebnf ) { case ANTLRParser.OPTIONAL : if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts); else c = new LL1OptionalBlock(this, ebnfRoot, alts); break; case ANTLRParser.CLOSURE : if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; case ANTLRParser.POSITIVE_CLOSURE : if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; } return c; }
public LL1StarBlockSingleAlt(OutputModelFactory factory, GrammarAST starRoot, List<CodeBlockForAlt> alts) { super(factory, starRoot, alts); StarLoopEntryState star = (StarLoopEntryState)starRoot.atnState; 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); } }
@Override public Choice getLL1EBNFBlock(GrammarAST ebnfRoot, List<CodeBlockForAlt> alts) { int ebnf = 0; if ( ebnfRoot!=null ) ebnf = ebnfRoot.getType(); Choice c = null; switch ( ebnf ) { case ANTLRParser.OPTIONAL : if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts); else c = new LL1OptionalBlock(this, ebnfRoot, alts); break; case ANTLRParser.CLOSURE : if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; case ANTLRParser.POSITIVE_CLOSURE : if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; } return c; }
public LL1StarBlockSingleAlt(OutputModelFactory factory, GrammarAST starRoot, List<CodeBlockForAlt> alts) { super(factory, starRoot, alts); StarLoopEntryState star = (StarLoopEntryState)starRoot.atnState; loopBackStateNumber = star.loopBackState.stateNumber; this.decision = star.decision; IntervalSet[] altLookSets = factory.getGrammar().decisionLOOK.get(decision); assert altLookSets.length == 2; IntervalSet enterLook = altLookSets[0]; @SuppressWarnings("unused") IntervalSet exitLook = altLookSets[1]; loopExpr = addCodeForLoopLookaheadTempVar(enterLook); } }
@Override public Choice getLL1EBNFBlock(GrammarAST ebnfRoot, List<CodeBlockForAlt> alts) { int ebnf = 0; if ( ebnfRoot!=null ) ebnf = ebnfRoot.getType(); Choice c = null; switch ( ebnf ) { case ANTLRParser.OPTIONAL : if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts); else c = new LL1OptionalBlock(this, ebnfRoot, alts); break; case ANTLRParser.CLOSURE : if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; case ANTLRParser.POSITIVE_CLOSURE : if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; } return c; }
public LL1StarBlockSingleAlt(OutputModelFactory factory, GrammarAST starRoot, List<CodeBlockForAlt> alts) { super(factory, starRoot, alts); StarLoopEntryState star = (StarLoopEntryState)starRoot.atnState; 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); } }
@Override public Choice getLL1EBNFBlock(GrammarAST ebnfRoot, List<CodeBlockForAlt> alts) { int ebnf = 0; if ( ebnfRoot!=null ) ebnf = ebnfRoot.getType(); Choice c = null; switch ( ebnf ) { case ANTLRParser.OPTIONAL : if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts); else c = new LL1OptionalBlock(this, ebnfRoot, alts); break; case ANTLRParser.CLOSURE : if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; case ANTLRParser.POSITIVE_CLOSURE : if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts); else c = getComplexEBNFBlock(ebnfRoot, alts); break; } return c; }
public LL1StarBlockSingleAlt(OutputModelFactory factory, GrammarAST starRoot, List<CodeBlockForAlt> alts) { super(factory, starRoot, alts); StarLoopEntryState star = (StarLoopEntryState)starRoot.atnState; 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); } }