[antlr-interest] Fragments and setText appear to not work at all - not even with code from the book

Harald Mueller harald_m_mueller at gmx.de
Wed Nov 21 02:15:22 PST 2007


> My copy of the book has something totally different on page 105 ...

A friend of mine showed me the code in a PDF version labelled "Beta 3" he got before the printed book ... so there may be offsets. The example is in 4.3 Rules, section "Lexical Rules" (some 14 pages after the start of the chapter), segment "Fragment Lexer Rules".

> Anyway, what you refer to is not a 
> bug in the sense that it was a deliberate design decision for the sake 
> of performance. [...] In other words, "settext" that 
> you do in a fragment rule is irrelevant.

Aha.
And how do you then convert an ANTLR2 grammar with ! in protected rules to ANTLR3?
And why is the example in the book, which explicitly DOES use setText() in a fragment??????

Regards
Harald


-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger


More information about the antlr-interest mailing list