GLSL grammar specs

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,

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.

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.

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.

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.