Exemplo n.º 1
0
  @Override
  public Reference evaluate(RuntimeObject parentOfThis) throws CompilerException {

    RuntimeObject ret = new RuntimeObject(type, Execution.getInstance().getThis().access(), false);

    for (int i = 0; i < exprs.length; i++) ret.write(i, exprs[i].evaluate(parentOfThis).access());

    return new Reference(ret, RefKind.VAL);
  }
Exemplo n.º 2
0
  public ListExpression(Execution exec, Expression[] exs, Type parentType, String name)
      throws CompilerException {

    this.exprs = exs;

    // FIXEDME: add this type to a scope!!!
    type =
        new TupleType(
            new TypeIdentifier((name == null ? "[AnonList]" : name), parentType),
            parentType); // FIXME?

    for (int i = 0; i < exs.length; i++) {

      Expression e = exs[i];
      assert e != null;

      // type.addAttribute(null, (String) null, new TypeOf(e, exec.getInterpreter())); // FIXME:
      // notnull attrKind
      type.addAttribute((String) null, new TypeOf(e, exec.getInterpreter()));
    }

    Execution.getInstance().allAnonTypes.add(type);
  }