home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / EventStack.inc < prev    next >
Encoding:
Text File  |  2004-03-24  |  2.4 KB  |  79 lines

  1. <?php
  2. //
  3. // +------------------------------------------------------------------------+
  4. // | phpDocumentor                                                          |
  5. // +------------------------------------------------------------------------+
  6. // | Copyright (c) 2000-2003 Joshua Eichorn, Gregory Beaver                 |
  7. // | Email         jeichorn@phpdoc.org, cellog@phpdoc.org                   |
  8. // | Web           http://www.phpdoc.org                                    |
  9. // | Mirror        http://phpdocu.sourceforge.net/                          |
  10. // | PEAR          http://pear.php.net/package-info.php?pacid=137           |
  11. // +------------------------------------------------------------------------+
  12. // | This source file is subject to version 3.00 of the PHP License,        |
  13. // | that is available at http://www.php.net/license/3_0.txt.               |
  14. // | If you did not receive a copy of the PHP license and are unable to     |
  15. // | obtain it through the world-wide-web, please send a note to            |
  16. // | license@php.net so we can mail you a copy immediately.                 |
  17. // +------------------------------------------------------------------------+
  18. //
  19.  
  20. /**
  21.  * An event Stack
  22.  * 
  23.  * @author    Joshua Eichorn <jeichorn@phpdoc.org>
  24.  * @version    $Id: EventStack.inc,v 1.8.2.1 2003/06/03 05:44:52 CelloG Exp $
  25.  * @package     phpDocumentor
  26.  */
  27. /**
  28.  * An event Stack
  29.  * 
  30.  * @author    Joshua Eichorn <jeichorn@phpdoc.org>
  31.  * @version    $Id: EventStack.inc,v 1.8.2.1 2003/06/03 05:44:52 CelloG Exp $
  32.  * @package     phpDocumentor
  33.  */
  34. class EventStack
  35. {
  36.     /**
  37.      * The stack
  38.      * @var array
  39.      */
  40.     var $stack = array(PARSER_EVENT_NOEVENTS);
  41.  
  42.     /**
  43.      * The number of events in the stack
  44.      * @var integer
  45.      */
  46.     var $num = 0;
  47.  
  48.     /**
  49.      * Push an event onto the stack
  50.      *
  51.      * @param    int    $event    All events must be constants
  52.      */
  53.     function pushEvent($event)
  54.     {
  55.         $this->num = array_push($this->stack,$event) - 1;
  56.     }
  57.  
  58.     /**
  59.      * Pop an event from the stack
  60.      *
  61.      * @return    int    An event
  62.      */
  63.     function popEvent()
  64.     {
  65.         $this->num--;
  66.         return array_pop($this->stack);
  67.     }
  68.  
  69.     /**
  70.      * Get the current event
  71.      *
  72.      * @return    int    An event
  73.      */
  74.     function getEvent()
  75.     {
  76.         return $this->stack[$this->num];
  77.     }
  78. }
  79.