summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/gl_XML.py
diff options
context:
space:
mode:
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."""