Why do we sometimes restrict the set of allowable languages
for compilation? Give an example of a language construct that, though
valid, might not be allowed, and explain why not.
(Don't use examples discussed in class; come up with your own.)
Top-down and bottom-up
parsers require different language restrictions in order to work.
Which type of parser do you think will be more flexible, i.e.,
allow a larger set of languages? Briefly explain your choice.
The following grammar has a few problems. For starters, it's ambiguous.
Without changing the underlying language it describes,
modify the grammar so that it is both unambiguous and
amenable to top-down (LL) parsing.
Material contained above is made available
for the purpose of peer review and discussion and does not
necessarily reflect the views of the Department of the Navy or the
Department of Defense.
Some links above are to sites that are not
located at the United States Naval Academy. The USNA is not
responsible for the content found on these sites. In addition, the
content of these sites does not reflect the opinions, standards,
policy or endorsement of the Naval Academy or the United States