CSC365 Compiler Design and Construction

Compiler Design and ConstructionModel question

What is ambiguous grammar? Explain the "Dangling Else" problem with example. Show how to resolve it. Construct the LL(1) parsing table for the following grammar (after removing left recursion if…

10

What is ambiguous grammar? Explain the "Dangling Else" problem with example. Show how to resolve it.

Construct the LL(1) parsing table for the following grammar (after removing left recursion if needed):

E → E + T | T

T → T * F | F

F → (E) | id

Parse the string id + id * id using this table.

A worked answer is on its wayMeanwhile, read the Compiler Design and Construction notes for this topic.

Discussion

Loading…

More Compiler Design and Construction questions

All Compiler Design and Construction old questions