removed mods directory from the ATutor codebase
[atutor.git] / mods / phpdoc2 / PhpDocumentor / phpDocumentor / XMLpackagePageParser.inc
diff --git a/mods/phpdoc2/PhpDocumentor/phpDocumentor/XMLpackagePageParser.inc b/mods/phpdoc2/PhpDocumentor/phpDocumentor/XMLpackagePageParser.inc
deleted file mode 100644 (file)
index 595d169..0000000
+++ /dev/null
@@ -1,644 +0,0 @@
-<?php\r
-/**\r
- * Parser for XML DocBook-based phpDocumentor tutorials\r
- * \r
- * phpDocumentor :: automatic documentation generator\r
- * \r
- * PHP versions 4 and 5\r
- *\r
- * Copyright (c) 2002-2007 Gregory Beaver\r
- * \r
- * LICENSE:\r
- * \r
- * This library is free software; you can redistribute it\r
- * and/or modify it under the terms of the GNU Lesser General\r
- * Public License as published by the Free Software Foundation;\r
- * either version 2.1 of the License, or (at your option) any\r
- * later version.\r
- * \r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * Lesser General Public License for more details.\r
- * \r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- *\r
- * @category   ToolsAndUtilities\r
- * @package    phpDocumentor\r
- * @subpackage Parsers\r
- * @author     Gregory Beaver <cellog@php.net>\r
- * @copyright  2002-2007 Gregory Beaver\r
- * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version    CVS: $Id: XMLpackagePageParser.inc,v 1.14 2007/11/14 01:31:24 ashnazg Exp $\r
- * @tutorial   tutorials.pkg\r
- * @link       http://www.phpdoc.org\r
- * @link       http://pear.php.net/PhpDocumentor\r
- * @since      1.2\r
- * @todo       CS cleanup - change package to PhpDocumentor\r
- * @todo       CS cleanup - PHPCS needs to ignore CVS Id length\r
- */\r
-/**\r
- * when <programlisting> is found\r
- */\r
-define('PHPDOCUMENTOR_PDP_EVENT_PROGRAMLISTING', 600);\r
-/**\r
- * when <programlisting> is found\r
- */\r
-define('PHPDOCUMENTOR_PDP_STATE_PROGRAMLISTING', 700);\r
-/**\r
- * when a DocBook <tag> is found\r
- */\r
-define('PHPDOCUMENTOR_PDP_EVENT_TAG', 601);\r
-/**\r
- * when a DocBook <tag> is found\r
- */\r
-define('PHPDOCUMENTOR_PDP_STATE_TAG', 701);\r
-/**\r
- * when <![CDATA[ ]]> is found\r
- */\r
-define('PHPDOCUMENTOR_PDP_EVENT_CDATA', 602);\r
-/**\r
- * when <![CDATA[ ]]> is found\r
- */\r
-define('PHPDOCUMENTOR_PDP_STATE_CDATA', 702);\r
-/**\r
- * when tag attributes name="value" are found\r
- */\r
-define('PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES', 603);\r
-/**\r
- * when tag attributes name="value" are found\r
- */\r
-define('PHPDOCUMENTOR_PDP_STATE_ATTRIBUTES', 703);\r
-/**\r
- * when tag attributes name="value" are found\r
- */\r
-define('PHPDOCUMENTOR_PDP_EVENT_ENTITY', 604);\r
-/**\r
- * when tag attributes name="value" are found\r
- */\r
-define('PHPDOCUMENTOR_PDP_STATE_ENTITY', 704);\r
-\r
-/**\r
- * Used to parse XML DocBook-based tutorials\r
- *\r
- * @category   ToolsAndUtilities\r
- * @package    phpDocumentor\r
- * @subpackage Parsers\r
- * @author     Gregory Beaver <cellog@php.net>\r
- * @copyright  2002-2007 Gregory Beaver\r
- * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version    Release: 1.4.1\r
- * @link       http://www.phpdoc.org\r
- * @link       http://pear.php.net/PhpDocumentor\r
- * @since      1.2\r
- * @todo       CS cleanup - change package to PhpDocumentor\r
- */\r
-class XMLPackagePageParser extends Parser\r
-{\r
-    /**\r
-     * @var array\r
-     */\r
-    var $eventHandlers = array(\r
-        PHPDOCUMENTOR_PDP_EVENT_TAG => 'handleTag',\r
-        PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES => 'handleAttributes',\r
-        PHPDOCUMENTOR_PDP_EVENT_CDATA => 'handleCData',\r
-        PARSER_EVENT_NOEVENTS => 'defaultHandler',\r
-        PARSER_EVENT_COMMENTBLOCK => 'ignoreHandler',\r
-        PARSER_EVENT_OUTPHP => 'ignoreHandler',\r
-        PARSER_EVENT_QUOTE => 'handleQuote',\r
-        PHPDOCUMENTOR_PDP_EVENT_ENTITY => 'handleEntity',\r
-    );\r
-    \r
-    /**\r
-     * @var array\r
-     */\r
-    var $pars = array();\r
-    \r
-    var $refsect1id = false;\r
-    var $refsect2id = false;\r
-    var $refsect3id = false;\r
-    /**\r
-     * @var array the tag stack\r
-     */\r
-    var $context;\r
-    /**#@+ @access private */\r
-    var $_gettoc = false;\r
-    var $_toc = array();\r
-    var $_cursection = 0;\r
-    /**#@-*/\r
-    /**\r
-     * Set up the wordparser\r
-     *\r
-     * {@source}\r
-     *\r
-     * @uses ObjectWordParser\r
-     */\r
-    function XMLPackagePageParser()\r
-    {\r
-        $this->wp = new ObjectWordParser(true);\r
-    }\r
-    /**\r
-     * Parse a new file\r
-     *\r
-     * @param string $parse_data the parse data\r
-     * @param array  $tutorial   for format, see {@link Io::getTutorials()}\r
-     *\r
-     * @return bool\r
-     * @staticvar integer used for recursion limiting \r
-     *            if a handler for an event is not found\r
-     * @uses parserTutorial using {@link Publisher::PublishEvent()}, a new tutorial\r
-     *                      is created from the file parsed, and passed to the\r
-     *                      Intermediate Parser\r
-     */\r
-    function parse ($parse_data, $tutorial)\r
-    {\r
-        $tempparse  = new ppageParser;\r
-        $parse_data = $tempparse->\r
-            parse($parse_data, true, $tutorial['package'], \r
-                $tutorial['subpackage'], basename($tutorial['path']), \r
-                $tutorial['category'], $tutorial['path']);\r
-        unset($tempparse);\r
-        static $endrecur = 0;\r
-        if (!is_array($parse_data) || count($parse_data) == 0) {\r
-            return false;\r
-        }\r
-        $this->setupStates();\r
-\r
-        // initialize variables so E_ALL error_reporting doesn't complain\r
-        $pevent                      = 0;\r
-        $word                        = 0;\r
-        $this->p_vars['start']       = true;\r
-        $this->p_vars['event_stack'] = new EventStack;\r
-\r
-        $this->wp->setup($parse_data, false);\r
-        $this->wp->setWhitespace(true);\r
-        $this->context = array();\r
-        if (isset($this->curtag)) {\r
-            unset($this->curtag);\r
-        }\r
-\r
-        do {\r
-            $lpevent = $pevent;\r
-            $pevent  = $this->p_vars['event_stack']->getEvent();\r
-            if ($lpevent != $pevent) {\r
-                $this->p_vars['last_pevent'] = $lpevent;\r
-            }\r
-\r
-            if ($this->p_vars['last_pevent'] != $pevent) {\r
-                // its a new event so the word parser needs to be reconfigured \r
-                $this->configWordParser($pevent);\r
-            }\r
-\r
-\r
-            $this->p_vars['last_word'] = $word;\r
-            $word                      = $this->wp->getWord();\r
-\r
-            if (PHPDOCUMENTOR_DEBUG == true) {\r
-                echo "----------------\n";\r
-                echo "LAST: |" . $this->p_vars['last_word'] . "|\n";\r
-                echo "INDEX: ".$this->p_vars['curpar']."\n";\r
-                echo "PEVENT: " . $this->getParserEventName($pevent) . "\n";\r
-                echo "LASTPEVENT: " . \r
-                    $this->getParserEventName($this->p_vars['last_pevent']) . "\n";\r
-                echo $this->wp->getPos() . " WORD: |$word|\n\n";\r
-                echo '"'.$this->p_vars['quote_data']."\"\n";\r
-            }\r
-            if (isset($this->eventHandlers[$pevent])) {\r
-                $handle = $this->eventHandlers[$pevent];\r
-                if ($word !== false) {\r
-                    $this->$handle($word, $pevent);\r
-                }\r
-            } else {\r
-                debug('WARNING: possible error, ' .\r
-                    'no XMLPackagePageParser handler for event number '. $pevent);\r
-                if ($endrecur++ == 25) {\r
-                    die("FATAL ERROR, recursion limit reached");\r
-                }\r
-            }\r
-            $this->p_vars['start'] = false;\r
-        } while (!($word === false));\r
-        if (count($this->_toc) && isset($this->p_vars['toc'])) {\r
-            $a = $this->curtag->getTOC($this->p_vars['toc']);\r
-            $a->setTOC($this->_toc);\r
-            $a->setPath($tutorial['path']);\r
-            $this->curtag->setTOC($this->p_vars['toc'], $a);\r
-        }\r
-        $this->PublishEvent(PHPDOCUMENTOR_EVENT_TUTORIAL, \r
-            new parserTutorial($this->curtag, $tutorial));\r
-        return $this->curtag;\r
-    }\r
-    \r
-    /**#@+\r
-     * @param string|parserInlineTag $word  token\r
-     * @param integer                $token parser event\r
-     * @return void\r
-     * @access private\r
-     * @todo CS cleanup - PHPCS needs to recognize docblock template tags\r
-     */\r
-    /**\r
-     * handler for default events\r
-     */\r
-    function defaultHandler($word, $pevent)\r
-    {\r
-        if (is_string($word) && $this->checkEventPush($word, $pevent)) {\r
-            return;\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for ignore events\r
-     */\r
-    function ignoreHandler($word, $pevent)\r
-    {\r
-        $this->checkEventPop($word, $pevent);\r
-    }\r
-    \r
-    /**\r
-     * handler for QUOTE\r
-     *\r
-     * this handler recognizes strings defined with \r
-     * double quotation marks (") and handles them correctly\r
-     * in any place that they legally appear in php code\r
-     */\r
-    function handleQuote($word, $pevent)\r
-    {\r
-        if ($this->p_flags['reset_quote_data'] === true) {\r
-            $this->p_flags['reset_quote_data'] = false;\r
-            $this->p_vars['quote_data']        = "";\r
-        }\r
-        if (!is_object($word)) {\r
-            $this->checkEventPush($word, $pevent);\r
-        }\r
-        if (is_object($word)) {\r
-            $this->p_vars['quote_data'] = $word;\r
-        } else {\r
-            if ($word != "\"") {\r
-                if (!is_object($this->p_vars['quote_data'])) {\r
-                    $this->p_vars['quote_data'] .= $word;\r
-                }\r
-            }\r
-            if ($word == '>') {\r
-                if (is_object($this->p_vars['quote_data'])) {\r
-                    $this->p_vars['quote_data'] = \r
-                        '{@id '.$this->p_vars['quote_data']->id.'}';\r
-                }\r
-                addErrorDie(PDERROR_UNTERMINATED_ATTRIB, $this->curtag->name, \r
-                    $this->p_vars['attrname'], $this->p_vars['quote_data']);\r
-            }\r
-            if ($this->checkEventPop($word, $pevent)) {\r
-                $this->p_flags['reset_quote_data'] = true;\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Handles all XML DocBook tags\r
-     *\r
-     * @todo replace commented-out debug lines with debug() func\r
-     */\r
-    function handleTag($word, $pevent)\r
-    {\r
-        if (isset($this->curtag) && $this->curtag->hasTitle() && \r
-            $this->_gettoc && $this->_gettoc->name == $this->curtag->name\r
-        ) {\r
-            if (isset($this->_toc[$this->_cursection])) {\r
-                $this->_toc[$this->_cursection]['title'] = $this->curtag->_title;\r
-                $this->_cursection++;\r
-            }\r
-            $this->_gettoc = false;\r
-        }\r
-        if ($this->p_vars['last_word'] == '<') {\r
-            // get tag name\r
-            $this->p_flags['begin_tag'] = true;\r
-            array_push($this->context, $word);\r
-            //DEBUG if (isset($this->curtag)) debug("pushed " . $this->curtag->name);\r
-            if (isset($this->curtag)) {\r
-                array_push($this->pars, $this->curtag);\r
-            }\r
-            $this->curtag = new parserXMLDocBookTag($word);\r
-        } elseif ($this->p_vars['last_word'] == '</' || $word == '/>') {\r
-            $tag = array_pop($this->context);\r
-            if ($word == '/>') {\r
-                // all is OK\r
-                $this->checkEventPop($word, $pevent);\r
-                $word = $tag;\r
-            }\r
-            if ($tag != $word) {\r
-                addErrorDie(PDERROR_UNMATCHED_TUTORIAL_TAG, \r
-                    $tag, $word, $this->curtag->getString());\r
-            }\r
-            if (in_array($this->curtag->name, \r
-                array('refentry', 'refsect1', 'refsect2', 'refsect3'))\r
-            ) {\r
-                if (!isset($this->curtag->_id)) {\r
-                    $title = '';\r
-                    if (isset($this->curtag->_title)) {\r
-                        $title = $this->curtag->_title->getString();\r
-                    }\r
-                    addWarning(PDERROR_NO_DOCBOOK_ID, $this->curtag->name, $title);\r
-                }\r
-            }\r
-            $this->p_flags['begin_tag'] = false;\r
-            $curtag                     = @array_pop($this->pars);\r
-            //DEBUG debug("popped $tag ".$curtag->name.' I am '.$this->curtag->name);\r
-            if ($curtag) {\r
-                if ($this->curtag->name == 'refsect1') $this->refsect1id = false;\r
-                if ($this->curtag->name == 'refsect2') $this->refsect2id = false;\r
-                if ($this->curtag->name == 'refsect3') $this->refsect3id = false;\r
-                $curtag->add($this->curtag);\r
-                //DEBUG debug("added " . $this->curtag->name . \r
-                //DEBUG     " to " . $curtag->name . ' ' . $curtag->id);\r
-                $this->curtag = $curtag;\r
-            } else {\r
-                //DEBUG debug("here");\r
-            }\r
-        } elseif (is_string($word)) {\r
-            if (!($e = $this->checkEventPush($word, $pevent))) {\r
-                if ($this->checkEventPop($word, $pevent)) {\r
-                    if ($this->p_flags['begin_tag']) {\r
-                        $this->p_vars['event_stack']->\r
-                            pushEvent(PHPDOCUMENTOR_PDP_EVENT_TAG);\r
-                        $this->p_vars['event_stack']->\r
-                            pushEvent(PHPDOCUMENTOR_PDP_EVENT_CDATA);\r
-                        $this->p_vars['last_tag'] = array_pop($this->context);\r
-                        array_push($this->context, $this->p_vars['last_tag']);\r
-                        $this->p_flags['in_cdata'] = false;\r
-                    }\r
-                    return;\r
-                }\r
-            } else {\r
-                $this->p_flags['start_attr'] = true;\r
-                $this->p_flags['end_attr']   = false;\r
-            }\r
-        } else {\r
-            addErrorDie(PDERROR_CANT_HAVE_INLINE_IN_TAGNAME);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Handle CData sections\r
-     */\r
-    function handleCData($word, $pevent)\r
-    {\r
-        if ($this->curtag->name == 'refentry' && \r
-            phpDocumentor_get_class($word) == 'parsertocinlinetag'\r
-        ) {\r
-            $this->p_vars['toc'] = $this->curtag->getTOC();\r
-        }\r
-        if (is_string($word) && !$this->p_flags['in_cdata']) {\r
-            if ($this->checkEventPop($word, $pevent)) {\r
-                return;\r
-            }\r
-            if ($this->checkEventPush($word, $pevent)) {\r
-                return;\r
-            }\r
-        }\r
-        if (is_string($word) && $word == '<![CDATA[') {\r
-            $this->curtag->startCData();\r
-            $this->p_flags['in_cdata'] = true;\r
-        } elseif ($this->p_flags['in_cdata'] && \r
-            is_string($word) && $word == ']]>'\r
-        ) {\r
-            $this->curtag->endCData();\r
-            $this->p_flags['in_cdata'] = false;\r
-        } else {\r
-            if ($this->p_flags['in_cdata']) {\r
-                $this->curtag->addCData($word);\r
-            } else {\r
-                $this->curtag->add($word);\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Handle Entities like &rdquo;\r
-     */\r
-    function handleEntity($word, $pevent)\r
-    {\r
-        if (!$word) {\r
-            if (!isset($this->p_vars['entity_name'])) {\r
-                $this->p_vars['entity_name'] = '';\r
-            }\r
-            addErrorDie(PDERROR_UNTERMINATED_ENTITY, $this->p_vars['entity_name']);\r
-        }\r
-        $e = $this->checkEventPop($word, $pevent);\r
-        if ($word && !$e) { \r
-            $this->p_vars['entity_name'] = $word;\r
-        }\r
-        if ($e) {\r
-            $entity = new parserEntity($this->p_vars['entity_name']);\r
-            unset($this->p_vars['entity_name']);\r
-            $this->curtag->add($entity);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Handle Tag attributes name="value"\r
-     *\r
-     * @todo replace commented-out debug lines with debug() func\r
-     */\r
-    function handleAttributes($word, $pevent)\r
-    {\r
-        if ($this->checkEventPush($word, $pevent)) {\r
-            return;\r
-        }\r
-        if ($word == '=') {\r
-            $this->p_flags['start_attr'] = false;\r
-            $this->p_vars['end_attr']    = true;\r
-        } else {\r
-            if ($this->p_flags['start_attr']) {\r
-                $this->p_vars['attrname'] = $word;\r
-            } else {\r
-                if (isset($this->p_vars['attrname'])) {\r
-                    $value = $this->p_vars['quote_data'];\r
-                    if (phpDocumentor_get_class($value) == 'parseridinlinetag') { \r
-                        // "inherit" the parent section's id, so\r
-\r
-                        // <!-- id is 'test' -->\r
-                        // <refsect1 id="{@id test"}> \r
-                        // ...\r
-                        //  <!-- id is 'test.me' -->\r
-                        //  <refsect2 id="{@id me}"> \r
-                        //  ...\r
-                        //   <!-- id is 'test.me.out' -->\r
-                        //   <refsect3 id="{@id out}"> \r
-                        //   ...\r
-                        //    <!-- id is 'test.me.out.withexample' -->\r
-                        //    <example id="{@id withexample}"> \r
-\r
-                        $a  = ($this->refsect1id ? $this->refsect1id . '.' : '');\r
-                        $a .= ($this->refsect2id ? $this->refsect2id . '.' : '');\r
-                        $a .= ($this->refsect3id ? $this->refsect3id . '.' : '');\r
-                        if ($this->curtag->name == 'refsect1') {\r
-                            $this->refsect1id = $value->id;\r
-                        }\r
-                        if ($this->curtag->name == 'refsect2') {\r
-                            $this->refsect2id = $value->id;\r
-                        }\r
-                        if ($this->curtag->name == 'refsect3') {\r
-                            $this->refsect3id = $value->id;\r
-                        }\r
-                        //DEBUG debug($value->id . ' is now ' . $a . $value->id);\r
-                        $value->id = $a . $value->id;\r
-                        if ($value->id != '') {\r
-                            if (isset($this->_toc[$this->_cursection])) {\r
-                                $this->_cursection++;\r
-                            }\r
-                            $this->_toc[$this->_cursection]['id']  = $value;\r
-                            $this->_toc[$this->_cursection]['tag'] = \r
-                                new parserXMLDocBookTag($this->curtag->name);\r
-                            //DEBUG debug("set gettoc to " . $this->curtag->name . \r
-                            //DEBUG     ' ' . $value->id);\r
-                            $this->_gettoc = $this->curtag;\r
-                        }\r
-                    }\r
-                    $this->curtag->addAttribute($this->p_vars['attrname'], $value);\r
-                    unset($this->p_vars['attrname']);\r
-                    if (is_string($word) && $this->checkEventPop($word, $pevent)) {\r
-                        $this->p_flags['start_attr'] = true;\r
-                        $this->p_flags['end_attr']   = false;\r
-                        $this->wp->setPos($this->wp->getPos() - strlen($word));\r
-                    } else {\r
-                        $this->wp->setPos($this->wp->getPos() - strlen($word));\r
-                    }\r
-                    return;\r
-                }\r
-            }\r
-        }\r
-        if (is_string($word) && $this->checkEventPop($word, $pevent)) {\r
-            $this->p_flags['start_attr'] = true;\r
-            $this->p_flags['end_attr']   = false;\r
-            $this->wp->setPos($this->wp->getPos() - strlen($word));\r
-        }\r
-    }\r
-    /**#@-*/\r
-    \r
-    /**\r
-     * setup the parser tokens, and the pushEvent/popEvent arrays\r
-     *\r
-     * @return void\r
-     * @see $tokens, $pushEvent, $popEvent\r
-     */\r
-    function setupStates()\r
-    {\r
-        $this->_gettoc     = false;\r
-        $this->_toc        = array();\r
-        $this->_cursection = 0;\r
-        if (isset($this->p_vars['toc'])) {\r
-            unset($this->p_vars['toc']);\r
-        }\r
-        \r
-        $this->tokens[STATE_NOEVENTS]\r
-            = array('</','<!--','<!','<?','<');\r
-        $this->tokens[STATE_COMMENTBLOCK]\r
-            = array('-->');\r
-        $this->tokens[STATE_OUTPHP]\r
-            = array('?>','>');\r
-        $this->tokens[STATE_QUOTE]\r
-            = array("\\\"","\\\\","\"",'>');\r
-        $this->tokens[STATE_ESCAPE]\r
-            = false;// this tells the word parser to just cycle\r
-        $this->tokens[PHPDOCUMENTOR_PDP_STATE_TAG]\r
-            = array('>',' ','/>');\r
-        $this->tokens[PHPDOCUMENTOR_PDP_STATE_CDATA]\r
-            = array('&','<!--','</','<![CDATA[','<',']]>');\r
-        $this->tokens[PHPDOCUMENTOR_PDP_STATE_ATTRIBUTES]\r
-            = array('=','>','/>','"');\r
-        $this->tokens[PHPDOCUMENTOR_PDP_STATE_ENTITY]\r
-            = array(';');\r
-\r
-        // For each event word to event mapings\r
-        $this->pushEvent[PARSER_EVENT_NOEVENTS] = \r
-            array(\r
-                '<!--' => PARSER_EVENT_COMMENTBLOCK,\r
-                '<!' => PARSER_EVENT_OUTPHP,\r
-                "</" => PHPDOCUMENTOR_PDP_EVENT_TAG,\r
-                '<?' => PARSER_EVENT_OUTPHP,\r
-                "<" => PHPDOCUMENTOR_PDP_EVENT_TAG,\r
-                '&' => PHPDOCUMENTOR_PDP_EVENT_ENTITY,\r
-            );\r
-        //##########################\r
-\r
-        $this->pushEvent[PHPDOCUMENTOR_PDP_EVENT_TAG] =\r
-            array(\r
-                ' ' => PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES,\r
-            );\r
-         \r
-        $this->popEvent[PHPDOCUMENTOR_PDP_EVENT_TAG] = array(">","/>");\r
-        //##########################\r
-        $this->pushEvent[PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES] =\r
-            array(\r
-                '"' => PARSER_EVENT_QUOTE,\r
-            );\r
-\r
-        $this->popEvent[PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES] = array(">","/>");\r
-        //##########################\r
-\r
-        $this->popEvent[PARSER_EVENT_COMMENTBLOCK] = array("-->");\r
-        //##########################\r
-        $this->pushEvent[PARSER_EVENT_QUOTE] = \r
-            array(\r
-                "\\"    => PARSER_EVENT_ESCAPE\r
-            );\r
-        $this->popEvent[PARSER_EVENT_QUOTE]  = array("\"");\r
-        //##########################\r
-\r
-        $this->popEvent[PARSER_EVENT_OUTPHP] = array("?>",">");\r
-        //##########################\r
-\r
-        $this->popEvent[PHPDOCUMENTOR_PDP_EVENT_ENTITY] = array(";");\r
-        //##########################\r
-\r
-        $this->pushEvent[PHPDOCUMENTOR_PDP_EVENT_CDATA] =\r
-            array(\r
-                "<" => PHPDOCUMENTOR_PDP_EVENT_TAG,\r
-                '<!--' => PARSER_EVENT_COMMENTBLOCK,\r
-                '<?' => PARSER_EVENT_OUTPHP,\r
-                '&' => PHPDOCUMENTOR_PDP_EVENT_ENTITY,\r
-            );\r
-        $this->popEvent[PHPDOCUMENTOR_PDP_EVENT_CDATA]  = array("</");\r
-    }\r
-    \r
-    /**\r
-     * debugging function\r
-     *\r
-     * {@source}\r
-     *\r
-     * @param mixed $value a value\r
-     *\r
-     * @return mixed the looked up value if found,\r
-     *               else the original value\r
-     * @static\r
-     */\r
-    function getParserEventName ($value)\r
-    {    \r
-        $lookup = array(\r
-            PARSER_EVENT_NOEVENTS\r
-                => "PARSER_EVENT_NOEVENTS",\r
-            PHPDOCUMENTOR_PDP_EVENT_TAG\r
-                => "PHPDOCUMENTOR_PDP_EVENT_TAG",\r
-            PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES\r
-                => "PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES",\r
-            PHPDOCUMENTOR_PDP_EVENT_CDATA\r
-                => "PHPDOCUMENTOR_PDP_EVENT_CDATA",\r
-            PHPDOCUMENTOR_PDP_EVENT_LIST\r
-                => "PHPDOCUMENTOR_PDP_EVENT_LIST",\r
-            PARSER_EVENT_QUOTE\r
-                => "PARSER_EVENT_QUOTE",\r
-            PHPDOCUMENTOR_PDP_EVENT_ENTITY\r
-                => "PHPDOCUMENTOR_PDP_EVENT_ENTITY",\r
-            PHPDOCUMENTOR_PDP_EVENT_COMMENT\r
-                => "PHPDOCUMENTOR_PDP_EVENT_COMMENT",\r
-            PHPDOCUMENTOR_PDP_EVENT_PI\r
-                => "PHPDOCUMENTOR_PDP_EVENT_PI",\r
-        );\r
-        if (isset($lookup[$value])) {\r
-            return $lookup[$value];\r
-        } else {\r
-            return $value;\r
-        }\r
-    }\r
-}\r
-?>\r