I would have put this thread in the WIP section but it's not exactly made in DBP, though it's kinda related...
Here's a newer version, with more optimized (and less buggy) code (and shows off a few language extensions).
Now, the cookie is slightly soggy due to my castle being slightly submerged below a few hundred feet of water. Therefore, David R wins a kiwi instead:
Benjamin may be the one who's supposed to win it, but I'm not sure if "It's the DBP compiler!" counts.
Anyway, having no internet connection other than a phone line after midnight, lost my job, and bailed out of classes for this year, I've obtained an unexpected level of coding productivity. In 3 weeks I've built 80% of what I've code named DBPXP: (Dark Basic Pro Cross Platform)
It's a re-targetable DBP compiler that uses plugins to generate the final binary. Currently it only generates code for the GP2X's ARM processor, but I'm planning on GBA and/or Dreamcast targets in the future. I am
NOT making an x86 version as I hate the x86. >_<
As for the internals, it uses a GlobStruct that's very similar to DBP's, but the types were changed to make it more platform-independent.
Also, functions are expected to be declared
extern "C" so as to avoid problems with different compilers and name mangling.
Using it is rocket science: my TGC's DBPCompiler.exe must be renamed to DBPexeCompiler.exe and my DBPCompiler.exe is put in its place. In the standard editor you can pick which target to build to by changing the file extension of your project's EXE Filename (Project.EXE -> Project.GPE). When my compiler sees that your project is an EXE, it calls the DBPexeCompiler. Otherwise it looks for a suitable output plugin to do the job.
What's done:
correctly (AFAIK) compiles expressions, function calls, functions, and a few keywords (TYPE...ENDTYPE, AS, IF...:...ENDIF, IF...THEN..., and some more stuff)
UDTs can contain any data type (even arrays)
Anything can be passed as a function parameter (including arrays / UDTs)
Some of the DBProCore.so ("so" files are the linux equivalents of dlls) has been implemented.
To do:
more keywords (FOR, DO, LOOP, etc.)
Arrays
All the built-in plugins.
Ok, time to go for a bath.
*opens a bottle of Mercury*