|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.ojrex.FarragoOJRexImplementor net.sf.farrago.ojrex.FarragoOJRexCastImplementor
public class FarragoOJRexCastImplementor
FarragoOJRexCastImplementor implements Farrago specifics of OJRexImplementor
for CAST expressions.
A cast is described in terms of an assignment: lhs = rhs, with "lhs" meaning the variable on the left hand side and "rhs" meaning the value right hand side. The general arguments are as follows:
The two main kinds of assignment are to "primitive" types and to
"AssignableValue" types. If the target type is "primitive", it is represented
by a primitive Java value in generated code, or a thin wrapper around one.
Non-primitive types are expected to fulfill the AssignableValue
interface and are assigned using that interface.
Nested Class Summary | |
---|---|
private class |
FarragoOJRexCastImplementor.CastHelper
Helps to implement the CAST operator for a specific cast node. |
Field Summary | |
---|---|
private static StatementList |
throwOverflowStmtList
|
Constructor Summary | |
---|---|
FarragoOJRexCastImplementor()
|
Method Summary | |
---|---|
Expression |
convertCastOrAssignment(FarragoRexToOJTranslator translator,
StatementList stmtList,
String targetName,
RelDataType lhsType,
RelDataType rhsType,
Expression lhsExp,
Expression rhsExp)
Generates code to cast an OJ expression as another type. |
Expression |
convertCastToAssignableValue(FarragoRexToOJTranslator translator,
StatementList stmtList,
RelDataType lhsType,
RelDataType rhsType,
Expression lhsExp,
Expression rhsExp)
Generates code to cast an OJ expression as another type. |
private static StatementList |
getThrowStmtList()
Gets a list of statements that throw an overflow exception |
Expression |
implementFarrago(FarragoRexToOJTranslator translator,
RexCall call,
Expression[] operands)
Refined version of OJRexImplementor.implement(org.eigenbase.oj.rex.RexToOJTranslator, org.eigenbase.rex.RexCall, openjava.ptree.Expression[]) . |
Methods inherited from class net.sf.farrago.ojrex.FarragoOJRexImplementor |
---|
canImplement, implement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static StatementList throwOverflowStmtList
Constructor Detail |
---|
public FarragoOJRexCastImplementor()
Method Detail |
---|
private static StatementList getThrowStmtList()
public Expression implementFarrago(FarragoRexToOJTranslator translator, RexCall call, Expression[] operands)
FarragoOJRexImplementor
OJRexImplementor.implement(org.eigenbase.oj.rex.RexToOJTranslator, org.eigenbase.rex.RexCall, openjava.ptree.Expression[])
.
implementFarrago
in class FarragoOJRexImplementor
translator
- provides Farrago-specific translation contextcall
- the call to be translatedoperands
- call's operands, which have already been translated
independentlypublic Expression convertCastOrAssignment(FarragoRexToOJTranslator translator, StatementList stmtList, String targetName, RelDataType lhsType, RelDataType rhsType, Expression lhsExp, Expression rhsExp)
public Expression convertCastToAssignableValue(FarragoRexToOJTranslator translator, StatementList stmtList, RelDataType lhsType, RelDataType rhsType, Expression lhsExp, Expression rhsExp)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |