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

Class Function

ASTNode --+
          |
         Function


Encapsulate a function
Method Summary
  __init__(self, name, arguments, numParen)
Function's constructor
  accept(self, visitor)
Method used in the visitor pattern.
Function clone(self)
Returns a copy of this object
  equals(self, anObject)
Returns true if this object equals another object
    Accessors
  setNumParen(self, numParen)
Set the number of parenthesis around this number
  setName(self, name)
Sets the name of this function
  setArgs(self, arguments)
Sets the arguments of this function
int getNumParen(self)
Returns the number of parenthesis around this ASTNode
string getName(self)
Returns the name of this function.
list of ASTNode getArgs(self)
Returns the arguments of this function.
    Inherited from ASTNode
string __str__(self)
String representation of the complete AST (common to every child)

Method Details

setArgs(self, arguments)

Sets the arguments of this function
Parameters:
arguments - list of arguments
           (type=list of ASTNode)

setName(self, name)

Sets the name of this function
Parameters:
name - name of the function
           (type=string)

setNumParen(self, numParen)

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

getArgs(self)

Returns the arguments of this function. Note: A copy of the list is returned to prevent from directly modifying the datastructure.
Returns:
list of ASTNode

getName(self)

Returns the name of this function.
Returns:
string

getNumParen(self)

Returns the number of parenthesis around this ASTNode
Returns:
int

__init__(self, name, arguments, numParen=0)
(Constructor)

Function's constructor
Parameters:
name - Name of the function
           (type=string)
arguments - Arguments of the function
           (type=list of ASTNode)
numParen - Number of parenthesis around this function
           (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:
Function
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:23 2004 http://epydoc.sf.net