scale.score.expr
Class MatchExpr

java.lang.Object
  extended by scale.common.Root
      extended by scale.score.Note
          extended by scale.score.expr.Expr
              extended by scale.score.expr.BinaryExpr
                  extended by scale.score.expr.MatchExpr
All Implemented Interfaces:
AnnotationInterface, DisplayNode
Direct Known Subclasses:
EqualityExpr, GreaterEqualExpr, GreaterExpr, LessEqualExpr, LessExpr, NotEqualExpr

public abstract class MatchExpr
extends BinaryExpr

This class represents expressions that compare two values and return "true" or "false".

$Id: CompareMode.java,v 1.10 2007-10-18 16:55:30 burrill Exp $

Copyright 2007 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Field Summary
 
Fields inherited from class scale.score.expr.Expr
fpReorder, SE_DOMAIN, SE_NONE, SE_OVERFLOW, SE_STATE
 
Constructor Summary
MatchExpr(Type t, Expr e1, Expr e2)
           
 
Method Summary
abstract  MatchExpr complement()
          Return the complement expression.
abstract  Expr create(Type t, Expr e1, Expr e2)
           
abstract  CompareMode getMatchOp()
          Return the type of comparison.
 boolean hasTrueFalseResult()
          Return true if the result of the expression is either true (1) or false (0).
 boolean isMatchExpr()
          Return true if this is a match expression.
 Expr reduce()
          Return a simplied equivalent expression.
 
Methods inherited from class scale.score.expr.BinaryExpr
associativeSwapOperands, containsDeclaration, dependsOnDeclaration, equivalent, executionCostEstimate, getAliasAnnote, getDeclList, getExprList, getLeftArg, getLoadExprList, getOperand, getOperandArray, getRightArg, isAssociative, isCommutative, isLeftDistributive, isRightDistributive, loopClean, numOperands, optimizationCandidate, pushOperands, recordRefs, removeRefs, removeUseDef, replaceDecl, setLeftArg, setOperand, setRightArg, sideEffects, swapOperands, unlinkExpression, validate
 
Methods inherited from class scale.score.expr.Expr
addCast, addCast, canonical, changeInDataEdge, conditionalCopy, conditionalUnlinkExpression, copy, deleteOutDataEdge, executionOrder, executionOrdinal, findCriticalChord, findLinearCoefficient, findSubscriptExpr, getAffineExpr, getAffineRepresentation, getCall, getConstantValue, getConstantValue, getCoreType, getCriticalChord, getDefExpr, getDisplayColorHint, getDisplayLabel, getDisplayShapeHint, getDualExpr, getInDataEdge, getInDataEdgeArray, getLoopHeader, getLow, getLValue, getOutDataEdge, getPointedToCore, getReference, getReuseLevel, getRValue, getType, getUseDef, isCast, isDefined, isDefined, isLiteralExpr, isLoopInvariant, isMemoryDef, isMemRefExpr, isScalar, isSimpleExpr, mayGenerateCall, numInDataEdges, removeDualExprs, setCrossloopReuse, setOutDataEdge, setSpatialReuse, setStep, setTemporalReuse, setType, setUseDef, toStringSpecial, validLValue
 
Methods inherited from class scale.score.Note
getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, visit
 
Methods inherited from class scale.common.Root
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatchExpr

public MatchExpr(Type t,
                 Expr e1,
                 Expr e2)
Method Detail

isMatchExpr

public final boolean isMatchExpr()
Return true if this is a match expression.

Overrides:
isMatchExpr in class Expr

getMatchOp

public abstract CompareMode getMatchOp()
Return the type of comparison.


complement

public abstract MatchExpr complement()
Return the complement expression. For example, the complement of "<=" is ">".


hasTrueFalseResult

public boolean hasTrueFalseResult()
Return true if the result of the expression is either true (1) or false (0).

Overrides:
hasTrueFalseResult in class Expr

create

public abstract Expr create(Type t,
                            Expr e1,
                            Expr e2)

reduce

public Expr reduce()
Description copied from class: Expr
Return a simplied equivalent expression. This method may modify the original expression. This is used in the lowering of subscript expressions.

Overrides:
reduce in class Expr
See Also:
SubscriptExpr.lower()