Exemple #1
0
 /**
  * Constructs a matching Machine for the specified {@code RE2}.
  */
 public Machine(RE2 re2)
 {
     this.prog     = re2.prog;
     this.re2      = re2;
     this.q0       = new Queue(prog.numInst());
     this.q1       = new Queue(prog.numInst());
     this.matchcap = new int[prog.numCap < 2 ? 2 : prog.numCap];
 }
Exemple #2
0
 private Frag newInst(Inst.InstOp op)
 {
     // TODO(rsc): impose length limit.
     prog.addInst(op);
     return(new Frag(prog.numInst() - 1));
 }