/** * Computes the type of the given list expression. * * @param expr a list expression * @return the type of the given list expression */ public static Type getType(ExprList expr) { Iterator<Expression> it = expr.getValue().iterator(); if (it.hasNext()) { Expression subExpr = it.next(); Type eltLubType = EcoreUtil.copy(subExpr.getType()); while (it.hasNext()) { subExpr = it.next(); Type t2 = subExpr.getType(); eltLubType = TypeUtil.getLub(eltLubType, t2); } return IrFactory.eINSTANCE.createTypeList(expr.getSize(), eltLubType); } return null; }
@Override public Type getType(Type t1, Type t2) { type = TypeUtil.getLub(t1, t2); return type; }
@Override public Type getType(Type t1, Type t2) { return TypeUtil.getGlb(t1, t2); }