|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.Tree.Simplification.Rule
public abstract static class Simplification.Rule
A simplification rule for use with the tree simplifier.
Constructor Summary | |
---|---|
Simplification.Rule(String name)
|
Method Summary | |
---|---|
Exp |
apply(TreeFactory tf,
Exp exp,
DerivationGenerator dg)
Applies this rule to exp , and returns the result. |
Stm |
apply(TreeFactory tf,
Stm stm,
DerivationGenerator dg)
Applies this rule to stm , and returns the result. |
boolean |
match(Exp exp)
Returns true if exp matches this rule. |
boolean |
match(Stm stm)
Returns true if stm matches this rule. |
String |
toString()
Returns a human-readable name for this rule. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Simplification.Rule(String name)
Method Detail |
---|
public String toString()
toString
in class Object
public boolean match(Exp exp)
exp
matches this rule.
public Exp apply(TreeFactory tf, Exp exp, DerivationGenerator dg)
exp
, and returns the result.
apply()
should always succeed when
match()
returns true
. Otherwise,
the behavior of apply
is undefined.
The returned Exp
cannot contain the parameter
exp
, although it can contain its children.
(use exp.build(tf, exp.kids()) to workaround this limitation.)
public boolean match(Stm stm)
stm
matches this rule.
public Stm apply(TreeFactory tf, Stm stm, DerivationGenerator dg)
stm
, and returns the result.
apply()
should always succeed when
match()
returns true
. Otherwise,
the behavior of apply
is undefined.
The returned Stm
cannot contain the parameter
stm
, although it can contain its children.
(use stm.build(tf, stm.kids()) to workaround this limitation.)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |