Example #1
0
 /**
  * this nodeToElement is pretty much identical to that of
  * graph.query.patternstagecompiler.compile.
  */
 private Element nodeToElement(Node X, Mapping map) {
   if (X.equals(Query.ANY)) return Element.ANY;
   if (X.isVariable()) {
     if (map.hasBound(X)) return new Bound(map.indexOf(X));
     else {
       freeVarCnt++;
       return new Free(X);
     }
   }
   return new Fixed(X);
 }
Example #2
0
 protected boolean isArgCheck(Free v, Mapping map) {
   int ix = map.lookUp(v.var());
   if (ix >= 0) {
     v.setIsArg(ix);
     isConnected = true;
     freeVarCnt -= 1;
     return true;
   } else return false;
 }