net.sf.farrago.fennel.calc
Class CalcRexImplementorTableImpl.InstrDefImplementor

java.lang.Object
  extended by net.sf.farrago.fennel.calc.CalcRexImplementorTableImpl.AbstractCalcRexImplementor
      extended by net.sf.farrago.fennel.calc.CalcRexImplementorTableImpl.InstrDefImplementor
All Implemented Interfaces:
CalcRexImplementor
Direct Known Subclasses:
CalcRexImplementorTableImpl.AddCharSetNameInstrImplementor, CalcRexImplementorTableImpl.BinaryNumericMakeSametypeImplementor, CalcRexImplementorTableImpl.BinaryStringMakeSametypeImplementor, CalcRexImplementorTableImpl.CastDecimalImplementor, CalcRexImplementorTableImpl.MakeOperandsDoubleImplementor, CalcRexImplementorTableImpl.TrimImplementor
Enclosing class:
CalcRexImplementorTableImpl

public static class CalcRexImplementorTableImpl.InstrDefImplementor
extends CalcRexImplementorTableImpl.AbstractCalcRexImplementor

Generic implementor that takes a CalcProgramBuilder.InstructionDef which implements an operator by generating a call to a given instruction.

If you need to tweak the arguments to the instruction, you can override makeRegList(net.sf.farrago.fennel.calc.RexToCalcTranslator, org.eigenbase.rex.RexCall).


Field Summary
protected  CalcProgramBuilder.InstructionDef instr
          The instruction with which to implement this operator.
 
Constructor Summary
CalcRexImplementorTableImpl.InstrDefImplementor(CalcProgramBuilder.InstructionDef instr)
          Creates an instruction implementor
 
Method Summary
 CalcReg implement(RexCall call, RexToCalcTranslator translator)
          Generates instructions to implement this call, and returns the register which holds the result.
protected  List<CalcReg> makeRegList(RexToCalcTranslator translator, RexCall call)
          Creates the list of registers which will be arguments to the instruction call.
 
Methods inherited from class net.sf.farrago.fennel.calc.CalcRexImplementorTableImpl.AbstractCalcRexImplementor
canImplement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instr

protected final CalcProgramBuilder.InstructionDef instr
The instruction with which to implement this operator.

Constructor Detail

CalcRexImplementorTableImpl.InstrDefImplementor

CalcRexImplementorTableImpl.InstrDefImplementor(CalcProgramBuilder.InstructionDef instr)
Creates an instruction implementor

Parameters:
instr - The instruction with which to implement this operator, must not be null
"Precondition:"
null != instr, instr != null
Method Detail

implement

public CalcReg implement(RexCall call,
                         RexToCalcTranslator translator)
Description copied from interface: CalcRexImplementor
Generates instructions to implement this call, and returns the register which holds the result.


makeRegList

protected List<CalcReg> makeRegList(RexToCalcTranslator translator,
                                    RexCall call)
Creates the list of registers which will be arguments to the instruction call. i.e implment all the operands of the call and create a result register for the call.

The 0th argument is assumed to hold the result of the call.