Assignments Branch: CE Subject: Compiler Design (3170701)
Unit 1. Overview of the Compiler and its Structure
1. Write Definition of Compiler. 2. Explain Phases of Compiler. 3. What is the difference between compiler and interpreter? 4. List the cousins of compiler and explain the role of any one of them. 5. Explain Incremental Compiler.
Unit 2. Lexical Analysis
1. Define lexemes, patterns and tokens. 2. Define lexeme, token and pattern. Identify the lexemes that make up the tokens in the following program segment. Indicate corresponding token and pattern. void swap(int a, int b) { int k; k = a; a = b; b = k; } 3. Explain Input Buffering. 4. Explain Optimization of DFA. 5. Construct the NFA using thompson’s notation for the following regular expression and then convert it to DFA a+(c|d)b*f#. 6. Draw DFA from regular expression without constructing NFA. (a|b|c)*a(b|c)*#.
Unit 3. Syntax Analysis
1. Construct leftmost and rightmost derivation for the sentence abab S -> aSbS | bSaS | Ɛ. 2. Differentiate top down parsing and bottom up parsing. 3. Eliminate left recursion from the following grammar and rewrite the grammar. S -> Aa | b A -> Ac | Sd | Ɛ 4. Distinguish between ambiguous and unambiguous grammar ? 5. Explain Bottom Up Parsing.
Apollo Institute of Engineering and Technology (121) CE Department
CD (3170701) Semester: VII
Unit 4. Syntax Directed Translation & Unit 5. Error Recovery
1. Explain Syntax Directed Definitions. 2. Discuss synthesized attributes and inherited attributes in details. 3. Differentiate between S-attributed grammar and L-attributed grammar. 4. Explain Construction of Syntax Trees. 5. Construct a syntax-directed translation scheme that translates arithmetic expressions from infix into postfix notation. Show the application of your scheme to the string “3*4+5*2”. 6. Explain Ad-Hoc and Systematic Methods.
Unit 6. Intermediate-Code Generation
1. Explain Properties of Intermediate Languages. 2. Explain Variants of Syntax Trees. 3. Translate the arithmetic expression a*-(b+c) into 1.Syntax tree, 2.Postfix notation, 3.Three address code 4. Explain quadruple, triple and indirect triple with suitable example. 5. Translate the expression -(a*b)+(c*d)+(a*b*c) into 1.Quadruples, 2.Triples 3.Indirect triples.
Unit 8. Code Generation and Optimization & Unit 9. Instruction-Level Parallelism
1. Write the generic issues in the design of code generators. 2. Explain Basic Blocks and Flow Graphs. 3. Explain Loops in Flow Graph. 4. Construct Syntax tree and DAG for following expression. a = (b+c+d) * (b+c-d) + a 5. Explain Few Selected Optimizations. 6. Explain how instruction Processing occurs using Instruction Pipelining. 7. Explain basic block scheduling with suitable example.
Apollo Institute of Engineering and Technology (121) CE Department