0% found this document useful (0 votes)
20 views

CD Question Bank

The document contains 26 questions related to compiler design. Some of the key topics covered include: 1. The different phases of compilation like lexical analysis, parsing, code generation and optimizations. 2. Parsing techniques like LL(1) parsing, LR parsing, top-down and bottom-up parsing. 3. Concepts in lexical analysis like lexemes, tokens, buffer management. 4. Syntax analysis concepts like grammars, parsing tables, SLR parsing. 5. Code generation topics like syntax directed translation, intermediate code forms, peephole optimizations.

Uploaded by

Tejas Taneja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

CD Question Bank

The document contains 26 questions related to compiler design. Some of the key topics covered include: 1. The different phases of compilation like lexical analysis, parsing, code generation and optimizations. 2. Parsing techniques like LL(1) parsing, LR parsing, top-down and bottom-up parsing. 3. Concepts in lexical analysis like lexemes, tokens, buffer management. 4. Syntax analysis concepts like grammars, parsing tables, SLR parsing. 5. Code generation topics like syntax directed translation, intermediate code forms, peephole optimizations.

Uploaded by

Tejas Taneja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Compiler Design

Question Bank
1. Explain the step by step (showing input and output of each phase) compiler translation of
the statement: - X:=Y*Z+10. Take another example also if required.
2. Define:
a. Cross compiler
b. Dirty Compiler
c. Lexeme
d. Token
e. Pattern
3. Discuss the advantages and disadvantages for single and multipass compilers
4. Differentiate between pass and phase in compiler design.
5. What is the need of lookahead pointer in Lexical analyzer.
6. Explain buffer management in lexical analyzer.
7. Write tools for lexical analyzer.
8. Differentiate between Top down and bottom-up parser
9. What is ambiguous CFG? Explain with Example. How it can be removed.
10. Explain Top down parser and the associated problems.
11. What is left recursion? How it can be removed?
12. What is backtracking problem in Top-down parser? How it can be removed?
13. What is recursive descent parser? Give example
14. Write the rules for finding First and Follow in a given grammar.
15. Write the rules to design predictive parsing table.
16. What is LL(1) Parser?
17. What is shift reduce parser? Explain with example.
18. Define handle and handle pruning.
19. What is operator grammar? Give example.
20. Explain Leading and trailing. What is their significance?
21. What is operator precedence parser?

22. Consider the following grammar:


S a | ^ | (T)
T T,S | S.
In the above grammar, find leftmost and rightmost derivation for
a) (a, (a,a)) b) (((a,a), ^, (a)), a)

Design the predictive Parsing Table for the following grammars and check whether
the given grammar is LL(1) or not:

23.S→ACB|CbB|
A→da|BC
B→g|Є

C→h|Є

24.S→AaAb|BbBa
A→ Є

B→Є

25. S →1AB| Є

A →1AC| 0C

B→0S

C→1

26. #=end marker


S →S#

S →qABC

A →a|bbD

B →a| Є

C →b| Є, D →c| Є
27.S  i C t S E | a

EeS | 

Cb

Design LR(0) and LR(1) parsing table for the following (Q1, Q2, Q3):

28 S→Aa|bAc|Bc|bBa
A->d
B->d

29 S→A
A→AB| Є
A→aB| b

30 S→xAy|xBy|xAz
A→aS|q
B→q

31 Write short note on Lex and YACC


32 What is the significance of Syntax directed translation schemes in Compiler design.
33 Show the implementation of syntax directed translation scheme of the following input
string: 23+5*4
34 What are the benefits of the three address code generation? Consider the input string:
X:=-a*b+-a*b and generate the following:
(a) Syntax tree (b) Postfix (c) Three address code
35 Differentiate between Quadruples, triples and indirect triples
36 Show the syntax directed translation of the following:
a. Assignment statement
b. Boolean Expressions
c. Control statement
d. Type system
e. Type expression
f. Type conversion
UNIT 3 and 4

37 What is the significance of symbol table in Compiler design?

38 Compare various data structures used for symbol table with their complexities.

39 How errors are handled in Compiler Design? Briefly describe.

40 Write short note on the following:

(a) Lexical phase error

(b) Syntactic phase errors

(c) Syntactic phase errors

(d) Semantic phase errors

41 What is the optimization? What are the various ways to optimize a computer problem?

42 Describe various loop optimization constructs.

43 What is peephole optimization? How is it performed? Give example of peephole

optimization.

44 How DAG is important in Code generation?

45 What is the significance of peephole optimization?

46 How register allocation and assignment is handled?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy