|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.opt.VolcanoRule | +--net.sf.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 net.sf.saffron.opt.VolcanoRule |
description, planner |
Constructor Summary | |
ConverterRule(Class clazz,
CallingConvention in,
CallingConvention out,
String description)
Creates a ConverterRule |
Method Summary | |
abstract SaffronRel |
convert(SaffronRel 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(VolcanoRuleCall call)
This method is called every time the rule matches. |
Methods inherited from class net.sf.saffron.opt.VolcanoRule |
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()
VolcanoRule
getOutConvention
in class VolcanoRule
public abstract SaffronRel convert(SaffronRel rel)
public boolean isGuaranteed()
The union-to-java converter, for example, is not guaranteed, because it only works on unions.
public void onMatch(VolcanoRuleCall call)
VolcanoRule
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 VolcanoRuleCall.transformTo(net.sf.saffron.rel.SaffronRel)
to register the expression.
onMatch
in class VolcanoRule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |