public static class SemanticContext.Predicate extends SemanticContext
SemanticContext.AND, SemanticContext.Operator, SemanticContext.OR, SemanticContext.PrecedencePredicate, SemanticContext.Predicate| 限定符和类型 | 字段和说明 |
|---|---|
boolean |
isCtxDependent |
int |
predIndex |
int |
ruleIndex |
NONE| 限定符 | 构造器和说明 |
|---|---|
protected |
Predicate() |
|
Predicate(int ruleIndex,
int predIndex,
boolean isCtxDependent) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object obj) |
<T> boolean |
eval(Recognizer<T,?> parser,
RuleContext parserCallStack)
For context independent predicates, we evaluate them without a local
context (i.e., null context).
|
int |
hashCode() |
String |
toString() |
and, evalPrecedence, orpublic final int ruleIndex
public final int predIndex
public final boolean isCtxDependent
protected Predicate()
public Predicate(int ruleIndex,
int predIndex,
boolean isCtxDependent)
public <T> boolean eval(Recognizer<T,?> parser, RuleContext parserCallStack)
SemanticContextFor context dependent predicates, we must pass in a local context so that references such as $arg evaluate properly as _localctx.arg. We only capture context dependent predicates in the context in which we begin prediction, so we passed in the outer context here in case of context dependent predicate evaluation.
eval 在类中 SemanticContextCopyright © 1992–2022 Daniel Sun. All rights reserved.