Re: Computing Follow set

"Russ Cox" <rsc@swtch.com>
Thu, 6 Mar 2008 21:04:52 -0500

          From comp.compilers

Related articles
Computing Follow set pavan.mail@gmail.com (pavan) (2008-03-06)
Re: Computing Follow set rsc@swtch.com (Russ Cox) (2008-03-06)
Re: Computing Follow set torbenm@app-2.diku.dk (2008-03-07)
Re: Computing Follow set max@gustavus.edu (Max Hailperin) (2008-03-07)
Re: Computing Follow set haberg_20080207@math.su.se (Hans Aberg) (2008-03-08)
| List of all articles for this month |

From: "Russ Cox" <rsc@swtch.com>
Newsgroups: comp.compilers
Date: Thu, 6 Mar 2008 21:04:52 -0500
Organization: Compilers Central
References: 08-03-033
Keywords: LR(1)
Posted-Date: 08 Mar 2008 10:55:04 EST

> A -> aB | a
> B -> bA | b
>
>>From the production A -> aB, we have FOLLOW(B) contains FOLLOW(A).
>>From the production B -> bA, we have FOLLOW(A) contains FOLLOW(B).
>
> This ends up being an infinite loop when I code it. I would appreciate
> your suggestions on this.


Start with FOLLOW(A), FOLLOW(B) empty, and then
repeatedly recalculate them, until they stop growing.


Russ



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.