[antlr-interest] Parser generation takes hours

Terence Parr parrt at cs.usfca.edu
Fri Jan 8 21:36:40 PST 2010


ANTLRWorks can do some left-factoring automatically.
Ter

On Jan 8, 2010, at 3:05 AM, Denis Debarbieux wrote:

> Hi everybody,
>> One of most tough problem in the migration for me was to resolve the
>> left factoring.
>
> I am surprised by this discussion.
>
> I thought that there are algorithms that automatically removes left
> recursions and left factorizations. Did I learn those algorithms at
> school but they are never used in real problem? Why  ANTLR does not  
> use
> them?
>
> Regards
>
> Denis
>
> Gokulakannan Somasundaram a écrit :
>> Hi Jean,
>>         I faced up with a similar issue, when i tried the migration  
>> of  a
>> LR parser. But it's definitely because of recursion stuffs. The way i
>> removed is sort of layman stuff, but thought of just informing you.
>>         Try to split the grammar into multiple sections(group of  
>> rules) and
>> try to add them one-by-one. You don't need to wait till the errors  
>> are
>> emitted. As soon as the parser generation takes more than 3-4 mins,  
>> just
>> stop the generation. The last section, which resulted in the  
>> increase most
>> probably contains the problematic code. Bear with me, if this  
>> approach looks
>> very awkward.
>>
>> Thanks,
>> Gokul.
>>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list