[antlr-interest] Best practice to handle Lexer backtracking demand

Joachim Schrod jschrod at acm.org
Sun Aug 15 01:45:15 PDT 2010


Gerald Rosenberg wrote:
> 
>> Input: aaaaXXXXbbbb wwwXXX ddddYYYzzzz
>>
> How is XXXX guaranteed to be unambiguous with any other fragment of 
> aaaaXXXXbbbb?  That is, how can you be sure that a fragment like aaaX or 
> XXXXb will never match a different start marker.

The data generating service guarantees it. (It escapes characters
if any complete marker substring happens to be in the data.)

> Is there a case 
> distinction, as implied, or something more interesting?  Is the 
> distinction the same for the end marker?

No and no. The markers are strings like `prenames', `prenamee',
`surnames', etc. That's why I used that example in my original email.

	Joachim

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod				Email: jschrod at acm.org
Roedermark, Germany



More information about the antlr-interest mailing list