summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-05-11Fix to handle chained #define directives.Carl Worth
The fix is as simple as adding a loop to continue to lookup values in the hash table until one of the following termination conditions: 1. The token we look up has no definition 2. We get back the original symbol we started with This second termination condition prevents infinite iteration.
2010-05-11Add test for chained #define directives.Carl Worth
Where one macro is defined in terms of another macro. The current implementation does not yet deal with this correctly.
2010-05-11Add README file describing glcpp.Carl Worth
Mostly this is a place for me to write down the URLs of the GLSL and C99 specifications that I need to write this code.
2010-05-10Add a very simple test for the pre-processor.Carl Worth
Validate desired test cases by ensuring the output of glcpp matches the output of the gcc preprocessor, (ignoring any lines of the gcc output beginning with '#'). Only one test case so far with a trivial #define.
2010-05-10Implment #defineCarl Worth
By using the recently-imported hash_table implementation.
2010-05-10Makefile: Enable debugging of parser.Carl Worth
This compiles the debugging code for teh parser. It's not active unless the yydebug variable is set to a non-zero value.
2010-05-10Add hash table implementation from glsl2 project.Carl Worth
The preprocessor here is intended to become part of the glsl2 codebase eventually anyway.
2010-05-10Add .gitignore file.Carl Worth
To ignore generated source files (and glcpp binary).
2010-05-10Add some compiler warnings and corresponding fixes.Carl Worth
Most of the current problems were (mostly) harmless things like missing declarations, but there was at least one real error, (reversed argument order for yyerrror).
2010-05-10Make the lexer reentrant (to avoid "still reachable" memory).Carl Worth
This allows the final program to be 100% "valgrind clean", (freeing all memory that it allocates). This will make it much easier to ensure that any allocation that parser actions perform are also cleaned up.
2010-05-10Add the tiniest shell of a flex/bison-based parser.Carl Worth
It doesn't really *do* anything yet---merlely parsing a stream of whitespace-separated tokens, (and not interpreting them at all).