1. Errors in a computer program can be classified according to when they are detected and, if they are detected at compile time, what part of the compiler detects them. Using your favorite imperative language, give an example of each of the following. (a) A lexical error, detected by the scanner (b) A syntax error, detected by the parser (c) A static semantic error, detected by semantic analysis (d) A dynamic semantic error, detected by code generated by the compiler (e) An error that the compiler can neither catch nor easily generate code to catch (this should be a violation of the language definition, not just a program bug) 2. Algol family languages are typically compiled, while Lisp family languages, in which many issues cannot be settled until run time, are typically interpreted. Is interpretation simply what one “has to do” when compilation is infeasible, or are there actually some advantages to interpreting a language, even when a compiler is available? Please state the comparative advantages between compiled code and interpreted code. 3. Which compiler phase (scanner, parser, constrainer, code generator) would be resposible for catching each of the following errors ? a. An illegal character b. Premature end-of-file. c. A undeclared variable. d. An unknown library function. e. Division by zero.o 4. Using the sample grammar on slide 13 in Lecture 3, build the derivation tree for the input i + ( i * i + i ) / i. 5. Using the Classical Top-Down Parsing Algorithm (slide 28), and the parse table on slide 32, hand-execute the parser for the input bbbddd| (here, "|" is "chicken-foot :-)