CD QB - Prep
CD QB - Prep
School of Computing
QUESTION BANK
PART-A
1. What is a translator?
2. Differentiate interpreters and compilers.
3. What is an assembler?
4. What are the phases of a compiler?
5. What is bootstrapping a compiler?
6. What are the two parts of compilation? Give a Diagram.
7. Give the parse tree for the statement a:=b+c*60.
8. What is the use of scanner generator?
9. What do you mean by syntax and semantics of a language?
10. Give some four compiler-generator tools.
11. Mention the cousins of the compiler.
12. Define a token.
13. What is a preprocessor?
14. What is a symbol table?
15. Define regular expressions.
16. Write down the Algebraic laws obeyed by Regular expressions
17. Define a finite state automation.
18. Draw the NFA for a*b*
19. Draw the NFA for R = (( ε | a ) b* ) *
20. Give the Procedure for ε-Closure
21. What is a transition diagram? Give example.
22. What is a recognizer?
23. What is CFG? Give example.
24. What are the capabilities of CFG?
25. Describe language denoted by the following regular expression:
0(0/1)*0
26. Describe language denoted by the following regular expression:
(0/1)*0(0/1)(0/1)
27. Describe language denoted by the following regular expression:
0*a0*a0*a0*
28. Write the regular definition for the following language:
"All strings of digits with no repeated digits"
29. Give an example for ambiguous grammar and justify it.
30. What is a parse tree?
31. What are the types of Grammars?
32. What is a Linear Grammar? Give ex.
33. What do you mean by BNF? Give Ex.
PART-B
7. Construct a minimal DFA for (a/b)*(a/b) and write the algorithm for
minimizing a DFA.
8. Explain the process of constructing an NFA from the regular expression.
9. Find the NFA for the expression (a/b)*abb.
10. Construct the DFA for (a/b)*abb and minimise the DFA.
11. Convert the Regular expression to DFA using Thompson’s Construction
R = (a | b)* a ( a | b )
12. How would you construct a DFA directly from a regular expression?
13. Write the appropriate rules and algorithm wherever necessary.
14. a. Discuss the Language for specifying Lexical analyzer
b. Explain the design of a Lexical analyzer generator
15. Explain the Thomson's construction technique in detail. Construct the
NFA for the expression d(a/b)*a.
16. Explain Non recursive predictive parsing technique
17. Explain shift-reduce parsing with stack implementation.
18. Explain Shift Reduce Parsing and Perform the stack implementation to show that the
string not ( true or false ) is parsed using the grammar given below
Bexpr -> Bexpr or Bterm | Bterm
Bterm -> Bterm and Bfactor | Bfactor
Bfactor -> not Bfactor | ( Bexpr) | true | false