/** * * @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; }
/** * @param TokenMatch $lastMatch * * @return bool */ private function advanceReader(TokenMatch $lastMatch) { //advance the reader $advanceBytes = $lastMatch->getByteLength(); $this->textReader->skip($advanceBytes); return true; }