php_parser.php
public function acceptStartToken($token, $event)
    {
        if ($event == LEXER_ENTER) {
            $this->tag = strtolower(substr($token, 1));

            return true;
        }
        if ($event == LEXER_EXIT) {
            $success = $this->listener->startElement(
                    $this->tag,
                    $this->attributes);
            $this->tag        = '';
            $this->attributes = array();

            return $success;
        }
        if ($token !== '=') {
            $this->current_attribute                    = strtolower(html_entity_decode($token, ENT_QUOTES));
            $this->attributes[$this->current_attribute] = '';
        }

        return true;
    }
public function acceptStartToken($token, $event)
    {
        if ($event == LEXER_ENTER) {
            $this->tag = strtolower(substr($token, 1));

            return true;
        }
        if ($event == LEXER_EXIT) {
            $success = $this->listener->startElement(
                    $this->tag,
                    $this->attributes);
            $this->tag        = '';
            $this->attributes = array();

            return $success;
        }
        if ($token !== '=') {
            $this->current_attribute                    = strtolower(html_entity_decode($token, ENT_QUOTES));
            $this->attributes[$this->current_attribute] = '';
        }

        return true;
    }
Accepts a token from the tag mode.
If the starting element completes then the element is
dispatched and the current attributes set back to empty.
The element or attribute name is converted to lower case.

@param string $token     Incoming characters.
@param int $event    Lexer event type.

@return bool          False if parse error.