help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: too many gotos


From: Nick Chapman
Subject: Re: too many gotos
Date: Wed, 13 Oct 2004 13:09:01 +0000

On Wednesday 13 October 2004 11:38, Sylvain Schmitz wrote:
>
> For a quick answer, the number of gotos depends on the number of states
> and the number of nonterminals (aka variables).  Thus if you have
> redondant nonterminals you could try to factor these.


Thank you.

And I think my problem is that I have been transforming the grammar in the
reverse direction.

I started with a badly conflicting grammar, which I have been
(semi-automatically) transforming to reduce the conflicts.

The starting grammar, having just 30649 gotos, was just within the limit.
But my transformations have blown it!

The counts of #rules/#states for the original & current grammars are:

orig:
    conflicts: 1265 shift/reduce, 2328 reduce/reduce
    #rules  = 907
    #states = 5376
    ngotos  = 30649

current:
    conflicts: 104 shift/reduce, 188 reduce/reduce
    #rules  = 1036
    #states = 7836
    ngotos  = 45156

So although the transformations have `only' increased the number of
non-terminals by around 10%, the states have blown up by 50%.


Nick.

-- 
Nick Chapman, Amadido Limited. address@hidden
34, St. Mary's Road, Harefield, Middlesex, UB9 6AD, UK.
+44 1895 473691 (work)  +44 7966 421391 (mobile)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]