Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
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 4577 times)
0 Members and 1 Guest are viewing this topic.
Offline homac

Senior Devvie


Medals: 31
Exp: 20 years


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: 31
Exp: 20 years


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: 31
Exp: 20 years


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  
 
 

 
Riven (439 views)
2019-09-04 15:33:17

hadezbladez (5297 views)
2018-11-16 13:46:03

hadezbladez (2213 views)
2018-11-16 13:41:33

hadezbladez (5565 views)
2018-11-16 13:35:35

hadezbladez (1156 views)
2018-11-16 13:32:03

EgonOlsen (4592 views)
2018-06-10 19:43:48

EgonOlsen (5467 views)
2018-06-10 19:43:44

EgonOlsen (3128 views)
2018-06-10 19:43:20

DesertCoockie (4023 views)
2018-05-13 18:23:11

nelsongames (4741 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
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!