ogl-sample
[Top] [All Lists]

[ogl-sample] .spec file syntax for assignments

To: OpenGL SI list <ogl-sample@xxxxxxxxxxx>
Subject: [ogl-sample] .spec file syntax for assignments
From: Sven Panne <Sven_Panne@xxxxxxxxxxxxxxx>
Date: Fri, 23 Nov 2001 10:58:05 +0100
Reply-to: ogl-sample@xxxxxxxxxxx
Sender: owner-ogl-sample@xxxxxxxxxxx
Hi,

I'm currently trying to use the .spec files for automatically generating the
low-level parts of an OpenGL binding for the functional language Haskell. The
first problem was that there seems to be no formal grammar or something
equivalent for the two kinds of .spec files. The Perl scripts for processing
them are "the grammar", I fear... :-} A currently unused feature in the .spec
files is the usage of "$" on the right hand side of an assignment, including
an optional offset. The exact syntax of this can only be guessed, but I'm quite
sure that ogl-sample/main/doc/registry/specs/glext.spec need a patch:

----------------------------------------------------------------------
--- glextenum.pl.orig   Mon Nov 19 21:41:02 2001
+++ glextenum.pl        Mon Nov 19 21:43:34 2001
@@ -143,14 +143,14 @@
            # Do we do an assignment?
            if ($f[1] eq "=") {
                # Do we assign to a known variable?
-               if (substr($f[2], 1, 1) eq "\$") {
+               if (substr($f[2], 0, 1) eq "\$") {
                    # Do we add to the known variable?
                    if ($f[3] eq "+") {
                        $offset = $f[4];
                    } else {
                        $offset = 0;
                    }
-                   $value = $offset + $variables{substr($f[3],2)};
+                   $value = $offset + $variables{substr($f[2],1)};
                } else {
                    $value = $f[2];
                }
----------------------------------------------------------------------

This allows something like:

----------------------------------------------------------------------
Foo enum:
        BAR  = $BAZ
        BLAH = $X + 42
----------------------------------------------------------------------

Is this what is intended? The SI Perl script needs a similar patch, BTW.

As already noticed by several people on this list, the .spec files have a few
buglets, like referencing extensions which are commented out, using "@@" to mark
a place to fix outside a comment, etc. Will this be fixed soon? Buglets related
to the stuff above are e.g. in ogl-sample/main/doc/registry/specs/enumext.spec,
which contains things like:

----------------------------------------------------------------------
...
EXT_vertex_weighting enum:
        MODELVIEW0_STACK_DEPTH_EXT     = GL_MODELVIEW_STACK_DEPTH
...
----------------------------------------------------------------------

which should probably read:

----------------------------------------------------------------------
...
EXT_vertex_weighting enum:
         MODELVIEW0_STACK_DEPTH_EXT    = $MODELVIEW_STACK_DEPTH
...
----------------------------------------------------------------------

Nothing very serious, but it would be nice if the .spec files could be processed
automatically without prior patching or extensive workarounds in the tools using
them. After all, the .spec files are really cool to get a binding for a new
language up and running quickly, and I wish I had discovered them earlier... :-]

Cheers,
   S.
-- 
Sven Panne    Fon: +49/89/99567000    Fax: +49/89/99567461
BetaResearch GmbH,    Betastr. 1,    D-85774 Unterfoehring
mailto:Sven_Panne@xxxxxxxxxxxxxxx    http://www.betaresearch.de

<Prev in Thread] Current Thread [Next in Thread>
  • [ogl-sample] .spec file syntax for assignments, Sven Panne <=