This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC Parse Tree/Grammar Issues
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Foolish Ewe <foolishewe at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 14 Apr 2003 21:46:08 +0100
- Subject: Re: GCC Parse Tree/Grammar Issues
- References: <Law9-F5KHRosXmhYkyN0000a8d5@hotmail.com>
Foolish Ewe wrote:-
> 2) Am I correct that gcc uses an ad hoc scanner, I did not see a file wiith
> a .l extension
> in the directory and it looks like c-lex.c may be the scanner? If I'm
Yes, it's hand coded. If you can produce one that handles lexing in the
same way as GCC, by passing the testsuite, and with all the diagnostics
and correct source file locations, I would consider it, but I think
you'll find that machine-generated scanners are not up to the job.
Starting at stage 3 of the ISO phases of translation might be more
realistic.
The lexer is currently in cpplex.c (and partly cpptrad.c for traditional
preprocessing), and is about to undergo a considerable rewrite over
the next few weeks. Whatever you do, it'll be worthwhile waiting for
the dust to settle as the end result will be considerably cleaner.
Neil.