|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--saffron.opt.Rule | +--saffron.rel.convert.ConverterRule
Abstract base class for a rule which converts from one calling convention to another without changing semantics.
Field Summary | |
CallingConvention |
inConvention
|
CallingConvention |
outConvention
|
Fields inherited from class saffron.opt.Rule |
description, planner |
Constructor Summary | |
ConverterRule(Class clazz,
CallingConvention in,
CallingConvention out,
String description)
Creates a ConverterRule |
Method Summary | |
abstract Rel |
convert(Rel rel)
|
CallingConvention |
getOutConvention()
Returns the calling convention of the result of firing this rule, null if not known. |
boolean |
isGuaranteed()
Returns true if this rule can convert any relational expression of the input convention. |
void |
onMatch(RuleCall call)
This method is called every time the rule matches. |
Methods inherited from class saffron.opt.Rule |
convert, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final CallingConvention inConvention
public final CallingConvention outConvention
Constructor Detail |
public ConverterRule(Class clazz, CallingConvention in, CallingConvention out, String description)
ConverterRule
Method Detail |
public CallingConvention getOutConvention()
Rule
getOutConvention
in class Rule
public abstract Rel convert(Rel rel)
public boolean isGuaranteed()
The union-to-java converter, for example, is not guaranteed, because it only works on unions.
public void onMatch(RuleCall call)
Rule
call.rels
holds the set of
relational expressions which match the operands to the rule;
call.rels[0]
is the root expression.
Typically a rule would check that the nodes are valid matches,
creates a new expression, then calls back RuleCall.transformTo(saffron.rel.Rel)
to
register the expression.
onMatch
in class Rule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |