Package gnu.expr
Class CheckedTarget
- java.lang.Object
-
- gnu.expr.Target
-
- gnu.expr.StackTarget
-
- gnu.expr.CheckedTarget
-
public class CheckedTarget extends StackTarget
Same as StackTarget, but catch ClassCastException. Generate code so that if coercion fails, catch ClassCastException, and re-throw a WrongType. This gives better error messages.
-
-
Field Summary
-
Fields inherited from class gnu.expr.StackTarget
autoTruncates
-
Fields inherited from class gnu.expr.Target
Ignore, pushObject
-
-
Constructor Summary
Constructors Constructor Description CheckedTarget(Type type)
CheckedTarget(Type type, LambdaExp proc, int argno)
CheckedTarget(Type type, String procname, int argno)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doCoerce(Compilation comp)
static void
emitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type stackType, Type type, Variable argValue)
static void
emitCheckedCoerce(Compilation comp, String procname, int argno, Type type)
protected StackTarget
getClonedInstance(Type type)
static Target
getInstance(Type type)
static Target
getInstance(Type type, LambdaExp proc, int argno)
static Target
getInstance(Type type, String procname, int argno)
static Target
getInstance(Declaration decl)
-
Methods inherited from class gnu.expr.StackTarget
compileFromStack, compileFromStack0, convert, emitCoerceFromObject, forceLazy, forceLazyIfNeeded, getTruncatingInstance, getType
-
-
-
-
Method Detail
-
getInstance
public static Target getInstance(Declaration decl)
-
getClonedInstance
protected StackTarget getClonedInstance(Type type)
- Overrides:
getClonedInstance
in classStackTarget
-
doCoerce
protected void doCoerce(Compilation comp)
- Overrides:
doCoerce
in classStackTarget
-
emitCheckedCoerce
public static void emitCheckedCoerce(Compilation comp, String procname, int argno, Type type)
-
emitCheckedCoerce
public static void emitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type stackType, Type type, Variable argValue)
-
-