revel8n / glfx

Automatically exported from code.google.com/p/glfx
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Prase included files #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Would it be possible to also parse included files? Currently included files 
(#include "external.glsl") can only contain pure opengl, since its content will 
just be pasted into the final content. Wouldn't it be possible to first paste 
its content into a string and then parse it? That should also work recursively, 
right?

Original issue reported on code.google.com by freakyma...@web.de on 16 Jan 2014 at 3:21

GoogleCodeExporter commented 9 years ago
Currently I have no plans of doing it because it would require converting the 
scanner/parser to a reentrant one. My current usage of flex/bison is by the 
older syntax which doesn't quite support reentrancy. If the code is to be 
rewritten with newer syntax then supporting full blown includes is a piece of 
cake.

Original comment by max.snif...@gmail.com on 16 Jan 2014 at 10:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This was an issue I wanted to deal with but my lex/yacc skills are not up to 
the task. But you can preprocess the entire file yourself, using something like 
http://dbgdiary.blogspot.co.uk/2014/04/recursive-c-include-processor-for-glsl.ht
ml. Then send the processed file to glfx using glfxParseEffectFromMemory.

Original comment by roderick...@gmail.com on 19 Apr 2014 at 5:16