Exemple #1
0
  /**
   * Get the precedence level for the top-most precedence rule.
   *
   * @return The precedence level for the top-most precedence rule, or -1 if the parser context is
   *     not nested within a precedence rule.
   */
  public final int getPrecedence() {
    if (_precedenceStack.isEmpty()) {
      return -1;
    }

    return _precedenceStack.peek();
  }
Exemple #2
0
 @Override
 public boolean precpred(RuleContext localctx, int precedence) {
   return precedence >= _precedenceStack.peek();
 }