org.antlr.analysis
Class SemanticContext.CommutativePredicate

java.lang.Object
  extended by org.antlr.analysis.SemanticContext
      extended by org.antlr.analysis.SemanticContext.CommutativePredicate
Direct Known Subclasses:
SemanticContext.AND, SemanticContext.OR
Enclosing class:
SemanticContext

public abstract static class SemanticContext.CommutativePredicate
extends SemanticContext


Nested Class Summary
 
Nested classes/interfaces inherited from class org.antlr.analysis.SemanticContext
SemanticContext.AND, SemanticContext.CommutativePredicate, SemanticContext.FalsePredicate, SemanticContext.NOT, SemanticContext.OR, SemanticContext.Predicate, SemanticContext.TruePredicate
 
Field Summary
protected  int hashcode
           
protected  Set<SemanticContext> operands
           
 
Fields inherited from class org.antlr.analysis.SemanticContext
EMPTY_SEMANTIC_CONTEXT
 
Constructor Summary
SemanticContext.CommutativePredicate(HashSet<SemanticContext> contexts)
           
SemanticContext.CommutativePredicate(SemanticContext a, SemanticContext b)
           
 
Method Summary
abstract  int calculateHashCode()
           
abstract  SemanticContext combinePredicates(SemanticContext left, SemanticContext right)
           
 boolean equals(Object obj)
           
 SemanticContext getGatedPredicateContext()
          Given a semantic context expression tree, return a tree with all nongated predicates set to true and then reduced.
abstract  String getOperandString()
           
 int hashCode()
           
 boolean hasUserSemanticPredicate()
           
 boolean isSyntacticPredicate()
           
 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, factorAnd, factorOr, genExpr, getAndOperands, getOrOperands, not, or
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

operands

protected final Set<SemanticContext> operands

hashcode

protected int hashcode
Constructor Detail

SemanticContext.CommutativePredicate

public SemanticContext.CommutativePredicate(SemanticContext a,
                                            SemanticContext b)

SemanticContext.CommutativePredicate

public SemanticContext.CommutativePredicate(HashSet<SemanticContext> contexts)
Method Detail

getGatedPredicateContext

public SemanticContext getGatedPredicateContext()
Description copied from class: 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.

Specified by:
getGatedPredicateContext in class SemanticContext

hasUserSemanticPredicate

public boolean hasUserSemanticPredicate()
Specified by:
hasUserSemanticPredicate in class SemanticContext

isSyntacticPredicate

public boolean isSyntacticPredicate()
Specified by:
isSyntacticPredicate in class SemanticContext

trackUseOfSyntacticPredicates

public void trackUseOfSyntacticPredicates(Grammar g)
Description copied from class: SemanticContext
Notify the indicated grammar of any syn preds used within this context

Overrides:
trackUseOfSyntacticPredicates in class SemanticContext

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getOperandString

public abstract String getOperandString()

combinePredicates

public abstract SemanticContext combinePredicates(SemanticContext left,
                                                  SemanticContext right)

calculateHashCode

public abstract int calculateHashCode()


Copyright © 2011. All Rights Reserved.