org.apache.poi.ss.formula
Class FormulaParser
- java.lang.Object
-
- org.apache.poi.ss.formula.FormulaParser
-
public final class FormulaParser extends java.lang.ObjectThis class parses a formula string into a List of tokens in RPN order. Inspired by Lets Build a Compiler, by Jack Crenshaw BNF for the formula expression is :::= [ ]* ::= [ ]* ::= | ( ) | | ::= ([expression [, expression]*]) For POI internal use only
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Ptg[]parse(java.lang.String formula, FormulaParsingWorkbook workbook, int formulaType, int sheetIndex)Parse a formula into a array of tokens
-
-
-
Method Detail
-
parse
public static Ptg[] parse(java.lang.String formula, FormulaParsingWorkbook workbook, int formulaType, int sheetIndex)
Parse a formula into a array of tokens- Parameters:
formula- the formula to parseworkbook- the parent workbookformulaType- the type of the formula, seeFormulaTypesheetIndex- the 0-based index of the sheet this formula belongs to. The sheet index is required to resolve sheet-level names.-1means that the scope of the name will be ignored and the parser will match names only by name- Returns:
- array of parsed tokens
- Throws:
FormulaParseException- if the formula has incorrect syntax or is otherwise invalid
-
-
DataMelt 3.0 © DataMelt by jWork.ORG