public static class SemanticContext.AND extends SemanticContext.Operator
SemanticContext.AND, SemanticContext.Operator, SemanticContext.OR, SemanticContext.PrecedencePredicate, SemanticContext.Predicate| 限定符和类型 | 字段和说明 |
|---|---|
SemanticContext[] |
opnds |
NONE| 构造器和说明 |
|---|
AND(SemanticContext a,
SemanticContext b) |
| 限定符和类型 | 方法和说明 |
|---|---|
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).
|
SemanticContext |
evalPrecedence(Recognizer<?,?> parser,
RuleContext parserCallStack)
Evaluate the precedence predicates for the context and reduce the result.
|
Collection<SemanticContext> |
getOperands()
Gets the operands for the semantic context operator.
|
int |
hashCode() |
String |
toString() |
and, or@NotNull public final SemanticContext[] opnds
public AND(@NotNull
SemanticContext a,
@NotNull
SemanticContext b)
public Collection<SemanticContext> getOperands()
SemanticContext.OperatorgetOperands 在类中 SemanticContext.OperatorSemanticContext operands for the
operator.public <T> boolean eval(Recognizer<T,?> parser, RuleContext parserCallStack)
For 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.
The evaluation of predicates by this context is short-circuiting, but unordered.
eval 在类中 SemanticContextpublic SemanticContext evalPrecedence(Recognizer<?,?> parser, RuleContext parserCallStack)
SemanticContextevalPrecedence 在类中 SemanticContextparser - The parser instance.SemanticContext.NONE: if the predicate simplifies to true after
precedence predicates are evaluated.null: if the predicate simplifies to false after
precedence predicates are evaluated.this: if the semantic context is not changed as a result of
precedence predicate evaluation.null SemanticContext: the new simplified
semantic context after precedence predicates are evaluated.Copyright © 1992–2022 Daniel Sun. All rights reserved.