Question to Mark Sibly or anyone else who knows...

BlitzMax Forums/BlitzMax Programming/Question to Mark Sibly or anyone else who knows...

Sanctus(Posted 2006) [#1]
Is the blitzcompiler made in c++?
and is there a tutorial on how to make exe's from c++??
I started learning it and I was just wondering...(not that I'm good anough at c++ to make a compiler)


Who was John Galt?(Posted 2006) [#2]
The blitz compiler is written in C++, but you could write a compiler in just about any language out there. When you say make exes from c++, do you mean how to write a compiler in c++? There's a demo in the code archives somewhere that shows you how to write a simple compiler in Blitz.


Chris C(Posted 2006) [#3]
errm I thought I remembered a worklog where mark was pleased, because he'd got the compiler code rewritten in bmx and that it was now self compiled...


Who was John Galt?(Posted 2006) [#4]
Really? I must have missed that one.... cool!


Helios(Posted 2006) [#5]
Try reading up on scripting languages, thats where I learnt about compiling, Its essentially the same process just a different output.

You split the source up into tokens (lexical analysis) then analyse them (parsing, type checking and a few other things) and finally emit a assembly code (or byte code in a scripting language) representation of them.

MicroC's compiler has full BMax source code if that would help you, you can find it here http://www.blitzbasic.com/Community/posts.php?topic=57520

You may also find these books usfull, I know I did.
http://www.amazon.com/exec/obidos/tg/detail/-/1931841578?v=glance
http://www.amazon.com/exec/obidos/tg/detail/-/0201100886?v=glance


Russell(Posted 2006) [#6]
I had a friend who wrote a C-64 compiler in C-64 BASIC and then compiled the compiler with the compiler (took a looong time, since the first compile was not compiled from a compiled compiler).

*note: The previous sentence may not be grammatically correct :)

Russell