home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!mips!darwin.sura.net!wupost!think.com!spdcc!iecc!compilers-sender
- From: cdh@world.std.com (Charles D Havener)
- Newsgroups: comp.compilers
- Subject: Using FLEX to do macro processing - enhancement to include processing
- Keywords: flex, macros, question
- Message-ID: <92-07-077@comp.compilers>
- Date: 23 Jul 92 13:21:24 GMT
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: cdh@world.std.com (Charles D Havener)
- Organization: The World Public Access UNIX, Brookline, MA
- Lines: 18
- Approved: compilers@iecc.cambridge.ma.us
-
- Has there been any discussion about using FLEX to handle macro expansion
- as opposed to just #include type processing as descriobed in the Flex
- manual?
-
- For example, can I use yy_create_buffer(FILE *file,int size) with a NIL
- FILE * and merely unput() the macro text into this buffer? Then I could
- use yy_switch_buffer(..) to switch to the macro buffer. I haven't tried
- this. Is there some other recommended way? I really don't want to write
- the expanded macro out to a disk file and then read it back in.
-
- Charlie Havener at Epsilon - Burlington , Mass. 617-273-2630 x6064
- cdh@world.std.com
- [Plain unput() might work, though I imagine it'd be more robust to
- redefine YY_INPUT to copy in expanded text when it's reading from a
- buffer corresponding to expanded text. -John]
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-