Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #2445
| From | Hans-Peter Diettrich <DrDiettrich1@netscape.net> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: FIRST_k, FOLLOW_k, k>1 |
| Date | 2020-02-08 11:00 +0100 |
| Organization | Compilers Central |
| Message-ID | <20-02-007@comp.compilers> (permalink) |
| References | <20-02-004@comp.compilers> <20-02-005@comp.compilers> |
Am 06.02.2020 um 23:16 schrieb Andy:
> I search examples,
> E->aWbXYcdZ
> W->w
> X->x
> Y->y
> Z->z
>
> if for FIRST(k=4) wil be: E={awbx} W={wbxy} X={xycd} Y={ycdz} Z={z}
> what is convention?
Your grammar definitely is LL(1). You should provide a grammar that
requires longer lookahead.
IMO the FIRST set covers all *different* sequences, in your case
FIRST(E)={a} hence LL(1).
Only if there exist multiple alternatives starting with 'a' they have to
be listed as e.g. FIRST(E)={ax, ay}.
Dunno about the FOLLOW set, perhaps it can stay LL(1)?
DoDi
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
FIRST_k, FOLLOW_k, k>1 Andy <borucki.andrzej@gmail.com> - 2020-02-06 10:43 -0800
Re: FIRST_k, FOLLOW_k, k>1 Andy <borucki.andrzej@gmail.com> - 2020-02-06 14:16 -0800
Re: FIRST_k, FOLLOW_k, k>1 Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-02-08 11:00 +0100
Re: FIRST_k, FOLLOW_k, k>1 Andy <borucki.andrzej@gmail.com> - 2020-02-08 11:54 -0800
Re: FIRST_k, FOLLOW_k, k>1 Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-02-09 02:46 +0100
FIRST_k, FOLLOW_k, k>1 Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2020-02-07 16:12 +0200
Re: FIRST_k, FOLLOW_k, k>1 honey crisis <gaztoast@gmail.com> - 2020-02-08 18:18 -0800
csiph-web