Package wyvern.tools.typedAST.interfaces

Examples of wyvern.tools.typedAST.interfaces.Value


  @Override
  public void execute() throws IOException, CopperParserException {
    TypedAST res = (TypedAST)new Wyvern().parse(new StringReader(code+"\n"), "test input");
    Assert.assertEquals(expectedType, res.typecheck(Globals.getStandardEnv(), Optional.<Type>empty()).toString());
    res = new DSLTransformer().transform(res);
    Value finalV = res.evaluate(Globals.getStandardEnv());
    Assert.assertEquals(expectedValue, finalV.toString());
  }
View Full Code Here


    }

    TypedAST res = (TypedAST)new Wyvern().parse(new StringReader(main), "test input");
    Assert.assertEquals(expectedType, res.typecheck(Globals.getStandardEnv(), Optional.<Type>empty()).toString());
    res = new DSLTransformer().transform(res);
    Value finalV = res.evaluate(Globals.getStandardEnv());
    Assert.assertEquals(expectedValue, finalV.toString());
  }
View Full Code Here

   * @param ast
   * @param value
   */
  public static void evaluateExpecting(TypedAST ast, int value) {
    ast.typecheck(Globals.getStandardEnv(), Optional.empty());
    Value v = ast.evaluate(Globals.getStandardEnv());
   
    String expecting = "IntegerConstant(" + value + ")";

    Assert.assertEquals(expecting, v.toString());
  }
View Full Code Here

    VarValueBinding vb = (VarValueBinding) declEnv.lookup(binding.getName());
    if (definition == null) {
            vb.assign(null);
      return;
    }
    Value defValue = definition.evaluate(evalEnv);
    vb.assign(defValue);
  }
View Full Code Here

TOP

Related Classes of wyvern.tools.typedAST.interfaces.Value

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.