943,648 Members | Top Members by Rank

Ad:
Apr 10th, 2004
0

Problem about grammar rules

Expand Post »
I have tried looking in my textbook as well as my notes to figure out how to do this problem. I should have asked my teacher when I had the chance, but first I wanted to try working out the problem myself. I have until Monday to figure out how to do this problem, but would appreciate it if you could help me start. Here's the problem:

Show that the grammar is still ambiguous:

<statement> ------> if exp then <substat> else <statement> (1)
| if exp then <statement> (2)
| other-stat (3)

<substat> ---------> if exp then <substat> else <statement> (4)
|other_stat (5)

I at least know that I have to show two different parse trees of a single statement that fits those rules. Other than that, I'm stuck. Please help.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
static_ace is offline Offline
2 posts
since Apr 2004
Apr 10th, 2004
0

Re: Problem about grammar rules

Sorry never mind. I finally got the solution.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
static_ace is offline Offline
2 posts
since Apr 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Computer Science Forum Timeline: Creating files defined by ME :-)
Next Thread in Computer Science Forum Timeline: Hi Everyone





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC