类 SemanticContext.Predicate
- java.lang.Object
-
- org.antlr.analysis.SemanticContext
-
- org.antlr.analysis.SemanticContext.Predicate
-
- 封闭类:
- SemanticContext
public static class SemanticContext.Predicate extends SemanticContext
-
-
字段概要
字段 修饰符和类型 字段 说明 protected int
constantValue
sometimes predicates are known to be true or false; we need a way to represent this without resorting to a target language value like true or TRUE.static int
FALSE_PRED
protected boolean
gated
Is this a {...}?=> gating predicate or a normal disambiguating {..}? If any predicate in expression is gated, then expression is considered gated.static int
INVALID_PRED_VALUE
GrammarAST
predicateAST
The AST node in tree created from the grammar holding the predicateprotected boolean
synpred
syntactic predicates are converted to semantic predicates but synpreds are generated slightly differently.static int
TRUE_PRED
-
从类继承的字段 org.antlr.analysis.SemanticContext
EMPTY_SEMANTIC_CONTEXT
-
-
构造器概要
构造器 构造器 说明 Predicate(int constantValue)
Predicate(SemanticContext.Predicate p)
Predicate(GrammarAST predicate)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
equals(java.lang.Object o)
Two predicates are the same if they are literally the same text rather than same node in the grammar's AST.org.stringtemplate.v4.ST
genExpr(CodeGenerator generator, org.stringtemplate.v4.STGroup templates, DFA dfa)
Generate an expression that will evaluate the semantic context, given a set of output templates.SemanticContext
getGatedPredicateContext()
Given a semantic context expression tree, return a tree with all nongated predicates set to true and then reduced.int
hashCode()
boolean
hasUserSemanticPredicate()
boolean
isSyntacticPredicate()
java.lang.String
toString()
void
trackUseOfSyntacticPredicates(Grammar g)
Notify the indicated grammar of any syn preds used within this context-
从类继承的方法 org.antlr.analysis.SemanticContext
and, factorAnd, factorOr, getAndOperands, getOrOperands, not, or
-
-
-
-
字段详细资料
-
predicateAST
public GrammarAST predicateAST
The AST node in tree created from the grammar holding the predicate
-
gated
protected boolean gated
Is this a {...}?=> gating predicate or a normal disambiguating {..}? If any predicate in expression is gated, then expression is considered gated. The simple Predicate object's predicate AST's type is used to set gated to true if type==GATED_SEMPRED.
-
synpred
protected boolean synpred
syntactic predicates are converted to semantic predicates but synpreds are generated slightly differently.
-
INVALID_PRED_VALUE
public static final int INVALID_PRED_VALUE
- 另请参阅:
- 常量字段值
-
FALSE_PRED
public static final int FALSE_PRED
- 另请参阅:
- 常量字段值
-
TRUE_PRED
public static final int TRUE_PRED
- 另请参阅:
- 常量字段值
-
constantValue
protected int constantValue
sometimes predicates are known to be true or false; we need a way to represent this without resorting to a target language value like true or TRUE.
-
-
构造器详细资料
-
Predicate
public Predicate(int constantValue)
-
Predicate
public Predicate(GrammarAST predicate)
-
Predicate
public Predicate(SemanticContext.Predicate p)
-
-
方法详细资料
-
equals
public boolean equals(java.lang.Object o)
Two predicates are the same if they are literally the same text rather than same node in the grammar's AST. Or, if they have the same constant value, return equal. As of July 2006 I'm not sure these are needed.- 覆盖:
equals
在类中java.lang.Object
-
hashCode
public int hashCode()
- 覆盖:
hashCode
在类中java.lang.Object
-
genExpr
public org.stringtemplate.v4.ST genExpr(CodeGenerator generator, org.stringtemplate.v4.STGroup templates, DFA dfa)
从类复制的说明:SemanticContext
Generate an expression that will evaluate the semantic context, given a set of output templates.- 指定者:
genExpr
在类中SemanticContext
-
getGatedPredicateContext
public SemanticContext getGatedPredicateContext()
从类复制的说明:SemanticContext
Given a semantic context expression tree, return a tree with all nongated predicates set to true and then reduced. So p&&(q||r) would return p&&r if q is nongated but p and r are gated.- 指定者:
getGatedPredicateContext
在类中SemanticContext
-
hasUserSemanticPredicate
public boolean hasUserSemanticPredicate()
- 指定者:
hasUserSemanticPredicate
在类中SemanticContext
-
isSyntacticPredicate
public boolean isSyntacticPredicate()
- 指定者:
isSyntacticPredicate
在类中SemanticContext
-
trackUseOfSyntacticPredicates
public void trackUseOfSyntacticPredicates(Grammar g)
从类复制的说明:SemanticContext
Notify the indicated grammar of any syn preds used within this context
-
toString
public java.lang.String toString()
- 覆盖:
toString
在类中java.lang.Object
-
-