harpoon.Tools.PatMat
Class Spec.Rule

java.lang.Object
  extended by harpoon.Tools.PatMat.Spec.Rule
Direct Known Subclasses:
Spec.RuleExp, Spec.RuleStm
Enclosing class:
Spec

public abstract static class Spec.Rule
extends Object

Abstract immutable representation of an Instruction Pattern. Contains a Spec.DetailList and a series of Java code statements.


Field Summary
 String action_str
          Java code to execute if this fires (ie. this pattern is chosen as part of the optimal set).
 Spec.DetailList details
          List of the extra details associated with this (speed-cost, size-cost, predicates, etc.).
 
Constructor Summary
Spec.Rule(Spec.DetailList details, String action_str)
          Constructs a new Spec.Rule.
 
Method Summary
abstract  void accept(Spec.RuleVisitor v)
          Applies v's visit method to this.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

details

public final Spec.DetailList details
List of the extra details associated with this (speed-cost, size-cost, predicates, etc.). null is a legal value.


action_str

public final String action_str
Java code to execute if this fires (ie. this pattern is chosen as part of the optimal set).

Constructor Detail

Spec.Rule

public Spec.Rule(Spec.DetailList details,
                 String action_str)
Constructs a new Spec.Rule.
requires: action_str is a series of valid Java code statements.
effects: constructs a new Spec.Rule object with associated Spec.DetailList and action to perform if this fires.

Parameters:
details - List of extra details associated with this (speed-cost, size-cost, predicates, etc.).
action_str - Series of Java code statements that represent the action to perform if this fires.
Method Detail

accept

public abstract void accept(Spec.RuleVisitor v)
Applies v's visit method to this. This is effectively a gludge to emulate multiple dispatch. Must be reimplemented by all subclasses of Spec.Rule.
effects: Calls v.visit(this).

See Also:
"Design Patterns pgs. 331-344"

toString

public String toString()
Overrides:
toString in class Object