Example #1
0
 /**
  * Sequence Runner
  *
  * Treats input as a sequence of symbols, in turn each is passed to the machine
  * taking the first accepting path at each state.
  *
  * @param State    $initialState
  * @param Stateful $context
  */
 public function __construct(State $initialState, Stateful $context = null)
 {
     if ($context === null) {
         $context = new Context();
     }
     $context->setCurrentState($initialState);
     $this->originalContext = clone $this->context = $context;
 }