Class: Spreadsheet_Excel_Writer_Parser
Source Location: /main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/Parser.php
PEAR
|
--Spreadsheet_Excel_Writer_Parser
Class for parsing Excel formulas
Author(s):
Version:
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Class Methods
constructor Spreadsheet_Excel_Writer_Parser [line 168]
Spreadsheet_Excel_Writer_Parser Spreadsheet_Excel_Writer_Parser(
integer
$byte_order,
$biff_version)
|
|
The class constructor
Parameters:
method parse [line 1282]
mixed parse(
string
$formula)
|
|
The parsing method. It parses a formula.
Tags:
Parameters:
method setExtSheet [line 980]
void setExtSheet(
string
$name, integer
$index)
|
|
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.
Tags:
Parameters:
method toReversePolish [line 1629]
string toReversePolish(
[array
$tree = array()])
|
|
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
Tags:
Parameters:
method _advance [line 1104]
Advance to the next valid token.
Tags:
method _cellToPackedRowcol [line 992]
array _cellToPackedRowcol(
string
$cell)
|
|
pack() row and column into the required 3 or 4 byte format.
Tags:
Parameters:
method _cellToRowcol [line 1074]
array _cellToRowcol(
string
$cell)
|
|
Convert an Excel cell reference such as A1 or $B2 or C$3 or $D$4 to a zero indexed row and column number. Also returns two (0,1) values to indicate whether the row or column are relative references.
Tags:
Parameters:
method _condition [line 1302]
It parses a condition. It assumes the following rule: Cond -> Expr [(">" | "<") Expr]
Tags:
method _convert [line 539]
mixed _convert(
mixed
$token)
|
|
Convert a token to the proper ptg value.
Tags:
Parameters:
method _convertFunction [line 645]
string _convertFunction(
string
$token, integer
$num_args)
|
|
Convert a function to a ptgFunc or ptgFuncVarV depending on the number of args that it takes.
Tags:
Parameters:
method _convertNumber [line 599]
void _convertNumber(
mixed
$num)
|
|
Convert a number token to ptgInt or ptgNum
Tags:
Parameters:
method _convertRange2d [line 666]
void _convertRange2d(
string
$range)
|
|
Convert an Excel range such as A1:D4 to a ptgRefV.
Tags:
Parameters:
method _convertRange3d [line 715]
mixed _convertRange3d(
string
$token)
|
|
Convert an Excel 3d range such as "Sheet1!A1:D4" or "Sheet1:Sheet2!A1:D4" to a ptgArea3d.
Tags:
Parameters:
method _convertRef2d [line 779]
string _convertRef2d(
string
$cell)
|
|
Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV.
Tags:
Parameters:
method _convertRef3d [line 812]
mixed _convertRef3d(
string
$cell)
|
|
Convert an Excel 3d reference such as "Sheet1!A1" or "Sheet1:Sheet2!A1" to a ptgRef3d.
Tags:
Parameters:
method _convertString [line 620]
mixed _convertString(
string
$string)
|
|
Convert a string token to ptgStr
Tags:
Parameters:
method _createTree [line 1597]
array _createTree(
mixed
$value, mixed
$left, mixed
$right)
|
|
Creates a tree. In fact an array which may have one or two arrays (sub-trees) as elements.
Tags:
Parameters:
method _expression [line 1363]
It parses a expression. It assumes the following rule: Expr -> Term [("+" | "-") Term] -> "string" -> "-" Term
Tags:
method _fact [line 1463]
It parses a factor. It assumes the following rule: Fact -> ( Expr ) | CellRef | CellRange | Number | Function
Tags:
method _func [line 1541]
It parses a function call. It assumes the following rule: Func -> ( Expr [,Expr]* )
Tags:
method _getRefIndex [line 903]
mixed _getRefIndex(
string
$ext_ref)
|
|
Look up the REF index that corresponds to an external sheet name (or range). If it doesn't exist yet add it to the workbook's references array. It assumes all sheet names given must exist.
Tags:
Parameters:
method _getSheetIndex [line 961]
integer _getSheetIndex(
$sheet_name)
|
|
Look up the index that corresponds to an external sheet name. The hash of sheet names is updated by the addworksheet() method of the Spreadsheet_Excel_Writer_Workbook class.
Tags:
Parameters:
method _initializeHashes [line 187]
void _initializeHashes(
)
|
|
Initialize the ptg and function hashes.
Tags:
method _match [line 1154]
mixed _match(
mixed
$token)
|
|
Checks if it's a valid token.
Tags:
Parameters:
method _packExtRef [line 857]
string _packExtRef(
string
$ext_ref)
|
|
Convert the sheet name part of an external reference, for example "Sheet1" or "Sheet1:Sheet2", to a packed structure.
Tags:
Parameters:
method _parenthesizedExpression [line 1411]
array _parenthesizedExpression(
)
|
|
This function just introduces a ptgParen element in the tree, so that Excel doesn't get confused when working with a parenthesized formula afterwards.
Tags:
method _rangeToPackedRange [line 1027]
array _rangeToPackedRange(
string
$range)
|
|
pack() row range into the required 3 or 4 byte format. Just using maximum col/rows, which is probably not the correct solution
Tags:
Parameters:
method _term [line 1424]
It parses a term. It assumes the following rule: Term -> Fact [("*" | "/") Fact]
Tags:
|
|