Example #1
0
 /**
  * This method return a tuple representing the token discovered.
  *
  * @access public
  * @param \Unicity\IO\Reader $reader                        the reader to be used
  * @return \Unicity\Lexer\Scanner\Tuple                     a tuple representing the token
  *                                                          discovered
  */
 public function process(IO\Reader $reader)
 {
     $char = $reader->readChar($reader->position(), false);
     if ($char !== null && $char == $this->terminal) {
         $tuple = new Lexer\Scanner\Tuple(Lexer\Scanner\TokenType::terminal(), new Common\String($char));
         $reader->skip(1);
         return $tuple;
     }
     return null;
 }