summaryrefslogtreecommitdiff
path: root/buildscripts/PhpDocumentor/phpDocumentor/EventStack.inc
blob: 5e2690e84fc26624cf947021a0979c1424e53d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
//
// +------------------------------------------------------------------------+
// | phpDocumentor                                                          |
// +------------------------------------------------------------------------+
// | Copyright (c) 2000-2003 Joshua Eichorn, Gregory Beaver                 |
// | Email         jeichorn@phpdoc.org, cellog@phpdoc.org                   |
// | Web           http://www.phpdoc.org                                    |
// | Mirror        http://phpdocu.sourceforge.net/                          |
// | PEAR          http://pear.php.net/package-info.php?pacid=137           |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License,        |
// | that is available at http://www.php.net/license/3_0.txt.               |
// | If you did not receive a copy of the PHP license and are unable to     |
// | obtain it through the world-wide-web, please send a note to            |
// | license@php.net so we can mail you a copy immediately.                 |
// +------------------------------------------------------------------------+
//

/**
 * An event Stack
 * 
 * @author    Joshua Eichorn <jeichorn@phpdoc.org>
 * @version    $Id: EventStack.inc,v 1.1 2005/10/17 18:36:55 jeichorn Exp $
 * @package     phpDocumentor
 */
/**
 * An event Stack
 * 
 * @author    Joshua Eichorn <jeichorn@phpdoc.org>
 * @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];
    }
}