Example #1
0
File: Prog.java Project: Godin/re2j
 void patch(int l, int val) {
   while (l != 0) {
     Inst i = inst.get(l >> 1);
     if ((l & 1) == 0) {
       l = i.out;
       i.out = val;
     } else {
       l = i.arg;
       i.arg = val;
     }
   }
 }
Example #2
0
File: Prog.java Project: Godin/re2j
 int append(int l1, int l2) {
   if (l1 == 0) {
     return l2;
   }
   if (l2 == 0) {
     return l1;
   }
   int last = l1;
   for (; ; ) {
     int next = next(last);
     if (next == 0) {
       break;
     }
     last = next;
   }
   Inst i = inst.get(last >> 1);
   if ((last & 1) == 0) {
     i.out = l2;
   } else {
     i.arg = l2;
   }
   return l1;
 }