new gcc front end question
Andi Hellmund
mail@andihellmund.com
Thu Dec 16 19:39:00 GMT 2010
Hey Asma,
> what I tried to do, is to avoid the use of Flex Bison (because I did not use
> them before and they are old tools ) and I replace those tools by another which
> parse my source file and produce directly the generic form !
In my personal opinion, tools like flex and bison are still great tools,
but that's a matter of flavor. You'll definitely find other
scanner/parser generation tools out there ...
> I want to pass the generic form to the gcc and I expect that he could compile it
> (i,e. when you specify the -S option, GCC will produce the .s file and will not
> link : we stop the GCC :run only cc1 not the as, the same when you specify -c we
> stop the GCC just after as we do not call ld : following this approach, I
> expected the gcc to start compiling from the Generic form ! but this is not
> possible or not implemented yet.
>
Well, GENERIC is an intermediate representation for the compiler and to
my knowledge - there's no formal specification for GENERIC, so yes this
is not implemented the way you like to use it.
But, if you're looking for a way to feed GCC with an intermediate
representation in plain text form, you might want to have a look at the
GIMPLE front-end here http://gcc.gnu.org/wiki/GimpleFrontEnd.
I don't know the current status of the project, but you could ask for it
on the mailing list, but you should use a separate thread (with a new
title) so that your questions really gets attention by the right people.
> I will take a look at Flex Bison, since this is the only way to implement gcc
> front end.
>
That's not true either. There are various ways/tools to implement a
front-end. For example, the C front-end meanwhile uses a hand-written
scanner and parser.
Best regards,
Andi
More information about the Gcc-help
mailing list