implementing #include etc without pre-preprocessing

Sudhakar Frederick <sfrederi@asc.corp.mot.com>
16 Mar 1997 23:38:48 -0500

          From comp.compilers

Related articles
implementing #include etc without pre-preprocessing sfrederi@asc.corp.mot.com (Sudhakar Frederick) (1997-03-16)
Re: implementing #include etc without pre-preprocessing thetick@scruz.net (Scott Stanchfield) (1997-03-18)
Re: implementing #include etc without pre-preprocessing bothner@cygnus.com (1997-03-21)
Re: implementing #include etc without pre-preprocessing ftit07bv85@pop.anti.wanadoo.spam.fr (1997-03-21)
Re: implementing #include etc without pre-preprocessing ok@cs.rmit.edu.au (1997-03-21)
Re: implementing #include etc without pre-preprocessing sethml@ugcs.caltech.edu (1997-03-22)
| List of all articles for this month |

From: Sudhakar Frederick <sfrederi@asc.corp.mot.com>
Newsgroups: comp.compilers
Date: 16 Mar 1997 23:38:48 -0500
Organization: Motorola Australia Software Centre
Keywords: parse, question

Hi,


Sort of a newbie question:


Is it practical to implement "conditional compilation" C-style
constructs similar to #include, #define #ifdef etc. as part of the
parsing rather than through a pre-processor. I'm using Bison and Flex.
My question is about how to implement #includes. Has anyone done this
before? How does the Flex/Bison input buffer switching work: When I
hit a #include I think I'll need to save some state info about the
current buffer. What do I need to do to get Flex/Bison to start from
where it left off on the previous input?


Any advice/comments/pointers much appreciated.


Thanks in advance,


Freddy
--
  SUDHAKAR FREDERICK
  mailto:sfrederi@asc.corp.mot.com
[Look at the flex manpage, wherein is found great wisdom on creating,
deleting, and switching among input buffers. Yes, you can do this although
the expressions in #if require a complete expression parser. -John]


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.