Package wyil.lang

Examples of wyil.lang.Type$UnionOfLists


   *            --- context in which to resolve the type.
   * @return
   * @throws IOException
   */
  public Nominal resolveAsType(SyntacticType type, Context context) {
    Type nominalType = resolveAsType(type, context, true, false);
    Type rawType = resolveAsType(type, context, false, false);
    return Nominal.construct(nominalType, rawType);
  }
View Full Code Here


   * @return
   * @throws IOException
   */
  public Nominal resolveAsUnconstrainedType(SyntacticType type,
      Context context) {
    Type nominalType = resolveAsType(type, context, true, true);
    Type rawType = resolveAsType(type, context, false, true);
    return Nominal.construct(nominalType, rawType);
  }
View Full Code Here

      // FIXME: the following allows (in certain cases) constants to be
      // interpreted as types. This should not be allowed and needs to be
      // removed in the future. However, to do this requires some kind of
      // unit/constant/enum type.  See #315

      Type t = resolveAsConstant(key).type();
      if (t instanceof Type.Set) {
        if (unconstrained) {
          // crikey this is ugly
          int myIndex = states.size();
          int kind = Type.leafKind(Type.T_VOID);
View Full Code Here

    return null;
  }

  private Constant evaluate(Expr.BinOp bop, Constant v1, Constant v2,
      Context context) {
    Type v1_type = v1.type();
    Type v2_type = v2.type();
    Type lub = Type.Union(v1_type, v2_type);

    // FIXME: there are bugs here related to coercions.

    if (Type.isSubtype(Type.T_BOOL, lub)) {
      return evaluateBoolean(bop, (Constant.Bool) v1, (Constant.Bool) v2,
View Full Code Here

  // expandAsType
  // =========================================================================

  public Nominal.EffectiveSet expandAsEffectiveSet(Nominal lhs)
      throws IOException, ResolveError {
    Type raw = lhs.raw();
    if (raw instanceof Type.EffectiveSet) {
      Type nominal = expandOneLevel(lhs.nominal());
      if (!(nominal instanceof Type.EffectiveSet)) {
        nominal = raw; // discard nominal information
      }
      return (Nominal.EffectiveSet) Nominal.construct(nominal, raw);
    } else {
View Full Code Here

    }
  }

  public Nominal.EffectiveList expandAsEffectiveList(Nominal lhs)
      throws IOException, ResolveError {
    Type raw = lhs.raw();
    if (raw instanceof Type.EffectiveList) {
      Type nominal = expandOneLevel(lhs.nominal());
      if (!(nominal instanceof Type.EffectiveList)) {
        nominal = raw; // discard nominal information
      }
      return (Nominal.EffectiveList) Nominal.construct(nominal, raw);
    } else {
View Full Code Here

    }
  }

  public Nominal.EffectiveCollection expandAsEffectiveCollection(Nominal lhs)
      throws IOException, ResolveError {
    Type raw = lhs.raw();
    if (raw instanceof Type.EffectiveCollection) {
      Type nominal = expandOneLevel(lhs.nominal());
      if (!(nominal instanceof Type.EffectiveCollection)) {
        nominal = raw; // discard nominal information
      }
      return (Nominal.EffectiveCollection) Nominal
          .construct(nominal, raw);
View Full Code Here

    }
  }

  public Nominal.EffectiveIndexible expandAsEffectiveMap(Nominal lhs)
      throws IOException, ResolveError {
    Type raw = lhs.raw();
    if (raw instanceof Type.EffectiveIndexible) {
      Type nominal = expandOneLevel(lhs.nominal());
      if (!(nominal instanceof Type.EffectiveIndexible)) {
        nominal = raw; // discard nominal information
      }
      return (Nominal.EffectiveIndexible) Nominal.construct(nominal, raw);
    } else {
View Full Code Here

    }
  }

  public Nominal.EffectiveMap expandAsEffectiveDictionary(Nominal lhs)
      throws IOException, ResolveError {
    Type raw = lhs.raw();
    if (raw instanceof Type.EffectiveMap) {
      Type nominal = expandOneLevel(lhs.nominal());
      if (!(nominal instanceof Type.EffectiveMap)) {
        nominal = raw; // discard nominal information
      }
      return (Nominal.EffectiveMap) Nominal.construct(nominal, raw);
    } else {
View Full Code Here

    }
  }

  public Nominal.EffectiveRecord expandAsEffectiveRecord(Nominal lhs)
      throws IOException, ResolveError {
    Type raw = lhs.raw();

    if (raw instanceof Type.Record) {
      Type nominal = expandOneLevel(lhs.nominal());
      if (!(nominal instanceof Type.Record)) {
        nominal = (Type) raw; // discard nominal information
      }
      return (Nominal.Record) Nominal.construct(nominal, raw);
    } else if (raw instanceof Type.UnionOfRecords) {
      Type nominal = expandOneLevel(lhs.nominal());
      if (!(nominal instanceof Type.UnionOfRecords)) {
        nominal = (Type) raw; // discard nominal information
      }
      return (Nominal.UnionOfRecords) Nominal.construct(nominal, raw);
    }
View Full Code Here

TOP

Related Classes of wyil.lang.Type$UnionOfLists

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.