Panda3D
Public Member Functions | Public Attributes | Static Public Attributes

ParseTreeInfo Class Reference

List of all members.

Public Member Functions

def __init__
def extract_derivs
def extract_info
def extract_tokens
def match

Public Attributes

 assign_info
 class_info
 derivs
 docstring
 file
 function_info
 name

Static Public Attributes

string docstring = ''
string name = ''

Constructor & Destructor Documentation

def __init__ (   self,
  tree,
  name,
  file 
)
The code can be a string (in which case it is parsed), or it
can be in parse tree form already.

Member Function Documentation

def extract_derivs (   self,
  classinfo,
  tree 
)
def extract_info (   self,
  tree 
)
def extract_tokens (   self,
  str,
  tree 
)
def match (   self,
  pattern,
  data,
  vars = None 
)
pattern
    Pattern to match against, possibly containing variables.
data
    Data to be checked and against which variables are extracted.
vars
    Dictionary of variables which have already been found.  If not
    provided, an empty dictionary is created.

The `pattern' value may contain variables of the form ['varname']
which are allowed to parseTreeMatch anything.  The value that is
parseTreeMatched is returned as part of a dictionary which maps
'varname' to the parseTreeMatched value.  'varname' is not required
to be a string object, but using strings makes patterns and the code
which uses them more readable.  This function returns two values: a
boolean indicating whether a parseTreeMatch was found and a
dictionary mapping variable names to their associated values.

Member Data Documentation

string docstring = '' [static]
string name = '' [static]
 All Classes Namespaces Functions Variables Properties