/** * * @param TextReader $reader * * @return TokenMatch|null */ public function read(TextReader $reader) { $matchedText = $reader->readTextMatch($this); if (!is_null($matchedText)) { return new TokenStringMatch($this->tokenType, $matchedText); } return null; }
/** * @return WhitespaceMatch|null */ private function matchWhitespace() { $whitespace = $this->textReader->readTextMatch($this->whitespaceMatcher); if ($whitespace == '') { return null; } $match = new WhitespaceMatch($whitespace); return $match; }