Improved extension detection in .spec parser.

Instead of using a hardcoded list of extensions, the parser will now
use a regex to detect extension names. This gives better results on
new specs without manual editing.
This commit is contained in:
Stefanos A. 2013-10-27 01:24:04 +02:00
parent d4eeb4e9ce
commit 5cc845713d
2 changed files with 32 additions and 32 deletions

View file

@ -16283,6 +16283,21 @@
<param name="index" type="UInt32" flow="in" />
<param name="v" type="UInt16*" flow="in" />
</function>
<function name="VertexAttribIFormat" extension="Core" category="ARB_vertex_attrib_binding" version="4.3">
<returns type="void" />
<param name="attribindex" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="GLenum" flow="in" />
<param name="relativeoffset" type="UInt32" flow="in" />
</function>
<function name="VertexAttribIPointer" extension="Core" category="VERSION_3_0" version="3.0">
<returns type="void" />
<param name="index" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="VertexAttribEnum" flow="in" />
<param name="stride" type="SizeI" flow="in" />
<param name="pointer" type="Void*" flow="in" />
</function>
<function name="VertexAttribL1d" extension="Core" category="ARB_vertex_attrib_64bit" version="4.1">
<returns type="void" />
<param name="index" type="UInt32" flow="in" />
@ -16329,6 +16344,21 @@
<param name="index" type="UInt32" flow="in" />
<param name="v" type="Float64*" flow="in" />
</function>
<function name="VertexAttribLFormat" extension="Core" category="ARB_vertex_attrib_binding" version="4.3">
<returns type="void" />
<param name="attribindex" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="GLenum" flow="in" />
<param name="relativeoffset" type="UInt32" flow="in" />
</function>
<function name="VertexAttribLPointer" extension="Core" category="ARB_vertex_attrib_64bit" version="4.1">
<returns type="void" />
<param name="index" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="GLenum" flow="in" />
<param name="stride" type="SizeI" flow="in" />
<param name="pointer" type="Void*" flow="in" />
</function>
<function name="VertexAttribP1ui" extension="Core" category="ARB_vertex_type_2_10_10_10_rev" version="1.2">
<returns type="void" />
<param name="index" type="UInt32" flow="in" />
@ -20101,13 +20131,6 @@
<param name="pointer" type="VoidPointer*" flow="in" />
<param name="ptrstride" type="Int32" flow="in" />
</function>
<function name="VertexAttribIFormat" extension="IF" category="ARB_vertex_attrib_binding" version="4.3">
<returns type="void" />
<param name="attribindex" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="GLenum" flow="in" />
<param name="relativeoffset" type="UInt32" flow="in" />
</function>
<function name="BlendFuncSeparateINGR" extension="INGR" category="INGR_blend_func_separate" version="1.0">
<returns type="void" />
<param name="sfactorRGB" type="BlendFuncSeparateParameterEXT" flow="in" />
@ -20155,29 +20178,6 @@
<param name="type" type="VertexPointerType" flow="in" />
<param name="pointer" type="VoidPointer*" flow="in" />
</function>
<function name="VertexAttribIPointer" extension="IP" category="VERSION_3_0" version="3.0">
<returns type="void" />
<param name="index" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="VertexAttribEnum" flow="in" />
<param name="stride" type="SizeI" flow="in" />
<param name="pointer" type="Void*" flow="in" />
</function>
<function name="VertexAttribLFormat" extension="LF" category="ARB_vertex_attrib_binding" version="4.3">
<returns type="void" />
<param name="attribindex" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="GLenum" flow="in" />
<param name="relativeoffset" type="UInt32" flow="in" />
</function>
<function name="VertexAttribLPointer" extension="LP" category="ARB_vertex_attrib_64bit" version="4.1">
<returns type="void" />
<param name="index" type="UInt32" flow="in" />
<param name="size" type="Int32" flow="in" />
<param name="type" type="GLenum" flow="in" />
<param name="stride" type="SizeI" flow="in" />
<param name="pointer" type="Void*" flow="in" />
</function>
<function name="ResizeBuffersMESA" extension="MESA" category="MESA_resize_buffers" version="1.0">
<returns type="void" />
</function>

View file

@ -35,8 +35,8 @@ namespace CHeaderToXML
class GLParser : Parser
{
static readonly Regex extensions = new Regex(
@"3DFX|(?!(?<=[1-4])D)[A-Z]{2,}",
RegexOptions.RightToLeft | RegexOptions.Compiled);
@"3DFX|(?!(?<=[1-4])D)[A-Z]{2,}$",
RegexOptions.Compiled);
static readonly char[] splitters = new char[] { ' ', '\t', ',', '(', ')', ';', '\n', '\r' };
enum ParserModes { None, Enum, Func };