PHPExcel_Calculation
[ class tree: PHPExcel_Calculation ] [ index: PHPExcel_Calculation ] [ all elements ]

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.  */
  27.  
  28.  
  29.  
  30.     private $_stack array();
  31.     private $_count 0;
  32.  
  33.  
  34.     public function count({
  35.         return $this->_count;
  36.     }    //    function count()
  37.  
  38.  
  39.     public function push($type,$value,$reference=null{
  40.         $this->_stack[$this->_count++array('type'        => $type,
  41.                                                'value'        => $value,
  42.                                                'reference'    => $reference
  43.                                               );
  44.         if ($type == 'Function'{
  45.             $localeFunction PHPExcel_Calculation::_localeFunc($value);
  46.             if ($localeFunction != $value{
  47.                 $this->_stack[($this->_count 1)]['localeValue'$localeFunction;
  48.             }
  49.         }
  50.     }    //    function push()
  51.  
  52.  
  53.     public function pop({
  54.         if ($this->_count 0{
  55.             return $this->_stack[--$this->_count];
  56.         }
  57.         return null;
  58.     }    //    function pop()
  59.  
  60.  
  61.     public function last($n=1{
  62.         if ($this->_count-$n 0{
  63.             return null;
  64.         }
  65.         return $this->_stack[$this->_count-$n];
  66.     }    //    function last()
  67.  
  68.  
  69.     function __construct({
  70.     }
  71.  
  72. }    //    class PHPExcel_Calculation_Token_Stack

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