Package subjectdata :: Module EvalVisitor :: Class EvalVisitor
[show private | hide private]
[frames | no frames]

Class EvalVisitor

ASTVisitor --+
             |
            EvalVisitor


Visit the formula AST and evaluate it
Method Summary
  __init__(self, sheet)
EvalVisitor's constructor.
CellValue getEvaluatedValue(self)
Returns the value computed by this visitor.
string getNameErrorStr(self)
Returns the invalid function name that was detected.
bool hasNameError(self)
Returns true if this visitor detected a name error.
bool hasRefError(self)
Returns true if this visitor detected a ref error.
bool hasValueError(self)
Returns true if this visitor detected a value error.
  visitCellRef(self, cellRef)
Visits a CellRef object
  visitFunction(self, function)
Visits a Function object
  visitNumber(self, number)
Visits a Number object
  visitRangeRef(self, rangeRef)
Visits a RangeRef object

Method Details

__init__(self, sheet)
(Constructor)

EvalVisitor's constructor. A reference to SSheetData is needed to resolve and evaluate references to other cells. If a reference does not exist in SSheetData, it evaluate to 0. Note that it is assumed that cycles were handled beforehand (i.e. This visitor is not executed on cycles).
Overrides:
ast.ASTVisitor.ASTVisitor.__init__

getEvaluatedValue(self)

Returns the value computed by this visitor.
Returns:
CellValue

getNameErrorStr(self)

Returns the invalid function name that was detected.
Returns:
string

hasNameError(self)

Returns true if this visitor detected a name error.
Returns:
bool

hasRefError(self)

Returns true if this visitor detected a ref error.
Returns:
bool

hasValueError(self)

Returns true if this visitor detected a value error.
Returns:
bool

visitCellRef(self, cellRef)

Visits a CellRef object
Parameters:
cellRef - The object which is visited
           (type=CellRef)
Overrides:
ast.ASTVisitor.ASTVisitor.visitCellRef (inherited documentation)

visitFunction(self, function)

Visits a Function object
Parameters:
function - The object which is visited
           (type=Function)
Overrides:
ast.ASTVisitor.ASTVisitor.visitFunction (inherited documentation)

visitNumber(self, number)

Visits a Number object
Parameters:
number - The object which is visited
           (type=Number)
Overrides:
ast.ASTVisitor.ASTVisitor.visitNumber (inherited documentation)

visitRangeRef(self, rangeRef)

Visits a RangeRef object
Parameters:
rangeRef - The object which is visited
           (type=RangeRef)
Overrides:
ast.ASTVisitor.ASTVisitor.visitRangeRef (inherited documentation)

Generated by Epydoc 2.1 on Thu Aug 26 22:55:24 2004 http://epydoc.sf.net