[antlr-interest] OutOfMemoryException when parsing incorrect input

Rob Harrop rob.harrop at springsource.com
Thu Nov 29 11:49:41 PST 2007


Thanks Clinton! That works a treat.

Rob

----- Original Message -----
From: "Clinton Roy" <clinton.roy at gmail.com>
To: "ANTLR List" <antlr-interest at antlr.org>
Sent: Wednesday, November 28, 2007 8:55:09 PM (GMT) Europe/London
Subject: Re: [antlr-interest] OutOfMemoryException when parsing incorrect input

Hi Rob,

On Nov 29, 2007 3:55 AM, Rob Harrop <rob.harrop at springsource.com> wrote:

> IDENTIFIER
>  : IDENTIFIER_PART ('.' IDENTIFIER_PART) *
>
> fragment
> IDENTIFIER_PART
>  : (ALPHA | DIGIT | '_' | '$' | '-') *

Don't let your token rules allow empty matches, if I replace these
zero-to-many matches with one-to-many matches (+) things seem a little
more happy.

More of a rule of thumb than a specific solution to your problem, hope
that helps,
-- 
Clinton Roy
CSIRO - Robotics Platform Engineer
Autonomous Systems Lab

humbug.org.au  - Brisbane Unix Group
azure.humbug.org.au/~croy/blog - Blog
flickr.com/photos/croy/ - Photos


-- 
Rob Harrop
Interface21 Limited

Registered in England & Wales - Registration Number 5187766
Registered Office: A2 Yeoman Gate, Yeoman Way, Worthing, West Sussex, BN13 3QZ, UK

This e-mail and any attachments transmitted with it are strictly confidential and intended solely for the person or entity to whom they are addressed. Unauthorised use, copying, disclosure or distribution is prohibited. If you receive this e-mail in error please notify the sender immediately and then delete it along with any attachments. E-mails should be checked by the recipient to ensure that there are no viruses and Interface21 does not accept any responsibility if this is not done. Any views or opinions presented are solely those of the author and do not necessarily represent those of Interface21.



More information about the antlr-interest mailing list