home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / compiler / 1256 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.4 KB

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