Compiler Construction Ques Problem

Compiler Construction Ques Problem

Postby abhishekvj » Wed Nov 30, 2011 8:53 pm

Consider the following question
********************************

show whether the following grammar is LL(1) or not
E --> TE/+TE/e
F --> FT/*FT/e
F --> (E)/id


where is is epsilon
****************************************
that ques was in our university exam.
i think the ques was wrong
because there is "T" in second production left side in the place of "F".
and "T" production are also not given.
so we cannot find its FIRST.
reply me is the ques is correct without any modification or cannot be solved
We will get bonus marks if it is a printing mistake
abhishekvj
 
Posts: 2
Joined: Tue Nov 15, 2011 7:52 pm
My College/Company:: 01452671195
Roll Number: 251222

Re: Compiler Construction Ques Problem

Postby JamesBond » Thu Dec 01, 2011 4:05 am

abhishekvj wrote:Consider the following question
********************************

show whether the following grammar is LL(1) or not
E --> TE/+TE/e
F --> FT/*FT/e
F --> (E)/id


where is is epsilon
****************************************
that ques was in our university exam.
i think the ques was wrong
because there is "T" in second production left side in the place of "F".
and "T" production are also not given.
so we cannot find its FIRST.
reply me is the ques is correct without any modification or cannot be solved
We will get bonus marks if it is a printing mistake


Definetly its a wrong question because if you want to parse this grammar this had to be CFG and its the rule of the grammar itself that all the Non Terminals should have a production rule so that the Non Terminals can terminate from the sentential form otherwise they will always remain in it and you language will be empty. And since the above grammar doesnot have production for T it has to be wrong question.

And for further references you can visit the Dragons book of compiler Ullman. This is one of the most standard examples of the Book.
JamesBond
Gatementor Regular
Gatementor Regular
 
Posts: 257
Joined: Thu Jul 07, 2011 10:13 am
My College/Company:: IIT DELHI
Roll Number: 9999999
City: delhi


Return to Discuss GATE 2011 Exam

Who is online

Users browsing this forum: No registered users and 1 guest
cron