PDA

View Full Version : GLSL grammar specs



BlackHC
07-20-2009, 03:03 PM
Hello,
I've been searching for a text version of the grammar part at the back of the GLSL specs and haven't been able to find anything.

I want to look into creating an ANTLR GLSL grammar and copying the grammar out of the PDF is not easily possible. (ANTLR's grammars are quite similar to normal BNF syntax if no actions are specified.)

It would be awesome if someone who has the source of the GLSL specs could release/copy the grammar part in the original form.

I think this would lessen the hurdle for people who want to create tools that work with GLSL.

Thanks in advance.
Best regards,
Andreas

Stephen A
07-21-2009, 09:01 PM
Mesa3d contains an open source GLSL compiler.

Edit: sorry, I thought you simply needed the source for a compiler. I agree, it would be nice to have the grammar in a nicely defined fashion.

Dark Photon
07-22-2009, 07:23 AM
I've been searching for a text version of the grammar part at the back of the GLSL specs and haven't been able to find anything
You can do a pdftohtml (part of the poppler-tools [formerly xpdf]), and then cut-n-paste from there. If you want the HTML form, PM me and I'll mail it to you.

BlackHC
07-28-2009, 02:58 AM
Hi,
thanks for your replies (I was busy with uni all week). I've looked at the Mesa source and they are using their own specification language it seems, so it's not straight forward to port.
I'm going to try pdftohtml next and if it's okay I'm also going to upload the grammar as text file.
Cheers,
Andreas

BlackHC
08-13-2009, 05:21 AM
Okay, a late update: I've tried pdftohtml and it didn't work very well.
I've decided not to use a GLSL grammar for now but more general text parsing rules in my project.
Thanks for your help.
Cheers,
Andreas