REGEX_SHEET_TITLE_UNQUOTED
REGEX_SHEET_TITLE_UNQUOTED = '[^\\*\\:\\/\\\\\\?\\[\\]\\+\\-\\% \\\'\\^\\&\\<\\>\\=\\,\\;\\#\\(\\)\\"\\{\\}]+'
Constants
$currentCharacter : int
The index of the character we are currently looking at.
$currentToken : string
The token we are working on.
$lookAhead : string
The character ahead of the current char.
$parseTree : string
The parse tree to be generated.
$references : array
Array of sheet references in the form of REF structures.
$formula : string
The formula to parse.
$externalSheets : array
Array of external sheets.
$ptg : array
The Excel ptg indices.
$functions : array
Thanks to Michael Meeks and Gnumeric for the initial arg values.
The following hash was generated by "function_locale.pl" in the distro. Refer to function_locale.pl for non-English function names.
The array elements are as follow: ptg: The Excel function ptg code. args: The number of arguments that the function takes: >=0 is a fixed number of arguments. -1 is a variable number of arguments. class: The reference, value or array class of the function args. vol: The function is volatile.
setExtSheet(string $name, int $index) : void
This method is used to update the array of sheet names. It is called by the addWorksheet() method of the \PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook class.
string | $name | The name of the worksheet being added |
int | $index | The index of the worksheet being added |
toReversePolish(array $tree = []) : string
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
array | $tree | the optional tree to convert |
The tree in reverse polish notation
convertFunction(string $token, int $num_args) : string
Convert a function to a ptgFunc or ptgFuncVarV depending on the number of args that it takes.
string | $token | the name of the function for convertion to ptg value |
int | $num_args | the number of arguments the function receives |
The packed ptg for the function
getRefIndex(string $ext_ref) : mixed
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.
string | $ext_ref | The name of the external reference |
The reference index in packed() format on success
getSheetIndex(string $sheet_name) : int
Look up the index that corresponds to an external sheet name. The hash of sheet names is updated by the addworksheet() method of the \PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook class.
string | $sheet_name | Sheet name |
The sheet index, -1 if the sheet was not found
rangeToPackedRange(string $range) : array
pack() row range into the required 3 or 4 byte format.
Just using maximum col/rows, which is probably not the correct solution.
string | $range | The Excel range to be packed |
Array containing (row1,col1,row2,col2) in packed() format
cellToRowcol(string $cell) : array
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.
string | $cell | the Excel cell reference in A1 format |
createTree(mixed $value, mixed $left, mixed $right) : array
Creates a tree. In fact an array which may have one or two arrays (sub-trees) as elements.
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 |
A tree