CD Question Bank
CD Question Bank
Question Bank
Unit 1
1. What is Compiler? Design the Analysis and Synthesis Model of Compiler.
2. Write down the five properties of compiler.
3. What is translator? Write down the steps to execute a program.
4. Explain the phases of compiler with block diagram.
5. Define the compiler. Explain the phases of compiler.
6. Write a short note on:
● YACC
● Pass
● Bootstrapping
● LEX Compiler
● Tokens, Patterns and Lexemes
7. Define following tools :
● Compiler
● Interpreter
● Assembler
● Translator
● Linker & Loader
8. Draw diagram for language processing system and explain.
9. Explain compiler construction tools with example.
Unit 2
1. Define token, pattern and lexeme with suitable example. How input
buffering can be implemented for scanner, Explain.
2. Explain about design of lexical analyzer generator with its suitable
diagram.
3. What is Regular Expression? Write the regular expression for:
● R=R1+R2 (Union operation)
● R=R1.R2 (concatenation Operation)
● R=R1* (Kleen Clouser)
● R=R+ (Positive Clouser)
4. Write a regular expression for a language containing strings which end
with “abb” over Ʃ= {a, b}.
5. Construct a regular expression for the language containing all strings
having any number of a’s and b’s except the null string.
6. Construct Deterministic Finite Automata to accept the regular
expression : (0+1)* (00+11) (0+1)*
7. Derivation and Parse Tree:
Let G be a Context Free Grammar for which the production Rules are
given below:
S -> aB|bA
A -> a|aS|bAA
B -> b|bS|aBB
Drive the string aaabbabbba using the above grammar (using Left Most
Derivation and Right most Derivation).
8. Convert the following Non-Deterministic Finite Automata (NFA) to
Deterministic Finite Automata (DFA).
Unit 3
Unit 6
1. What is code optimization? Explain machine dependent and
independent code optimization.
2. What is common sub-expression and how to eliminate it? Explain with
example.
3. Write a short note with example to optimize the code:
a. Dead code elimination
b. Variable elimination
c. Code motion
d. Reduction in strength
4. What is control and data flow analysis? Explain with example.
5. What are the properties of code generation phase? Also explain the
Design Issues of this phase.