Trees | Index | Help |
|
---|
Package xode :: Module parser :: Class Parser |
|
setParams()
.
spaceFactory
spaceFactory
can be set to a callable object that
creates instances which inherit from ode.SpaceBase
. This factory will be
used by the parser to create Space objects for <space> tags
unless the class is overridden in the XODE file. The default behavior
is to use the ode.SimpleSpace
class.
ode.HashSpace
:
| from xode import parser | import ode | | p = parser.Parser() | p.setParams(spaceFactory=ode.HashSpace)Example using
ode.QuadTreeSpace
:
| from xode import parser | import ode | | def makeSpace(): | return ode.QuadTreeSpace((0, 0, 0), (2, 2, 2), 3) | | p = parser.Parser() | p.setParams(spaceFactory=makeSpace)
Method Summary | |
---|---|
Initialise the parser. | |
Return the value of the given parameter. | |
instance of node.TreeNode
|
Parses the given file. |
instance of node.TreeNode
|
Parses the given string. |
tuple |
Parses an element's attributes as a vector. |
pop(self)
| |
push(self,
startElement,
endElement)
| |
Sets some parse parameters. | |
Creates an expat parser. | |
_nullHandler(self,
*args,
**kwargs)
| |
_startElement(self,
name,
attrs)
|
Method Details |
---|
__init__(self)
Initialise the parser.
|
getParam(self, name)
|
parseFile(self, fp)Parses the given file.
|
parseString(self, xml)Parses the given string.
|
parseVector(self, attrs)Parses an element's attributes as a vector.
|
setParams(self, **params)Sets some parse parameters. |
_create(self)Creates an expat parser. |
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sun Feb 4 17:54:12 2007 | http://epydoc.sf.net |