ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Stack.php
Go to the documentation of this file.
1<?php
37
43 private $_stack = array();
44
50 private $_count = 0;
51
52
58 public function count() {
59 return $this->_count;
60 } // function count()
61
69 public function push($type, $value, $reference = NULL) {
70 $this->_stack[$this->_count++] = array('type' => $type,
71 'value' => $value,
72 'reference' => $reference
73 );
74 if ($type == 'Function') {
75 $localeFunction = PHPExcel_Calculation::_localeFunc($value);
76 if ($localeFunction != $value) {
77 $this->_stack[($this->_count - 1)]['localeValue'] = $localeFunction;
78 }
79 }
80 } // function push()
81
87 public function pop() {
88 if ($this->_count > 0) {
89 return $this->_stack[--$this->_count];
90 }
91 return NULL;
92 } // function pop()
93
100 public function last($n = 1) {
101 if ($this->_count - $n < 0) {
102 return NULL;
103 }
104 return $this->_stack[$this->_count - $n];
105 } // function last()
106
110 function clear() {
111 $this->_stack = array();
112 $this->_count = 0;
113 }
114
115} // class PHPExcel_Calculation_Token_Stack
$n
Definition: RandomTest.php:80
An exception for terminatinating execution or to throw for unit testing.
clear()
Clear the stack.
Definition: Stack.php:110
count()
Return the number of entries on the stack.
Definition: Stack.php:58
last($n=1)
Return an entry from the stack without removing it.
Definition: Stack.php:100
push($type, $value, $reference=NULL)
Push a new entry onto the stack.
Definition: Stack.php:69
pop()
Pop the last entry from the stack.
Definition: Stack.php:87
static _localeFunc($function)