Home | Trees | Index | Help |
|
---|
Module bison :: Class BisonParser |
|
object
--+
|
BisonParser
Base parser class
You should subclass this, and provide a bunch of methods called 'on_TargetName', where 'TargetName' is the name of each target in your grammar (.y) file.Method Summary | |
---|---|
Abstract representation of parser | |
__getitem__(self,
idx)
| |
Return the result of this method from a handler to notify a syntax error | |
Loads a parse tree from raw xml text | |
Returns a reconstituted parse tree, loaded from an xml.dom.minidom.Document instance | |
Returns a node object, being a parse tree, reconstituted from an xml.dom.minidom.Element object | |
Override this in your subclass, if you desire. | |
Runs the parser, and returns the top-most parse target. | |
Returns a human-readable xml representation of the parse tree | |
Serialises the parse tree and returns it as a raw xml string | |
Returns an xml.dom.minidom.Document object containing the parse tree | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T |
Class Variable Summary | |
---|---|
str |
bisonCFile = 'tmp.tab.c'
|
str |
bisonCFile1 = 'tmp.bison.c'
|
list |
bisonCmd = ['bison', '-d', '-v', '-t']
|
NoneType |
bisonEngineLibName = None |
str |
bisonFile = 'tmp.y'
|
str |
bisonHFile = 'tmp.tab.h'
|
str |
bisonHFile1 = 'tokens.h'
|
classobj |
defaultNodeClass = bison.BisonNode |
NoneType |
file = None |
str |
flexCFile = 'lex.yy.c'
|
str |
flexCFile1 = 'tmp.lex.c'
|
list |
flexCmd = ['flex']
|
str |
flexFile = 'tmp.l'
|
int |
keepfiles = 0 |
NoneType |
last = None |
NoneType |
lasterror = None |
int |
verbose = 0 |
Method Details |
---|
__init__(self,
**kw)
|
error(self, value)Return the result of this method from a handler to notify a syntax error |
loadxml(self, raw, namespace=None)Loads a parse tree from raw xml text Stores it in the '.last' attribute, which is where the root node of parsed text gets stored Arguments:
|
loadxmldoc(self, xmldoc, namespace=None)Returns a reconstituted parse tree, loaded from an xml.dom.minidom.Document instance Arguments:
|
loadxmlobj(self, xmlobj, namespace=None)Returns a node object, being a parse tree, reconstituted from an xml.dom.minidom.Element object Arguments:
|
read(self, nbytes)Override this in your subclass, if you desire. Arguments:
|
run(self, **kw)Runs the parser, and returns the top-most parse target. Keywords:
|
toprettyxml(self)Returns a human-readable xml representation of the parse tree |
toxml(self)Serialises the parse tree and returns it as a raw xml string |
toxmldoc(self)Returns an xml.dom.minidom.Document object containing the parse tree |
Class Variable Details |
---|
bisonCFile
|
bisonCFile1
|
bisonCmd
|
bisonEngineLibName
|
bisonFile
|
bisonHFile
|
bisonHFile1
|
file
|
flexCFile
|
flexCFile1
|
flexCmd
|
flexFile
|
keepfiles
|
last
|
lasterror
|
verbose
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sun Jun 27 12:36:56 2004 | http://epydoc.sf.net |