Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.compilers    |    Compiler construction, theory, etc. (Mod    |    2,753 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 2,547 of 2,753    |
|    Hans-Peter Diettrich to All    |
|    Re: FIRST_k, FOLLOW_k, k>1    |
|    08 Feb 20 11:00:48    |
   
   From: DrDiettrich1@netscape.net   
      
   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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca