Anthony Liguori - 2002-01-05

Greetings,

I would like to take a minute and introduce everyone here to GLBCC.  GLBCC stands for (GNU/Liberty Basic Compiler Collection).  It started as a simple project to convert Liberty Basic code into C but has grown into a GCC front-end to allow direct compliation of Liberty Basic code.

It currently has a fully functioning grammar definition and a fully built syntax tree.  I am in the process of translating the LB syntax tree into the native GCC RTL tree format (a relatively simple process, with an unforunately steep learning curve it seems).

Liberty Basic is a pretty simple Basic dialect but I have written all the code for the project in a generic way so extending it to another language should be fairly easy.

All the code for the project is written in C.  I notice many believe here that a Basic compiler should be written in Basic, but I don't think this is such a good idea.  Especially since a great deal of GLBCC is written in Lex/Yacc since these languages are meant to be used for writing compilers.

The cool thing about GLBCC though is that since it compiles natively, a large portion of the run-time library can be written in Liberty Basic itself.

Once GLBCC is integrated with GCC, GDB will work completly as a debugger for the language (although, one would have to debug it via C code).  I do not know how hard it would be to add the ability to understand Basic to GDB but I don't really think it's necessary since this is only really used for the more advanced features (like conditional breakpoints and stuff).  I would rather just see a GUI front end be used.

Due to the way I designed GLBCC, writing an interpretter for the language should also be fairly straight forward since the entire run-time library can be reused and the entire parser and tree manipulation routines can be reused.

The website for GLBCC is at:

http://lbpp.sf.net

There is a package available for download that runs on both Windows and Linux (and allows Windows executables to be created on Linux).  I am having some install related problems on some versions of Windows but that should be resolved soon enough.  The compiled executables run fine on Windows though, it is just my install program unfortunately that doesn't seem to want to work.

There are some other neat features of GLBCC such as string reference counting and OO device classes.  These were really fun to implement in C and are about the only aspects of the run-time library that probably couldn't be easily implemented in Liberty Basic itself.

Regards,
Anthony Liguori
GLBCC
http://lbpp.sf.net