Tabnine Logo
LL1Analyzer
Code IndexAdd Tabnine to your IDE (free)

How to use
LL1Analyzer
in
org.antlr.v4.runtime.atn

Best Java code snippets using org.antlr.v4.runtime.atn.LL1Analyzer (Showing top 20 results out of 315)

origin: org.antlr/antlr4-runtime

/** Compute the set of valid tokens that can occur starting in state {@code s}.
 *  If {@code ctx} is null, the set of tokens will not include what can follow
 *  the rule surrounding {@code s}. In other words, the set will be
 *  restricted to tokens reachable staying within {@code s}'s rule.
 */
public IntervalSet nextTokens(ATNState s, RuleContext ctx) {
  LL1Analyzer anal = new LL1Analyzer(this);
  IntervalSet next = anal.LOOK(s, ctx);
  return next;
}
origin: org.antlr/antlr4-runtime

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param stopState the ATN state to stop at. This can be a
 * {@link BlockEndState} to detect epsilon paths through a closure.
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
  public IntervalSet LOOK(ATNState s, ATNState stopState, RuleContext ctx) {
    IntervalSet r = new IntervalSet();
  boolean seeThruPreds = true; // ignore preds; get all lookahead
  PredictionContext lookContext = ctx != null ? PredictionContext.fromRuleContext(s.atn, ctx) : null;
    _LOOK(s, stopState, lookContext,
     r, new HashSet<ATNConfig>(), new BitSet(), seeThruPreds, true);
    return r;
  }
origin: io.virtdata/virtdata-lib-realer

protected void processParser() {
  g.decisionLOOK = new ArrayList<IntervalSet[]>(g.atn.getNumberOfDecisions()+1);
  for (DecisionState s : g.atn.decisionToState) {
    g.tool.log("LL1", "\nDECISION "+s.decision+" in rule "+g.getRule(s.ruleIndex).name);
    IntervalSet[] look;
    if ( s.nonGreedy ) { // nongreedy decisions can't be LL(1)
      look = new IntervalSet[s.getNumberOfTransitions()+1];
    }
    else {
      LL1Analyzer anal = new LL1Analyzer(g.atn);
      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));
  }
}
origin: org.antlr/antlr4-runtime

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
  public IntervalSet LOOK(ATNState s, RuleContext ctx) {
  return LOOK(s, null, ctx);
  }
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

protected void processParser() {
  g.decisionLOOK = new ArrayList<IntervalSet[]>(g.atn.getNumberOfDecisions()+1);
  for (DecisionState s : g.atn.decisionToState) {
    g.tool.log("LL1", "\nDECISION "+s.decision+" in rule "+g.getRule(s.ruleIndex).name);
    IntervalSet[] look;
    if ( s.nonGreedy ) { // nongreedy decisions can't be LL(1)
      look = new IntervalSet[s.getNumberOfTransitions()+1];
    }
    else {
      LL1Analyzer anal = new LL1Analyzer(g.atn);
      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));
  }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
  public IntervalSet LOOK(ATNState s, RuleContext ctx) {
  return LOOK(s, null, ctx);
  }
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/** Compute the set of valid tokens that can occur starting in state {@code s}.
 *  If {@code ctx} is null, the set of tokens will not include what can follow
 *  the rule surrounding {@code s}. In other words, the set will be
 *  restricted to tokens reachable staying within {@code s}'s rule.
 */
public IntervalSet nextTokens(ATNState s, RuleContext ctx) {
  LL1Analyzer anal = new LL1Analyzer(this);
  IntervalSet next = anal.LOOK(s, ctx);
  return next;
}
origin: com.tunnelvisionlabs/antlr4

protected void processParser() {
  g.decisionLOOK = new ArrayList<IntervalSet[]>(g.atn.getNumberOfDecisions()+1);
  for (DecisionState s : g.atn.decisionToState) {
    g.tool.log("LL1", "\nDECISION "+s.decision+" in rule "+g.getRule(s.ruleIndex).name);
    IntervalSet[] look;
    if ( s.nonGreedy ) { // nongreedy decisions can't be LL(1)
      look = new IntervalSet[s.getNumberOfTransitions()+1];
    }
    else {
      LL1Analyzer anal = new LL1Analyzer(g.atn);
      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));
  }
}
origin: org.antlr/antlr4-runtime

Set<ATNConfig> lookBusy = new HashSet<ATNConfig>();
boolean seeThruPreds = false; // fail to get lookahead upon pred
_LOOK(s.transition(alt).target, null, PredictionContext.EMPTY,
   look[alt], lookBusy, new BitSet(), seeThruPreds, false);
origin: io.virtdata/virtdata-lib-realer

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
  public IntervalSet LOOK(ATNState s, RuleContext ctx) {
  return LOOK(s, null, ctx);
  }
origin: io.virtdata/virtdata-lib-realer

/** Compute the set of valid tokens that can occur starting in state {@code s}.
 *  If {@code ctx} is null, the set of tokens will not include what can follow
 *  the rule surrounding {@code s}. In other words, the set will be
 *  restricted to tokens reachable staying within {@code s}'s rule.
 */
public IntervalSet nextTokens(ATNState s, RuleContext ctx) {
  LL1Analyzer anal = new LL1Analyzer(this);
  IntervalSet next = anal.LOOK(s, ctx);
  return next;
}
origin: org.antlr/antlr4

protected void processParser() {
  g.decisionLOOK = new ArrayList<IntervalSet[]>(g.atn.getNumberOfDecisions()+1);
  for (DecisionState s : g.atn.decisionToState) {
    g.tool.log("LL1", "\nDECISION "+s.decision+" in rule "+g.getRule(s.ruleIndex).name);
    IntervalSet[] look;
    if ( s.nonGreedy ) { // nongreedy decisions can't be LL(1)
      look = new IntervalSet[s.getNumberOfTransitions()+1];
    }
    else {
      LL1Analyzer anal = new LL1Analyzer(g.atn);
      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));
  }
}
origin: org.antlr/antlr4-runtime

    ATNState returnState = atn.states.get(ctx.getReturnState(i));
    _LOOK(returnState, stopState, ctx.getParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF);
  _LOOK(t.target, stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);
  _LOOK(t.target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);
_LOOK(t.target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF);
origin: uk.co.nichesolutions/antlr4-runtime

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
  public IntervalSet LOOK(ATNState s, RuleContext ctx) {
  return LOOK(s, null, ctx);
  }
origin: uk.co.nichesolutions/antlr4-runtime

/** Compute the set of valid tokens that can occur starting in state {@code s}.
 *  If {@code ctx} is null, the set of tokens will not include what can follow
 *  the rule surrounding {@code s}. In other words, the set will be
 *  restricted to tokens reachable staying within {@code s}'s rule.
 */
public IntervalSet nextTokens(ATNState s, RuleContext ctx) {
  LL1Analyzer anal = new LL1Analyzer(this);
  IntervalSet next = anal.LOOK(s, ctx);
  return next;
}
origin: uk.co.nichesolutions/antlr4

protected void processParser() {
  g.decisionLOOK = new ArrayList<IntervalSet[]>(g.atn.getNumberOfDecisions()+1);
  for (DecisionState s : g.atn.decisionToState) {
    g.tool.log("LL1", "\nDECISION "+s.decision+" in rule "+g.getRule(s.ruleIndex).name);
    IntervalSet[] look;
    if ( s.nonGreedy ) { // nongreedy decisions can't be LL(1)
      look = new IntervalSet[s.getNumberOfTransitions()+1];
    }
    else {
      LL1Analyzer anal = new LL1Analyzer(g.atn);
      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));
  }
}
origin: uk.co.nichesolutions/antlr4-runtime

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param stopState the ATN state to stop at. This can be a
 * {@link BlockEndState} to detect epsilon paths through a closure.
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
  public IntervalSet LOOK(ATNState s, ATNState stopState, RuleContext ctx) {
    IntervalSet r = new IntervalSet();
  boolean seeThruPreds = true; // ignore preds; get all lookahead
  PredictionContext lookContext = ctx != null ? PredictionContext.fromRuleContext(s.atn, ctx) : null;
    _LOOK(s, stopState, lookContext,
     r, new HashSet<ATNConfig>(), new BitSet(), seeThruPreds, true);
    return r;
  }
origin: com.tunnelvisionlabs/antlr4-runtime

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
@NotNull
  public IntervalSet LOOK(@NotNull ATNState s, @NotNull PredictionContext ctx) {
  return LOOK(s, s.atn.ruleToStopState[s.ruleIndex], ctx);
  }
origin: com.tunnelvisionlabs/antlr4-runtime

/** Compute the set of valid tokens that can occur starting in state {@code s}.
 *  If {@code ctx} is {@link PredictionContext#EMPTY_LOCAL}, the set of tokens will not include what can follow
 *  the rule surrounding {@code s}. In other words, the set will be
 *  restricted to tokens reachable staying within {@code s}'s rule.
 */
@NotNull
public IntervalSet nextTokens(ATNState s, @NotNull PredictionContext ctx) {
  Args.notNull("ctx", ctx);
  LL1Analyzer anal = new LL1Analyzer(this);
  IntervalSet next = anal.LOOK(s, ctx);
  return next;
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Compute set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 *
 * <p>If {@code ctx} is {@code null} and the end of the rule containing
 * {@code s} is reached, {@link Token#EPSILON} is added to the result set.
 * If {@code ctx} is not {@code null} and the end of the outermost rule is
 * reached, {@link Token#EOF} is added to the result set.</p>
 *
 * @param s the ATN state
 * @param stopState the ATN state to stop at. This can be a
 * {@link BlockEndState} to detect epsilon paths through a closure.
 * @param ctx the complete parser context, or {@code null} if the context
 * should be ignored
 *
 * @return The set of tokens that can follow {@code s} in the ATN in the
 * specified {@code ctx}.
 */
  public IntervalSet LOOK(ATNState s, ATNState stopState, RuleContext ctx) {
    IntervalSet r = new IntervalSet();
  boolean seeThruPreds = true; // ignore preds; get all lookahead
  PredictionContext lookContext = ctx != null ? PredictionContext.fromRuleContext(s.atn, ctx) : null;
    _LOOK(s, stopState, lookContext,
     r, new HashSet<ATNConfig>(), new BitSet(), seeThruPreds, true);
    return r;
  }
org.antlr.v4.runtime.atnLL1Analyzer

Most used methods

  • <init>
  • LOOK
    Compute set of tokens that can follow s in the ATN in the specified ctx.If ctx is null and the end o
  • _LOOK
    Compute set of tokens that can follow s in the ATN in the specified ctx.If ctx is null and stopState
  • getDecisionLookahead
    Calculates the SLL(1) expected lookahead set for each outgoing transition of an ATNState. The return

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • Menu (java.awt)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now