This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC Parse Tree/Grammar Issues


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]