类 PredicateLabel
- java.lang.Object
-
- org.antlr.analysis.Label
-
- org.antlr.analysis.PredicateLabel
-
-
字段概要
字段 修饰符和类型 字段 说明 protected SemanticContextsemanticContextA tree of semantic predicates from the grammar AST if label==SEMPRED.-
从类继承的字段 org.antlr.analysis.Label
ACTION, DOWN, EOF, EOR_TOKEN_TYPE, EOT, EPSILON, EPSILON_STR, INVALID, label, labelSet, MAX_CHAR_VALUE, MIN_ATOM_VALUE, MIN_CHAR_VALUE, MIN_TOKEN_TYPE, NUM_FAUX_LABELS, SEMPRED, SET, UP
-
-
构造器概要
构造器 构造器 说明 PredicateLabel(SemanticContext semCtx)Make a semantic predicates labelPredicateLabel(GrammarAST predicateASTNode)Make a semantic predicate label
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(java.lang.Object o)SemanticContextgetSemanticContext()inthashCode()booleanisSemanticPredicate()java.lang.StringtoString()Predicates are lists of AST nodes from the NFA created from the grammar, but the same predicate could be cut/paste into multiple places in the grammar.java.lang.StringtoString(Grammar g)
-
-
-
字段详细资料
-
semanticContext
protected SemanticContext semanticContext
A tree of semantic predicates from the grammar AST if label==SEMPRED. In the NFA, labels will always be exactly one predicate, but the DFA may have to combine a bunch of them as it collects predicates from multiple NFA configurations into a single DFA state.
-
-
构造器详细资料
-
PredicateLabel
public PredicateLabel(GrammarAST predicateASTNode)
Make a semantic predicate label
-
PredicateLabel
public PredicateLabel(SemanticContext semCtx)
Make a semantic predicates label
-
-
方法详细资料
-
isSemanticPredicate
public boolean isSemanticPredicate()
- 覆盖:
isSemanticPredicate在类中Label
-
getSemanticContext
public SemanticContext getSemanticContext()
- 覆盖:
getSemanticContext在类中Label
-
toString
public java.lang.String toString()
从类复制的说明:LabelPredicates are lists of AST nodes from the NFA created from the grammar, but the same predicate could be cut/paste into multiple places in the grammar. I must compare the text of all the predicates to truly answer whether {p1,p2} .equals {p1,p2}. Unfortunately, I cannot rely on the AST.equals() to work properly so I must do a brute force O(n^2) nested traversal of the Set doing a String compare. At this point, Labels are not compared for equals when they are predicates, but here's the code for future use.
-
-