Re: Lex surrogates

Henry Spencer <henry@zoo.toronto.edu>
Sat, 11 Feb 89 00:19:36 EST

          From comp.compilers

Related articles
[3 earlier articles]
Re: Lex surrogates rsalz@BBN.COM (Rich Salz) (1989-02-07)
Re: Lex surrogates wpl@PRC.Unisys.COM (1989-02-06)
Re: Lex surrogates ken@cs.rochester.edu (Ken Yap) (1989-02-09)
Re: Lex surrogates mike@arizona.edu (1989-02-09)
Re: Lex surrogates tower@bu-cs.BU.EDU (1989-02-10)
Re: Lex surrogates pardo@june.cs.washington.edu (1989-02-11)
Re: Lex surrogates henry@zoo.toronto.edu (Henry Spencer) (1989-02-11)
Re: Lex surrogates holt@turing.toronto.edu (Ric Holt) (1989-02-13)
Re: Lex surrogates henry@zoo.toronto.edu (1989-02-16)
Re: Lex surrogates gmdka!grosch@unido.irb.informatik.uni-dortmund.de (1989-02-17)
| List of all articles for this month |

From: Henry Spencer <henry@zoo.toronto.edu>
Date: Sat, 11 Feb 89 00:19:36 EST
In-Reply-To: <3304@ima.ima.isc.com>

>...one way
>flex gets its speed is by returning a pointer to the string comprising
>the token in place (no string copying). This can bite you if you are
>using flex with yacc/bison and you don't copy the string into your own
>variable right away. After the next terminal has been matched is too
>late.


The stuff lex puts in yytext[] also changes for each terminal, and hence
also must be saved immediately if you want to use it. I don't understand
why the lack of copying makes a practical difference.


                                                                          Henry Spencer at U of Toronto Zoology
                                                                  uunet!attcan!utzoo!henry henry@zoo.toronto.edu
--


Post a followup to this message

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