Package ast :: Module Number :: Class Number
[show private | hide private]
[frames | no frames]

Class Number

ASTNode --+
          |
         Number


Encapsulate numerical data (float). Instance of this class are leaf nodes of the AST
Method Summary
  __init__(self, number, numParen)
Number constructor
  accept(self, visitor)
Method used in the visitor pattern.
Number clone(self)
Returns a copy of this object
  equals(self, anObject)
Returns true if this object equals another object
    Accessors
  setValue(self, number)
Set the value of this Number
  setNumParen(self, numParen)
Set the number of parenthesis around this number
float getValue(self)
Returns the encapsulated value
int getNumParen(self)
Returns the number of parenthesis around this ASTNode
    Inherited from ASTNode
string __str__(self)
String representation of the complete AST (common to every child)

Method Details

setNumParen(self, numParen)

Set the number of parenthesis around this number
Parameters:
numParen - number of parenthesis
           (type=int)

setValue(self, number)

Set the value of this Number
Parameters:
number - The value to be encapsulated
           (type=int, float)

getNumParen(self)

Returns the number of parenthesis around this ASTNode
Returns:
int

getValue(self)

Returns the encapsulated value
Returns:
float

__init__(self, number, numParen=0)
(Constructor)

Number constructor
Parameters:
number - numerical value encapsulated by this object
           (type=int, float)
numParen - number of parenthesis
           (type=int)
Overrides:
ast.ASTNode.ASTNode.__init__

accept(self, visitor)

Method used in the visitor pattern. Calls the appropriate action to perform while visiting this object.
Parameters:
visitor - Visitor accepted by this object
           (type=Visitor)
Overrides:
ast.ASTNode.ASTNode.accept (inherited documentation)

clone(self)

Returns a copy of this object
Returns:
Number
Overrides:
ast.ASTNode.ASTNode.clone

equals(self, anObject)

Returns true if this object equals another object
Parameters:
anObject - Object compared to this object
           (type=Object)
Overrides:
ast.ASTNode.ASTNode.equals (inherited documentation)

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