[antlr-interest] Re: (follow up) setting,
altering text in lexer rules
Terence Parr
parrt at cs.usfca.edu
Mon Jun 12 16:43:56 PDT 2006
On Jun 12, 2006, at 4:41 PM, Bill Canfield wrote:
>> Well the ! thing has always been a pain in the ass ;) I'd rather opt
>> for speed for now with a workable solution and see what happens in
>> the future. :)
>
> Ter:
>
> One testcase I profiled (C++) used most of its time allocating more
> and
> more space for the text of a multi-thousand-line comment that I was
> just
> going to throw away anyway. I was sure! glad! to! have! that
> exclamation point!!!
>
> I would like to second Don Caton's viewpoint: pick good features and
> then optimize.
Hi Bill,
Yep. I did to pick features to start with so that there IS no char
copying by default, which is why the ! is such a huge pain this go
around. All tokens point into the char buffer, the correct
approach. It's very rare to modify more than a few tokens' text. I
believe I've made the right choice here. For your comment case,
you'll get love out of the box; no ! needed. I call that a great
invisible feature :)
Thanks to all for the comments!
Ter
More information about the antlr-interest
mailing list