Constructs a matching Machine for the specified RE2.
(RE2 re2)
| 108 | * Constructs a matching Machine for the specified {@code RE2}. |
| 109 | */ |
| 110 | Machine(RE2 re2) { |
| 111 | this.prog = re2.prog; |
| 112 | this.re2 = re2; |
| 113 | this.q0 = new Queue(prog.numInst()); |
| 114 | this.q1 = new Queue(prog.numInst()); |
| 115 | this.matchcap = new int[prog.numCap < 2 ? 2 : prog.numCap]; |
| 116 | } |
| 117 | |
| 118 | /** Copy constructor, but does not include {@code next} */ |
| 119 | Machine(Machine copy) { |