This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: BCPL compiler with GCC
Tom Crick writes:
>
> > Yes. In fact, you could generate generic trees during parsing.
>
> I think this may be the best way - I like the potential benefits of using
> generic trees, even if if is just for the aesthetic quality.
>
> > But you could convert BCPL to C instead.
>
> Maybe - it wouldn't be so bad to knock up some Perl to convert the BCPL to C
> and then just use GCC as normal, but I'd like it to be a fairly elegant
> solution, plus I'd like to learn more about the GCC internals.
>
> What are the major problems with writing a new frontend? Anything to avoid
> when starting out?
Look at treelang to begin with.
BCPL is such a simple language that generating generic trees from BCPL
parse trees ought to be quite straightforward. It sounds fun.
Andrew.