示例#1
0
 private Part buildNewComplexPart(Part lp, Part rp) {
   ListSet<Part> allParts = new ListSet<Part>();
   allParts.addAll(lp.getParts());
   allParts.addAll(rp.getParts());
   FunctionCall andCall =
       new FunctionCall(
           FunctionName.makeAnd(), Functional.apply(allParts, Part.castToExpression));
   AndedParts cp = parent.buildAndedParts(andCall, allParts);
   if (parent.isComplete(cp)) {
     setComplete(cp);
   } else if (!parent.isComplete(cp)) {
     AndedParts ncp = parent.maybeMakeComplete(cp);
     if (ncp != null) {
       setComplete(ncp);
       return ncp;
     }
   }
   return cp;
 }
示例#2
0
 private Part buildPart(LanguageNode parentNode, ColumnInstance ci, ConstantExpression litex) {
   EqualityPart sp = parent.buildEqualityPart(parentNode, ci, litex);
   if (parent.isComplete(sp)) {
     setComplete(sp);
     state.put(parentNode, sp);
   } else {
     AndedParts xformed = parent.maybeMakeComplete(sp);
     if (xformed != null) {
       setComplete(xformed);
       LanguageNode ret = xformed.getParent();
       state.put(ret, xformed);
       return xformed;
     } else {
       state.put(sp.getParent(), sp);
     }
   }
   return sp;
 }