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.

Field Summary

Fields inherited from class gnu.expr.Target

Ignore, pushObject

Constructor Summary

CheckedTarget(Type type)
CheckedTarget(Type type, String procname, int argno)
CheckedTarget(Type type, LambdaExp proc, int argno)

Method Summary

void
compileFromStack(Compilation comp, Type stackType)
static void
emitCheckedCoerce(Compilation comp, String procname, int argno, Type type)
static void
emitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type type)
static void
emitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type type, Variable argValue)
static Target
getInstance(Type type)
static Target
getInstance(Type type, String procname, int argno)
static Target
getInstance(Type type, LambdaExp proc, int argno)

Methods inherited from class gnu.expr.StackTarget

compileFromStack, compileFromStack0, convert, emitCoerceFromObject, getInstance, getType

Methods inherited from class gnu.expr.Target

compileFromStack, getType, pushValue

Constructor Details

CheckedTarget

public CheckedTarget(Type type)

CheckedTarget

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

CheckedTarget

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

Method Details

compileFromStack

public void compileFromStack(Compilation comp,
                             Type stackType)
Overrides:
compileFromStack in interface StackTarget

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)
Overrides:
getInstance in interface StackTarget

getInstance

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

getInstance

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