Package weasel.interpreter

Examples of weasel.interpreter.WeaselObject


 
  @Override
  public void run(WeaselInterpreter interpreter, WeaselThread thread, WeaselMethodExecutor method) {
    StackElement se = thread.pop();
    if(se.value==null){
      WeaselObject object = interpreter.getObject(se.object);
      if(object==null)
        throw new WeaselNativeException("Null pointer");
      WeaselField field = object.getWeaselClass().getField("value");
      switch(primitiveID){
      case WeaselPrimitive.BOOLEAN:
        thread.pushValue(field.getBoolean(object));
        break;
      case WeaselPrimitive.CHAR:
        thread.pushValue(field.getChar(object));
        break;
      case WeaselPrimitive.BYTE:
        thread.pushValue(field.getBoolean(object));
        break;
      case WeaselPrimitive.SHORT:
        thread.pushValue(field.getShort(object));
        break;
      case WeaselPrimitive.INT:
        thread.pushValue(field.getInt(object));
        break;
      case WeaselPrimitive.LONG:
        thread.pushValue(field.getLong(object));
        break;
      case WeaselPrimitive.DOUBLE:
        thread.pushValue(field.getDouble(object));
        break;
      case WeaselPrimitive.FLOAT:
        thread.pushValue(field.getFloat(object));
        break;
      }
    }else{
      Object object = se.value;
      Class<?> c = object.getClass();
      switch(primitiveID){
      case WeaselPrimitive.BOOLEAN:
        thread.pushValue((Boolean)object);
        break;
      case WeaselPrimitive.CHAR:
View Full Code Here


  @Override
  public void run(WeaselInterpreter interpreter, WeaselThread thread, WeaselMethodExecutor method) {
    if(primitiveID==0){
      int obj2 = thread.popObject();
      int obj1 = thread.popObject();
      WeaselObject o2 = interpreter.getObject(obj2);
      WeaselObject o1 = interpreter.getObject(obj1);
      if(o1==null && o2==null){
        thread.pushValue(false);
      }else if(o1!=null && o2!=null){
        WeaselMethodBody methodBody = interpreter.baseTypes.getlObjectEqualMethod().getMethod(o1);
        if(methodBody.isNative()){
View Full Code Here

  @Override
  public void run(WeaselInterpreter interpreter, WeaselThread thread, WeaselMethodExecutor method) {
    resolve(interpreter);
    StackElement se = thread.pop();
    if(se.value==null){
      WeaselObject object = interpreter.getObject(se.object);
      if(object!=null){
        WeaselChecks.checkCast(object.getWeaselClass(), weaselClass);
      }
      thread.push(se);
    }else{
      String name = weaselClass.getByteName();
      Object object = se.value;
      Class<?> c = object.getClass();
      if(name==WeaselBaseTypes.weaselBooleanClassName){
        if(c!=Boolean.class){
          throw new WeaselNativeException("Can't cast %s to %s", c, weaselClass);
        }
        thread.pushObject(interpreter.baseTypes.createBooleanObject((Boolean)object));
View Full Code Here

TOP

Related Classes of weasel.interpreter.WeaselObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.