aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/gl_XML.py
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-04-18 19:42:23 +0000
committerIan Romanick <[email protected]>2005-04-18 19:42:23 +0000
commit93d2d54e7a11cf1a01c976ede37db2320ccc2dff (patch)
tree7918b8232796a7480f63e9b57dfd34f87f3a6327 /src/mesa/glapi/gl_XML.py
parent8ea22650bd2f791f72b9b2970b88236d59234d61 (diff)
Refactor a bunch of common code from the "leaf" scripts to a new functions,
parse_GL_API, in gl_XML.py.
Diffstat (limited to 'src/mesa/glapi/gl_XML.py')
-rw-r--r--src/mesa/glapi/gl_XML.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index 38ccc53465f..64422be913d 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -48,6 +48,24 @@ def is_attr_true( attrs, name ):
raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name))
+def parse_GL_API( handler, file_name ):
+ """Boiler-plate code to create an XML parser and use it.
+
+ Creates an XML parser and uses that parser with the application
+ supplied SAX callback, which should be derived from
+ FilterGLAPISpecBase.
+ """
+ parser = make_parser()
+ parser.setFeature(feature_namespaces, 1)
+ parser.setContentHandler( handler )
+
+ handler.printHeader()
+ parser.parse( file_name )
+
+ handler.printFooter()
+ return
+
+
class glItem:
"""Generic class on which all other API entity types are based."""