|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jxl.biff.formula.StringFormulaParser
Parses a string formula into a parse tree
Field Summary | |
private java.util.Stack |
arguments
The stack argument used when parsing a function in order to pass multiple arguments back to the calling method |
private ExternalSheet |
externalSheet
A handle to the external sheet |
private java.lang.String |
formula
The formula string passed to this object |
private NameTable |
nameTable
A handle to the name table |
private java.lang.String |
parsedFormula
The parsed formula string, as retrieved from the parse tree |
private ParseItem |
root
The parse tree |
private WorkbookSettings |
settings
The workbook settings |
Constructor Summary | |
StringFormulaParser(java.lang.String f,
ExternalSheet es,
NameTable nt,
WorkbookSettings ws)
Constructor |
Method Summary | |
byte[] |
getBytes()
Gets the bytes for the formula |
java.lang.String |
getFormula()
Gets the formula as a string. |
private java.util.ArrayList |
getTokens()
Gets the list of lexical tokens using the generated lexical analyzer |
private void |
handleFunction(StringFunction sf,
java.util.Iterator i,
java.util.Stack stack)
Handles the case when parsing a string when a token is a function |
void |
parse()
Parses the list of tokens |
private ParseItem |
parseCurrent(java.util.Iterator i)
Recursively parses the token array. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.lang.String formula
private java.lang.String parsedFormula
private ParseItem root
private java.util.Stack arguments
private WorkbookSettings settings
private ExternalSheet externalSheet
private NameTable nameTable
Constructor Detail |
public StringFormulaParser(java.lang.String f, ExternalSheet es, NameTable nt, WorkbookSettings ws)
f
- ws
- Method Detail |
public void parse() throws FormulaException
parse
in interface Parser
FormulaException
- private ParseItem parseCurrent(java.util.Iterator i) throws FormulaException
i
- an iterator of tokensFormulaException
- if an error occursprivate java.util.ArrayList getTokens() throws FormulaException
FormulaException
- if an error occurspublic java.lang.String getFormula()
getFormula
in interface Parser
jxl.biff.formula.Parser
public byte[] getBytes()
getBytes
in interface Parser
private void handleFunction(StringFunction sf, java.util.Iterator i, java.util.Stack stack) throws FormulaException
sf
- the string functioni
- the token iteratorstack
- the parse tree stackFormulaException
- if an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |