From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: aldyh@redhat.com (Aldy Hernandez) Cc: zlaski@apple.com (Ziemowit Laski), mark@codesourcery.com (Mark Mitchell), jbuck@synopsys.COM (Joe Buck), jsm28@cam.ac.uk (Joseph S. Myers), gcc@gcc.gnu.org (gcc@gcc.gnu.org) Subject: Re: Target-specific Front-Ends? (Was: front end changes for Date: Wed, 28 Nov 2001 09:11:00 -0000 Message-ID: <200111281711.JAA03791@atrus.synopsys.com> References: X-SW-Source: 2001-11/msg01484.html Message-ID: <20011128091100.9OoBvbdO2H23PuV7DRT7a0ZCnsw0UQMfxVNme4faH5w@z> Tuesday, November 27, 2001, at 06:23 , Aldy Hernandez wrote: > > >> I've actually thought about implementing generic front end extension > >> support to gcc for this kind of nonsense. Sort of like a preprocessor > >> that runs after the actual C preprocessor-- massages the output in any > >> way it sees fit, and feeds its output to the lexical analyzer. ... > > Well, it definitely sounds interesting! Tell me more. :) :) Aldy again: > simple, it just reads the output from CPP, manipulates the strings, > and, feeds it's output to the lexer. But we no longer use a separate preprocessing program. We now use cpplib, integrating preprocessing with lexing for the main compiler. I suppose that you could still insert a pass that looks like the C++ "spew" hack (implement a token queue to allow for extra lookahead and re-labeling of tokens).