ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
__construct ($biff_version) | |
The class constructor. | |
_initializeHashes () | |
Initialize the ptg and function hashes. | |
_convert ($token) | |
Convert a token to the proper ptg value. | |
_convertNumber ($num) | |
Convert a number token to ptgInt or ptgNum. | |
_convertString ($string) | |
Convert a string token to ptgStr. | |
_convertFunction ($token, $num_args) | |
Convert a function to a ptgFunc or ptgFuncVarV depending on the number of args that it takes. | |
_convertRange2d ($range, $class=0) | |
Convert an Excel range such as A1:D4 to a ptgRefV. | |
_convertRange3d ($token) | |
Convert an Excel 3d range such as "Sheet1!A1:D4" or "Sheet1:Sheet2!A1:D4" to a ptgArea3d. | |
_convertRef2d ($cell) | |
Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV. | |
_convertRef3d ($cell) | |
Convert an Excel 3d reference such as "Sheet1!A1" or "Sheet1:Sheet2!A1" to a ptgRef3d. | |
_packExtRef ($ext_ref) | |
Convert the sheet name part of an external reference, for example "Sheet1" or "Sheet1:Sheet2", to a packed structure. | |
_getRefIndex ($ext_ref) | |
Look up the REF index that corresponds to an external sheet name (or range). | |
_getSheetIndex ($sheet_name) | |
Look up the index that corresponds to an external sheet name. | |
setExtSheet ($name, $index) | |
This method is used to update the array of sheet names. | |
_cellToPackedRowcol ($cell) | |
pack() row and column into the required 3 or 4 byte format. | |
_rangeToPackedRange ($range) | |
pack() row range into the required 3 or 4 byte format. | |
_cellToRowcol ($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. | |
_advance () | |
Advance to the next valid token. | |
_match ($token) | |
Checks if it's a valid token. | |
parse ($formula) | |
The parsing method. | |
_condition () | |
It parses a condition. | |
_expression () | |
It parses a expression. | |
_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. | |
_term () | |
It parses a term. | |
_fact () | |
It parses a factor. | |
_func () | |
It parses a function call. | |
_createTree ($value, $left, $right) | |
Creates a tree. | |
toReversePolish ($tree=array()) | |
Builds a string containing the tree in reverse polish notation (What you would use in a HP calculator stack). |
Data Fields | |
$_current_char | |
$_current_token | |
$_formula | |
$_lookahead | |
$_parse_tree | |
$_ext_sheets | |
$_references | |
$_BIFF_version |
Definition at line 75 of file Parser.php.
PHPExcel_Writer_Excel5_Parser::__construct | ( | $biff_version | ) |
The class constructor.
integer | $byte_order | The byte order (Little endian or Big endian) of the architecture (optional). 1 => big endian, 0 (default) little endian. |
Definition at line 131 of file Parser.php.
References _initializeHashes().
PHPExcel_Writer_Excel5_Parser::_advance | ( | ) |
Advance to the next valid token.
private
Definition at line 1056 of file Parser.php.
References $_current_char, and _match().
Referenced by _condition(), _expression(), _fact(), _func(), _term(), and parse().
PHPExcel_Writer_Excel5_Parser::_cellToPackedRowcol | ( | $cell | ) |
pack() row and column into the required 3 or 4 byte format.
private
string | $cell | The Excel cell reference to be packed |
Definition at line 944 of file Parser.php.
References $row, _cellToRowcol(), and elseif().
Referenced by _convertRange2d(), _convertRange3d(), _convertRef2d(), and _convertRef3d().
PHPExcel_Writer_Excel5_Parser::_cellToRowcol | ( | $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.
private
string | $cell | The Excel cell reference in A1 format. |
Definition at line 1026 of file Parser.php.
References $row.
Referenced by _cellToPackedRowcol().
PHPExcel_Writer_Excel5_Parser::_condition | ( | ) |
It parses a condition.
It assumes the following rule: Cond -> Expr [(">" | "<") Expr]
private
Definition at line 1251 of file Parser.php.
References $result, _advance(), _createTree(), _expression(), and elseif().
Referenced by _func(), and parse().
PHPExcel_Writer_Excel5_Parser::_convert | ( | $token | ) |
Convert a token to the proper ptg value.
private
mixed | $token | The token to convert. |
Definition at line 524 of file Parser.php.
References _convertNumber(), _convertRange2d(), _convertRange3d(), _convertRef2d(), _convertRef3d(), _convertString(), and elseif().
Referenced by toReversePolish().
PHPExcel_Writer_Excel5_Parser::_convertFunction | ( | $token, | |
$num_args | |||
) |
Convert a function to a ptgFunc or ptgFuncVarV depending on the number of args that it takes.
private
string | $token | The name of the function for convertion to ptg value. |
integer | $num_args | The number of arguments the function receives. |
Definition at line 628 of file Parser.php.
PHPExcel_Writer_Excel5_Parser::_convertNumber | ( | $num | ) |
Convert a number token to ptgInt or ptgNum.
private
mixed | $num | an integer or double for conversion to its ptg value |
Definition at line 584 of file Parser.php.
References PHPExcel_Writer_Excel5_BIFFwriter\getByteOrder().
Referenced by _convert().
PHPExcel_Writer_Excel5_Parser::_convertRange2d | ( | $range, | |
$class = 0 |
|||
) |
Convert an Excel range such as A1:D4 to a ptgRefV.
private
string | $range | An Excel range in the A1:A2 or A1..A2 format. |
Definition at line 649 of file Parser.php.
References _cellToPackedRowcol(), and elseif().
Referenced by _convert().
PHPExcel_Writer_Excel5_Parser::_convertRange3d | ( | $token | ) |
Convert an Excel 3d range such as "Sheet1!A1:D4" or "Sheet1:Sheet2!A1:D4" to a ptgArea3d.
private
string | $token | An Excel range in the Sheet1!A1:A2 format. |
Definition at line 692 of file Parser.php.
References _cellToPackedRowcol(), _getRefIndex(), _packExtRef(), _rangeToPackedRange(), and elseif().
Referenced by _convert().
PHPExcel_Writer_Excel5_Parser::_convertRef2d | ( | $cell | ) |
Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV.
private
string | $cell | An Excel cell reference |
Definition at line 741 of file Parser.php.
References $row, _cellToPackedRowcol(), and elseif().
Referenced by _convert().
PHPExcel_Writer_Excel5_Parser::_convertRef3d | ( | $cell | ) |
Convert an Excel 3d reference such as "Sheet1!A1" or "Sheet1:Sheet2!A1" to a ptgRef3d.
private
string | $cell | An Excel cell reference |
Definition at line 771 of file Parser.php.
References $row, _cellToPackedRowcol(), _getRefIndex(), _packExtRef(), and elseif().
Referenced by _convert().
PHPExcel_Writer_Excel5_Parser::_convertString | ( | $string | ) |
Convert a string token to ptgStr.
private
string | $string | A string for conversion to its ptg value. |
Definition at line 604 of file Parser.php.
References elseif(), and PHPExcel_Shared_String\UTF8toBIFF8UnicodeShort().
Referenced by _convert().
PHPExcel_Writer_Excel5_Parser::_createTree | ( | $value, | |
$left, | |||
$right | |||
) |
Creates a tree.
In fact an array which may have one or two arrays (sub-trees) as elements.
private
mixed | $value | The value of this node. |
mixed | $left | The left array (sub-tree) or a final node. |
mixed | $right | The right array (sub-tree) or a final node. |
Definition at line 1501 of file Parser.php.
Referenced by _condition(), _expression(), _fact(), _func(), _parenthesizedExpression(), and _term().
PHPExcel_Writer_Excel5_Parser::_expression | ( | ) |
It parses a expression.
It assumes the following rule: Expr -> Term [("+" | "-") Term] -> "string" -> "-" Term
private
Definition at line 1291 of file Parser.php.
References $result, _advance(), _createTree(), _term(), and elseif().
Referenced by _condition(), and _parenthesizedExpression().
PHPExcel_Writer_Excel5_Parser::_fact | ( | ) |
It parses a factor.
It assumes the following rule: Fact -> ( Expr ) | CellRef | CellRange | Number | Function
private
Definition at line 1373 of file Parser.php.
References $_current_token, $result, _advance(), _createTree(), _func(), _parenthesizedExpression(), and elseif().
Referenced by _term().
PHPExcel_Writer_Excel5_Parser::_func | ( | ) |
It parses a function call.
It assumes the following rule: Func -> ( Expr [,Expr]* )
private
Definition at line 1451 of file Parser.php.
References $result, _advance(), _condition(), and _createTree().
Referenced by _fact().
PHPExcel_Writer_Excel5_Parser::_getRefIndex | ( | $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.
private
string | $ext_ref | The name of the external reference |
Definition at line 855 of file Parser.php.
References _getSheetIndex().
Referenced by _convertRange3d(), and _convertRef3d().
PHPExcel_Writer_Excel5_Parser::_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 PHPExcel_Writer_Excel5_Workbook class.
private
Definition at line 913 of file Parser.php.
Referenced by _getRefIndex(), and _packExtRef().
PHPExcel_Writer_Excel5_Parser::_initializeHashes | ( | ) |
Initialize the ptg and function hashes.
private
Definition at line 149 of file Parser.php.
Referenced by __construct().
PHPExcel_Writer_Excel5_Parser::_match | ( | $token | ) |
Checks if it's a valid token.
private
mixed | $token | The token to check. |
Definition at line 1106 of file Parser.php.
References elseif().
Referenced by _advance().
PHPExcel_Writer_Excel5_Parser::_packExtRef | ( | $ext_ref | ) |
Convert the sheet name part of an external reference, for example "Sheet1" or "Sheet1:Sheet2", to a packed structure.
private
string | $ext_ref | The name of the external reference |
Definition at line 810 of file Parser.php.
References _getSheetIndex().
Referenced by _convertRange3d(), and _convertRef3d().
PHPExcel_Writer_Excel5_Parser::_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.
private
Definition at line 1330 of file Parser.php.
References $result, _createTree(), and _expression().
Referenced by _fact().
PHPExcel_Writer_Excel5_Parser::_rangeToPackedRange | ( | $range | ) |
pack() row range into the required 3 or 4 byte format.
Just using maximum col/rows, which is probably not the correct solution
private
string | $range | The Excel range to be packed |
Definition at line 979 of file Parser.php.
References elseif().
Referenced by _convertRange3d().
PHPExcel_Writer_Excel5_Parser::_term | ( | ) |
It parses a term.
It assumes the following rule: Term -> Fact [("*" | "/") Fact]
private
Definition at line 1343 of file Parser.php.
References $result, _advance(), _createTree(), and _fact().
Referenced by _expression().
PHPExcel_Writer_Excel5_Parser::parse | ( | $formula | ) |
The parsing method.
It parses a formula.
public
string | $formula | The formula to parse, without the initial equal sign (=). |
Definition at line 1234 of file Parser.php.
References _advance(), and _condition().
PHPExcel_Writer_Excel5_Parser::setExtSheet | ( | $name, | |
$index | |||
) |
This method is used to update the array of sheet names.
It is called by the addWorksheet() method of the PHPExcel_Writer_Excel5_Workbook class.
public
string | $name | The name of the worksheet being added |
integer | $index | The index of the worksheet being added |
Definition at line 932 of file Parser.php.
References $name.
PHPExcel_Writer_Excel5_Parser::toReversePolish | ( | $tree = array() | ) |
Builds a string containing the tree in reverse polish notation (What you would use in a HP calculator stack).
The following tree:
produces: "23+"
The following tree:
produces: "36A1*+"
In fact all operands, functions, references, etc... are written as ptg's
public
array | $tree | The optional tree to convert. |
Definition at line 1533 of file Parser.php.
References $_parse_tree, _convert(), and elseif().
PHPExcel_Writer_Excel5_Parser::$_BIFF_version |
Definition at line 123 of file Parser.php.
PHPExcel_Writer_Excel5_Parser::$_current_char |
Definition at line 81 of file Parser.php.
Referenced by _advance().
PHPExcel_Writer_Excel5_Parser::$_current_token |
Definition at line 87 of file Parser.php.
Referenced by _fact().
PHPExcel_Writer_Excel5_Parser::$_ext_sheets |
Definition at line 111 of file Parser.php.
PHPExcel_Writer_Excel5_Parser::$_formula |
Definition at line 93 of file Parser.php.
PHPExcel_Writer_Excel5_Parser::$_lookahead |
Definition at line 99 of file Parser.php.
PHPExcel_Writer_Excel5_Parser::$_parse_tree |
Definition at line 105 of file Parser.php.
Referenced by toReversePolish().
PHPExcel_Writer_Excel5_Parser::$_references |
Definition at line 117 of file Parser.php.