public static class SemanticContext.Predicate extends SemanticContext
SemanticContext.AND, SemanticContext.Operator, SemanticContext.OR, SemanticContext.PrecedencePredicate, SemanticContext.Predicate| Modifier and Type | Field and Description |
|---|---|
boolean |
isCtxDependent |
int |
predIndex |
int |
ruleIndex |
NONE| Modifier | Constructor and Description |
|---|---|
protected |
SemanticContext.Predicate() |
|
SemanticContext.Predicate(int ruleIndex,
int predIndex,
boolean isCtxDependent) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
eval(Recognizer<?,?> parser,
RuleContext parserCallStack)
For context independent predicates, we evaluate them without a local
context (i.e., null context).
|
int |
hashCode() |
java.lang.String |
toString() |
and, evalPrecedence, orpublic final int ruleIndex
public final int predIndex
public final boolean isCtxDependent
protected SemanticContext.Predicate()
public SemanticContext.Predicate(int ruleIndex,
int predIndex,
boolean isCtxDependent)
public boolean eval(Recognizer<?,?> 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 in class SemanticContextpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object