Constructing LL(k) tables

Borneq <a.moderacja@gmail.com>
Sun, 13 Nov 2011 04:57:26 -0800 (PST)

          From comp.compilers

Related articles
Constructing LL(k) tables a.moderacja@gmail.com (Borneq) (2011-11-13)
Re: Constructing LL(k) tables DrDiettrich1@aol.com (Hans-Peter Diettrich) (2011-11-14)
| List of all articles for this month |

From: Borneq <a.moderacja@gmail.com>
Newsgroups: comp.compilers
Date: Sun, 13 Nov 2011 04:57:26 -0800 (PST)
Organization: Compilers Central
Keywords: LL(1), question
Posted-Date: 13 Nov 2011 18:24:17 EST

To construct LL(1) table M:
for each production A->alpha do:
for each terminal a from FIRST(alpha) (a<>eps) add production A->alpha
to M[A,a]
if eps is in FIRST(alpha), for each b from FOLLOW(A) add A->alpha to
M[A,b]


If grammar is not LL(1), in one table position there will be more than
one production. Can I construct LL(k) tables simply by splitting cells
with more than one production? Which is algorithm to production
choosing ?



Post a followup to this message

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