home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / compiler / 2113 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.9 KB

  1. Path: sparky!uunet!spool.mu.edu!uwm.edu!ogicse!das-news.harvard.edu!spdcc!iecc!compilers-sender
  2. From: finger@convex.com (Jay Finger)
  3. Newsgroups: comp.compilers
  4. Subject: Re: Input buffer overflow in lex...
  5. Keywords: lex, comment
  6. Message-ID: <93-01-040@comp.compilers>
  7. Date: 8 Jan 93 00:12:02 GMT
  8. Article-I.D.: comp.93-01-040
  9. References: <93-01-009@comp.compilers> <93-01-024@comp.compilers>
  10. Sender: compilers-sender@iecc.cambridge.ma.us
  11. Reply-To: finger@convex.com (Jay Finger)
  12. Organization: CONVEX Computer Corporation, Richardson, Tx., USA
  13. Lines: 27
  14. Approved: compilers@iecc.cambridge.ma.us
  15.  
  16. richw@sol.camb.inmet.com (Richard Wagner) writes:
  17. >In the version of "lex" I use, the generated lexer gets its input via an
  18. >"input" macro.  One solution, which may be viewed as a "kludge" or "hack",
  19. >is to [redefine the input() macro]
  20.  
  21. I don't remember where I read this, but some piece of of AT&T
  22. documentation I once read documented the input macro and suggested that it
  23. be redefined to fit your own application if you thought that was
  24. appropriate.  I have done this many times in the past, but all of the code
  25. I have with me now uses flex (which uses a different input mechanism
  26. completely).
  27.  
  28. So, while it me be a kludge, it's at least an "official kludge". :-)
  29.  
  30. jay
  31. -- 
  32. Jay Finger - finger@convex.com        | Convex Computer Corp
  33. CONVEX System Integration and Support | 3000 Waterview Parkway
  34. Product Specialist                    | Richardson, TX 75080
  35. [In the O'Reilly "lex & yacc" there are several examples of redefining the
  36. lex input macro, since there isn't any other way to change the input source.
  37. Flex lets you redefine YY_INPUT which reads a chunk of input, which is a lot
  38. easier since you don't have to worry about pushback as you do with input().
  39. -John]
  40. -- 
  41. Send compilers articles to compilers@iecc.cambridge.ma.us or
  42. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  43.