|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.antlr.analysis.SemanticContext
org.antlr.analysis.SemanticContext.Predicate
public static class SemanticContext.Predicate
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.antlr.analysis.SemanticContext |
---|
SemanticContext.AND, SemanticContext.NOT, SemanticContext.OR, SemanticContext.Predicate, SemanticContext.TruePredicate |
Field Summary | |
---|---|
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 predicate |
protected boolean |
synpred
syntactic predicates are converted to semantic predicates but synpreds are generated slightly differently. |
static int |
TRUE_PRED
|
Fields inherited from class org.antlr.analysis.SemanticContext |
---|
EMPTY_SEMANTIC_CONTEXT |
Constructor Summary | |
---|---|
SemanticContext.Predicate()
|
|
SemanticContext.Predicate(GrammarAST predicate)
|
|
SemanticContext.Predicate(SemanticContext.Predicate p)
|
Method Summary | |
---|---|
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.antlr.stringtemplate.StringTemplate |
genExpr(CodeGenerator generator,
org.antlr.stringtemplate.StringTemplateGroup 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 |
isSyntacticPredicate()
|
java.lang.String |
toString()
|
void |
trackUseOfSyntacticPredicates(Grammar g)
Notify the indicated grammar of any syn preds used within this context |
Methods inherited from class org.antlr.analysis.SemanticContext |
---|
and, not, or |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public GrammarAST predicateAST
protected boolean gated
protected boolean synpred
public static final int INVALID_PRED_VALUE
public static final int FALSE_PRED
public static final int TRUE_PRED
protected int constantValue
Constructor Detail |
---|
public SemanticContext.Predicate()
public SemanticContext.Predicate(GrammarAST predicate)
public SemanticContext.Predicate(SemanticContext.Predicate p)
Method Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public org.antlr.stringtemplate.StringTemplate genExpr(CodeGenerator generator, org.antlr.stringtemplate.StringTemplateGroup templates, DFA dfa)
SemanticContext
genExpr
in class SemanticContext
public SemanticContext getGatedPredicateContext()
SemanticContext
getGatedPredicateContext
in class SemanticContext
public boolean isSyntacticPredicate()
isSyntacticPredicate
in class SemanticContext
public void trackUseOfSyntacticPredicates(Grammar g)
SemanticContext
trackUseOfSyntacticPredicates
in class SemanticContext
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |