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; }
boolean treatEofAsEpsilon = t == Token.EOF; for (ATNConfig c : intermediate) { closure(c, reach, closureBusy, false, fullCtx, treatEofAsEpsilon);
protected void closure(ATNConfigSet sourceConfigs, @NotNull ATNConfigSet configs, boolean collectPredicates, boolean hasMoreContext, @Nullable PredictionContextCache contextCache, boolean treatEofAsEpsilon) { if (contextCache == null) { contextCache = PredictionContextCache.UNCACHED; } ATNConfigSet currentConfigs = sourceConfigs; Set<ATNConfig> closureBusy = new HashSet<ATNConfig>(); while (currentConfigs.size() > 0) { ATNConfigSet intermediate = new ATNConfigSet(); for (ATNConfig config : currentConfigs) { closure(config, configs, intermediate, closureBusy, collectPredicates, hasMoreContext, contextCache, 0, treatEofAsEpsilon); } currentConfigs = intermediate; } }
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; }
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; }
boolean treatEofAsEpsilon = t == Token.EOF; for (ATNConfig c : intermediate) { closure(c, reach, closureBusy, false, fullCtx, treatEofAsEpsilon);
boolean treatEofAsEpsilon = t == Token.EOF; for (ATNConfig c : intermediate) { closure(c, reach, closureBusy, false, fullCtx, treatEofAsEpsilon);
boolean treatEofAsEpsilon = t == Token.EOF; for (ATNConfig c : intermediate) { closure(c, reach, closureBusy, false, fullCtx, treatEofAsEpsilon);
closure(reachIntermediate, reach, collectPredicates, hasMoreContext, contextCache, treatEofAsEpsilon); stepIntoGlobal = reach.getDipsIntoOuterContext();
closure(reachIntermediate, configs, collectPredicates, hasMoreContext, contextCache, false); boolean stepIntoGlobal = configs.getDipsIntoOuterContext();
c.setPrecedenceFilterSuppressed(config.isPrecedenceFilterSuppressed()); assert depth > Integer.MIN_VALUE; closure(c, configs, intermediate, closureBusy, collectPredicates, hasMoreContexts, contextCache, depth - 1, treatEofAsEpsilon); closure(c, configs, intermediate, closureBusy, continueCollecting, hasMoreContexts, contextCache, newDepth, treatEofAsEpsilon);