Package org.eclipse.imp.pdb.facts.type

Examples of org.eclipse.imp.pdb.facts.type.Type.lub()


          if (resultElem.getType().isSet() || resultElem.getType().isList()){
            /*
             * Splice the elements in the set
             * __eval.
             */
            elementType = elementType.lub(resultElem.getType().getElementType());
            for (IValue val : (Iterable<IValue>) resultElem.getValue()) {
              results.add(val);
            }
          continue;
          }
View Full Code Here


          resultElem = expr.interpret(__eval);
          if (resultElem.getType().isBottom()) {
            throw new NonVoidTypeRequired(expr);
          }
        }
        elementType = elementType.lub(resultElem.getType());
        results.add(results.size(), resultElem.getValue());
      }
      Type resultType = TF.setType(elementType);
      ISetWriter w = __eval.__getVf().setWriter();
      w.insertAll(results);
View Full Code Here

      types[i] = actualTypes[i];
    }
   
    Type lub = TF.voidType();
    for (int j = i; j < actualTypes.length; j++) {
      lub = lub.lub(actualTypes[j]);
    }
   
    types[i] = TF.listType(lub);
   
    return TF.tupleType(types);
View Full Code Here

        if (valueResult.getType().isBottom()) {
          throw new NonVoidTypeRequired(mapping.getTo());
        }

        keyType = keyType.lub(keyResult.getType());
        valueType = valueType.lub(valueResult.getType());

        IValue keyValue = result.get(keyResult.getValue());
        if (keyValue != null) {
          throw org.rascalmpl.interpreter.utils.RuntimeExceptionFactory
              .MultipleKey(keyValue, mapping.getFrom(), __eval
View Full Code Here

    return input.accept(new IValueVisitor<IValue, RuntimeException>() {

      private Type calcLub(Iterable<? extends IValue> e) {
        Type elemType = tf.voidType();
        for (IValue v : e) {
          elemType = elemType.lub(v.getType());
        }
        return elemType;
      }

      @Override
View Full Code Here

      newActuals[i] = actuals[i];
    }
   
    Type lub = TF.voidType();
    for (int j = i; j < actuals.length; j++) {
      lub = lub.lub(actuals[j].getType());
    }
   
    IListWriter list = vf.listWriter();
    list.insertAt(0, actuals, i, actuals.length - arity + 1);
    newActuals[i] = list.done();
View Full Code Here

      labels[i] = formals.getFieldName(i);
    }
   
    Type lub = TF.voidType();
    for (int j = i; j < actualTypes.getArity(); j++) {
      lub = lub.lub(actualTypes.getFieldType(j));
    }
   
    types[i] = TF.listType(lub);
    labels[i] = formals.getFieldName(i);
   
View Full Code Here

      types[i] = actualTypes[i];
    }
   
    Type lub = TF.voidType();
    for (int j = i; j < actualTypes.length; j++) {
      lub = lub.lub(actualTypes[j]);
    }
   
    types[i] = TF.listType(lub);
   
    return TF.tupleType(types);
View Full Code Here

          if(resultElem.getType().isList()|| resultElem.getType().isSet()){
            /*
             * Splice elements in list
             */
          elementType = elementType.lub(resultElem.getType().getElementType());
            for (IValue val : (Iterable<IValue>) resultElem.getValue()) {
              results.add(val);
            }
            continue;
          }
View Full Code Here

            }
            continue;
          }
        }

        elementType = elementType.lub(resultElem.getType());
        results.add(results.size(), resultElem.getValue());
      }

      Type resultType = TF.listType(elementType);
      IListWriter w = __eval.__getVf().listWriter();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.