Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #336

Constructing LL(k) tables

From Borneq <a.moderacja@gmail.com>
Newsgroups comp.compilers
Subject Constructing LL(k) tables
Date 2011-11-13 04:57 -0800
Organization Compilers Central
Message-ID <11-11-034@comp.compilers> (permalink)

Show all headers | View raw


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 ?

Back to comp.compilers | Previous | NextNext in thread | Find similar


Thread

Constructing LL(k) tables Borneq <a.moderacja@gmail.com> - 2011-11-13 04:57 -0800
  Re: Constructing LL(k) tables Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2011-11-14 01:56 +0100

csiph-web