3 * An Event Stack for inter-program communication, particularly for parsing
\r
5 * phpDocumentor :: automatic documentation generator
\r
7 * PHP versions 4 and 5
\r
9 * Copyright (c) 2000-2007 Joshua Eichorn
\r
13 * This library is free software; you can redistribute it
\r
14 * and/or modify it under the terms of the GNU Lesser General
\r
15 * Public License as published by the Free Software Foundation;
\r
16 * either version 2.1 of the License, or (at your option) any
\r
19 * This library is distributed in the hope that it will be useful,
\r
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
22 * Lesser General Public License for more details.
\r
24 * You should have received a copy of the GNU Lesser General Public
\r
25 * License along with this library; if not, write to the Free Software
\r
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
28 * @category ToolsAndUtilities
\r
29 * @package phpDocumentor
\r
30 * @author Joshua Eichorn <jeichorn@phpdoc.org>
\r
31 * @copyright 2000-2007 Joshua Eichorn
\r
32 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
\r
33 * @version CVS: $Id: EventStack.inc,v 1.4 2007/10/10 02:27:28 ashnazg Exp $
\r
35 * @link http://www.phpdoc.org
\r
36 * @link http://pear.php.net/PhpDocumentor
\r
38 * @todo CS cleanup - change package to PhpDocumentor
\r
43 * @category ToolsAndUtilities
\r
44 * @package phpDocumentor
\r
45 * @author Joshua Eichorn <jeichorn@phpdoc.org>
\r
46 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
\r
47 * @version Release: 1.4.1
\r
48 * @link http://www.phpdoc.org
\r
49 * @link http://pear.php.net/PhpDocumentor
\r
50 * @todo CS cleanup - change package to PhpDocumentor
\r
58 var $stack = array(PARSER_EVENT_NOEVENTS);
\r
61 * The number of events in the stack
\r
67 * Push an event onto the stack
\r
69 * @param int $event All events must be constants
\r
73 function pushEvent($event)
\r
75 $this->num = array_push($this->stack, $event) - 1;
\r
79 * Pop an event from the stack
\r
81 * @return int An event
\r
86 return array_pop($this->stack);
\r
90 * Get the current event
\r
92 * @return int An event
\r
96 return $this->stack[$this->num];
\r