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.