Package wyrl.core

Examples of wyrl.core.Type$Bag


  }

  public int translate(int level, Expr.Constant code,
      Environment environment, SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;
    Object v = code.value;
    String rhs;

    if (v instanceof Boolean) {
      rhs = v.toString();
View Full Code Here


    return target;
  }

  public int translate(int level, Expr.UnOp code, Environment environment,
      SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;
    int rhs = translate(level, code.mhs, environment, file);
    rhs = coerceFromRef(level, code.mhs, rhs, environment);
    String body;

    switch (code.op) {
View Full Code Here

    return target;
  }

  public int translate(int level, Expr.BinOp code, Environment environment,
      SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;
    Type lhs_t = code.lhs.attribute(Attribute.Type.class).type;
    Type rhs_t = code.rhs.attribute(Attribute.Type.class).type;
    int lhs = translate(level, code.lhs, environment, file);

    String body;

    if (code.op == Expr.BOp.IS && code.rhs instanceof Expr.Constant) {
      // special case for runtime type tests
      Expr.Constant c = (Expr.Constant) code.rhs;
      Type test = (Type) c.value;
      int typeIndex = register(test);
      body = "Runtime.accepts(type" + typeIndex + ", automaton, r" + lhs
          + ", SCHEMA)";
    } else if (code.op == Expr.BOp.AND) {
      // special case to ensure short-circuiting of AND.
View Full Code Here

    return target;
  }

  public int translate(int level, Expr.NaryOp code, Environment environment,
      SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;
    String body = "new Automaton.";

    if (code.op == Expr.NOp.LISTGEN) {
      body += "List(";
    } else if (code.op == Expr.NOp.BAGGEN) {
View Full Code Here

    return target;
  }

  public int translate(int level, Expr.ListAccess code,
      Environment environment, SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;
    int src = translate(level, code.src, environment, file);
    int idx = translate(level, code.index, environment, file);
    src = coerceFromRef(level, code.src, src, environment);
    idx = coerceFromRef(level, code.index, idx, environment);
View Full Code Here

    return target;
  }

  public int translate(int level, Expr.ListUpdate code,
      Environment environment, SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;
    int src = translate(level, code.src, environment, file);
    int idx = translate(level, code.index, environment, file);
    int value = translate(level, code.value, environment, file);

    src = coerceFromRef(level, code.src, src, environment);
View Full Code Here

    return target;
  }

  public int translate(int level, Expr.Constructor code,
      Environment environment, SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;
    String body;

    if (code.argument == null) {
      body = code.name;
    } else {
View Full Code Here

      Environment environment, SpecFile file) {
    Integer operand = environment.get(code.var);
    if (operand != null) {
      return operand;
    } else {
      Type type = code.attribute(Attribute.Type.class).type;
      int target = environment.allocate(type);
      myOut(level, type2JavaType(type) + " r" + target + " = " + code.var
          + ";");
      return target;
    }
View Full Code Here

    }
  }

  public int translate(int level, Expr.Substitute code,
      Environment environment, SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;

    // first, translate all subexpressions and make sure they are
    // references.
    int src = translate(level, code.src, environment, file);
    src = coerceFromValue(level, code.src, src, environment);
View Full Code Here

    return target;
  }

  public int translate(int level, Expr.TermAccess code,
      Environment environment, SpecFile file) {
    Type type = code.attribute(Attribute.Type.class).type;

    // first translate src expression, and coerce to a value
    int src = translate(level, code.src, environment, file);
    src = coerceFromRef(level, code.src, src, environment);
View Full Code Here

TOP

Related Classes of wyrl.core.Type$Bag

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.