Examples of BytecodeValue


Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

        "  def get5():Int = 5              \n"
        "  def getP():Int = this.get4()+this.get5()  \n"
        "val h:Hello = Hello.make()            \n"
        "h.getP()                    \n";

    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "9");
   
    String[] names = { "Hello", "h" };
    BytecodeValue[] vals = { clasDef, clas };
    assertTrue(isInContext(names,vals));
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

        +   "val y : X = X.create()    \n"
        +   "val xBefore = y.getX()    \n"
        +   "y.setX()          \n"
        +   "val xAfter = y.getX()    \n";
   
    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "()");
   
    String[] names = { "X", "xBefore", "xAfter" };
    BytecodeValue[] vals = { clasDef, new BytecodeInt(4), new BytecodeInt(2) };
    assertTrue(isInContext(names,vals));   
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

        +   "val h : Hello = Hello.make()          \n"
        +   "val aBefore = h.getA()              \n"
        +   "h.setA()                    \n"
        +   "val aAfter = h.getA()              \n";

    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "()");
   
    String[] names = { "Hello", "h", "a", "aBefore", "aAfter" };
    BytecodeValue[] vals = { clasDef, clas, new BytecodeInt(2),
        new BytecodeInt(4), new BytecodeInt(2) };
    assertTrue(isInContext(names,vals));
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

    PRINTS_ON = false;
       
    s = "var x : Int = -20   \n"
    +   "x          \n";
   
    BytecodeValue res = runTest(s)
    assertEquals(res.toString(), "-20");

    String[] names = { "x" };
    BytecodeValue[] vals = { new BytecodeInt(3), new BytecodeInt(-20) };
    assertTrue(isInContext(names,vals));
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

        +   "val y : X = X.create()    \n"
        +   "val xBefore = y.getX()    \n"
        +   "y.setX()          \n"
        +   "val xAfter = y.getX()    \n";
     
    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "()");
   
    String[] names = { "Hello", "h", "a", "aBefore", "aAfter" };
    BytecodeValue[] vals = { clasDef, clas, new BytecodeInt(2),
        new BytecodeInt(4), new BytecodeInt(2) };
    assertTrue(isInContext(names,vals))
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

   
    PRINTS_ON = false;
       
    s = "val x = (1,2,3))";
   
    BytecodeValue res = runTest(s)
    assertEquals(res.toString(), "-20");

    String[] names = { "x" };
    BytecodeValue[] vals = { new BytecodeInt(3), new BytecodeInt(-20) };
    assertTrue(isInContext(names,vals));
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

    +   "var b : Bool = 6      \n"
    +   "var c : Str = false    \n"
    +   "var d : Int = \"hello\"  \n"
    +   "val e : Int -> Str = 3    \n";

    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "()");

    String[] names = { "a", "b", "c", "d", "e" };
    BytecodeValue[] vals = { new BytecodeInt(8), new BytecodeInt(6),
        new BytecodeBoolean(false), new BytecodeString("hello"),
        new BytecodeInt(3)};
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

   
    s =  "val a : Int = 3    \n"
    +   "a = 5          \n"
    +   "a            \n";

    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "5");

    String[] names = { };
    BytecodeValue[] vals = { };
    assertTrue(isInContext(names, vals));   
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

    +   "  val x3 = max(min(max(a,b),max(c,d)),max(min(a,b),min(c,d))) \n"
    "  val x4 = max(max(a,b),max(c,d))                             \n"
    +   "  (x1,x2,x3,x4)                        \n"
    +   "sortFour(60,5,23,41)                      \n";

    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "(5,23,41,60)");

    String[] names = { "sortFour" };
    BytecodeValue[] vals = { func };
    assertTrue(isInContext(names, vals));
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeValue

    +"l.remove(3)                            \n"
    +"l.insert(13,0)                          \n"
    +"l.remove(0)                            \n"
    +"(l.get(0),l.get(1),l.get(2),l.get(3),l.get(4),l.get(5))      \n";

    BytecodeValue res = runTest(s);
    assertEquals(res.toString(), "(6,3,5,1,0,9)");

    String[] names = { "Node", "DummyNode", "IntList", "l" };
    BytecodeValue[] vals = { clasDef, clasDef, clasDef, clas };
    assertTrue(isInContext(names, vals));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.