Individual assignment for the course Compiler design
Due date will be 23-09-2013 morning 2:00LT
1. Select four different programming languages, discuss the historical developments and the difference between their compilers. (5 points) 2. List the end-to-end stages passed by the compiler to compile a source program and discuss each step. (5 points) 3. In detail, design a cooperation between a lexical analyzer and a symbol-table handler. Describe how to store and find identifiers in the table. Furthermore, explain how to distinguish keywords from identifiers. (3 points) 4. Consider the language consisting of all identifiers defined as alphanumerical strings ending with a letter. Construct a finite automaton that accepts this language. Construct a regular expression that denotes this language. (3 points) 5. Consider each of the following languages over {a, b}. Construct a grammar that generates the language. Can you also construct a deterministic pushdown automaton that accepts the language? If so, make the construction. If not, explain why this construction is impossible. (2 points each) (a) {x | x ∈ Σ*, occur(x, a) < occur(x, b)} (b) {x | x ∈ Σ*, occur(x, a) = 2occur(x, b)} (c) {xy | x, y ∈ Σ*, y = reversal(x)} 6. Write one function with any programming language that has at least one loop and one conditional statement and solve the following problem. NB. The function should has at least 4 lines. (4 points each) a) Provide a token stream for each instruction line separately b) Design a parse tree for each token stream provided as per instruction line separately