3 namespace dokuwiki\Parsing\ParserMode
;
5 use dokuwiki\Parsing\Lexer\Lexer
;
8 * This class and all the subclasses below are used to reduce the effort required to register
9 * modes with the Lexer.
11 * @author Harry Fuecks <hfuecks@gmail.com>
13 abstract class AbstractMode
implements ModeInterface
15 /** @var Lexer $Lexer will be injected on loading FIXME this should be done by setter */
17 protected $allowedModes = [];
20 abstract public function getSort();
23 public function preConnect()
28 public function connectTo($mode)
33 public function postConnect()
38 public function accepts($mode)
40 return in_array($mode, (array) $this->allowedModes
);