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 voiddoCoerce(Compilation comp)static voidemitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type stackType, Type type, Variable argValue)static voidemitCheckedCoerce(Compilation comp, String procname, int argno, Type type)protected StackTargetgetClonedInstance(Type type)static TargetgetInstance(Type type)static TargetgetInstance(Type type, LambdaExp proc, int argno)static TargetgetInstance(Type type, String procname, int argno)static TargetgetInstance(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:
getClonedInstancein classStackTarget
-
doCoerce
protected void doCoerce(Compilation comp)
- Overrides:
doCoercein 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)
-
-