removed mods directory from the ATutor codebase
[atutor.git] / mods / phpdoc2 / PhpDocumentor / phpDocumentor / phpDocumentorTParser.inc
diff --git a/mods/phpdoc2/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc b/mods/phpdoc2/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc
deleted file mode 100644 (file)
index 6ad94b5..0000000
+++ /dev/null
@@ -1,2946 +0,0 @@
-<?php\r
-/**\r
- * tokenizer extension-based parser for PHP code\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: phpDocumentorTParser.inc,v 1.29 2007/12/14 16:25:00 ashnazg Exp $\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
-\r
-/**\r
- * Tokenizer-based parser for PHP source code\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
- * @todo       CS cleanup - change package to PhpDocumentor\r
- * @todo       CS cleanup - change classname to PhpDocumentor_*\r
- */\r
-class phpDocumentorTParser extends Parser\r
-{\r
-    /**#@+\r
-     * @access private\r
-     */\r
-    /**\r
-     * @var EventStack\r
-     */\r
-    var $_event_stack;\r
-    /**\r
-     * last event triggered before the current event\r
-     * @var integer\r
-     */\r
-    var $_last_pevent;\r
-    /**\r
-     * last word parsed\r
-     * @var integer\r
-     */\r
-    var $_last_word;\r
-    /**\r
-     * full path of the currently parsed file\r
-     * @var string\r
-     */\r
-    var $_path;\r
-    /**#@-*/\r
-\r
-    /**#@+\r
-     * Parser Variables\r
-     * @access private\r
-     */\r
-    var $_pv_class;\r
-    var $_pv_cur_class;\r
-    var $_pv_define;\r
-    var $_pv_define_name;\r
-    var $_pv_define_value;\r
-    var $_pv_define_params_data;\r
-    var $_pv_dtype;\r
-    var $_pv_docblock;\r
-    var $_pv_dtemplate;\r
-    var $_pv_func;\r
-    var $_pv_func_param;\r
-    var $_pv_findglobal;\r
-    var $_pv_global_name;\r
-    var $_pv_global_val;\r
-    var $_pv_globals;\r
-    var $_pv_global_count;\r
-    var $_pv_include_params_data;\r
-    var $_pv_include_name;\r
-    var $_pv_include_value;\r
-    var $_pv_linenum;\r
-    var $_pv_periodline;\r
-    var $_pv_paren_count = 0;\r
-    var $_pv_statics;\r
-    var $_pv_static_count;\r
-    var $_pv_static_val;\r
-    var $_pv_quote_data;\r
-    var $_pv_function_data;\r
-    var $_pv_var;\r
-    var $_pv_varname;\r
-    var $_pv_var_value;\r
-    /**#@-*/\r
-\r
-    /**#@+\r
-     * Parser Flags\r
-     * @access private\r
-     */\r
-    var $_pf_definename_isset = false;\r
-    var $_pf_includename_isset = false;\r
-    var $_pf_get_source = false;\r
-    var $_pf_getting_source = false;\r
-    var $_pf_internal = false;\r
-    var $_pf_in_class = false;\r
-    var $_pf_in_define = false;\r
-    var $_pf_in_global = false;\r
-    var $_pf_in_include = false;\r
-    var $_pf_in_include_value = false;\r
-    var $_pf_in_var = false;\r
-    var $_pf_interface = false;\r
-    var $_pf_funcparam_val = false;\r
-    var $_pf_quote_active = false;\r
-    var $_pf_reset_quote_data = true;\r
-    var $_pf_useperiod = false;\r
-    var $_pf_set_var_value = false;\r
-    var $_pf_var_equals = false;\r
-    /**#@-*/\r
-\r
-    /**\r
-     * relative path of the parsed file from the base parse directory\r
-     * @var string\r
-     */\r
-    var $source_location;\r
-    var $eventHandlers = array(\r
-        PARSER_EVENT_ARRAY                      => 'handleArray',\r
-        PARSER_EVENT_VAR_ARRAY                  => 'handleArray',\r
-        PARSER_EVENT_VAR_ARRAY_COMMENT          => 'handleVarArrayComment',\r
-        PARSER_EVENT_CLASS                      => 'handleClass',\r
-        PARSER_EVENT_COMMENT                    => 'handleComment',\r
-        PARSER_EVENT_DOCBLOCK_TEMPLATE          => 'handleDocBlockTemplate',\r
-        PARSER_EVENT_END_DOCBLOCK_TEMPLATE      => 'handleEndDocBlockTemplate',\r
-        PARSER_EVENT_LOGICBLOCK                 => 'handleLogicBlock',\r
-        PARSER_EVENT_NOEVENTS                   => 'defaultHandler',\r
-        PARSER_EVENT_OUTPHP                     => 'defaultHandler',\r
-        PARSER_EVENT_DEFINE                     => 'handleDefine',\r
-        PARSER_EVENT_DEFINE_PARAMS              => 'handleDefineParams',\r
-        PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS  => 'handleDefineParamsParenthesis',\r
-        PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS => 'handleIncludeParamsParenthesis',\r
-        PARSER_EVENT_DOCBLOCK                   => 'handleDocBlock',\r
-        PARSER_EVENT_TAGS                       => 'handleTags',\r
-        PARSER_EVENT_DESC                       => 'handleDesc',\r
-        PARSER_EVENT_DOCKEYWORD                 => 'handleTag',\r
-        PARSER_EVENT_DOCKEYWORD_EMAIL           => 'handleDockeywordEmail',\r
-        PARSER_EVENT_EOFQUOTE                   => 'handleHereDoc',\r
-        PARSER_EVENT_FUNCTION                   => 'handleFunction',\r
-        PARSER_EVENT_FUNCTION_PARAMS            => 'handleFunctionParams',\r
-        PARSER_EVENT_FUNCTION_PARAM_VAR         => 'handleFunctionParams',\r
-        PARSER_EVENT_FUNC_GLOBAL                => 'handleFuncGlobal',\r
-        PARSER_EVENT_DEFINE_GLOBAL              => 'handleGlobal',\r
-        PARSER_EVENT_GLOBAL_VALUE               => 'handleGlobalValue',\r
-        PARSER_EVENT_INLINE_DOCKEYWORD          => 'handleInlineDockeyword',\r
-        PARSER_EVENT_INCLUDE                    => 'handleInclude',\r
-        PARSER_EVENT_INCLUDE_PARAMS             => 'handleIncludeParams',\r
-        PARSER_EVENT_QUOTE                      => 'handleQuote',\r
-        PARSER_EVENT_PHPCODE                    => 'handlePhpCode',\r
-        PARSER_EVENT_SINGLEQUOTE                => 'handleSingleQuote',\r
-        PARSER_EVENT_STATIC_VAR                 => 'handleStaticVar',\r
-        PARSER_EVENT_STATIC_VAR_VALUE           => 'handleStaticValue',\r
-        PARSER_EVENT_VAR                        => 'handleVar',\r
-        PARSER_EVENT_ACCESS_MODIFIER            => 'handleAccessModifier',\r
-        PARSER_EVENT_IMPLEMENTS                 => 'handleImplements',\r
-        PARSER_EVENT_CLASS_CONSTANT             => 'handleClassConstant',\r
-    );\r
-    \r
-    var $inlineTagHandlers = array(\r
-        '*'    => 'handleDefaultInlineTag',\r
-        'link' => 'handleLinkInlineTag',\r
-    );\r
-    \r
-    /**\r
-     * Constructor\r
-     *\r
-     */\r
-    function phpDocumentorTParser()\r
-    {\r
-        $this->allowableTags\r
-            = $GLOBALS['_phpDocumentor_tags_allowed'];\r
-        $this->allowableInlineTags\r
-            = $GLOBALS['_phpDocumentor_inline_doc_tags_allowed'];\r
-        $this->subscribe(PHPDOCUMENTOR_EVENT_NEWLINENUM,\r
-            $GLOBALS['phpDocumentor_errors']);\r
-        $this->subscribe(PHPDOCUMENTOR_EVENT_NEWFILE,\r
-            $GLOBALS['phpDocumentor_errors']);\r
-        $this->tagHandlers['author']     = 'authorTagHandler';\r
-        $this->tagHandlers['filesource'] = 'filesourceTagHandler';\r
-        $this->setupEventStates();\r
-    }\r
-    \r
-    /**\r
-     * Parse a new file\r
-     *\r
-     * @param string &$parse_data the parse data\r
-     * @param string $path        the path\r
-     * @param int    $base        number of directories to drop off the bottom \r
-     *                            when creating names using path\r
-     * @param bool   $packages    ???\r
-     *\r
-     * @staticvar int used for recursion limiting \r
-     *                if a handler for an event is not found\r
-     * @return bool\r
-     */\r
-    function parse (&$parse_data, $path, $base = 0, $packages = false)\r
-    {\r
-        global $_phpDocumentor_options;\r
-        static $endrecur = 0;\r
-\r
-        $this->setupStates();\r
-        if (strlen($parse_data) == 0) {\r
-            return false;\r
-        }\r
-\r
-        $this->configWordParser($parse_data);\r
-        // initialize variables so E_ALL error_reporting doesn't complain\r
-        $pevent = 0;\r
-        $word   = 0;\r
-\r
-        $page = new ParserPage;\r
-        $page->setSource($this->_wp->getFileSource());\r
-        $page->setPath($path);\r
-        $this->_path = $path;\r
-        $page->setPackageOutput($packages);\r
-        $page->setFile(basename($path));\r
-        $this->publishEvent(PHPDOCUMENTOR_EVENT_NEWFILE, basename($path));\r
-        //$name = str_replace("/","_",dirname($path)) . "_" \r
-        //    . array_shift(explode(".",$page->getFile()));\r
-        // fc@fc.clever-soft.com 11/29/2001\r
-        $name = str_replace(':', '', dirname($path)\r
-            . PATH_DELIMITER . $page->getFile());\r
-        $tmp  = explode(PATH_DELIMITER, $name);\r
-        $name = implode("---", array_slice($tmp, $base));\r
-        // if base is '', drive letter is present in windows\r
-\r
-        $page->setName($name);\r
-        $temploc = $_phpDocumentor_options['Program_Root'] \r
-            . PATH_DELIMITER . implode(PATH_DELIMITER,\r
-            array_slice(explode(PATH_DELIMITER, $path), $base));\r
-        \r
-        if ($temploc == $_phpDocumentor_options['Program_Root'] . PATH_DELIMITER) {\r
-            $temploc .= $path;\r
-        }\r
-        \r
-        $this->source_location = $source_location = $temploc;\r
-        $page->setSourceLocation($source_location);\r
-\r
-        $this->publishEvent(PHPDOCUMENTOR_EVENT_PAGE, $page);\r
-        unset($page);\r
-        do {\r
-            $lpevent = $pevent;\r
-            $pevent  = $this->_event_stack->getEvent();\r
-            if ($lpevent != $pevent) {\r
-                $this->_last_pevent = $lpevent;\r
-            }\r
-\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_NEWSTATE, ($pevent + 100));\r
-\r
-            $this->_pv_last_word = $word;\r
-\r
-            $word = $this->_wp->getWord();\r
-            if (isset($this->_pv_findglobal) && $word == $this->_pv_findglobal) {\r
-                $this->_last_pevent = $pevent;\r
-\r
-                $this->_event_stack->pushEvent($pevent = PARSER_EVENT_DEFINE_GLOBAL);\r
-            }\r
-            // in wordparser, have to keep track of lines\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_NEWLINENUM, $this->_wp->linenum);\r
-            if ($this->_pf_get_source) {\r
-                if ($word[0] == T_FUNCTION) {\r
-                    $this->_wp->retrievesource($word);\r
-                    $this->_pf_get_source     = false;\r
-                    $this->_pf_getting_source = true;\r
-                }\r
-            }\r
-\r
-            if (PHPDOCUMENTOR_DEBUG == true) {\r
-                echo "LAST: ";\r
-                if (is_array($this->_pv_last_word)) {\r
-                    echo token_name($this->_pv_last_word[0]) . ' => |' \r
-                        . htmlspecialchars($this->_pv_last_word[1]);\r
-                } else {\r
-                    echo "|" . $this->_pv_last_word;\r
-                }\r
-                echo "|\n";\r
-                echo "PEVENT: " . $this->getParserEventName($pevent) . "\n";\r
-                echo "LASTPEVENT: "\r
-                    . $this->getParserEventName($this->_last_pevent) . "\n";\r
-                echo $this->_wp->getPos() . ": ";\r
-                if (is_array($word)) {\r
-                    echo token_name($word[0]) . ' => |'\r
-                        . htmlspecialchars($word[1]);\r
-                } else {\r
-                    echo '|' . htmlspecialchars($word);\r
-                }\r
-                echo "|\n-------------------\n\n\n";\r
-            }\r
-\r
-            // $this->_pf_getting_source && \r
-            // ($pevent == PARSER_EVENT_DOCBLOCK) || \r
-            // ($pevent == PARSER_EVENT_NOEVENTS))\r
-            if (0) {\r
-                addError(PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND);\r
-                // throw away source\r
-                $this->_wp->getSource();\r
-            }\r
-            if (isset($this->eventHandlers[$pevent])) {\r
-                $handle = $this->eventHandlers[$pevent];\r
-                $this->$handle($word, $pevent);\r
-            } else {\r
-                debug('WARNING: possible error, no handler for event number '\r
-                    . $pevent);\r
-                if ($endrecur++ == 25) {\r
-                    die("FATAL ERROR, recursion limit reached");\r
-                }\r
-            }\r
-        } while (!($word === false));\r
-        $this->publishEvent(PHPDOCUMENTOR_EVENT_NEWSTATE,\r
-            PHPDOCUMENTOR_EVENT_END_PAGE);\r
-    }\r
-\r
-    /**#@+\r
-     * @param string $word   the string word\r
-     * @param int    $pevent the token constant\r
-     * @access private\r
-     * @return void\r
-     */\r
-\r
-    /**\r
-     * handler for COMMENT\r
-     */\r
-    function handleComment($word, $pevent)\r
-    {\r
-        $this->_wp->backupPos();\r
-        $this->_event_stack->popEvent();\r
-    }\r
-\r
-    /**\r
-     * handler for PHPCODE.\r
-     *\r
-     * this handler recognizes the <code><?</code> php processor directive,\r
-     * and begins parsing php code\r
-     */\r
-    function handlePhpCode($word, $pevent)\r
-    {\r
-        $e = $this->checkEventPush($word, $pevent);\r
-        if (isset($this->_pv_findglobal) && $e) {\r
-            if ($e != PARSER_EVENT_DEFINE_GLOBAL\r
-                && $e != PARSER_EVENT_ARRAY\r
-                && $e != PARSER_EVENT_QUOTE\r
-                && $e != PARSER_EVENT_SINGLEQUOTE\r
-                && $e != PARSER_EVENT_COMMENT\r
-                && $e != PARSER_EVENT_COMMENTBLOCK\r
-            ) {\r
-                addError(PDERROR_GLOBAL_NOT_FOUND, $this->_pv_findglobal);\r
-                $this->_wp->findGlobal(false);\r
-                unset($this->_pv_findglobal);\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for FUNC_GLOBAL.\r
-     *\r
-     * this handler recognizes "global $var1, $var2" declarations in a function,\r
-     * and parses them\r
-     */\r
-    function handleFuncGlobal($word, $pevent)\r
-    {\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            return;\r
-        }\r
-        if (!$this->checkEventPush($word, $pevent)) {\r
-            if ($word == ',') {\r
-                // another variable\r
-                $this->_pv_global_count++;\r
-            } else {\r
-                if (!isset($this->_pv_globals[$this->_pv_global_count])) {\r
-                    $this->_pv_globals[$this->_pv_global_count] = '';\r
-                }\r
-\r
-                // if (!empty($this->_pv_globals[$this->_pv_global_count])) {\r
-                //     $this->_pv_global_count++;\r
-                // }\r
-\r
-                if (is_array($word)) {\r
-                    $word = $word[1];\r
-                }\r
-                $this->_pv_globals[$this->_pv_global_count] .= $word;\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * handler for DEFINE_GLOBAL\r
-     */\r
-    function handleGlobal($word, $pevent)\r
-    {\r
-        if (isset($this->_pv_findglobal)) {\r
-            $this->_pv_global_name = $this->_pv_findglobal;\r
-            unset($this->_pv_findglobal);\r
-        }\r
-        if (!$this->_pf_in_global) {\r
-            $this->_pv_linenum = $this->_wp->linenum + 1;\r
-        }\r
-        $this->_pf_in_global = true;\r
-        if ($this->checkEventPush($word, $pevent)) {\r
-            $this->_wp->setWhitespace(true);\r
-        }\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pf_in_global = false;\r
-            $a                   = new parserGlobal;\r
-            $a->setDataType($this->_pv_global_type);\r
-            $this->_pv_global_type = '';\r
-            $a->setLineNumber($this->_pv_linenum);\r
-            $a->setName($this->_pv_global_name);\r
-            if (isset($this->_pv_global_val)) {\r
-                $a->setValue(trim($this->_pv_global_val));\r
-            }\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_GLOBAL, $a);\r
-            unset($this->_pv_global_val);\r
-            unset($this->_pv_global_type);\r
-        }\r
-    }\r
-\r
-    /**\r
-     * handler for GLOBAL_VALUE\r
-     */\r
-    function handleGlobalValue($word, $pevent)\r
-    {\r
-        if ($this->checkEventPush($word, $pevent)) {\r
-            return;\r
-        }\r
-        $this->_wp->setWhitespace(true);\r
-        if (!isset($this->_pv_global_val)) {\r
-            $this->_pv_global_val = '';\r
-        }\r
-        if ($this->_last_pevent == PARSER_EVENT_ARRAY) {\r
-            $this->_pv_global_val   .= $this->_pv_function_data;\r
-            $this->_pv_function_data = '';\r
-        }\r
-        if ($this->_last_pevent == PARSER_EVENT_QUOTE ||\r
-            $this->_last_pevent == PARSER_EVENT_EOFQUOTE\r
-        ) {\r
-            $this->_pv_global_val .= $this->_pv_quote_data;\r
-            unset($this->_pv_quote_data);\r
-        }\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_wp->setWhitespace(false);\r
-            $this->_wp->backupPos();\r
-            return;\r
-        }\r
-        if (is_array($word)) {\r
-            $word = $word[1];\r
-        }\r
-        $this->_pv_global_val .= $word;\r
-    }\r
-    \r
-    /**\r
-     * handler for STATIC_VAR.\r
-     *\r
-     * this handler recognizes "static $var1, \r
-     * $var2 = 6" declarations in a function, \r
-     * and parses them\r
-     */\r
-    function handleStaticVar($word, $pevent)\r
-    {\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pv_static_count++;\r
-            return;\r
-        }\r
-        if (!$this->checkEventPush($word, $pevent)) {\r
-            if ($word == ',') {\r
-                $this->_pv_static_count++;\r
-                return;\r
-            }\r
-            if (!isset($this->_pv_statics[$this->_pv_static_count])) {\r
-                $this->_pv_statics[$this->_pv_static_count] = '';\r
-            }\r
-            if (!empty($this->_pv_statics[$this->_pv_static_count])) {\r
-                $this->_pv_static_count++;\r
-            }\r
-            if (is_array($word)) {\r
-                $word = $word[1];\r
-            }\r
-            $this->_pv_statics[$this->_pv_static_count] = $word;\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for STATIC_VAR_VALUE.\r
-     *\r
-     * this handler parses the 6 in "static $var1, $var2 = 6"\r
-     */\r
-    function handleStaticValue($word, $pevent)\r
-    {\r
-        if ($this->checkEventPush($word, $pevent)) {\r
-            return;\r
-        }\r
-        if (!isset($this->_pv_static_val[$this->_pv_static_count])) {\r
-            $this->_pv_static_val[$this->_pv_static_count] = '';\r
-        }\r
-        if ($this->_last_pevent == PARSER_EVENT_QUOTE) {\r
-            $this->_pv_static_val[$this->_pv_static_count]\r
-                .= $this->_pv_quote_data;\r
-            unset($this->_pv_quote_data);\r
-        }\r
-        if ($this->_last_pevent == PARSER_EVENT_ARRAY) {\r
-            $this->_pv_static_val[$this->_pv_static_count]\r
-                .= $this->_pv_function_data;\r
-            $this->_pv_function_data = '';\r
-        }\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pv_static_val[$this->_pv_static_count]\r
-                = trim($this->_pv_static_val[$this->_pv_static_count]);\r
-            $this->_wp->backupPos($word);\r
-            return;\r
-        } else {\r
-            if (is_array($word)) $word = $word[1];\r
-            $this->_pv_static_val[$this->_pv_static_count] .= $word;\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for LOGICBLOCK\r
-     *\r
-     * Logic Blocks are the stuff between { and } in a function/method.  A\r
-     * logic block can clearly contain other logic blocks, as in:\r
-     *\r
-     * <code>\r
-     * function test($a)\r
-     * {\r
-     *    if (testcondition)\r
-     *    { // nested logic block\r
-     *    }\r
-     * }\r
-     * </code>\r
-     *\r
-     * So, the exit portion of the logic block handler must check to see if the\r
-     * logic block being exited is the top-level, and it does this by retrieving\r
-     * the last event from the stack.  If it is a function (and not a logic block)\r
-     * then it backs up the word parser so that the function will exit properly.\r
-     *\r
-     * {@source 11}\r
-     */\r
-    function handleLogicBlock($word, $pevent)\r
-    {\r
-        $a = $this->checkEventPush($word, $pevent);\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $e = $this->_event_stack->popEvent();\r
-            $this->_event_stack->pushEvent($e);\r
-            if ($e == PARSER_EVENT_FUNCTION) {\r
-                $this->_wp->backupPos(); \r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for FUNCTION.\r
-     *\r
-     * this handler recognizes function declarations, and parses them.  The body\r
-     * of the function is parsed by handleLogicBlock()\r
-     *\r
-     * @see handleLogicBlock()\r
-     */\r
-    function handleFunction($word, $pevent)\r
-    {\r
-        if ($e = $this->checkEventPush($word, $pevent)) {\r
-            $this->_pv_function_data = '';\r
-            if ($e == PARSER_EVENT_FUNCTION_PARAMS && !is_object($this->_pv_func)\r
-            ) {\r
-                addErrorDie(PDERROR_FUNCTION_HAS_NONAME);\r
-            }\r
-            if ($e == PARSER_EVENT_COMMENT || $e == PARSER_EVENT_COMMENTBLOCK || \r
-                $e == PARSER_EVENT_FUNCTION_PARAMS || $e == PARSER_EVENT_LOGICBLOCK\r
-            ) {\r
-                return;\r
-            }\r
-        }\r
-    \r
-        if (!isset($this->_pv_func)) {\r
-            $this->_pv_func = false;\r
-        }\r
-        if (! is_object($this->_pv_func)) {\r
-            $this->_pv_globals      = array();\r
-            $this->_pv_global_count = $this->_pv_static_count = 0;\r
-            if ($this->_pf_in_class) {\r
-                $this->_pv_func = new parserMethod($this->_pv_cur_class); \r
-            } else {\r
-                $this->_pv_func = new parserFunction;\r
-                unset($this->_accessModifiers);\r
-            }\r
-            if (isset($this->_accessModifiers)) {\r
-                $this->_pv_func->setModifiers($this->_accessModifiers);\r
-                unset($this->_accessModifiers);\r
-            }\r
-            $this->_pv_func->setLineNumber($this->_wp->linenum + 1);\r
-            if (is_string($word) && $word == '&') {\r
-                $this->_pv_func->setReturnsReference();\r
-            }\r
-            if (is_array($word) && $word[0] == T_STRING) {\r
-                $this->_pv_func->setName($word[1]);\r
-            }\r
-        } else {\r
-            if ($this->_pv_func->getReturnsReference()) {\r
-                if (is_array($word) && $word[0] == T_STRING) {\r
-                    $this->_pv_func->setName($word[1]);\r
-                }\r
-            }\r
-        }\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pv_func->setEndLineNumber($this->_wp->linenum + 1);\r
-            $this->_pv_func->addGlobals($this->_pv_globals);\r
-            $this->_pv_func->addStatics($this->_pv_statics, $this->_pv_static_val);\r
-            $this->_pv_globals      = array();\r
-            $this->_pv_global_count = 0;\r
-            if ($this->_pf_getting_source) {\r
-                $x = $this->_wp->getSource();\r
-                $this->_pv_func->addSource($x);\r
-                $this->_pf_get_source     = false;\r
-                $this->_pf_getting_source = false;\r
-            }\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_FUNCTION, $this->_pv_func); \r
-            $this->_pv_func = false; \r
-\r
-            // subtle bug fixed by this, sometimes string from function body\r
-            unset($this->_pv_quote_data); // was picked up by the next function \r
-                                          // as a default value for a parameter!\r
-        } \r
-    }\r
-\r
-    /**\r
-     * handler for FUNCTION_PARAMS.\r
-     *\r
-     * this handler recognizes the parameters of a function within parentheses \r
-     * like function(param, param = default_value) and parses them\r
-     *\r
-     * @see endFunctionParam()\r
-     */\r
-    function handleFunctionParams($word, $pevent)\r
-    {\r
-        //echo $this->_wp->getPos() . ": word=|$word|\t\t\tlastword=|"\r
-        //    . $this->_pv_last_word."|\n";\r
-        //echo "function_param = '".$this->_pv_function_param."'\n";\r
-        //echo "function_data = '".$this->_pv_function_data."'\n";\r
-        $e1 = $this->checkEventPush($word, $pevent); \r
-\r
-        if (!$e1) {\r
-            if (($pop = $this->checkEventPop($word, $pevent)) && \r
-                $pevent == PARSER_EVENT_FUNCTION_PARAM_VAR\r
-            ) {\r
-                // end of [typehint ]$param[= defaultval]\r
-                if (is_string($word) && $word == ')') {\r
-                    $this->_wp->backupPos();\r
-                }\r
-                $this->endFunctionParam($word);\r
-            } elseif ($word == '=') {\r
-                // about to parse the default value\r
-                $this->_pf_funcparam_val = true;\r
-            } else {\r
-                if ($this->_pf_funcparam_val) {\r
-                    // parsing default value\r
-                    if (isset($this->_pv_quote_data)) {\r
-                        $this->_pv_function_data .= $this->_pv_quote_data;\r
-                        unset($this->_pv_quote_data);\r
-                    }\r
-                    if (is_array($word)) {\r
-                        $word = $word[1];\r
-                    }\r
-                    $this->_pv_function_data .= $word;\r
-                } else {\r
-                    // pre-param\r
-                    if ($pop) {\r
-                        return;\r
-                    }\r
-                    if (!isset($this->_pv_function_param)) {\r
-                        $this->_pv_function_param = '';\r
-                    }\r
-                    if (is_array($word) && $pevent == PARSER_EVENT_FUNCTION_PARAMS\r
-                    ) {\r
-                        if ($word[0] == T_STRING || $word[0] == T_ARRAY) {\r
-                            // object or array type hint\r
-                            $this->_pv_function_param_type = $word[1];\r
-                            return;\r
-                        }\r
-                        $word = $word[1];\r
-                    }\r
-                    $this->_pv_function_param .= $word;\r
-                }\r
-            }\r
-        } elseif ($e1 == PARSER_EVENT_ARRAY) {\r
-            $this->_wp->setWhiteSpace(true);\r
-        } elseif ($e1 == PARSER_EVENT_FUNCTION_PARAM_VAR) {\r
-            if (!isset($this->_pv_function_param)) {\r
-                $this->_pv_function_param = '';\r
-            }\r
-            // we just got the $var part of the param\r
-            $this->_pv_function_param .= $word[1];\r
-        }\r
-    }\r
-\r
-    /**\r
-     * handler for ARRAY.\r
-     *\r
-     * this event handler parses arrays in default values of function\r
-     * and var definitions\r
-     */\r
-    function handleArray($word, $pevent)\r
-    {\r
-        $e = $this->checkEventPush($word, $pevent);\r
-        if ($e) {\r
-            return;\r
-        }\r
-\r
-        if (!isset($this->_pv_function_data) || \r
-            (isset($this->_pv_function_data) && empty($this->_pv_function_data))\r
-        ) {\r
-            $this->_pv_function_data = "array";\r
-        }\r
-\r
-        if ($word == '(' && $this->_pv_paren_count++) {\r
-            // need extra parentheses help\r
-            $this->_event_stack->pushEvent($pevent);\r
-        }\r
-        if (is_array($word)) {\r
-            $this->_pv_function_data .= $word[1];\r
-        } else {\r
-            $this->_pv_function_data .= $word;\r
-        }\r
-        //echo "function_data = |$this->_pv_function_data|\n";\r
-\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pv_paren_count--;\r
-            $this->_wp->setWhiteSpace(false);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for HEREDOC in a function logic block.\r
-     *\r
-     * this handler recognizes function declarations, and parses them.  The body\r
-     * of the function is parsed by handleLogicBlock()\r
-     *\r
-     * @see handleLogicBlock()\r
-     */\r
-    function handleHereDoc($word, $pevent)\r
-    {\r
-        if (is_array($this->_pv_last_word) && \r
-            $this->_pv_last_word[0] == T_START_HEREDOC\r
-        ) {\r
-            $save = $word;\r
-            if (is_array($word)) {\r
-                $word = $word[1];\r
-            }\r
-            $this->_pv_quote_data   = $this->_pv_last_word[1] . $word;\r
-            $this->_pf_quote_active = true;\r
-        } elseif (!$this->_pf_quote_active) {\r
-            $this->_pv_quote_data = $this->_pv_last_word[1];\r
-            $this->_event_stack->popEvent();\r
-            $this->_wp->backupPos();\r
-            return;\r
-        }\r
-        $save = $word;\r
-        if (is_array($word)) {\r
-            $word = $word[1];\r
-        }\r
-        $this->_pv_quote_data .= $word;\r
-        if ($this->checkEventPop($save, $pevent)) {\r
-            $this->_pf_quote_active = false;\r
-        }\r
-    }\r
-\r
-    /**\r
-     * handler for QUOTE.\r
-     *\r
-     * this handler recognizes strings defined with double quotation marks (")\r
-     * and single 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->_pv_last_word == '"' || $this->_pv_last_word == "'" && \r
-            $this->_last_pevent != PARSER_EVENT_QUOTE\r
-        ) {\r
-            $save = $word;\r
-            if (is_array($word)) {\r
-                $word = $word[1];\r
-            }\r
-            $this->_pv_quote_data   = $this->_pv_last_word . $word;\r
-            $this->_pf_quote_active = true;\r
-            $this->checkEventPop($save, $pevent);\r
-        } elseif (!$this->_pf_quote_active) {\r
-            $this->_pv_quote_data = $this->_pv_last_word[1];\r
-            $this->_event_stack->popEvent();\r
-            $this->_wp->backupPos();\r
-            return;\r
-        }\r
-        $save = $word;\r
-        if (is_array($word)) {\r
-            $word = $word[1];\r
-        }\r
-        $this->_pv_quote_data .= $word;\r
-        if ($this->checkEventPop($save, $pevent)) {\r
-            $this->_pf_quote_active = false;\r
-        }\r
-    }\r
-\r
-    /**\r
-     * handler for INCLUDE.\r
-     *\r
-     * this handler recognizes include/require/include_once/include_once statements,\r
-     * and publishes the data to Render\r
-     */\r
-    function handleInclude($word, $pevent)\r
-    {\r
-        if (!$this->_pf_in_include) {\r
-            $this->_pv_linenum = $this->_wp->linenum;\r
-        }\r
-        $this->_pf_in_include = true;\r
-\r
-        $a = $this->checkEventPush($word, $pevent);\r
-        if (!$this->_pf_includename_isset) {\r
-            $this->_pf_includename_isset = true;\r
-\r
-            $w = $this->_pv_last_word;\r
-            if (is_array($w)) {\r
-                $w = $w[1];\r
-            }\r
-            $this->_pv_include_name = $w;\r
-            if ($a) {\r
-                $this->_pv_include_value = '';\r
-            } else {\r
-                if (is_array($word)) {\r
-                    $word = $word[1];\r
-                }\r
-                $this->_pv_include_value = $word;\r
-            }\r
-            unset($this->_pv_quote_data);\r
-        } else {\r
-            if (!$a) {\r
-                if (empty($this->_pv_include_params_data)) {\r
-                    if ($word != ';') {\r
-                        if (is_array($word)) $word = $word[1];\r
-                        $this->_pv_include_value .= $word;\r
-                    }\r
-                }\r
-            } else {\r
-                if ($this->_pf_in_include_value && $a == PARSER_EVENT_INCLUDE_PARAMS\r
-                ) {\r
-                    /* we're already inside the include value, \r
-                     * so an open paren does NOT mean the beginning \r
-                     * of "include parameters"...\r
-                     * it's just a part of the include's value string...\r
-                     * but we've already pushed PARSER_EVENT_INCLUDE_PARAMS \r
-                     * onto the stack... \r
-                     * we need to pop it off \r
-                     * before handleIncludeParams gets called...\r
-                     */\r
-                    $this->_event_stack->popEvent();\r
-                    // also need to keep that open parens...\r
-                    $this->_pv_include_value .= $word;\r
-                }\r
-                $this->_pv_include_params_data = '';\r
-            }\r
-        }\r
-\r
-        if (!empty($this->_pv_include_value)) {\r
-            $this->_pf_in_include_value = true;\r
-        }\r
-\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pv_include = new parserInclude;\r
-            $this->_pv_include->setLineNumber($this->_pv_linenum + 1);\r
-            $this->_pf_in_include = false;\r
-            $this->_pv_include->setName($this->_pv_include_name);\r
-            $this->_pv_include->setValue($this->_pv_include_value);\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_INCLUDE, $this->_pv_include);\r
-            $this->_pf_includename_isset = false;\r
-            $this->_pf_in_include_value  = false;\r
-            unset($this->_pv_include);\r
-            unset($this->_pv_include_name);\r
-            unset($this->_pv_include_value);\r
-            unset($this->_pv_include_params_data);\r
-        } elseif ($this->_last_pevent == PARSER_EVENT_INCLUDE_PARAMS) {\r
-            // include is part of a larger statement\r
-            // force ending of include\r
-            $this->_event_stack->popEvent();\r
-            $this->_pv_include = new parserInclude;\r
-            $this->_pv_include->setLineNumber($this->_pv_linenum + 1);\r
-            $this->_pf_in_include = false;\r
-            $this->_pv_include->setName($this->_pv_include_name);\r
-            $this->_pv_include->setValue($this->_pv_include_value);\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_INCLUDE, $this->_pv_include);\r
-            $this->_pf_includename_isset = false;\r
-            $this->_pf_in_include_value  = false;\r
-            unset($this->_pv_include);\r
-            unset($this->_pv_include_name);\r
-            unset($this->_pv_include_value);\r
-            unset($this->_pv_include_params_data);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for INCLUDE_PARAMS.\r
-     *\r
-     * this handler parses the contents of ( ) \r
-     * in include/require/include_once/include_once statements\r
-     */\r
-    function handleIncludeParams($word, $pevent)\r
-    {\r
-        $e = $this->checkEventPush($word, $pevent);\r
-        if ($e == PARSER_EVENT_COMMENT) {\r
-            return;\r
-        }\r
-        \r
-        if (!isset($this->_pv_include_params_data)) {\r
-            $this->_pv_include_params_data = '';\r
-        }\r
-        \r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            if (!empty($this->_pv_include_params_data)) {\r
-                $this->_pv_include_value = $this->_pv_include_params_data;\r
-            } else {\r
-                $w = $this->_pv_last_word;\r
-                if (is_array($w)) {\r
-                    $w = $w[1];\r
-                }\r
-                $this->_pv_include_value = $w;\r
-            }\r
-        }\r
-        if (is_array($word)) {\r
-            $word = $word[1];\r
-        }\r
-        $this->_pv_include_params_data .= $word;\r
-    }\r
-    \r
-    /**\r
-     * handler for INCLUDE_PARAMS_PARENTHESIS.\r
-     *\r
-     * this handler takes all parenthetical statements within file in:\r
-     * include statement include(file), and handles them properly\r
-     */\r
-    function handleIncludeParamsParenthesis($word, $pevent)\r
-    {\r
-        $this->checkEventPush($word, $pevent);\r
-        $this->checkEventPop($word, $pevent);\r
-        if (is_array($word)) {\r
-            $word = $word[1];\r
-        }\r
-        $this->_pv_include_params_data .= $word;\r
-    }\r
-\r
-    /**\r
-     * handler for DEFINE.\r
-     *\r
-     * handles define(constant, value); statements\r
-     */\r
-    function handleDefine($word, $pevent)\r
-    {\r
-        if (!$this->_pf_in_define) {\r
-            $this->_pv_linenum = $this->_wp->linenum + 1;\r
-        }\r
-        $this->_pf_in_define = true;\r
-        $this->checkEventPush($word, $pevent);\r
-\r
-        $this->_pf_definename_isset   = false;\r
-        $this->_pv_define_params_data = '';\r
-        unset($this->_pv_quote_data);\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pf_in_define = false;\r
-            $this->_pv_define    = new parserDefine;\r
-            $this->_pv_define->setLineNumber($this->_pv_linenum);\r
-            $this->_pv_define->setName($this->_pv_define_name);\r
-            $this->_pv_define->setValue($this->_pv_define_value);\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_DEFINE, $this->_pv_define);\r
-            $this->_pf_definename_isset = false;\r
-            unset($this->_pv_define);\r
-            unset($this->_pv_define_name);\r
-            unset($this->_pv_define_value);\r
-            $this->_pf_in_define          = false;\r
-            $this->_pv_define_params_data = '';\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for DEFINE_PARAMS.\r
-     *\r
-     * handles the parsing of constant and value in define(constant, value);\r
-     */\r
-    function handleDefineParams($word, $pevent)\r
-    {\r
-        $e = $this->checkEventPush($word, $pevent);\r
-        if ($e && $e != PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS) {\r
-            return;\r
-        }\r
-        \r
-        if (!isset($this->_pv_define_params_data)) {\r
-            $this->_pv_define_params_data = '';\r
-        }\r
-        \r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            if ($this->_last_pevent == PARSER_EVENT_QUOTE ||\r
-                $this->_last_pevent == PARSER_EVENT_EOFQUOTE\r
-            ) {\r
-                $this->_pv_define_params_data .= $this->_pv_quote_data;\r
-                unset($this->_pv_quote_data);\r
-            }\r
-            if (is_array($word)) {\r
-                $word = $word[1];\r
-            }\r
-            if (!empty($this->_pv_define_params_data)) {\r
-                //echo $this->_pv_define_params_data."\n";\r
-                $this->_pv_define_value = $this->_pv_define_params_data;\r
-            } else {\r
-                $w = $this->_pv_last_word;\r
-                if (is_array($this->_pv_last_word)) {\r
-                    $w = $this->_pv_last_word[1];\r
-                }\r
-                if (!empty($w)) {\r
-                    $this->_pv_define_value = $w;\r
-                } else {\r
-                    $this->_pv_define_value = "";\r
-                    switch ($w) {\r
-                    case 0:\r
-                        $this->_pv_define_value = "0";\r
-                        break;\r
-                    case null:\r
-                        $this->_pv_define_value = "null";\r
-                        break;\r
-                    case "":\r
-                        $this->_pv_define_value = "";\r
-                        break;\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        if ($this->_pf_definename_isset) {\r
-            if (is_array($word)) {\r
-                $word = $word[1];\r
-            }\r
-            $this->_pv_define_params_data .= $word;\r
-        } else {\r
-            if ($word != ",") {\r
-                if (is_array($word)) {\r
-                    $word = $word[1];\r
-                }\r
-                $this->_pv_define_params_data .= $word;\r
-            } else {\r
-                if (substr($this->_pv_define_params_data, 0, 1) ==\r
-                    substr($this->_pv_define_params_data,\r
-                        strlen($this->_pv_define_params_data) - 1) &&\r
-                    in_array(substr($this->_pv_define_params_data,\r
-                        0, 1), array('"', "'"))\r
-                ) {\r
-                    // remove leading and ending quotation marks \r
-                    // if there are only two\r
-                    $a = substr($this->_pv_define_params_data, 0, 1);\r
-                    $b = substr($this->_pv_define_params_data, 1, \r
-                        strlen($this->_pv_define_params_data) - 2);\r
-                    if (strpos($b, $a) === false) {\r
-                        $this->_pv_define_params_data = $b;\r
-                    }\r
-                }\r
-                $this->_pf_definename_isset   = true;\r
-                $this->_pv_define_name        = $this->_pv_define_params_data;\r
-                $this->_pv_define_params_data = '';\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for DEFINE_PARAMS_PARENTHESIS.\r
-     *\r
-     * this handler takes all parenthetical statements within constant or value in:\r
-     * define(constant, value) of a define statement, and handles them properly\r
-     */\r
-    function handleDefineParamsParenthesis($word, $pevent)\r
-    {\r
-        $e = $this->checkEventPush($word, $pevent);\r
-        $this->checkEventPop($word, $pevent);\r
-        if ($this->_last_pevent == PARSER_EVENT_QUOTE) {\r
-            $this->_pv_define_params_data .= $this->_pv_quote_data;\r
-            unset($this->_pv_quote_data);\r
-        }\r
-        if (is_array($word)) {\r
-            $word = $word[1];\r
-        }\r
-        $this->_pv_define_params_data .= $word;\r
-    }\r
-\r
-    /**\r
-     * handler for IMPLEMENTS.\r
-     *\r
-     * this handler parses a class statement's implements clause (PHP 5)\r
-     */\r
-    function handleImplements($word, $pevent)\r
-    {\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_wp->backupPos();\r
-            return;\r
-        }\r
-        if (is_array($word) && $word[0] == T_STRING) {\r
-            $this->_pv_class->addImplements($word[1]);\r
-        }\r
-    }\r
-\r
-    /**\r
-     * handler for ACCESS_MODIFIER.\r
-     *\r
-     * this handler parses public/private/protected/static/abstract PHP 5 modifiers\r
-     */\r
-    function handleAccessModifier($word, $pevent)\r
-    {\r
-        if (!isset($this->_accessModifiers)) {\r
-            $this->_accessModifiers = array();\r
-        }\r
-        $this->_wp->backupPos();\r
-        $this->_event_stack->popEvent();\r
-        if ($word[0] == T_VARIABLE) {\r
-            // this is a PHP5-style variable with no "var"\r
-            $this->_event_stack->pushEvent(PARSER_EVENT_VAR);\r
-        }\r
-        $this->_accessModifiers[] = strtolower($this->_pv_last_word[1]);\r
-    }\r
-\r
-    /**\r
-     * handler for CLASS.\r
-     *\r
-     * this handler parses a class/interface statement\r
-     */\r
-    function handleClass($word, $pevent)\r
-    {\r
-        if (!$this->_pf_in_class) {\r
-            $this->_pf_in_class = true;\r
-            if ($this->_pv_last_word[0] == T_INTERFACE) {\r
-                $this->_pf_interface = true;\r
-            } else {\r
-                $this->_pf_interface = false;\r
-            }\r
-        }\r
-        $a = $this->checkEventPush($word, $pevent);\r
-\r
-        if (!isset($this->_pv_class)) {\r
-            $this->_pv_class = false;\r
-        }\r
-        if (!is_subclass_of($this->_pv_class, "parserBase")) {\r
-            $this->_pv_class = new parserClass;\r
-            if (isset($this->_accessModifiers)) {\r
-                $this->_pv_class->setModifiers($this->_accessModifiers);\r
-                unset($this->_accessModifiers);\r
-            }\r
-            if ($this->_pf_interface) {\r
-                $this->_pv_class->setInterface();\r
-            }\r
-            $this->_pv_class->setLineNumber($this->_wp->linenum + 1);\r
-            $this->_pv_class->setname($word[1]);\r
-            $this->_pv_cur_class = $word[1];\r
-            $this->_pv_class->setSourceLocation($this->source_location);\r
-        }\r
-\r
-        if (is_array($this->_pv_last_word) && $this->_pv_last_word[0] == T_EXTENDS\r
-        ) {\r
-            // I don't know why I am so nice, this fixes 1150809\r
-            if ($word[1] == $this->_pv_class->getName()) {\r
-                addErrorDie(PDERROR_CANNOT_EXTEND_SELF, $word[1]);\r
-            }\r
-            $this->_pv_class->setExtends($word[1]);\r
-        }\r
-\r
-        if ($word == "{") {\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_CLASS, $this->_pv_class);\r
-        }\r
-        //echo $this->wp->getPos() . ": |$word|\n";\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_pv_class->setEndLineNumber($this->_wp->linenum + 1);\r
-            $this->_pf_in_class = $this->_pf_interface = false;\r
-            // throw an event when class is done\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_NEWSTATE, STATE_END_CLASS);\r
-            $this->_pv_class = false;\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handler for VAR_ARRAY_COMMENT\r
-     *\r
-     * if parsing a default value, add the comment to the text\r
-     */\r
-    function handleVarArrayComment($word, $pevent)\r
-    {\r
-        $this->_pv_function_data .= $this->_pv_last_word[1];\r
-        return $this->handleComment($word, $pevent);\r
-    }\r
-\r
-    /**\r
-     * handler for VAR.\r
-     *\r
-     * handle a var $varname = default_value;\r
-     * or var $varname; statement \r
-     * in a class definition\r
-     */\r
-    function handleVar($word, $pevent)\r
-    {\r
-        if (!$this->_pf_in_var) {\r
-            $this->_pf_set_var_value = false;\r
-            $this->_pv_var_value     = '';\r
-            $this->_pv_linenum       = $this->_wp->linenum + 1;\r
-        }\r
-        $this->_pf_in_var = true;\r
-        //echo $word."\n";\r
-        $e = $this->checkEventPush($word, $pevent);\r
-        \r
-        if (!isset($this->_pv_var)) {\r
-            $this->_pv_var = false;\r
-        }\r
-        if ($word == '=' || $word == ';' || $word == ',') {\r
-            $this->_wp->setWhitespace(true);\r
-            $this->_pf_var_equals = true;\r
-            $this->_pv_var        = new parserVar($this->_pv_cur_class);\r
-            $this->_pv_var->setName($this->_pv_varname);\r
-        }\r
-        if ($this->_last_pevent == PARSER_EVENT_VAR_ARRAY) {\r
-            if (isset($this->_pv_function_data)) {\r
-                $this->_pv_var->setValue($this->_pv_function_data);\r
-            }\r
-            $this->_pf_set_var_value = true;\r
-            unset($this->_pv_function_data);\r
-        } elseif ($this->_pf_var_equals && $word != ';' && \r
-            $word != '=' && $word != ',' && !$e\r
-        ) {\r
-            if (is_array($word)) {\r
-                $word = $word[1];\r
-            }\r
-            $this->_pv_var_value .= $word;\r
-        }\r
-        if ($word == ',') {\r
-            if (!$this->_pf_set_var_value) {\r
-                $this->_pv_var->setValue($this->_pv_var_value);\r
-            }\r
-            $this->_pf_set_var_value = false;\r
-            unset($this->_pv_var_value);\r
-            $this->_pv_var->setEndLineNumber($this->_wp->linenum + 1);\r
-            $this->_pv_var->setLineNumber($this->_pv_linenum);\r
-            if (isset($this->_accessModifiers)) {\r
-                $this->_pv_var->setModifiers($this->_accessModifiers);\r
-            }\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_VAR, $this->_pv_var);\r
-            unset($this->_pv_var);\r
-            $this->_pf_in_var     = false;\r
-            $this->_pf_var_equals = false;\r
-            $this->_pv_varname    = '';\r
-            return;\r
-        }\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_wp->setWhitespace(false);\r
-            if (!$this->_pf_set_var_value) {\r
-                $this->_pv_var->setValue($this->_pv_var_value);\r
-            }\r
-            $this->_pf_set_var_value = false;\r
-            unset($this->_pv_var_value);\r
-            $this->_pv_var->setEndLineNumber($this->_wp->linenum + 1);\r
-            $this->_pv_var->setLineNumber($this->_pv_linenum);\r
-            if (isset($this->_accessModifiers)) {\r
-                $this->_pv_var->setModifiers($this->_accessModifiers);\r
-                unset($this->_accessModifiers);\r
-            }\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_VAR, $this->_pv_var);\r
-            unset($this->_pv_var);\r
-            $this->_pf_in_var     = false;\r
-            $this->_pf_var_equals = false;\r
-            $this->_pv_varname    = '';\r
-            return;\r
-        }\r
-        if ($word[0] == T_VARIABLE) {\r
-            $this->_pv_varname = $word[1];\r
-        }\r
-    }\r
-\r
-    /**\r
-     * handler for CLASS_CONSTANT.\r
-     *\r
-     * handle a const constname = default_value; statement in a class definition\r
-     */\r
-    function handleClassConstant($word, $pevent)\r
-    {\r
-        if (!$this->_pf_in_const) {\r
-            $this->_pf_set_const_value = false;\r
-            $this->_pv_const_value     = '';\r
-            $this->_pv_linenum         = $this->_wp->linenum + 1;\r
-        }\r
-        $this->_pf_in_const = true;\r
-        //echo $word."\n";\r
-        $e = $this->checkEventPush($word, $pevent);\r
-        \r
-        if (!isset($this->_pv_const)) {\r
-            $this->_pv_const = false;\r
-        }\r
-        if ($word == '=' || $word == ';' || $word == ',') {\r
-            $this->_wp->setWhitespace(true);\r
-            $this->_pf_const_equals = true;\r
-            $this->_pv_const        = new parserConst($this->_pv_cur_class);\r
-            $this->_pv_const->setName($this->_pv_constname);\r
-        }\r
-        if ($this->_last_pevent == PARSER_EVENT_VAR_ARRAY) {\r
-            if (isset($this->_pv_function_data)) {\r
-                $this->_pv_const->setValue($this->_pv_function_data);\r
-            }\r
-            $this->_pf_set_const_value = true;\r
-            unset($this->_pv_function_data);\r
-        } elseif ($this->_pf_const_equals && $word != ';' && \r
-            $word != '=' && $word != ',' && !$e\r
-        ) {\r
-            if (is_array($word)) {\r
-                $word = $word[1];\r
-            }\r
-            $this->_pv_const_value .= $word;\r
-        }\r
-        if ($word == ',') {\r
-            if (!$this->_pf_set_const_value) {\r
-                $this->_pv_const->setValue($this->_pv_const_value);\r
-            }\r
-            $this->_pf_set_const_value = false;\r
-            unset($this->_pv_const_value);\r
-            $this->_pv_const->setEndLineNumber($this->_wp->linenum + 1);\r
-            $this->_pv_const->setLineNumber($this->_pv_linenum);\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_CONST, $this->_pv_const);\r
-            unset($this->_pv_const);\r
-            $this->_pf_in_const     = false;\r
-            $this->_pf_const_equals = false;\r
-            $this->_pv_constname    = '';\r
-            return;\r
-        }\r
-        if ($this->checkEventPop($word, $pevent)) {\r
-            $this->_wp->setWhitespace(false);\r
-            if (!$this->_pf_set_const_value) {\r
-                $this->_pv_const->setValue($this->_pv_const_value);\r
-            }\r
-            $this->_pf_set_const_value = false;\r
-            unset($this->_pv_const_value);\r
-            $this->_pv_const->setEndLineNumber($this->_wp->linenum + 1);\r
-            $this->_pv_const->setLineNumber($this->_pv_linenum);\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_VAR, $this->_pv_const);\r
-            unset($this->_pv_const);\r
-            $this->_pf_in_const     = false;\r
-            $this->_pf_const_equals = false;\r
-            $this->_pv_constname    = '';\r
-            return;\r
-        }\r
-        if ($word[0] == T_STRING && !$this->_pf_const_equals) {\r
-            $this->_pv_constname = $word[1];\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Handler for the \r
-     * {@tutorial phpDocumentor.howto.pkg#using.command-line.javadocdesc}\r
-     * command-line switch DocBlocks.\r
-     *\r
-     * @todo CS cleanup - rename to javaDoc* for camelCasing rule\r
-     */\r
-    function JavaDochandleDocblock($word, $pevent)\r
-    {\r
-        $this->commonDocBlock($word, $pevent, 'handleJavaDocDesc');\r
-    }\r
-    \r
-    /**\r
-     * Handler for normal DocBlocks\r
-     */\r
-    function handleDocBlock($word, $pevent)\r
-    {\r
-        $this->commonDocBlock($word, $pevent, 'handleDesc');\r
-    }\r
-    /**#@-*/\r
-    \r
-    /**\r
-     * Helper function for {@link handleFunctionParams()}\r
-     *\r
-     * This function adds a new parameter to the parameter list\r
-     *\r
-     * @param string $word the parameter word\r
-     *\r
-     * @return void\r
-     * @access private\r
-     */\r
-    function endFunctionParam($word)\r
-    {\r
-        if (isset($this->_pv_quote_data)) {\r
-            $this->_pv_function_data .= $this->_pv_quote_data;\r
-            unset($this->_pv_quote_data);\r
-        }\r
-        if (isset($this->_pv_function_param)) {\r
-            $this->_pv_func->addParam($this->_pv_function_param,\r
-                $this->_pv_function_data,\r
-                $this->_pf_funcparam_val,\r
-                $this->_pv_function_param_type);\r
-            unset($this->_pv_function_param);\r
-            $this->_pv_function_data       = '';\r
-            $this->_pf_funcparam_val       = false;\r
-            $this->_pv_function_param_type = null;\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Common DocBlock Handler for both JavaDoc-format and normal DocBlocks\r
-     *\r
-     * @param string $word        the word\r
-     * @param int    $pevent      the parser event\r
-     * @param string $deschandler the handler to use\r
-     *\r
-     * @return void\r
-     * @access private\r
-     */\r
-    function commonDocBlock($word, $pevent, $deschandler)\r
-    {\r
-        $this->_wp->backupPos();\r
-        $this->_event_stack->popEvent();\r
-        $word  = $this->_pv_last_word[1];\r
-        $dtype = '_pv_docblock';\r
-        if (strpos($word, '/**') !== 0) {\r
-            // not a docblock\r
-            // $this->_wp->backupPos();\r
-            $this->_event_stack->pushEvent(PARSER_EVENT_COMMENT);\r
-            return;\r
-        }\r
-        if ($word == '/**#@-*/') {\r
-            // stop using docblock template\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_NEWSTATE,\r
-                PHPDOCUMENTOR_EVENT_END_DOCBLOCK_TEMPLATE);\r
-            unset($this->_pv_dtemplate);\r
-            return;\r
-        }\r
-        if (strpos($word, '/**#@+') === 0) {\r
-            // docblock template definition\r
-            $dtype = '_pv_dtemplate';\r
-            // strip /**#@+ and */\r
-            $word = substr($word, 6).'*';\r
-            $word = trim(substr($word, 0, strlen($word) - 3));\r
-            if (strlen($word) && $word{0} != '*') {\r
-                $word = "* $word";\r
-            }\r
-        } else {\r
-            // strip /** and */\r
-            $word = substr($word, 2);\r
-            $word = substr($word, 0, strlen($word) - 2);\r
-        }\r
-        $lines = explode("\n", trim($word));\r
-        $go    = count($lines);\r
-        for ($i=0; $i < $go; $i++) {\r
-            if (substr(trim($lines[$i]), 0, 1) != '*') {\r
-                unset($lines[$i]);\r
-            } else {\r
-                // remove leading "* "\r
-                $lines[$i] = substr(trim($lines[$i]), 1);\r
-            }\r
-        }\r
-        // remove empty lines\r
-        if ($lines == array(false)) { \r
-            // prevent PHP 5.2 segfault (see http://bugs.php.net/bug.php?id=39350)\r
-            $lines = array('');\r
-        }\r
-        $lines = explode("\n", trim(join("\n", $lines)));\r
-        for ($i = 0; $i < count($lines); $i++) {\r
-            if (substr(trim($lines[$i]), 0, 1) == '@' && \r
-                substr(trim($lines[$i]), 0, 2) != '@ '\r
-            ) {\r
-                $tagindex = $i;\r
-                $i        = count($lines);\r
-            }\r
-        }\r
-        if (isset($tagindex)) {\r
-            $tags = array_slice($lines, $tagindex);\r
-            $desc = array_slice($lines, 0, $tagindex);\r
-        } else {\r
-            $tags = array();\r
-            $desc = $lines;\r
-        }\r
-        //var_dump($desc,$tags);\r
-        $this->$dtype = new parserDocBlock;\r
-        $this->$dtype->setLineNumber($this->_wp->_docblock_linenum + 1);\r
-        $this->$dtype->setEndLineNumber($this->_wp->linenum);\r
-        $this->_pv_dtype = $dtype;\r
-        $this->$deschandler($desc);\r
-        $this->handleTags($tags);\r
-        if ($dtype == '_pv_docblock') {\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_DOCBLOCK, $this->$dtype);\r
-            $this->$dtype = new parserDocBlock();\r
-        } else {\r
-            $this->publishEvent(PHPDOCUMENTOR_EVENT_DOCBLOCK_TEMPLATE,\r
-                $this->$dtype);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Handles JavaDoc descriptions\r
-     *\r
-     * @param string $desc the description\r
-     *\r
-     * @return void\r
-     * @access private\r
-     */\r
-    function handleJavaDocDesc($desc)\r
-    {\r
-        unset($this->_pv_periodline);\r
-        $this->_pf_useperiod = false;\r
-        if (empty($desc)) {\r
-            $desc = array('');\r
-        }\r
-        foreach ($desc as $i => $line) {\r
-            $line = trim($line);\r
-            if (!isset($this->_pv_periodline) && \r
-                substr($line, strlen($line) - 1) == '.'\r
-            ) {\r
-                $this->_pv_periodline = $i;\r
-                $this->_pf_useperiod  = true;\r
-            }\r
-        }\r
-        if (!isset($this->_pv_periodline)) {\r
-            $this->_pv_periodline = 0;\r
-        }\r
-\r
-        $dtype = $this->_pv_dtype;\r
-        if ($dtype == '_pv_docblock') {\r
-            $save = $desc;\r
-            // strip leading <p>\r
-            if (strpos($desc[0], '<p>') === 0) {\r
-                $desc[0] = substr($desc[0], 3);\r
-            }\r
-            $sdesc = new parserDesc;\r
-            $desci = '';\r
-            for ($i = 0; ($i <= $this->_pv_periodline) && ($i < count($desc)); $i++\r
-            ) {\r
-                if (strpos($desc[$i], '.') !== false) {\r
-                    $desci .= substr($desc[$i], 0, strpos($desc[$i], '.') + 1);\r
-                } else {\r
-                    $desci .= $desc[$i];\r
-                }\r
-                $desci .= "\n";\r
-            }\r
-            $sdesc->add($this->getInlineTags($desci));\r
-            $desc = $save;\r
-        \r
-            $my_desc = new parserDesc;\r
-            if (isset($this->_pv_dtemplate)) {\r
-                // copy template values if not overridden\r
-                if (!$this->_pv_docblock->getExplicitPackage()) {\r
-                    if ($p = $this->_pv_dtemplate->getKeyword('package')) {\r
-                        $this->_pv_docblock->addKeyword('package', $p);\r
-                        $this->_pv_docblock->setExplicitPackage();\r
-                    }\r
-                    if ($p = $this->_pv_dtemplate->getKeyword('category')) {\r
-                        $this->_pv_docblock->addKeyword('category', $p);\r
-                        $this->_pv_docblock->setExplicitCategory();\r
-                    }\r
-                    if ($p = $this->_pv_dtemplate->getKeyword('subpackage')) {\r
-                        $this->_pv_docblock->addKeyword('subpackage', $p);\r
-                    }\r
-                }\r
-                $tags = $this->_pv_dtemplate->listTags();\r
-                foreach ($tags as $tag) {\r
-                    $this->_pv_docblock->addTag($tag);\r
-                }\r
-                if (!count($this->_pv_docblock->params)) {\r
-                    $this->_pv_docblock->params = $this->_pv_dtemplate->params;\r
-                }\r
-                $my_desc->add($this->_pv_dtemplate->desc);\r
-            }\r
-            //echo "i = ".$this->_pv_periodline."; i < " . count($desc) . "\n";\r
-            $desci = '';\r
-            for ($i = 0; $i < count($desc); $i++) {\r
-                // the line will not be set if it doesn't start with a *\r
-                if (isset($desc[$i])) {\r
-                    $desci .= $desc[$i] . "\n";\r
-                }\r
-            }\r
-            $my_desc->add($this->getInlineTags($desci));\r
-        } else {\r
-            $sdesc = new parserDesc;\r
-            $save  = $desc;\r
-            // strip leading <p>\r
-            if (strpos($desc[0], '<p>') === 0) {\r
-                $desc[0] = substr($desc[0], 3);\r
-            }\r
-            $desci = '';\r
-            for ($i = 0; ($i <= $this->_pv_periodline) && ($i < count($desc)); $i++\r
-            ) {\r
-                if (strpos($desc[$i], '.') !== false) {\r
-                    $desci .= substr($desc[$i], 0, strpos($desc[$i], '.') + 1);\r
-                } else {\r
-                    $desci .= $desc[$i];\r
-                }\r
-                $desci .= "\n";\r
-            }\r
-            $sdesc->add($this->getInlineTags($desci));\r
-            $desc = $save;\r
-        \r
-            $my_desc = new parserDesc;\r
-            $desci   = '';\r
-            for ($i=0; $i < count($desc); $i++) {\r
-                if (isset($desc[$i])) {\r
-                    $desci .= $desci[$i] . "\n";\r
-                }\r
-            }\r
-            $my_desc->add($this->getInlineTags($desci));\r
-        }\r
-        \r
-        if ($this->_pf_internal) {\r
-            addError(PDERROR_INTERNAL_NOT_CLOSED);\r
-            $this->_pf_internal = false;\r
-        }\r
-        $this->$dtype->setShortDesc($sdesc);\r
-        $this->$dtype->setDesc($my_desc);\r
-        unset($my_desc);\r
-        //var_dump($this->$dtype);\r
-        //exit;\r
-    }\r
-    \r
-    /**\r
-     * Process the Long Description of a DocBlock\r
-     *\r
-     * @param array $desc array of lines containing the description\r
-     *                    with leading asterisk "*" stripped off.\r
-     *\r
-     * @return void\r
-     * @access private\r
-     */\r
-    function handleDesc($desc)\r
-    {\r
-        unset($this->_pv_periodline);\r
-        $this->_pf_useperiod = false;\r
-        foreach ($desc as $i => $line) {\r
-            $line = trim($line);\r
-            if (!isset($this->_pv_periodline) && \r
-                substr($line, strlen($line) - 1) == '.'\r
-            ) {\r
-                $this->_pv_periodline = $i;\r
-                $this->_pf_useperiod  = true;\r
-            }\r
-        }\r
-        if (!isset($this->_pv_periodline)) {\r
-            $this->_pv_periodline = 0;\r
-        }\r
-        if ($this->_pv_periodline > 3) {\r
-            $this->_pf_useperiod = false;\r
-        } else {\r
-            for ($i = 0; $i < $this->_pv_periodline; $i++) {\r
-                if (strlen($desc[$i]) == 0 && isset($desc[$i - 1]) && \r
-                    strlen($desc[$i - 1])\r
-                ) {\r
-                    $this->_pv_periodline = $i;\r
-                }\r
-            }\r
-        }\r
-        for ($i=0;$i <= $this->_pv_periodline && $i < count($desc);$i++) {\r
-            if (!strlen(trim($desc[$i]))) {\r
-                $this->_pf_useperiod = false;\r
-            }\r
-        }\r
-        // figure out the shortdesc\r
-        if ($this->_pf_useperiod === false) {\r
-            // use the first non blank line for short desc\r
-            for ($i = 0; $i < count($desc); $i++) {\r
-                if (strlen($desc[$i]) > 0) {\r
-                    $this->_pv_periodline = $i;\r
-                    $i                    = count($desc);\r
-                }\r
-            }\r
-        \r
-            // check to see if we are going to use a blank line to end the shortdesc\r
-            // this can only be in the first 4 lines\r
-            if (count($desc) > 4) {\r
-                $max = 4;\r
-            } else {\r
-                $max = count($desc);\r
-            }\r
-        \r
-            for ($i = $this->_pv_periodline; $i < $max; $i++) {\r
-                if (strlen(trim($desc[$i])) == 0) {\r
-                    $this->_pv_periodline = $i;\r
-                    $i                    = $max;\r
-                }\r
-            }\r
-        }\r
-\r
-        $dtype = $this->_pv_dtype;\r
-        if ($dtype == '_pv_docblock') {\r
-            $sdesc = new parserDesc;\r
-            $desci = '';\r
-            for ($i = 0; ($i <= $this->_pv_periodline) && ($i < count($desc)); $i++\r
-            ) {\r
-                $desci .= $desc[$i] . "\n";\r
-            }\r
-            $sdesc->add($this->getInlineTags($desci));\r
-            $this->_pv_periodline++;\r
-        \r
-            $my_desc = new parserDesc;\r
-            if (isset($this->_pv_dtemplate)) {\r
-                // copy template values if not overridden\r
-                if (!$this->_pv_docblock->getExplicitPackage()) {\r
-                    if ($p = $this->_pv_dtemplate->getKeyword('package')) {\r
-                        $this->_pv_docblock->addKeyword('package', $p);\r
-                        $this->_pv_docblock->setExplicitPackage();\r
-                    }\r
-                    if ($p = $this->_pv_dtemplate->getKeyword('category')) {\r
-                        $this->_pv_docblock->addKeyword('category', $p);\r
-                        $this->_pv_docblock->setExplicitCategory();\r
-                    }\r
-                    if ($p = $this->_pv_dtemplate->getKeyword('subpackage')) {\r
-                        $this->_pv_docblock->addKeyword('subpackage', $p);\r
-                    }\r
-                }\r
-                $tags = $this->_pv_dtemplate->listTags();\r
-                foreach ($tags as $tag) {\r
-                    $this->_pv_docblock->addTag($tag);\r
-                }\r
-                if (!count($this->_pv_docblock->params)) {\r
-                    $this->_pv_docblock->params = $this->_pv_dtemplate->params;\r
-                }\r
-                if (!$this->_pv_docblock->return) {\r
-                    $this->_pv_docblock->return = $this->_pv_dtemplate->return;\r
-                }\r
-                if (!$this->_pv_docblock->var) {\r
-                    $this->_pv_docblock->var = $this->_pv_dtemplate->var;\r
-                }\r
-                $my_desc->add($this->_pv_dtemplate->sdesc);\r
-                $my_desc->add($this->_pv_dtemplate->desc);\r
-            }\r
-            //echo "i = ".$this->_pv_periodline."; i < " . count($desc) . "\n";\r
-            $desci = '';\r
-            for ($i = $this->_pv_periodline; $i < count($desc); $i++) {\r
-                // the line will not be set if it doesn't start with a *\r
-                if (isset($desc[$i])) {\r
-                    $desci .= $desc[$i] . "\n";\r
-                }\r
-            }\r
-            $my_desc->add($this->getInlineTags($desci));\r
-        } else {\r
-            // this is a docblock template\r
-            $sdesc = new parserDesc;\r
-            $desci = '';\r
-            for ($i = 0; ($i <= $this->_pv_periodline) && ($i < count($desc)); $i++\r
-            ) {\r
-                if (isset($desc[$i])) {\r
-                    $desci .= $desc[$i] . "\n";\r
-                }\r
-            }\r
-            $sdesc->add($this->getInlineTags($desci));\r
-            $this->_pv_periodline++;\r
-        \r
-            $my_desc = new parserDesc;\r
-            $desci   = '';\r
-            for ($i=$this->_pv_periodline; $i < count($desc); $i++) {\r
-                if (isset($desc[$i])) {\r
-                    $desci .= $desc[$i] . "\n";\r
-                }\r
-            }\r
-            $my_desc->add($this->getInlineTags($desci));\r
-        }\r
-        if ($this->_pf_internal) {\r
-            addError(PDERROR_INTERNAL_NOT_CLOSED);\r
-            $this->_pf_internal = false;\r
-        }\r
-        $this->$dtype->setShortDesc($sdesc);\r
-        $this->$dtype->setDesc($my_desc);\r
-        unset($my_desc);\r
-        //var_dump($this->$dtype);\r
-        //exit;\r
-    }\r
-    \r
-    /**\r
-     * Process the tags of a DocBlock\r
-     *\r
-     * @param array $tags array of lines that contain all @tags\r
-     *\r
-     * @return void\r
-     * @access private\r
-     */\r
-    function handleTags($tags)\r
-    {\r
-        $newtags = array();\r
-        $curtag  = '';\r
-        for ($i=0; $i < count($tags); $i++) {\r
-            if (strpos(trim($tags[$i]), '@') === 0) {\r
-                $tags[$i] = ltrim($tags[$i]);\r
-            }\r
-            if (substr($tags[$i], 0, 1) == '@' && substr($tags[$i], 0, 2) != '@ '\r
-            ) {\r
-                // start a new tag\r
-                if (!empty($curtag)) {\r
-                    $newtags[] = $curtag;\r
-                }\r
-                $curtag = $tags[$i];\r
-            } else {\r
-                $curtag .= "\n" . $tags[$i];\r
-            }\r
-        }\r
-        if (!empty($curtag)) {\r
-            $newtags[] = $curtag;\r
-        }\r
-        foreach ($newtags as $tag) {\r
-            $x         = explode(' ', str_replace("\t", '    ', $tag));\r
-            $tagname   = trim(substr(array_shift($x), 1));\r
-            $restoftag = $x;\r
-            if (isset($this->tagHandlers[$tagname])) {\r
-                $handle = $this->tagHandlers[$tagname];\r
-            } else {\r
-                $handle = $this->tagHandlers['*'];\r
-            }\r
-            $this->$handle($tagname, $restoftag);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Process all inline tags in text, and convert them to their abstract\r
-     * object representations.\r
-     *\r
-     * @param string|array $value complete code to search for inline tags,\r
-     *                            if an array, it's an array of strings\r
-     *\r
-     * @return parserStringWithInlineTags\r
-     * @access private\r
-     */\r
-    function getInlineTags($value)\r
-    {\r
-        if (is_array($value)) {\r
-            $value = join("\n", $value);\r
-        }\r
-        global $_phpDocumentor_setting;\r
-        $priv = (isset($_phpDocumentor_setting['parseprivate']) && \r
-            $_phpDocumentor_setting['parseprivate'] == 'on');\r
-        $a    = new parserStringWithInlineTags();\r
-        if (!$priv && $this->_pf_internal) {\r
-            if ($x = strpos($value, '}}')) {\r
-                $x                  = strrpos($value, '}}');\r
-                $value              = substr($value, $x + 1);\r
-                $this->_pf_internal = false;\r
-            } else {\r
-                $value = '';\r
-            }\r
-        } elseif ($this->_pf_internal) {\r
-            if ($x = strpos($value, '}}')) {\r
-                $x     = strrpos($value, '}}');\r
-                $value = substr($value, 0, $x) . substr($value, $x+2);\r
-            }\r
-        }\r
-        $save   = $value;\r
-        $value  = explode('{@', $value);\r
-        $newval = array();\r
-        if ($priv || (!$priv && !$this->_pf_internal)) {\r
-            // ignore anything between {@internal and }}\r
-            $a->add($value[0]);\r
-        }\r
-        for ($i=1; $i < count($value); $i++) {\r
-            if (substr($value[$i], 0, 1) == '}') {\r
-                if ($priv || (!$priv && !$this->_pf_internal)) {\r
-                    // ignore anything between {@internal and }}\r
-                    $a->add('{@' . substr($value[$i], 1));\r
-                }\r
-            } elseif (substr($value[$i], 0, 2) == '*}') {\r
-                // used for inserting */ in code examples\r
-                if ($priv || (!$priv && !$this->_pf_internal)) {\r
-                    // ignore anything between {@internal and }}\r
-                    $a->add('*/' . substr($value[$i], 2));\r
-                }\r
-            } else {\r
-                $save      = $value[$i];\r
-                $value[$i] = split("[\t ]", str_replace("\t", '    ', $value[$i]));\r
-                $word      = trim(array_shift($value[$i]));\r
-                $val       = join(' ', $value[$i]);\r
-                if (trim($word) == 'internal') {\r
-                    if ($this->_pf_internal) {\r
-                        addErrorDie(PDERROR_NESTED_INTERNAL);\r
-                    }\r
-                    $this->_pf_internal = true;\r
-                    $value[$i]          = substr($save, strlen('internal') + 1);\r
-                    if (!$value[$i]) {\r
-                        // substr can set this to false\r
-                        $value[$i] = '';\r
-                    }\r
-                    if (strpos($value[$i], '}}') !== false) {\r
-                        $x = strrpos($value[$i], '}}');\r
-                        // strip internal and cycle as if it were normal text.\r
-                        $startval = substr($value[$i], 0, $x);\r
-                        if ($priv) {\r
-                            $a->add($startval);\r
-                        }\r
-                        $value[$i] = substr($value[$i], $x + 2);\r
-                        if (!$value[$i]) {\r
-                            $value[$i] = '';\r
-                        }\r
-                        $this->_pf_internal = false;\r
-                        $a->add($value[$i]);\r
-                        continue;\r
-                    } elseif ($priv) {\r
-                        $a->add($value[$i]);\r
-                    }\r
-                    continue;\r
-                }\r
-                if (in_array(str_replace('}', '', trim($word)),\r
-                    $this->allowableInlineTags)\r
-                ) {\r
-                    if (strpos($word, '}')) {\r
-                        $res  = substr($word, strpos($word, '}'));\r
-                        $word = str_replace('}', '', trim($word));\r
-                        $val  = $res . $val;\r
-                    }\r
-                    if ($priv || (!$priv && !$this->_pf_internal)) {\r
-                        // ignore anything between {@internal and }}\r
-                        if ($word == 'source') {\r
-                            $this->_pf_get_source = true;\r
-                        }\r
-                    }\r
-                    $val = explode('}', $val);\r
-                    if (count($val) == 1) {\r
-                           addError(PDERROR_UNTERMINATED_INLINE_TAG,\r
-                               $word, '', $save);\r
-                    }\r
-                    $rest = $val;\r
-                    $val  = array_shift($rest);\r
-                    $rest = join('}', $rest);\r
-                    if (isset($this->inlineTagHandlers[$word])) {\r
-                        $handle = $this->inlineTagHandlers[$word];\r
-                    } else {\r
-                        $handle = $this->inlineTagHandlers['*'];\r
-                    }\r
-                    $val = $this->$handle($word, $val);\r
-                    if ($priv || (!$priv && !$this->_pf_internal)) {\r
-                        // ignore anything between {@internal and }}\r
-                        $a->add($val);\r
-                    }\r
-                    if ($this->_pf_internal) {\r
-                        if (($x = strpos($rest, '}}')) !== false) {\r
-                            $value[$i] = $rest;\r
-                            $startval  = substr($value[$i], 0, $x);\r
-                            if ((false !== $startval) && $priv) {\r
-                                $a->add($startval);\r
-                            }\r
-                            $value[$i] = substr($value[$i], $x + 2);\r
-                            if (!$value[$i]) {\r
-                                $value[$i] = '';\r
-                            }\r
-                            $this->_pf_internal = false;\r
-                            $a->add($value[$i]);\r
-                        } else {\r
-                            $rest = explode('}}', $rest);\r
-                            if ($priv) {\r
-                                $a->add(array_shift($rest));\r
-                            }\r
-                            $this->_pf_internal = false;\r
-                            // try this line again without internal\r
-                            $value[$i--] = join('}}', $rest);\r
-                            continue;\r
-                        }\r
-                    } else {\r
-                        $a->add($rest);\r
-                    }\r
-                } else {\r
-                    $val = $word . ' ' . $val;\r
-                    if ($priv || (!$priv && !$this->_pf_internal)) {\r
-                        // ignore anything between {@internal and }}\r
-                        $a->add('{@' . $val);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        return $a;\r
-    }\r
-\r
-    /**#@+\r
-     * @param string $name name of the tag\r
-     * @param string $value any parameters passed to the inline tag\r
-     * @access private\r
-     */\r
-    /**\r
-     * Most inline tags require no special processing\r
-     *\r
-     * @return mixed some type of parser_*_InlineTag object\r
-     */\r
-    function handleDefaultInlineTag($name, $value)\r
-    {\r
-        $tag = 'parser' . ucfirst($name) . 'InlineTag';\r
-        return new $tag($value, $value);\r
-    }\r
-    \r
-    /**\r
-     * Handle the inline {@}link} tag\r
-     *\r
-     * @return parserLinkInlineTag\r
-     * @tutorial tags.inlinelink.pkg\r
-     */\r
-    function handleLinkInlineTag($name, $value)\r
-    {\r
-        // support hyperlinks of any protocol\r
-        if (is_numeric(strpos($value, '://')) || \r
-            (strpos(trim($value), 'mailto:') === 0)\r
-        ) {\r
-            $value = str_replace('\\,', '###commanana####', $value);\r
-            if (strpos($value, ',')) {\r
-                $val = new parserLinkInlineTag($value, $value);\r
-            } elseif (strpos(trim($value), ' ')) {\r
-                // if there is more than 1 parameter, \r
-                // the stuff after the space is the hyperlink text\r
-                $i1   = strpos(trim($value), ' ') + 1;\r
-                $link = substr(trim($value), 0, $i1 - 1);\r
-                $text = substr(trim($value), $i1);\r
-                $val  = new parserLinkInlineTag($link, $text);\r
-            } else {\r
-                $val = new parserLinkInlineTag($value, $value);\r
-            }\r
-        } else {\r
-            $value = str_replace('\\,', '###commanana####', $value);\r
-            if (!strpos($value, ',')) {\r
-                $testp = explode('#', $value);\r
-                if (count($testp) - 1) {\r
-                    $val = new parserLinkInlineTag($value, $testp[1]);\r
-                } else {\r
-                    $val = new parserLinkInlineTag($value, $value);\r
-                }\r
-            } else {\r
-                $val = new parserLinkInlineTag($value, $value);\r
-            }\r
-        }\r
-        return $val;\r
-    }\r
-    /**#@-*/\r
-\r
-    /**#@+\r
-     * @access private\r
-     * @param string $name name of tag\r
-     * @param array $value all words in the tag that were separated by a space ' '\r
-     * @return void\r
-     */\r
-    /**\r
-     * Most tags only need the value as a string\r
-     *\r
-     * @uses getInlineTags() all tag handlers check their values for inline tags\r
-     * @uses parserDocBlock::addKeyword()\r
-     */\r
-    function defaultTagHandler($name, $value)\r
-    {\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->addKeyword($name, $this->getInlineTags(join(' ', $value)));\r
-    }\r
-    \r
-    /**\r
-     * handles the @example tag\r
-     *\r
-     * @tutorial tags.example.pkg\r
-     * @uses parserDocBlock::addExample()\r
-     */\r
-    function exampleTagHandler($name, $value)\r
-    {\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->addExample($this->getInlineTags(join(' ', $value)),\r
-            $this->_path);\r
-    }\r
-    \r
-    /**\r
-     * handles the @filesource tag\r
-     *\r
-     * @tutorial tags.filesource.pkg\r
-     * @uses phpDocumentorTWordParser::getFileSource() retrieves the source for\r
-     *       use in the @filesource tag\r
-     * @uses parserDocBlock::addFileSource()\r
-     */\r
-    function filesourceTagHandler($name, $value)\r
-    {\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->addFileSource($this->_path, $this->_wp->getFileSource());\r
-    }\r
-    \r
-    /**\r
-     * handles the @uses tag\r
-     *\r
-     * @tutorial tags.uses.pkg\r
-     * @uses parserDocBlock::addUses()\r
-     */\r
-    function usesTagHandler($name, $value)\r
-    {\r
-        $dtype = $this->_pv_dtype;\r
-        $seel  = '';\r
-        while ($seel == '' && count($value)) {\r
-            $seel = array_shift($value);\r
-        }\r
-        $this->$dtype->addUses($this->getInlineTags($seel),\r
-            $this->getInlineTags(join(' ', $value)));\r
-    }\r
-    \r
-    /**\r
-     * handles the @author tag\r
-     *\r
-     * @tutorial tags.author.pkg\r
-     * @uses parserDocBlock::addKeyword()\r
-     */\r
-    function authorTagHandler($name, $value)\r
-    {\r
-        $dtype = $this->_pv_dtype;\r
-        $value = join(' ', $value);\r
-        if ((strpos($value, '<') !== false) && (strpos($value, '>') !== false)) {\r
-            $email = substr($value, \r
-                strpos($value, '<') + 1, \r
-                strpos($value, '>') - strpos($value, '<') - 1);\r
-            $value = str_replace('<' . $email . '>', \r
-                '<{@link mailto:' . $email . ' ' .  $email . '}>',\r
-                $value);\r
-        }\r
-        $this->$dtype->addKeyword('author', $this->getInlineTags($value));\r
-    }\r
-    \r
-    /**\r
-     * handles the @package tag\r
-     *\r
-     * @tutorial tags.package.pkg\r
-     * @uses parserDocBlock::setExplicitPackage()\r
-     */\r
-    function packageTagHandler($name, $value)\r
-    {\r
-        if (count($value) && empty($value[0])) {\r
-            $found = false;\r
-            // CRB - I believe this loop is correct in not having a body...\r
-            //       I think it is only to determine the $i value needed\r
-            //       by the one array_splice() call...\r
-            for ($i=0; $i < count($value) && !strlen($value[$i]); $i++);\r
-            array_splice($value, 0, $i);\r
-        }\r
-        $this->defaultTagHandler($name, $value);\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->setExplicitPackage();\r
-    }\r
-    \r
-    /**\r
-     * handles the @category tag\r
-     *\r
-     * @tutorial tags.category.pkg\r
-     * @uses parserDocBlock::setExplicitCategory()\r
-     */\r
-    function categoryTagHandler($name, $value)\r
-    {\r
-        if (count($value) && empty($value[0])) {\r
-            $found = false;\r
-            // CRB - I believe this loop is correct in not having a body...\r
-            //       I think it is only to determine the $i value needed\r
-            //       by the one array_splice() call...\r
-            for ($i=0; $i < count($value) && !strlen($value[$i]); $i++);\r
-            array_splice($value, 0, $i);\r
-        }\r
-        $this->defaultTagHandler($name, $value);\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->setExplicitCategory();\r
-    }\r
-    \r
-    /**\r
-     * handles the @global tag\r
-     *\r
-     * @tutorial tags.global.pkg\r
-     * @uses parserDocBlock::addFuncGlobal()\r
-     */\r
-    function globalTagHandler($name, $value)\r
-    {\r
-        $info = $this->retrieveType($value, true);\r
-        if (!$info) {\r
-            addError(PDERROR_MALFORMED_TAG, '@global');\r
-        }\r
-        $type  = $info['type'];\r
-        $var   = $info['var'];\r
-        $desc  = $info['desc'];\r
-        $dtype = $this->_pv_dtype;\r
-        if (!$var && empty($desc)) {\r
-            if ($type{0} == '$') {\r
-                addError(PDERROR_MALFORMED_GLOBAL_TAG);\r
-            }\r
-            return $this->$dtype->addFuncGlobal($type,\r
-                new parserStringWithInlineTags);\r
-        }\r
-        if ($var) {\r
-            // global define\r
-            $this->_pv_global_type = $type;\r
-            if (!empty($desc)) {\r
-                $var .= ' '.$desc;\r
-            }\r
-            $this->findGlobal(trim($var));\r
-        } elseif (!empty($desc)) {\r
-            // function global\r
-            if ($type{0} == '$') {\r
-                addError(PDERROR_MALFORMED_GLOBAL_TAG);\r
-            }\r
-            $this->$dtype->addFuncGlobal($type, $this->getInlineTags($desc));\r
-        } else {\r
-            addError(PDERROR_MALFORMED_GLOBAL_TAG);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handles the @staticvar tag\r
-     *\r
-     * @tutorial tags.staticvar.pkg\r
-     * @uses parserDocBlock::addStaticVar()\r
-     */\r
-    function staticvarTagHandler($name, $value)\r
-    {\r
-        $info = $this->retrieveType($value, true);\r
-        if (!$info) {\r
-            addError(PDERROR_MALFORMED_TAG, '@staticvar');\r
-        }\r
-        $type  = $info['type'];\r
-        $var   = $info['var'];\r
-        $desc  = $info['desc'];\r
-        $dtype = $this->_pv_dtype;\r
-        if (!$var && empty($desc)) {\r
-            $this->$dtype->addStaticVar(null, $type,\r
-                new parserStringWithInlineTags);\r
-        } else {\r
-            if ($var) {\r
-                $this->$dtype->addStaticVar($var, $type,\r
-                    $this->getInlineTags($desc));\r
-            } else {\r
-                $this->$dtype->addStaticVar(null, $type,\r
-                    $this->getInlineTags($desc));\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handles the @param tag\r
-     *\r
-     * @tutorial tags.param.pkg\r
-     * @uses parserDocBlock::addParam()\r
-     */\r
-    function paramTagHandler($name, $value)\r
-    {\r
-        $info = $this->retrieveType($value, true);\r
-        if (!$info) { \r
-            addError(PDERROR_MALFORMED_TAG, '@param');\r
-            return;\r
-        }\r
-        $type  = $info['type'];\r
-        $var   = $info['var'];\r
-        $desc  = $info['desc'];\r
-        $dtype = $this->_pv_dtype;\r
-        if (!$var && empty($desc)) {\r
-            $this->$dtype->addParam(null, $type, new parserStringWithInlineTags);\r
-        } else {\r
-            if ($var) {\r
-                $this->$dtype->addParam($var, $type, $this->getInlineTags($desc));\r
-            } else {\r
-                $this->$dtype->addParam(null, $type, $this->getInlineTags($desc));\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * handles the @return tag\r
-     *\r
-     * @tutorial tags.return.pkg\r
-     * @uses parserDocBlock::addReturn()\r
-     */\r
-    function returnTagHandler($name, $value)\r
-    {\r
-        $info = $this->retrieveType($value, true);\r
-        if (!$info) {\r
-            addError(PDERROR_MALFORMED_TAG, '@return'); \r
-            return;\r
-        }\r
-        $type  = $info['type'];\r
-        $desc  = $info['desc'];\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->addReturn($type, $this->getInlineTags($desc));\r
-    }\r
-    \r
-    /**\r
-     * handles the @var tag\r
-     *\r
-     * @tutorial tags.var.pkg\r
-     * @uses parserDocBlock::addVar()\r
-     */\r
-    function varTagHandler($name, $value)\r
-    {\r
-        $info = $this->retrieveType($value, true);\r
-        if (!$info) {\r
-            addError(PDERROR_MALFORMED_TAG, '@var');\r
-        }\r
-        $type  = $info['type'];\r
-        $desc  = $info['desc'];\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->addVar($type, $this->getInlineTags($desc));\r
-    }\r
-    \r
-    /**\r
-     * Handles @property(-read or -write) and @method magic tags\r
-     *\r
-     * @tutorial tags.method.pkg\r
-     * @tutorial tags.property.pkg\r
-     * @uses parserDocBlock::addProperty()\r
-     */\r
-    function propertyTagHandler($name, $value)\r
-    {\r
-        $info = $this->retrieveType($value, true);\r
-        if (!$info) {\r
-            addError(PDERROR_MALFORMED_TAG, '@' . $name);\r
-        }\r
-        $type  = $info['type'];\r
-        $var   = $info['var'];\r
-        $desc  = $info['desc'];\r
-        $dtype = $this->_pv_dtype;\r
-        $this->$dtype->addProperty($name, $var, $type, $this->getInlineTags($desc));\r
-    }\r
-    /**#@-*/\r
-\r
-    /**#@+\r
-     * @access private\r
-     */\r
-    \r
-    /**\r
-     * Retrieve the type portion of a @tag type description\r
-     *\r
-     * Tags like @param, @return and @var all have a PHP type portion in their\r
-     * description.  Since the type may contain the expression "object blah"\r
-     * where blah is a classname, it makes parsing out the type field complex.\r
-     *\r
-     * Even more complicated is the case where a tag variable can contain\r
-     * multiple types, such as object blah|object blah2|false, and so this\r
-     * method handles these cases.\r
-     *\r
-     * @param array $value       array of words that were separated by spaces\r
-     * @param bool  $checkforvar flag to determine whether to check for the end of a\r
-     *                           type is defined by a $varname\r
-     *\r
-     * @return bool|array FALSE if there is no value,\r
-     *     or an array of Format:\r
-     *    <pre>\r
-     *         array(\r
-     *             'type' => string,\r
-     *             'var'  => false|string variable name,\r
-     *             'desc' => rest of the tag\r
-     *         )\r
-     *    </pre>\r
-     */\r
-    function retrieveType($value, $checkforvar = false)\r
-    {\r
-        if (!count($value)) {\r
-            return false;\r
-        }\r
-        $result = array();\r
-        $types  = '';\r
-        // remove empty entries resulting from extra spaces between @tag and type\r
-        $this->_removeWhiteSpace($value, 0);\r
-        $index = 0;\r
-        if (trim($value[0]) == 'object') {\r
-            $types .= array_shift($value) . ' ';\r
-            $this->_removeWhiteSpace($value, 0);\r
-            if (!count($value)) {\r
-                // was just passed "object"\r
-                $result = array('type' => rtrim($types), 'desc' => '');\r
-                if ($checkforvar) {\r
-                    $result['var'] = false;\r
-                }\r
-                return $result;\r
-            }\r
-            if ($value[0]{0} == '$' || substr($value[0], 0, 2) == '&$') {\r
-                // was just passed "object" and the next thing is a variable name\r
-                $result['var']  = trim($value[0]);\r
-                $result['type'] = 'object';\r
-                array_shift($value);\r
-                $result['desc'] = join(' ', $value);\r
-                return $result;\r
-            }\r
-        }\r
-        $done = false;\r
-        do {\r
-            // this loop checks for type|type|type\r
-            // and for type|object classname|type|object classname2\r
-            if (strpos($value[0], '|')) {\r
-                $temptypes = explode('|', $value[0]);\r
-                while (count($temptypes)) {\r
-                    $type   = array_shift($temptypes);\r
-                    $types .= $type;\r
-                    if (count($temptypes)) {\r
-                        $types .= '|';\r
-                    }\r
-                }\r
-                if (trim($type) == 'object') {\r
-                    $types .= ' ';\r
-                    $this->_removeWhiteSpace($value, 0);\r
-                } else {\r
-                    $done = true;\r
-                }\r
-                array_shift($value);\r
-                if (isset ($value[0]) && strlen($value[0]) && ($value[0]{0} == '$' ||\r
-                    substr($value[0], 0, 2) == '&$')\r
-                ) {\r
-                    // was just passed "object" and the next thing is a variable name\r
-                    $result['var']  = trim($value[0]);\r
-                    $result['type'] = $types;\r
-                    array_shift($value);\r
-                    $result['desc'] = join(' ', $value);\r
-                    return $result;\r
-                }\r
-            } else {\r
-                $types .= $value[0];\r
-                array_shift($value);\r
-                $done = true;\r
-            }\r
-        } while (!$done && count($value));\r
-        $result['type'] = rtrim($types);\r
-        $this->_removeWhiteSpace($value, 0);\r
-        if ($checkforvar) {\r
-            if (!count($value)) {\r
-                $result['var'] = false;\r
-            } else {\r
-                /*\r
-                 * check for:\r
-                 *    variable name ($) \r
-                 *    var passed by reference (&$)\r
-                 *    method name (only used by magic method)\r
-                 */\r
-                if (substr($value[0], 0, 1) == '$' ||\r
-                    substr($value[0], 0, 2) == '&$' ||\r
-                    substr($value[0], -2, 2) == '()'\r
-                ) {\r
-                    $result['var'] = trim($value[0]);\r
-                    array_shift($value);\r
-                } else {\r
-                    $result['var'] = false;\r
-                }\r
-            }\r
-        }\r
-        $result['desc'] = join(' ', $value);\r
-        return $result;\r
-    }\r
-    \r
-    /**\r
-     * remove whitespace from a value\r
-     *\r
-     * @param array   &$value array of string\r
-     * @param integer $index  index to seek non-whitespace to\r
-     *\r
-     * @return void\r
-     */\r
-    function _removeWhiteSpace(&$value, $index)\r
-    {\r
-        if (count($value) > $index && empty($value[$index])) {\r
-            $found = false;\r
-            // CRB - I believe this loop is correct in not having a body...\r
-            //       I think it is only to determine the $i value needed\r
-            //       by the one array_splice() call...\r
-            for ($i=$index; $i < count($value) && !strlen($value[$i]); $i++);\r
-            array_splice($value, $index, $i - $index);\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Retrieve all the tokens that represent the definition of the global variable\r
-     *\r
-     * {@source}\r
-     *\r
-     * @param string $name the global variable to find\r
-     *\r
-     * @return void\r
-     */\r
-    function findGlobal($name)\r
-    {\r
-        $tokens = token_get_all('<?php ' . $name);\r
-        $tokens = array_slice($tokens, 1);\r
-        $this->_wp->findGlobal($tokens);\r
-        $this->_pv_findglobal = $name;\r
-    }\r
-\r
-    /**\r
-     * this function checks whether parameter $word \r
-     * is a token for pushing a new event onto the Event Stack.\r
-     *\r
-     * @param string $word   the word to check\r
-     * @param int    $pevent the event to push\r
-     *\r
-     * @return mixed returns false, or the event number\r
-     */\r
-    function checkEventPush($word, $pevent)\r
-    {\r
-        if (is_array($word) && $word[0] == T_STRING) {\r
-            $word = $word[1];\r
-        }\r
-        if (is_array($word)) {\r
-            $pushEvent = &$this->tokenpushEvent;\r
-            $word      = $word[0];\r
-        } else {\r
-            $pushEvent = &$this->wordpushEvent;\r
-            $word      = strtolower($word);\r
-        }\r
-        $e = false;\r
-        if (isset($pushEvent[$pevent])) {\r
-            if (isset($pushEvent[$pevent][$word])) {\r
-                $e = $pushEvent[$pevent][$word];\r
-            }\r
-        }\r
-        if ($e) {\r
-            $this->_event_stack->pushEvent($e);\r
-            return $e;\r
-        } else {\r
-            return false;\r
-        }\r
-    }\r
-\r
-    /**\r
-     * this function checks whether parameter $word \r
-     * is a token for popping the current event off of the Event Stack.\r
-     *\r
-     * @param string $word   the word to check\r
-     * @param int    $pevent the event to pop\r
-     *\r
-     * @return mixed returns false, or the event number popped off of the stack\r
-     */\r
-    function checkEventPop($word, $pevent)\r
-    {\r
-        if (is_array($word) && $word[0] == T_STRING) {\r
-            $word = $word[1];\r
-        }\r
-        if (is_array($word)) {\r
-            $popEvent = &$this->tokenpopEvent;\r
-            $word     = $word[0];\r
-        } else {\r
-            $popEvent = &$this->wordpopEvent;\r
-            $word     = strtolower($word);\r
-        }\r
-        if (!isset($popEvent[$pevent])) {\r
-            return false;\r
-        }\r
-        if (in_array($word, $popEvent[$pevent])) {\r
-            return $this->_event_stack->popEvent();\r
-        } else {\r
-            return false;\r
-        }\r
-    }\r
-\r
-    /**\r
-     * returns the token from the $word array\r
-     *\r
-     * @param mixed $word the token array\r
-     *\r
-     * @return mixed the token from the array,\r
-     *               or FALSE if it's not an array\r
-     */\r
-    function getToken($word)\r
-    {\r
-        if (is_array($word)) {\r
-            return $word[0];\r
-        }\r
-        return false;\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
-        unset($this->_wp);\r
-        $this->_wp                     = new phpDocumentorTWordParser;\r
-        $this->_pv_class               = null;\r
-        $this->_pv_cur_class           = null;\r
-        $this->_pv_define              = null;\r
-        $this->_pv_define_name         = null;\r
-        $this->_pv_define_value        = null;\r
-        $this->_pv_define_params_data  = null;\r
-        $this->_pv_dtype               = null;\r
-        $this->_pv_docblock            = null;\r
-        $this->_pv_dtemplate           = null;\r
-        $this->_pv_func                = null;\r
-        $this->_pv_findglobal          = null;\r
-        $this->_pv_global_name         = null;\r
-        $this->_pv_global_val          = null;\r
-        $this->_pv_globals             = null;\r
-        $this->_pv_global_count        = null;\r
-        $this->_pv_include_params_data = null;\r
-        $this->_pv_include_name        = null;\r
-        $this->_pv_include_value       = null;\r
-        $this->_pv_linenum             = null;\r
-        $this->_pv_periodline          = null;\r
-        $this->_pv_paren_count         = 0;\r
-        $this->_pv_statics             = null;\r
-        $this->_pv_static_count        = null;\r
-        $this->_pv_static_val          = null;\r
-        $this->_pv_quote_data          = null;\r
-        $this->_pv_function_data       = null;\r
-        $this->_pv_var                 = null;\r
-        $this->_pv_varname             = null;\r
-        $this->_pv_const               = null;\r
-        $this->_pv_constname           = null;\r
-        $this->_pv_function_param_type = null;\r
-        $this->_pf_definename_isset    = false;\r
-        $this->_pf_includename_isset   = false;\r
-        $this->_pf_get_source          = false;\r
-        $this->_pf_getting_source      = false;\r
-        $this->_pf_in_class            = false;\r
-        $this->_pf_in_define           = false;\r
-        $this->_pf_in_global           = false;\r
-        $this->_pf_in_include          = false;\r
-        $this->_pf_in_var              = false;\r
-        $this->_pf_in_const            = false;\r
-        $this->_pf_funcparam_val       = false;\r
-        $this->_pf_quote_active        = false;\r
-        $this->_pf_reset_quote_data    = true;\r
-        $this->_pf_useperiod           = false;\r
-        $this->_pf_var_equals          = false;\r
-        $this->_pf_const_equals        = false;\r
-        $this->_event_stack            = new EventStack;\r
-    }\r
-    \r
-    /**\r
-     * Creates the state arrays\r
-     *\r
-     * @return void\r
-     */\r
-    function setupEventStates()\r
-    {\r
-        if (!defined('T_DOC_COMMENT')) {\r
-            define('T_DOC_COMMENT', T_DOC_COMMENT);\r
-        }\r
-        /**************************************************************/\r
-\r
-        $this->wordpushEvent[PARSER_EVENT_LOGICBLOCK]  = \r
-            array(\r
-                "{" => PARSER_EVENT_LOGICBLOCK,\r
-                '"' => PARSER_EVENT_QUOTE,\r
-            );\r
-        $this->tokenpushEvent[PARSER_EVENT_LOGICBLOCK] =\r
-            array(\r
-                T_GLOBAL                   => PARSER_EVENT_FUNC_GLOBAL,\r
-                T_STATIC                   => PARSER_EVENT_STATIC_VAR,\r
-                T_START_HEREDOC            => PARSER_EVENT_EOFQUOTE,\r
-                T_CURLY_OPEN               => PARSER_EVENT_LOGICBLOCK,\r
-                T_DOLLAR_OPEN_CURLY_BRACES => PARSER_EVENT_LOGICBLOCK,\r
-            );\r
-\r
-        $this->wordpopEvent[PARSER_EVENT_LOGICBLOCK]  = array("}");\r
-        $this->tokenpopEvent[PARSER_EVENT_LOGICBLOCK] = array(T_CURLY_OPEN);\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_NOEVENTS] = \r
-            array(\r
-                T_OPEN_TAG => PARSER_EVENT_PHPCODE,\r
-            );\r
-\r
-        /**************************************************************/\r
-\r
-        $this->tokenpopEvent[PARSER_EVENT_EOFQUOTE] = array(T_END_HEREDOC);\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_PHPCODE] = \r
-            array(\r
-                T_FUNCTION     => PARSER_EVENT_FUNCTION,\r
-                T_ABSTRACT     => PARSER_EVENT_ACCESS_MODIFIER,\r
-                T_CLASS        => PARSER_EVENT_CLASS,\r
-                T_INTERFACE    => PARSER_EVENT_CLASS,\r
-                T_INCLUDE_ONCE => PARSER_EVENT_INCLUDE,\r
-                T_INCLUDE      => PARSER_EVENT_INCLUDE,\r
-                T_REQUIRE      => PARSER_EVENT_INCLUDE,\r
-                T_REQUIRE_ONCE => PARSER_EVENT_INCLUDE,\r
-                T_COMMENT      => PARSER_EVENT_DOCBLOCK,\r
-                T_DOC_COMMENT  => PARSER_EVENT_DOCBLOCK,\r
-                //"/**#@+"       => PARSER_EVENT_DOCBLOCK_TEMPLATE,\r
-                //"/**#@-*/"     => PARSER_EVENT_END_DOCBLOCK_TEMPLATE,\r
-                T_CLOSE_TAG    => PARSER_EVENT_OUTPHP,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_PHPCODE]  =\r
-            array(\r
-                "define" => PARSER_EVENT_DEFINE,\r
-            );\r
-        /**************************************************************/\r
-\r
-        $this->tokenpopEvent[PARSER_EVENT_OUTPHP] = array(T_OPEN_TAG);\r
-        /**************************************************************/\r
-\r
-        $this->wordpushEvent[PARSER_EVENT_FUNCTION]  =\r
-            array(\r
-                '{' => PARSER_EVENT_LOGICBLOCK,\r
-                '(' => PARSER_EVENT_FUNCTION_PARAMS,\r
-            );\r
-        $this->tokenpushEvent[PARSER_EVENT_FUNCTION] =\r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-\r
-        $this->wordpopEvent[PARSER_EVENT_FUNCTION] = array("}",';');\r
-        /**************************************************************/\r
-\r
-        $this->wordpopEvent[PARSER_EVENT_QUOTE] = array('"');\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_FUNCTION_PARAMS] =\r
-            array(\r
-                T_VARIABLE    => PARSER_EVENT_FUNCTION_PARAM_VAR,\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_FUNCTION_PARAMS]   = array(")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_FUNCTION_PARAM_VAR] =\r
-            array(\r
-                T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE,\r
-                T_COMMENT                  => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT              => PARSER_EVENT_COMMENT,\r
-                T_ARRAY                    => PARSER_EVENT_ARRAY,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_FUNCTION_PARAM_VAR]  =\r
-            array(\r
-                '"' => PARSER_EVENT_QUOTE,\r
-                "'" => PARSER_EVENT_QUOTE,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_FUNCTION_PARAM_VAR]   = array(",", ")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_ARRAY] = \r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_ARRAY]   = array(")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_VAR_ARRAY] = \r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_VAR_ARRAY_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_VAR_ARRAY_COMMENT,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_VAR_ARRAY]   = array(")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_FUNC_GLOBAL] =\r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_FUNC_GLOBAL]   = array(";");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_STATIC_VAR] =\r
-            array(\r
-                T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE,\r
-                T_COMMENT                  => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT              => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_STATIC_VAR]  =\r
-            array(\r
-                "=" => PARSER_EVENT_STATIC_VAR_VALUE,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_STATIC_VAR]   = array(";");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_STATIC_VAR_VALUE] = \r
-            array(\r
-                T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE,\r
-                T_COMMENT                  => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT              => PARSER_EVENT_COMMENT,\r
-                T_ARRAY                    => PARSER_EVENT_ARRAY,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_STATIC_VAR_VALUE]  =\r
-            array(\r
-                '"' => PARSER_EVENT_QUOTE,\r
-                "'" => PARSER_EVENT_QUOTE,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_STATIC_VAR_VALUE]   = array(";",",");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_DEFINE] = \r
-            array(\r
-                T_COMMENT                  => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT              => PARSER_EVENT_COMMENT,\r
-                T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_DEFINE]  = \r
-            array(\r
-                "(" => PARSER_EVENT_DEFINE_PARAMS,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_DEFINE]   = array(";");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_INCLUDE] = \r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_INCLUDE]  = \r
-            array(\r
-                "(" => PARSER_EVENT_INCLUDE_PARAMS,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_INCLUDE]   = array(";");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_DEFINE_PARAMS] = \r
-            array(\r
-                T_COMMENT       => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT   => PARSER_EVENT_COMMENT,\r
-                T_START_HEREDOC => PARSER_EVENT_EOFQUOTE,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_DEFINE_PARAMS]  = \r
-            array(\r
-                "(" => PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS,\r
-                '"' => PARSER_EVENT_QUOTE,\r
-                "'" => PARSER_EVENT_QUOTE,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_DEFINE_PARAMS]   = array(")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_INCLUDE_PARAMS] = \r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_INCLUDE_PARAMS]  = \r
-            array(\r
-                "(" => PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_INCLUDE_PARAMS]   = array(")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS] =\r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS]  =\r
-            array(\r
-                "(" => PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS,\r
-                '"' => PARSER_EVENT_QUOTE,\r
-                "'" => PARSER_EVENT_QUOTE,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS]   = array(")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS] =\r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS]  =\r
-            array(\r
-                "(" => PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS]   = array(")");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_VAR] = \r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-                T_ARRAY       => PARSER_EVENT_VAR_ARRAY,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_VAR]   = array(";");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_CLASS_CONSTANT] = \r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-                T_ARRAY       => PARSER_EVENT_VAR_ARRAY,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_CLASS_CONSTANT]   = array(";");\r
-        /**************************************************************/\r
-\r
-        $this->wordpopEvent[PARSER_EVENT_IMPLEMENTS] = array('{');\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_CLASS] = \r
-            array(\r
-                T_ABSTRACT    => PARSER_EVENT_ACCESS_MODIFIER,\r
-                T_PUBLIC      => PARSER_EVENT_ACCESS_MODIFIER,\r
-                T_PRIVATE     => PARSER_EVENT_ACCESS_MODIFIER,\r
-                T_PROTECTED   => PARSER_EVENT_ACCESS_MODIFIER,\r
-                T_STATIC      => PARSER_EVENT_ACCESS_MODIFIER,\r
-                T_IMPLEMENTS  => PARSER_EVENT_IMPLEMENTS,\r
-                T_CONST       => PARSER_EVENT_CLASS_CONSTANT,\r
-                T_FUNCTION    => PARSER_EVENT_FUNCTION,\r
-                T_VAR         => PARSER_EVENT_VAR,\r
-                T_COMMENT     => PARSER_EVENT_DOCBLOCK,\r
-                T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK,\r
-                T_CLOSE_TAG   => PARSER_EVENT_OUTPHP,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_CLASS]   = array("}");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_DEFINE_GLOBAL] = \r
-            array(\r
-                T_COMMENT     => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT => PARSER_EVENT_COMMENT,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_DEFINE_GLOBAL]  = \r
-            array(\r
-                "=" => PARSER_EVENT_GLOBAL_VALUE,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_DEFINE_GLOBAL]   = array(";");\r
-        /**************************************************************/\r
-\r
-        $this->tokenpushEvent[PARSER_EVENT_GLOBAL_VALUE] = \r
-            array(\r
-                T_ARRAY         => PARSER_EVENT_ARRAY,\r
-                T_COMMENT       => PARSER_EVENT_COMMENT,\r
-                T_DOC_COMMENT   => PARSER_EVENT_COMMENT,\r
-                T_START_HEREDOC => PARSER_EVENT_EOFQUOTE,\r
-            );\r
-        $this->wordpushEvent[PARSER_EVENT_GLOBAL_VALUE]  =\r
-            array(\r
-                '"' => PARSER_EVENT_QUOTE,\r
-                "'" => PARSER_EVENT_QUOTE,\r
-            );\r
-        $this->wordpopEvent[PARSER_EVENT_GLOBAL_VALUE]   = array(";");\r
-    }\r
-    \r
-    /**\r
-     * initializes all the setup\r
-     *\r
-     * @param mixed &$data the data parser (?)\r
-     *\r
-     * @return void\r
-     */\r
-    function configWordParser(&$data)\r
-    {\r
-        $this->_wp->setup($data);\r
-        $this->_wp->setWhitespace(false);\r
-    }\r
-\r
-    /**#@-*/\r
-\r
-}\r
-?>\r