A FrontEnd in C++?

Michael S. Zick mszick@goquest.com
Sat Aug 17 18:06:00 GMT 2002


On Saturday 17 August 2002 05:45 pm, khalid aggag wrote:
> I am currently developing a new Frontend for an educational language for
> GCC. I have the language's lexical analysis and parsing modules in C++. Is
> it possible to develop a frontend for gcc written completely in C++? How
> would I make up for the different function naming and calling conventions
> between C and C++? Thanx alot in advance.
>
>
> Khalid Aggag

Aside from the technical questions...
Have you considered the bootstrapping issues?

Originally, GCC could be bootstrapped with "any 'ol" C compiler.
Now, it can be bootstrapped with (almost) "any 'ol C compiler PLUS an Ada 
compiler that produces "link compatable" object files.

Writing a front end in C++ would make that process:

Stage0: any 'ol C compiler -> gcc<c, c++>
Stage1: gcc<c, c++> + new_frontend -> gcc<c, c++, New>
Stage2: gcc<c, c++, New> -> presumably_finished_compiler
Stage3: presumably_finished_compiler -> finished_compiler

Compare Stage2 with Stage3, if same; then done; else punt!

And just to make it more interesting - add bootstrapping Ada in the above 
process at the same time.

Mike



More information about the Gcc mailing list