protected ATNConfig actionTransition(ATNConfig config, ActionTransition t) { if ( debug ) System.out.println("ACTION edge "+t.ruleIndex+":"+t.actionIndex); return new ATNConfig(config, t.target); }
protected ATNConfig ruleTransition(ATNConfig config, RuleTransition t) { if ( debug ) { System.out.println("CALL rule "+getRuleName(t.target.ruleIndex)+ ", ctx="+config.context); } ATNState returnState = t.followState; PredictionContext newContext = SingletonPredictionContext.create(config.context, returnState.stateNumber); return new ATNConfig(config, t.target, newContext); }
protected ATNConfigSet computeStartState(ATNState p, RuleContext ctx, boolean fullCtx) { // always at least the implicit call to start rule PredictionContext initialContext = PredictionContext.fromRuleContext(atn, ctx); ATNConfigSet configs = new ATNConfigSet(fullCtx); for (int i=0; i<p.getNumberOfTransitions(); i++) { ATNState target = p.transition(i).target; ATNConfig c = new ATNConfig(target, i+1, initialContext); Set<ATNConfig> closureBusy = new HashSet<ATNConfig>(); closure(c, configs, closureBusy, true, fullCtx, false); } return configs; }
configSet.add(new ATNConfig(config, updatedContext), mergeCache);
protected ATNConfig actionTransition(ATNConfig config, ActionTransition t) { if ( debug ) System.out.println("ACTION edge "+t.ruleIndex+":"+t.actionIndex); return new ATNConfig(config, t.target); }
protected ATNConfig actionTransition(ATNConfig config, ActionTransition t) { if ( debug ) System.out.println("ACTION edge "+t.ruleIndex+":"+t.actionIndex); return new ATNConfig(config, t.target); }
protected ATNConfig actionTransition(ATNConfig config, ActionTransition t) { if ( debug ) System.out.println("ACTION edge "+t.ruleIndex+":"+t.actionIndex); return new ATNConfig(config, t.target); }
if (nextTokens.contains(Token.EPSILON)) { ATNState endOfRuleState = atn.ruleToStopState[config.state.ruleIndex]; result.add(new ATNConfig(config, endOfRuleState), mergeCache);
ATNConfig c = new ATNConfig(s, 0, ctx); if ( !lookBusy.add(c) ) return;
ATNState target = getReachableTarget(trans, t); if ( target!=null ) { intermediate.add(new ATNConfig(c, target), mergeCache);
c = new ATNConfig(c,SemanticContext.NONE); dup.add(c);
protected ATNConfig ruleTransition(ATNConfig config, RuleTransition t) { if ( debug ) { System.out.println("CALL rule "+getRuleName(t.target.ruleIndex)+ ", ctx="+config.context); } ATNState returnState = t.followState; PredictionContext newContext = SingletonPredictionContext.create(config.context, returnState.stateNumber); return new ATNConfig(config, t.target, newContext); }
protected ATNConfig ruleTransition(ATNConfig config, RuleTransition t) { if ( debug ) { System.out.println("CALL rule "+getRuleName(t.target.ruleIndex)+ ", ctx="+config.context); } ATNState returnState = t.followState; PredictionContext newContext = SingletonPredictionContext.create(config.context, returnState.stateNumber); return new ATNConfig(config, t.target, newContext); }
protected ATNConfig ruleTransition(ATNConfig config, RuleTransition t) { if ( debug ) { System.out.println("CALL rule "+getRuleName(t.target.ruleIndex)+ ", ctx="+config.context); } ATNState returnState = t.followState; PredictionContext newContext = SingletonPredictionContext.create(config.context, returnState.stateNumber); return new ATNConfig(config, t.target, newContext); }
protected ATNConfigSet computeStartState(ATNState p, RuleContext ctx, boolean fullCtx) { // always at least the implicit call to start rule PredictionContext initialContext = PredictionContext.fromRuleContext(atn, ctx); ATNConfigSet configs = new ATNConfigSet(fullCtx); for (int i=0; i<p.getNumberOfTransitions(); i++) { ATNState target = p.transition(i).target; ATNConfig c = new ATNConfig(target, i+1, initialContext); Set<ATNConfig> closureBusy = new HashSet<ATNConfig>(); closure(c, configs, closureBusy, true, fullCtx, false); } return configs; }
protected ATNConfigSet computeStartState(ATNState p, RuleContext ctx, boolean fullCtx) { // always at least the implicit call to start rule PredictionContext initialContext = PredictionContext.fromRuleContext(atn, ctx); ATNConfigSet configs = new ATNConfigSet(fullCtx); for (int i=0; i<p.getNumberOfTransitions(); i++) { ATNState target = p.transition(i).target; ATNConfig c = new ATNConfig(target, i+1, initialContext); Set<ATNConfig> closureBusy = new HashSet<ATNConfig>(); closure(c, configs, closureBusy, true, fullCtx, false); } return configs; }