gnu.expr

Class 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.
Constructor Summary
CheckedTarget(Type type)
CheckedTarget(Type type, LambdaExp proc, int argno)
CheckedTarget(Type type, String procname, int argno)
Method Summary
voidcompileFromStack(Compilation comp, Type stackType)
static voidemitCheckedCoerce(Compilation comp, String procname, int argno, Type type)
static voidemitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type type)
static voidemitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type type, Variable argValue)
static TargetgetInstance(Type type, String procname, int argno)
static TargetgetInstance(Type type, LambdaExp proc, int argno)
static TargetgetInstance(Type type)

Constructor Detail

CheckedTarget

public CheckedTarget(Type type)

CheckedTarget

public CheckedTarget(Type type, LambdaExp proc, int argno)

CheckedTarget

public CheckedTarget(Type type, String procname, int argno)

Method Detail

compileFromStack

public void compileFromStack(Compilation comp, Type stackType)

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 type)

emitCheckedCoerce

public static void emitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type type, Variable argValue)

getInstance

public static Target getInstance(Type type, String procname, int argno)

getInstance

public static Target getInstance(Type type, LambdaExp proc, int argno)

getInstance

public static Target getInstance(Type type)