PHPExcel_Calculation

# Source for file Stack.php

Documentation is available at Stack.php

1. <?php
2. /**
3. * PHPExcel
4. *
5. * Copyright (c) 2006 - 2012 PHPExcel
6. *
7. * This library is free software; you can redistribute it and/or
8. * modify it under the terms of the GNU Lesser General Public
9. * License as published by the Free Software Foundation; either
10. * version 2.1 of the License, or (at your option) any later version.
11. *
12. * This library is distributed in the hope that it will be useful,
13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15. * Lesser General Public License for more details.
16. *
17. * You should have received a copy of the GNU Lesser General Public
18. * License along with this library; if not, write to the Free Software
19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20. *
21. * @category PHPExcel
22. * @package PHPExcel_Calculation
23. * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25. * @version 1.7.8, 2012-10-12
26. */
29. class PHPExcel_Calculation_Token_Stack {
31. private $_stack = array();
32. private $_count = 0;
35. public function count () {
36. return $this->_count;
37. } // function count()
40. public function push ($type,$value,$reference=null) {
41. $this->_stack[$this->_count++] = array('type' => $type,
42. 'value' => $value,
43. 'reference' => $reference
44. );
45. if ($type == 'Function') {
46. $localeFunction = PHPExcel_Calculation :: _localeFunc ($value);
47. if ($localeFunction != $value) {
48. $this->_stack[($this->_count - 1)]['localeValue'] = $localeFunction;
49. }
50. }
51. } // function push()
54. public function pop () {
55. if ($this->_count > 0) {
56. return $this->_stack[--$this->_count];
57. }
58. return null;
59. } // function pop()
62. public function last ($n=1) {
63. if ($this->_count-$n < 0) {
64. return null;
65. }
66. return $this->_stack[$this->_count-$n];
67. } // function last()
70. function __construct () {
71. }
73. } // class PHPExcel_Calculation_Token_Stack

Documentation generated on Fri, 12 Oct 2012 00:17:48 +0200 by phpDocumentor 1.4.4