示例#1
0
文件: IntSet.java 项目: kamaci/UBL
 public Type inferType(List<Var> vars, List<List<Type>> varTypes) {
   for (Exp e : exps) {
     Type t = e.inferType(vars, varTypes);
     if (t == null || !t.subType(PType.E)) {
       inferedType = null; // update cache
       return null;
     }
   }
   inferedType = FType.ET; // update cache
   return FType.ET; // could we infer subtypes here?
 }
示例#2
0
文件: Count.java 项目: kamaci/UBL
 public Type inferType(List<Var> vars, List<List<Type>> varTypes) {
   arg.addTypeSig(vars, varTypes);
   Type t = body.inferType(vars, varTypes);
   arg.removeTypeSig(vars, varTypes);
   if (t == null || !t.subType(PType.T)) {
     inferedType = null; // update cache
     return null;
   }
   inferedType = PType.I; // update cache
   return PType.I;
 }
示例#3
0
文件: Count.java 项目: kamaci/UBL
 public void allSubExps(Type type, List result) {
   if (type == null || type.equals(type())) result.add(this);
   if (arg.type().equals(type)) result.add(arg);
   if (body.type().equals(type)) result.add(body);
   body.allSubExps(type, result);
 }