Beispiel #1
0
 /**
  * Return the character from the current offset
  * @return string A single character
  */
 public function getCharacter()
 {
     $ord = $this->getOrd();
     $char = new Character($this->getLine(), $this->getColumn());
     $char->setOrd($ord);
     // TODO: Remove this debug
     if (!ctype_print($char->getValue()) || ctype_space($char->getValue())) {
         $buffer = '0x' . str_pad(mb_strtoupper($char->toHex()), 2, '0', STR_PAD_LEFT);
     } else {
         $buffer = $char->getValue();
     }
     $this->debug(__METHOD__, __LINE__, sprintf('Offset(%u:%u) Char(%s)', $this->line, $this->column, $buffer));
     // Increment counters
     $this->offset++;
     $this->column++;
     if ($char->isEOL()) {
         $this->column = 1;
         $this->line++;
     }
     return $char;
 }