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.


Fields inherited from class gnu.expr.Target
Ignore, pushObject, returnObject
 
Constructor Summary
CheckedTarget(Type type, LambdaExp proc, int argno)
           
CheckedTarget(Type type, java.lang.String procname, int argno)
           
 
Method Summary
 void compileFromStack(Compilation comp, Type stackType)
           
static void emitCheckedCoerce(Compilation comp, LambdaExp proc, int argno, Type type)
           
static void emitCheckedCoerce(Compilation comp, java.lang.String procname, int argno, Type type)
           
static Target getInstance(Type type, LambdaExp proc, int argno)
           
static Target getInstance(Type type, java.lang.String procname, int argno)
           
 
Methods inherited from class gnu.expr.StackTarget
compileFromStack0, getInstance, getType
 
Methods inherited from class gnu.expr.Target
pushValue, returnValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckedTarget

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

CheckedTarget

public CheckedTarget(Type type,
                     java.lang.String procname,
                     int argno)
Method Detail

getInstance

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

getInstance

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

compileFromStack

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

emitCheckedCoerce

public static void emitCheckedCoerce(Compilation comp,
                                     java.lang.String procname,
                                     int argno,
                                     Type type)

emitCheckedCoerce

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