Class Spreadsheet_Excel_Writer_Parser

Description

Class for parsing Excel formulas

  • author: Xavier Noguer <xnoguer@rezebra.com>
  • version: Release: 1.9.0
  • copyright: 1997-2006 The PHP Group

Located in /web/plugin/feature/sms_excel/lib/external/Spreadsheet/Excel/Writer/Parser.php (line 110)

PEAR
   |
   --Spreadsheet_Excel_Writer_Parser
Variable Summary
 integer $_BIFF_version
 integer $_byte_order
 integer $_current_char
 array $_ext_sheets
 string $_formula
 string $_lookahead
 string $_parse_tree
 array $_references
Method Summary
 Spreadsheet_Excel_Writer_Parser Spreadsheet_Excel_Writer_Parser (integer $byte_order,  $biff_version)
 mixed parse (string $formula)
 void setExtSheet (string $name, integer $index)
 string toReversePolish ([array $tree = array()])
Variables
integer $_BIFF_version (line 164)

The BIFF version for the workbook

integer $_byte_order (line 146)

The byte order. 1 => big endian, 0 => little endian.

integer $_current_char (line 116)

The index of the character we are currently looking at

string $_current_token (line 122)

The token we are working on.

array $_ext_sheets (line 152)

Array of external sheets

string $_formula (line 128)

The formula to parse

string $_lookahead (line 134)

The character ahead of the current char

string $_parse_tree (line 140)

The parse tree to be generated

array $_references (line 158)

Array of sheet references in the form of REF structures

Methods
Constructor Spreadsheet_Excel_Writer_Parser (line 172)

The class constructor

Spreadsheet_Excel_Writer_Parser Spreadsheet_Excel_Writer_Parser (integer $byte_order,  $biff_version)
  • integer $byte_order: The byte order (Little endian or Big endian) of the architecture
  • $biff_version
parse (line 1289)

The parsing method. It parses a formula.

  • return: true on success, PEAR_Error on failure
  • access: public
mixed parse (string $formula)
  • string $formula: The formula to parse, without the initial equal sign (=).
setExtSheet (line 984)

This method is used to update the array of sheet names. It is called by the addWorksheet() method of the Spreadsheet_Excel_Writer_Workbook class.

void setExtSheet (string $name, integer $index)
  • string $name: The name of the worksheet being added
  • integer $index: The index of the worksheet being added
toReversePolish (line 1643)

Builds a string containing the tree in reverse polish notation (What you would use in a HP calculator stack).

The following tree:

+ / \ 2 3

produces: "23+"

The following tree:

+ / \ 3 * / \ 6 A1

produces: "36A1*+"

In fact all operands, functions, references, etc... are written as ptg's

  • return: The tree in reverse polish notation
  • access: public
string toReversePolish ([array $tree = array()])
  • array $tree: The optional tree to convert.

Inherited Methods

Inherited From PEAR

 PEAR::PEAR()
 PEAR::delExpect()
 PEAR::expectError()
 PEAR::getStaticProperty()
 PEAR::isError()
 PEAR::loadExtension()
 PEAR::popErrorHandling()
 PEAR::popExpect()
 PEAR::pushErrorHandling()
 PEAR::raiseError()
 PEAR::registerShutdownFunc()
 PEAR::setErrorHandling()
 PEAR::staticPopErrorHandling()
 PEAR::staticPushErrorHandling()
 PEAR::throwError()
 PEAR::_PEAR()

Documentation generated on Wed, 09 Feb 2011 09:03:02 +0700 by phpDocumentor 1.4.2