11 votes 11 votes Does there exist LL(1) grammar for every Regular Language ? OR For Every Regular Language there exist atleast one LL(1) Grammar . True /False Compiler Design compiler-design parsing theory-of-computation regular-language + – Himanshu1 asked Dec 5, 2015 • retagged Jun 4, 2017 by Arjun Himanshu1 3.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 14 votes 14 votes True : For every Regular Language there exists a LL(1) grammar. This is true because we can always get a right recursive grammar for any LL(1) that generates a Regular language. amarVashishth answered Dec 5, 2015 • selected Dec 5, 2015 by Himanshu1 amarVashishth comment Share Follow See all 30 Comments See all 30 30 Comments reply Show 27 previous comments Arjun commented Dec 6, 2015 reply Follow Share @Amsar that should be a typo there. Because regular set does not have prefix property. And why? It is just about allowing one more choice. But that is not given- I don't know the practical reason for this. 1 votes 1 votes Himanshu1 commented Dec 6, 2015 reply Follow Share Oky. thanks.. :) 0 votes 0 votes agoh commented Nov 16, 2016 reply Follow Share What about ambiguous grammar? How will it be LL(1)? 0 votes 0 votes Please log in or register to add a comment.
–1 votes –1 votes I THINK FOR EVERY RL ,LL(1) GRAMMAR NOT EXISTS BECAUSE S->aS|a IT IS NOT LL(1)BUT IT IS REGULAR GRAMMAR. FINITE AUTOMATA POSSIBLE FOR THE ABOVE GRAMMAR Santhosh Devulapally answered Dec 20, 2015 Santhosh Devulapally comment Share Follow See all 3 Comments See all 3 3 Comments reply Himanshu1 commented Dec 21, 2015 reply Follow Share But for language of this Regular grammar , i.e. a+ there exist a LL(1) grammar. 1 votes 1 votes Santhosh Devulapally commented Dec 21, 2015 reply Follow Share it is not LL(1) on input symbol 'a' it has two transitions i.e)s->as and s->a so there is a conflict occurs 0 votes 0 votes ravi_ssj4 commented Jun 29, 2016 reply Follow Share After removing non-determinism, it will be LL(1). S -> aS' S' -> S/∈ 0 votes 0 votes Please log in or register to add a comment.