Ejemplo n.º 1
0
  @Override
  public void resolveTypes(int currentTypeInferenceId) throws CompilerException {
    super.resolveTypes(currentTypeInferenceId);

    for (TypeReference tr : type.getAttributeTypes())
      tr.resolve(currentTypeInferenceId); // FIXME: really ok?!

    for (Expression e : exprs) e.resolveTypes(currentTypeInferenceId);

    outputType = type.withKind(RefKind.VAL);
    outputType.resolve(currentTypeInferenceId);
  }
Ejemplo 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);
  }