Completely overhauled my preprocessor for Lumenarium. I was doing a pretty basic pass at generating type info and coupling functions with input data types (kind of like on HMH) at first but the system wasn't extensible. When I wanted to generate a new set of data, I found myself pulling up the floorboards to make it work. After about a week of work, I now have a functional preprocessor!
Features:
- One step preprocessing of entire program (with levels of granularity underneath). It takes your main file, and uses #includes to crawl through the program like the compiler.
- Currently detecting struct, union, enum, variable, and function declarations.
- Attaches meta tags to the declarations (you can see GSMetaTag on the left above v3)
- Passes all that info out to the user. I've built a type info generator at this point that just takes the preprocessor and generates a file with typeinfo for any struct that was preceeded by the GSMetaTag(gen_type_info) tag.
What you're seeing in the screenshot is the result of just tagging v3 with gen_type_info. It recursively generates info for all members of structs with that tag (which is why you get float in there). Its also parsing the size of a union correctly (the 2nd number in StructType entries is the size)
Next steps:
- more cpp language support. High priority are #define's for array sizes
- store the tags in the type info so the receiving program can take advantage of it.
- explore how to do really basic templates (thought atm is literal text replacement and include those files in the program for better errors and debugging than cpp templates)
- figure out what else I can do with this.