org.antlr.v4.runtime.Parser.getState()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.antlr.v4.runtime.Parser.getState()方法的一些代码示例,展示了Parser.getState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.getState()方法的具体详情如下:
包路径:org.antlr.v4.runtime.Parser
类名称:Parser
方法名:getState

Parser.getState介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

currentState = atn.states.get(parser.getState());
currentToken = parser.getCurrentToken();
context = parser.getContext();

代码示例来源:origin: apache/incubator-shardingsphere

TokenStream tokens = recognizer.getInputStream();
Token token = tokens.LT(1);
ATNState state = recognizer.getInterpreter().atn.states.get(recognizer.getState());
IntervalSet nextTokens = recognizer.getATN().nextTokens(state);
if (nextTokens.contains(token.getType())) {
  if (null == nextTokensContext) {
    nextTokensContext = recognizer.getContext();
    nextTokensState = recognizer.getState();

代码示例来源:origin: org.antlr/antlr4-runtime

public IntervalSet getExpectedTokensWithinCurrentRule() {
  ATN atn = getInterpreter().atn;
  ATNState s = atn.states.get(getState());
    return atn.nextTokens(s);
  }

代码示例来源:origin: org.antlr/antlr4-runtime

/**
 * Computes the set of input symbols which could follow the current parser
 * state and context, as given by {@link #getState} and {@link #getContext},
 * respectively.
 *
 * @see ATN#getExpectedTokens(int, RuleContext)
 */
public IntervalSet getExpectedTokens() {
  return getATN().getExpectedTokens(getState(), getContext());
}

代码示例来源:origin: org.antlr/antlr4-runtime

public FailedPredicateException(Parser recognizer,
                String predicate,
                String message)
{
  super(formatMessage(predicate, message), recognizer, recognizer.getInputStream(), recognizer._ctx);
  ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState());
  AbstractPredicateTransition trans = (AbstractPredicateTransition)s.transition(0);
  if (trans instanceof PredicateTransition) {
    this.ruleIndex = ((PredicateTransition)trans).ruleIndex;
    this.predicateIndex = ((PredicateTransition)trans).predIndex;
  }
  else {
    this.ruleIndex = 0;
    this.predicateIndex = 0;
  }
  this.predicate = predicate;
  this.setOffendingToken(recognizer.getCurrentToken());
}

代码示例来源:origin: org.antlr/antlr4-runtime

ATNState currentState = recognizer.getInterpreter().atn.states.get(recognizer.getState());
ATNState next = currentState.transition(0).target;
ATN atn = recognizer.getInterpreter().atn;

代码示例来源:origin: org.antlr/antlr4-runtime

lastErrorStates.contains(recognizer.getState()) ) {
lastErrorStates.add(recognizer.getState());
IntervalSet followSet = getErrorRecoverySet(recognizer);
consumeUntil(recognizer, followSet);

代码示例来源:origin: org.antlr/antlr4-runtime

ATNState s = atn.states.get(getState());
IntervalSet following = atn.nextTokens(s);
if (following.contains(symbol)) {

代码示例来源:origin: org.antlr/antlr4-runtime

ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState());
    nextTokensState = recognizer.getState();

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public IntervalSet getExpectedTokensWithinCurrentRule() {
  ATN atn = getInterpreter().atn;
  ATNState s = atn.states.get(getState());
    return atn.nextTokens(s);
  }

代码示例来源:origin: io.virtdata/virtdata-lib-realer

public IntervalSet getExpectedTokensWithinCurrentRule() {
  ATN atn = getInterpreter().atn;
  ATNState s = atn.states.get(getState());
    return atn.nextTokens(s);
  }

代码示例来源:origin: uk.co.nichesolutions/antlr4-runtime

public IntervalSet getExpectedTokensWithinCurrentRule() {
  ATN atn = getInterpreter().atn;
  ATNState s = atn.states.get(getState());
    return atn.nextTokens(s);
  }

代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime

@NotNull
public IntervalSet getExpectedTokensWithinCurrentRule() {
  ATN atn = getInterpreter().atn;
  ATNState s = atn.states.get(getState());
    return atn.nextTokens(s);
  }

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Computes the set of input symbols which could follow the current parser
 * state and context, as given by {@link #getState} and {@link #getContext},
 * respectively.
 *
 * @see ATN#getExpectedTokens(int, RuleContext)
 */
public IntervalSet getExpectedTokens() {
  return getATN().getExpectedTokens(getState(), getContext());
}

代码示例来源:origin: uk.co.nichesolutions/antlr4-runtime

/**
 * Computes the set of input symbols which could follow the current parser
 * state and context, as given by {@link #getState} and {@link #getContext},
 * respectively.
 *
 * @see ATN#getExpectedTokens(int, RuleContext)
 */
public IntervalSet getExpectedTokens() {
  return getATN().getExpectedTokens(getState(), getContext());
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Computes the set of input symbols which could follow the current parser
 * state and context, as given by {@link #getState} and {@link #getContext},
 * respectively.
 *
 * @see ATN#getExpectedTokens(int, RuleContext)
 */
public IntervalSet getExpectedTokens() {
  return getATN().getExpectedTokens(getState(), getContext());
}

代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime

/**
 * Computes the set of input symbols which could follow the current parser
 * state and context, as given by {@link #getState} and {@link #getContext},
 * respectively.
 *
 * @see ATN#getExpectedTokens(int, RuleContext)
 */
@NotNull
public IntervalSet getExpectedTokens() {
  return getATN().getExpectedTokens(getState(), getContext());
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

public FailedPredicateException(Parser recognizer,
                String predicate,
                String message)
{
  super(formatMessage(predicate, message), recognizer, recognizer.getInputStream(), recognizer._ctx);
  ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState());
  AbstractPredicateTransition trans = (AbstractPredicateTransition)s.transition(0);
  if (trans instanceof PredicateTransition) {
    this.ruleIndex = ((PredicateTransition)trans).ruleIndex;
    this.predicateIndex = ((PredicateTransition)trans).predIndex;
  }
  else {
    this.ruleIndex = 0;
    this.predicateIndex = 0;
  }
  this.predicate = predicate;
  this.setOffendingToken(recognizer.getCurrentToken());
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public FailedPredicateException(Parser recognizer,
                String predicate,
                String message)
{
  super(formatMessage(predicate, message), recognizer, recognizer.getInputStream(), recognizer._ctx);
  ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState());
  AbstractPredicateTransition trans = (AbstractPredicateTransition)s.transition(0);
  if (trans instanceof PredicateTransition) {
    this.ruleIndex = ((PredicateTransition)trans).ruleIndex;
    this.predicateIndex = ((PredicateTransition)trans).predIndex;
  }
  else {
    this.ruleIndex = 0;
    this.predicateIndex = 0;
  }
  this.predicate = predicate;
  this.setOffendingToken(recognizer.getCurrentToken());
}

代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime

public FailedPredicateException(@NotNull Parser recognizer,
                            @Nullable String predicate,
                            @Nullable String message)
{
  super(formatMessage(predicate, message), recognizer, recognizer.getInputStream(), recognizer._ctx);
  ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState());
  AbstractPredicateTransition trans = (AbstractPredicateTransition)s.transition(0);
  if (trans instanceof PredicateTransition) {
    this.ruleIndex = ((PredicateTransition)trans).ruleIndex;
    this.predicateIndex = ((PredicateTransition)trans).predIndex;
  }
  else {
    this.ruleIndex = 0;
    this.predicateIndex = 0;
  }
  this.predicate = predicate;
  this.setOffendingToken(recognizer, recognizer.getCurrentToken());
}

相关文章