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

Source for file FormulaToken.php

Documentation is available at FormulaToken.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.7.6, 2011-02-27
  26.  */
  27.  
  28.  
  29. /*
  30. PARTLY BASED ON:
  31.     Copyright (c) 2007 E. W. Bachtal, Inc.
  32.  
  33.     Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  34.     and associated documentation files (the "Software"), to deal in the Software without restriction,
  35.     including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
  36.     and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
  37.     subject to the following conditions:
  38.  
  39.       The above copyright notice and this permission notice shall be included in all copies or substantial
  40.       portions of the Software.
  41.  
  42.     The software is provided "as is", without warranty of any kind, express or implied, including but not
  43.     limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
  44.     no event shall the authors or copyright holders be liable for any claim, damages or other liability,
  45.     whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
  46.     software or the use or other dealings in the software.
  47.  
  48.     http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
  49.     http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
  50. */
  51.  
  52.  
  53. /**
  54.  * PHPExcel_Calculation_FormulaToken
  55.  *
  56.  * @category   PHPExcel
  57.  * @package    PHPExcel_Calculation
  58.  * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
  59.  */
  60.     /* Token types */
  61.     const TOKEN_TYPE_NOOP                    'Noop';
  62.     const TOKEN_TYPE_OPERAND                'Operand';
  63.     const TOKEN_TYPE_FUNCTION                'Function';
  64.     const TOKEN_TYPE_SUBEXPRESSION            'Subexpression';
  65.     const TOKEN_TYPE_ARGUMENT                'Argument';
  66.     const TOKEN_TYPE_OPERATORPREFIX            'OperatorPrefix';
  67.     const TOKEN_TYPE_OPERATORINFIX            'OperatorInfix';
  68.     const TOKEN_TYPE_OPERATORPOSTFIX        'OperatorPostfix';
  69.     const TOKEN_TYPE_WHITESPACE                'Whitespace';
  70.     const TOKEN_TYPE_UNKNOWN                'Unknown';
  71.  
  72.     /* Token subtypes */
  73.     const TOKEN_SUBTYPE_NOTHING                'Nothing';
  74.     const TOKEN_SUBTYPE_START                'Start';
  75.     const TOKEN_SUBTYPE_STOP                'Stop';
  76.     const TOKEN_SUBTYPE_TEXT                'Text';
  77.     const TOKEN_SUBTYPE_NUMBER                'Number';
  78.     const TOKEN_SUBTYPE_LOGICAL                'Logical';
  79.     const TOKEN_SUBTYPE_ERROR                'Error';
  80.     const TOKEN_SUBTYPE_RANGE                'Range';
  81.     const TOKEN_SUBTYPE_MATH                'Math';
  82.     const TOKEN_SUBTYPE_CONCATENATION        'Concatenation';
  83.     const TOKEN_SUBTYPE_INTERSECTION        'Intersection';
  84.     const TOKEN_SUBTYPE_UNION                'Union';
  85.  
  86.     /**
  87.      * Value
  88.      *
  89.      * @var string 
  90.      */
  91.     private $_value;
  92.  
  93.     /**
  94.      * Token Type (represented by TOKEN_TYPE_*)
  95.      *
  96.      * @var string 
  97.      */
  98.     private $_tokenType;
  99.  
  100.     /**
  101.      * Token SubType (represented by TOKEN_SUBTYPE_*)
  102.      *
  103.      * @var string 
  104.      */
  105.     private $_tokenSubType;
  106.  
  107.     /**
  108.      * Create a new PHPExcel_Calculation_FormulaToken
  109.      *
  110.      * @param string    $pValue 
  111.      * @param string    $pTokenType     Token type (represented by TOKEN_TYPE_*)
  112.      * @param string    $pTokenSubType     Token Subtype (represented by TOKEN_SUBTYPE_*)
  113.      */
  114.     public function __construct($pValue$pTokenType PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN$pTokenSubType PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING)
  115.     {
  116.         // Initialise values
  117.         $this->_value                $pValue;
  118.         $this->_tokenType            $pTokenType;
  119.         $this->_tokenSubType         $pTokenSubType;
  120.     }
  121.  
  122.     /**
  123.      * Get Value
  124.      *
  125.      * @return string 
  126.      */
  127.     public function getValue({
  128.         return $this->_value;
  129.     }
  130.  
  131.     /**
  132.      * Set Value
  133.      *
  134.      * @param string    $value 
  135.      */
  136.     public function setValue($value{
  137.         $this->_value $value;
  138.     }
  139.  
  140.     /**
  141.      * Get Token Type (represented by TOKEN_TYPE_*)
  142.      *
  143.      * @return string 
  144.      */
  145.     public function getTokenType({
  146.         return $this->_tokenType;
  147.     }
  148.  
  149.     /**
  150.      * Set Token Type
  151.      *
  152.      * @param string    $value 
  153.      */
  154.     public function setTokenType($value PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN{
  155.         $this->_tokenType $value;
  156.     }
  157.  
  158.     /**
  159.      * Get Token SubType (represented by TOKEN_SUBTYPE_*)
  160.      *
  161.      * @return string 
  162.      */
  163.     public function getTokenSubType({
  164.         return $this->_tokenSubType;
  165.     }
  166.  
  167.     /**
  168.      * Set Token SubType
  169.      *
  170.      * @param string    $value 
  171.      */
  172.     public function setTokenSubType($value PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING{
  173.         $this->_tokenSubType $value;
  174.     }
  175. }

Documentation generated on Sun, 27 Feb 2011 16:31:48 -0800 by phpDocumentor 1.4.3