I'm working on a preprocessor, so I could add extensions to BlitzMax. The first I tried was Properties (like in .NET languages).
I have an alpha version you could try. It is very unfinished (a proof or concept) and will probably throw all sorts of errors at you, if it does not understand your syntax. That said, it should understand most simple syntax, including arbitrarily complicated expressions. Output will not be pretty, though.
Download: MaxPre Alpha (50KB zip)
If you fix the path in bmxpath.zip you will be able to preprocess source files by dragging them on the executable. Try the test file to see how it works.
Basically, using a property in an expression is transformed into a call to GetProperty and assignments to SetProperty. The default implementations for Get and Set methods just pass values from/to a hidden field and can be overridden by declaring a Method of that name.
The question:
Does someone have enough familiarity with BMK to create a hack for running a preprocessor on the source before the compiler? Or better yet, does someone have such a hack already?
|