This is the mail archive of the
mailing list for the GCC project.
Re: A FrontEnd in C++?
Kelley Cook wrote:
Michael S. Zick wrote:
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!
You just need to treat the new front end the same as, say, the C++ Standard
Library, which requires C++ to build.
So you really get the exact same as what we have now.
Unamed Stage0: any 'ol C compiler -> gcc<c>
Stage1: gcc<c> -> presumably_finished_compiler <c, c++, F77, Java>
Stage2: presumably_finished_compiler -> finished_compiler <c, c++, F77, Java>
Compare stage1 and stage2
If they compare, then do the unnamed stage3 which is to build Fortran's, C++'s,
and Java's Libraries as well as your new Frontend that was written in C++.
Of course, I don't see that there is a good reason other than "It's always been
done that way" and for a greater code sample for the compare to build C++, F77,
and Java in stage 1. But that is not for this discussion.
Maybe someone who understands the treecode front end could
write a set of C++ classes to interface with the rest of the compiler.
If it's going to be done by someone anyway (for their own C++
written front end), it would be nice to have a common interface
available to all.