Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: computation...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 2358 of 2508
Post > Topic >>

Re: computation of the canonical collection of sets of LR(0) items

by Scott Burson <FSet.SLB@[EMAIL PROTECTED] > Mar 15, 2008 at 11:36 AM

On Mar 10, 4:57 pm, Carlo Salinari <carlo.salin...@[EMAIL PROTECTED]
> wrote:

> Couldn't the algorithm be rewritten like this:
>
> void items(G') {
>     C = CLOSURE({[S' -> .S]});
>     repeat
>         for ( each set of items I in C )
>             for ( each symbol X in the current set that is on the
>                           right of a dot )
>                 if ( GOTO(I, X) is not already in C )
>                     add GOTO(I, X) to C;
>     until no new sets of items are added to C on a round;
>
> }
>
> Avoiding a (possibly large) set of unfruitful iterations?

I believe you are correct.  I think it's just a case where the most
elegant way to describe an algorithm isn't exactly how you would want
to implement it.  I'm sure there are plenty of such cases in any
compiler text.

-- Scott
 




 2 Posts in Topic:
computation of the canonical collection of sets of LR(0) items
Carlo Salinari <carlo.  2008-03-10 16:57:46 
Re: computation of the canonical collection of sets of LR(0) ite
Scott Burson <FSet.SLB  2008-03-15 11:36:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 7:12:53 CDT 2008.