home bbs files messages ]

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,531 of 2,753   
   Andy to All   
   How change grammar to equivalent LL(1) ?   
   22 Dec 19 15:55:12   
   
   From: borucki.andrzej@gmail.com   
      
   Obviously if is possible.   
   In Polish Wikipedia can we read, that even very simple grammar:   
   expr->number '+' expr   
   expr->number   
   is not LL(1) bacause we must see '+' to distinguish   
      
   But   
   is posssible equivalent grammar:   
   expr -> number optPlusExpr   
   optPlusExpr -> epsilon   
   optPlusExpr ->'+' expr   
      
   What are general rules to change grammar to equivalent LL(1) grammar if   
   possible?   
   [This topic is covered in every compiler textbooks.  Or you can start   
   with this Wikipedia article   
   https://en.wikipedia.org/wiki/Left_recursion#Removing_left_recursion   
   -John]   
      
   --- 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