Package formulaparser :: Module FormulaToAST :: Class FormulaToAST
[show private | hide private]
[frames | no frames]

Class FormulaToAST


Class creating an AST from a formula string
Method Summary
  __init__(self)
tuple (bool, ast.ASTNode, string) parseToAST(self, stringToParse)
Given a formula string, return its AST representation.
  __constructAST(self, parseTree)
Recursive function reducing a parse tree to an AST.
  __getCellRef(self, ref)
Given a ref string (e.g.

Method Details

parseToAST(self, stringToParse)

Given a formula string, return its AST representation. Note: A tuple is returned to propagate possible errors. The first element of the tuple is a boolean flag set to true if the parse was a success. The second element is the actual parse tree (None on failure). Finally, the last element of the tuple is the error message.
Parameters:
stringToParse - formula string
           (type=string)
Returns:
tuple (bool, ast.ASTNode, string)

__constructAST(self, parseTree)

Recursive function reducing a parse tree to an AST. The resulting parse tree contains no grammar artifacts, only the minimal amount of information.

__getCellRef(self, ref)

Given a ref string (e.g. "$A1"),convert it to a CellRef object (e.g. CellRef(0,0,1,0))

Generated by Epydoc 2.1 on Tue Aug 17 18:20:07 2004 http://epydoc.sf.net