This is a subset of the final exam that Dr. Eggers gave in 1994.

Q: What are the two key differences between intermediate languages that assembly code target languages?

A1: Intermediate languages are machine independent, that is they are an abstract representation of the underlying hardware, while target languages are necessarily machine dependent and reflect the opcodes, addressing modes physical registers of the underlying hardware. An implication of this is that intermediate languages are a better vehicle for retargeting a compiler to another machine.

A2: Intermediate languages virtualize storage, allowing and assume an unbounded number of temporary registers or run time storage; the real machine has limits, but those limits can be dealt

Q: can any language be described using regular expressions?

A: no, since REs are not powerful enough to describe recursion or balanced delimiters, such as parenthesis.

Q: Is it possible for a CFG to describe the extended PL/0 language, deriving all legal PL/0 programs and no illegal ones?

A: No, emphatically. CFG's can not check semantics, for example: type checking; guaranteeing that the same procedure name occurs on the declaration and end clause; declarations before use, and so on.

Q: What makes a grammar ambiguous?

A: A grammar is ambiguous if there are two distinct parse trees for the same input string/sentence.

Q: Are all left recursive grammars ambiguous? Why or why not?

A: no: for example, S -> a | Sa