harpoon.Tools.PatMat
Class Spec.Stm

java.lang.Object
  extended by harpoon.Tools.PatMat.Spec.Stm
Direct Known Subclasses:
Spec.StmAlign, Spec.StmCall, Spec.StmCjump, Spec.StmData, Spec.StmExp, Spec.StmJump, Spec.StmLabel, Spec.StmMethod, Spec.StmMove, Spec.StmNativeCall, Spec.StmReturn, Spec.StmSegment, Spec.StmSeq, Spec.StmThrow
Enclosing class:
Spec

public abstract static class Spec.Stm
extends Object

Abstract immutable representation of a Statement in an Instruction Pattern.

See Also:
Stm

Constructor Summary
Spec.Stm()
           
 
Method Summary
abstract  void accept(Spec.StmVisitor v)
          Applies v's visit method to this.
abstract  Spec.Stm build(Spec.ExpList kids)
          Creates a new Spec.Stm similar to this one, using the provided Spec.ExpList of children.
 boolean canBeRootOfData()
          Checks if this Stm object is valid for Data patterns.
abstract  Spec.ExpList kids()
          Creates an Spec.ExpList of children of this Spec.Stm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spec.Stm

public Spec.Stm()
Method Detail

accept

public abstract void accept(Spec.StmVisitor 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.Stm.
effects: Calls v.visit(this).

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

build

public abstract Spec.Stm build(Spec.ExpList kids)
Creates a new Spec.Stm similar to this one, using the provided Spec.ExpList of children.


kids

public abstract Spec.ExpList kids()
Creates an Spec.ExpList of children of this Spec.Stm.


canBeRootOfData

public boolean canBeRootOfData()
Checks if this Stm object is valid for Data patterns. Most patterns are for code generation, not data tables. Specific subclasses of Stm that wish to be matched when generating data tables should override this method to return true.