addText($text); } /** * Add text to internal text buffer * * @param string $text The text to add * @return void */ public function addText($text) { $this->_text .= $text; } /** * Parse added text as sql und split into queries * * @return void */ public function parse() { //TODO implement parser return $this->_text; $i=1; $tokens = token_get_all('_text.'?>'); unset($tokens[0]); unset($tokens[count($tokens)]); //unset($tokens[count($tokens)]); //unset($tokens[0]); foreach ($tokens as $token) { if (is_string($token)) { // simple 1-character token echo "
$i. $token"; } else { // token array list($token, $text) = $token; echo "
$i. ". token_name($token)." => " . htmlspecialchars($text); } $i++; } } }