/** * This method determines whether the sigma matches the pattern described by the machine. * * @access public * @param \Unicity\Common\IList $sigma the sigma to be processed * @param \Unicity\Common\Mutable\IList $path the path through which the pattern * was found * @return boolean whether the machine finished in * a goal state * @throws \Unicity\Throwable\InvalidArgument\Exception indicates that no sigma has been * specified * @throws \Unicity\Throwable\Parse\Exception indicates that the machine failed * to parse */ public function matches(Common\IList $sigma, Common\Mutable\IList $path = null) { return $this->machine->run($sigma, $path); }
/** * This method adds the transition to the machine. * * @param \Unicity\Automaton\IMachine $machine the state machine where the transition * will be added */ public function setMachine(Automaton\IMachine $machine) { $machine->addTransition($this); }
/** * This method adds the state to the machine. * * @param \Unicity\Automaton\IMachine $machine the state machine where the state * will be added * @param boolean $initial whether the state is considered an * initial state */ public function setMachine(Automaton\IMachine $machine, $initial = false) { $machine->addState($this, $initial); }