Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (813)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  GLSL Language Parsers for Java?  (Read 1571 times)
0 Members and 1 Guest are viewing this topic.
Offline homac

Senior Devvie


Medals: 18


life is cake.


« Posted 2017-05-08 16:42:27 »

I'm looking for an open source GLSL parser preferably producing an abstract syntax tree.

What we found so far:

  • glsl4idea: IntelliJ plugin. Too many dependencies on IntelliJ code, but language description for FLEX might be useful.
  • glslang: Reference implementation of a GLSL compiler in C, by Khronos Group. Contains language description for Bison.
  • fragbyte: GLSL to bytecode compiler based on ANTLR4. Uses AST for bytecode representation. Rule set possibly useful.
  • antlr4_convert: Compiler based on ANTLR4, which converts between GLSL and HLSL.


Does anybody of you know of some others? Maybe integrated in graphics/game engines?

The guy who cooks Java .Blend and helps people to launch their Life in the Woods.
Offline CoDi^R
« Reply #1 - Posted 2017-05-08 20:33:01 »

Seems there is no "official" GLSL grammar for ANTLR, but Google points me to a few Github projects:

https://github.com/divanburger/fragbyte/blob/master/grammar/GLSL.g4
https://github.com/labud/antlr4_convert/blob/master/src/GLSL/GLSL.g4

Robotality - steamworks4j - @code_disaster - codi^r @ #java-gaming
Offline homac

Senior Devvie


Medals: 18


life is cake.


« Reply #2 - Posted 2017-05-09 14:24:17 »

Thanks, CoDi^R. fragbyte looks promising and uses even an AST. Will see.

EDIT: Nope. The AST is for the bytecode which is getting generated by the compiler. But the ANTLR rule set might be a good start.

The guy who cooks Java .Blend and helps people to launch their Life in the Woods.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #3 - Posted 2017-05-15 07:18:11 »

Hi

The author of Unlicense Lib probably knows the answer, you should contact him.

Julien Gouesse | Personal blog | Website | Jogamp
Offline homac

Senior Devvie


Medals: 18


life is cake.


« Reply #4 - Posted 2017-05-16 16:34:26 »

@ gouessej: had a look at their repository but didn't find anything related to GLSL parsing. Also, I couldn't find a contact address.

Ported the grammar from Khronos' reference impl to ANTLR4 and extended it by the rules for preprocessing according to ISO C standard (also added #include directive while I'm at it - doesn't hurt to have it).

The grammar is written. Test coverage is currently at 30%, roughly.

The guy who cooks Java .Blend and helps people to launch their Life in the Woods.
Pages: [1]
  ignore  |  Print  
 
 

 
cybrmynd (138 views)
2017-08-02 12:28:51

cybrmynd (159 views)
2017-08-02 12:19:43

cybrmynd (153 views)
2017-08-02 12:18:09

Sralse (169 views)
2017-07-25 17:13:48

Archive (646 views)
2017-04-27 17:45:51

buddyBro (766 views)
2017-04-05 03:38:00

CopyableCougar4 (1300 views)
2017-03-24 15:39:42

theagentd (1264 views)
2017-03-24 15:32:08

Rule (1237 views)
2017-03-19 12:43:22

Rule (1312 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!