* @version $Id: EventStack.inc,v 1.1 2005/10/17 18:36:55 jeichorn Exp $ * @package phpDocumentor */ /** * An event Stack * * @author Joshua Eichorn * @version $Id: EventStack.inc,v 1.1 2005/10/17 18:36:55 jeichorn Exp $ * @package phpDocumentor */ class EventStack { /** * The stack * @var array */ var $stack = array(PARSER_EVENT_NOEVENTS); /** * The number of events in the stack * @var integer */ var $num = 0; /** * Push an event onto the stack * * @param int $event All events must be constants */ function pushEvent($event) { $this->num = array_push($this->stack,$event) - 1; } /** * Pop an event from the stack * * @return int An event */ function popEvent() { $this->num--; return array_pop($this->stack); } /** * Get the current event * * @return int An event */ function getEvent() { return $this->stack[$this->num]; } }