| | |
Problem about grammar rules
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Thread Solved |
•
•
Join Date: Apr 2004
Posts: 2
Reputation:
Solved Threads: 0
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.
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
- Grammar rules (Java)
- A.I.--Self Programming and Artificial 'Learning' (Python)
- Python for Laptop Robot Speech recognition and TTS. (Python)
- Trouble with a certain Exception (Python)
Other Threads in the Computer Science Forum
- Previous Thread: finding area of something
- Next Thread: Hi Everyone
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery bigbrother binary bittorrent bizarre bletchleypark blogging bomb business cern codebreaker compiler computer computers computerscience computertrackingsoftware connect conversion csc dataanalysis dataintepretation development dfa dissertation dissertations dissertationthesis dissertationtopic ebook employment energy floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government hardware history homeworkassignment homeworkhelp humor ibm idea ideas internet iphone ipod itcontracts jobs kindle laser laws linkbait lsmeans mainframes marketing mobileapplication nano netbeans networking news os p2p piracy piratebay principles programming rasterizer research sam-being-cute sas science security sex simulation software spying stephenfry study supercomputer supercomputing sweden technology textfield turing turingtest two'scompliment uk virus ww2





