jxl.biff.formula
Class FormulaParser

java.lang.Object
  |
  +--jxl.biff.formula.FormulaParser

public class FormulaParser
extends java.lang.Object

Parses the formula passed in (either as parsed strings or as a string) into a tree of operators and operands


Field Summary
private  Parser parser
          The formula parser.
 
Constructor Summary
FormulaParser(byte[] tokens, Cell rt, ExternalSheet es, NameTable nt, WorkbookSettings ws)
          Constructor which creates the parse tree out of tokens
FormulaParser(java.lang.String form, ExternalSheet es, NameTable nt, WorkbookSettings ws)
          Constructor which creates the parse tree out of the string
 
Method Summary
 byte[] getBytes()
          Gets the bytes for the formula.
 java.lang.String getFormula()
          Gets the formula as a string
 void parse()
          Parses the formula into a parse tree
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

parser

private Parser parser
The formula parser. The object implementing this interface will either parse tokens or strings
Constructor Detail

FormulaParser

public FormulaParser(byte[] tokens,
                     Cell rt,
                     ExternalSheet es,
                     NameTable nt,
                     WorkbookSettings ws)
              throws FormulaException
Constructor which creates the parse tree out of tokens
Parameters:
tokens - the list of parsed tokens
rt - the cell containing the formula
es - a handle to the external sheet
nt - a handle to the name table
ws - the workbook settings
Throws:
FormulaException -  

FormulaParser

public FormulaParser(java.lang.String form,
                     ExternalSheet es,
                     NameTable nt,
                     WorkbookSettings ws)
Constructor which creates the parse tree out of the string
Parameters:
form - the formula string
es - the external sheet handle
nt - the name table
ws - the workbook settings
Method Detail

parse

public void parse()
           throws FormulaException
Parses the formula into a parse tree
Throws:
FormulaException -  

getFormula

public java.lang.String getFormula()
                            throws FormulaException
Gets the formula as a string
Throws:
FormulaException -  

getBytes

public byte[] getBytes()
Gets the bytes for the formula. This takes into account any token mapping necessary because of shared formulas
Returns:
the bytes in RPN