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