gnu.expr
Class CheckedTarget

java.lang.Object
  extended by gnu.expr.Target
      extended by gnu.expr.StackTarget
          extended by 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.Target
Ignore, pushObject
 
Constructor Summary
CheckedTarget(Type type)
           
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, LambdaExp proc, int argno, Type type, Variable argValue)
           
static void emitCheckedCoerce(Compilation comp, java.lang.String procname, int argno, Type type)
           
static Target getInstance(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, convert, emitCoerceFromObject, getType
 
Methods inherited from class gnu.expr.Target
pushValue
 
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)

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)

getInstance

public static Target getInstance(Type type)

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)

emitCheckedCoerce

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