Lines Matching refs:mode

54      * @param string $mode         Should only apply this
58 public function addPattern($pattern, $mode = "accept") argument
60 if (! isset($this->regexes[$mode])) {
61 $this->regexes[$mode] = new ParallelRegex($this->case);
63 $this->regexes[$mode]->addPattern($pattern);
72 … * @param string $mode Should only apply this pattern when dealing with this type of input.
75 public function addEntryPattern($pattern, $mode, $new_mode) argument
77 if (! isset($this->regexes[$mode])) {
78 $this->regexes[$mode] = new ParallelRegex($this->case);
80 $this->regexes[$mode]->addPattern($pattern, $new_mode);
87 * @param string $mode Mode to leave.
89 public function addExitPattern($pattern, $mode) argument
91 if (! isset($this->regexes[$mode])) {
92 $this->regexes[$mode] = new ParallelRegex($this->case);
94 $this->regexes[$mode]->addPattern($pattern, "__exit");
104 … * @param string $mode Should only apply this pattern when dealing with this type of input.
107 public function addSpecialPattern($pattern, $mode, $special) argument
109 if (! isset($this->regexes[$mode])) {
110 $this->regexes[$mode] = new ParallelRegex($this->case);
112 $this->regexes[$mode]->addPattern($pattern, "_$special");
118 * @param string $mode Mode to be remapped.
121 public function mapHandler($mode, $handler) argument
123 $this->mode_handlers[$mode] = $handler;
144 list($unmatched, $matched, $mode) = $parsed;
147 if (! $this->dispatchTokens($unmatched, $matched, $mode, $pos, $matchPos)) {
179 * @param bool|string $mode Mode after match. A boolean false mode causes no change.
184 protected function dispatchTokens($unmatched, $matched, $mode, $initialPos, $matchPos) argument
189 if ($this->isModeEnd($mode)) {
195 if ($this->isSpecialMode($mode)) {
196 $this->modeStack->enter($this->decodeSpecial($mode));
202 if (is_string($mode)) {
203 $this->modeStack->enter($mode);
213 * @param string $mode Mode to test.
216 protected function isModeEnd($mode) argument
218 return ($mode === "__exit");
225 * @param string $mode Mode to test.
228 protected function isSpecialMode($mode) argument
230 return (strncmp($mode, "_", 1) == 0);
236 * @param string $mode Mode to decode.
239 protected function decodeSpecial($mode) argument
241 return substr($mode, 1);