Question: Ambiguous Grammars Some programming languages have if expressions: :: = + | = | * | if then else | | | ( ) Thus
Ambiguous Grammars Some programming languages have if expressions: :: if then else Thus one can write: if x then else x y However the grammar above is ambiguous. Show all five parse trees for the string if then else For each one, indicate what the computed result would be In the next step, Ill ask you to write an unambiguous grammar that accepts the same language. But doing so is tricky. So first, find whats wrong with the following threesolutions For each one, indicate if there are false negatives strings that are not accepted, even though they should be false positives strings that are accepted, even though they should not be or ambiguous parses strings for which there is more than one parse tree You must give concrete examples. Concrete examples have no nonterminals in them.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
