Example #1
0
 /**
  * Construct an NFA that will recognize a string matching this regular expression and then
  * transition to a state that will accept with the given integer code.
  */
 public State toNFA(int accept) {
   State s = new State(); // Build a new state
   s.accept = accept; // with specified accept code
   s.trans = new Transition[0]; // and no outgoing transitions.
   return this.toNFA(s); // Generate recognizer.
 }