954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem about grammar rules

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:

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

---------> if exp then else (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. :sad:

static_ace
Newbie Poster
2 posts since Apr 2004
Reputation Points: 10
Solved Threads: 0
 

Sorry never mind. I finally got the solution.

static_ace
Newbie Poster
2 posts since Apr 2004
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You