Module bison :: Class BisonNode
[show private | hide private]
[frames | no frames]

Class BisonNode


Generic class for wrapping parse targets.

Arguments: Keywords:
Method Summary
  __init__(self, **kw)
  __getitem__(self, item)
Retrieves the ith value from this node, or child nodes
  __getslice__(self, fromidx, toidx)
  __iter__(self)
  __len__(self)
  __repr__(self)
  __str__(self)
  dump(self, indent)
For debugging - prints a recursive dump of a parse tree node and its children
  toprettyxml(self, indent, newl, encoding)
returns a human-readable xml serialisation of this node and its children
  toxml(self)
Returns an xml serialisation of this node and its children, as a raw string
  toxmldoc(self)
Returns the node and its children as an xml.dom.minidom.Document object
  toxmlelem(self, docobj)
Returns a DOM Element object of this node and its children

Method Details

__getitem__(self, item)
(Indexing operator)

Retrieves the ith value from this node, or child nodes

If the subscript is a single number, it will be used as an index into this node's children list.

If the subscript is a list or tuple, we recursively fetch the item by using the first element as an index into this node's children, the second element as an index into that child node's children, and so on

dump(self, indent=0)

For debugging - prints a recursive dump of a parse tree node and its children

toprettyxml(self, indent='  ', newl='\n', encoding=None)

returns a human-readable xml serialisation of this node and its children

toxml(self)

Returns an xml serialisation of this node and its children, as a raw string

Called on the toplevel node, the xml is a representation of the entire parse tree.

toxmldoc(self)

Returns the node and its children as an xml.dom.minidom.Document object

toxmlelem(self, docobj)

Returns a DOM Element object of this node and its children

Generated by Epydoc 2.0 on Sun Jun 27 12:36:56 2004 http://epydoc.sf.net