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

Gerald Rosenberg gerald at certiv.net
Sun Aug 15 08:52:42 PDT 2010


  The attached grammar illustrates two different patterns that could 
work to identify the markers.

However, there is an open question about whether a valid marker can 
appear without prefix, suffix, or any escaped characters).  Since it is 
not clear what would be valid, I have left the grammar as an incomplete 
example.



------ Original Message (Sunday, August 15, 2010 10:42:28 
AM) From: Joachim Schrod ------
Subject: Re: [antlr-interest] Best practice to handle Lexer backtracking 
demand
> Gerald Rosenberg writes:
>> 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.
>
> 	Joachim
>


-- 

Gerald B. Rosenberg, Esq.
NewTechLaw
260 Sheridan Ave., Suite 208
Palo Alto, CA 94306-2009
650.325.2100 (office) / 650.703.1724 (cell)
650.325.2107 (facsimile)

www.newtechlaw.com

CONFIDENTIALITY NOTICE: This email message (including any attachments) 
is being sent by an attorney,
is for the sole use of the intended recipient, and may contain 
confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited. 
If you are not the intended
recipient, please contact the sender immediately by reply email and 
delete all copies of this message
and any attachments without retaining a copy.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20100815/02d29b64/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.txt
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20100815/02d29b64/attachment.txt 


More information about the antlr-interest mailing list