You are here: Home > Computer Science CSE
All posts from

Compiler Design B.Tech Question Bank : tits.ac.in

Name of the College : Turbomachinery Institute of Technology &Sciences (TITS)
University : JNTU Hyderabad
Department : Computer Science Engineering
Subject Name : Compiler Design
Degree : B.Tech
Year/Sem : III/II
Website : tits.ac.in
Document Type : Question Bank

Download Model Question Paper : https://www.pdfquestion.in/uploads/tits.ac.in/3067-cdqb.pdf

TITS Compiler Design Question Paper

UNIT – 1

SYLLABUS:
Overview of Compilation: Phases of Compilation – Lexical Analysis, Regular Grammar and regular expression for common programming language features, pass and Phases of translation, interpretation, bootstrapping, data structures in compilation – LEX lexical analyzer generator.

Sample Questions:
1.Design a DFA that accepts the language over the alphabet, _ = {0, 1, 2} where the decimal equivalent of the language is divisible by 3. [Sup.Feb 2008, Set1]
2.Compare compiler and an interpreter with the help of suitable examples. [Sup.Feb 2008, Set1]
3. Obtain the Kleen Closure and Positive Closure of the language {ba, bb}, where the alphabet _ = {a, b}.[Sup.Feb 2008, Set2]
4. Give a finite state diagram that accepts all the floating-point numbers. [Sup.Feb 2008, Set2]
5. Explain Regular Expressions with suitable examples. [Sup.Feb 2008, Set3]


6. Design a DFA that accepts the language over _ = {a, b} of all strings that contain the sub-string either aa or bb. [Sup.Feb 2008, Set4]
7. Explain the input buffer scheme for scanning the source program. How the use of sentinels can improve its performance? Describe in detail.[Apr/May 2008,Set1]
8. Explain the different phases of a compiler, showing the output of each phase, using the example of the following statement:
position : = initial + rate * 60[Apr/May 2008,Set2]
9. Compare compiler and interpreter with suitable diagrams. [Apr/May 2008,Set2]
10. Explain, in detail, lexical analyzer generator. [Apr/May 2008,Set3]
11. Describe the lexical errors and various error recovery strategies with suitable examples. [Apr/May 2008,Set3]
12. Consider the following fragment of ‘C’ code:
float i, j;
i = i * 70 + j + 2;
Write the output at all phases of the compiler for the above ‘C’ code. [Apr/May 2008,Set4]
13. Write short notes on: input buffering. [Apr/May 2008,Set4]
14. Write a Lex Specification to read a C program and calculate number of new line characters, tabs and white spaces in the program.
15. Whether lexical analysis detects any errors? Explain with example. [Feb 2003]
16. Explain with example various Compiler Construction tools. [9]
17.Why compilation phases are divided into front-end and back-end? What are the advantages?

18 Explain the following :
i) token.
ii)pattern.
iii) lexeme.

UNIT – 2

SYLLABUS:
Semantic analysis : Intermediate forms of source Programs – abstract syntax tree, polish notation and three address codes. Attributed grammars, Syntax directed translation, Conversion of popular Programming languages language Constructs into Intermediate code forms, Type checker.
Questions:
1.Compare Inherited attributes and Synthesized attributes with an example. [Sup.Feb 2008, Set1]
2. Construct triples of an expression: a * – (b + c). [Sup.Feb 2008, Set1]
3. Let synthesized attribute, Val give the value of the binary number generated by S
in the following grammar. For example, on input 101.101, S.Val = 5.625.
S ! L • L |L
L ! LB|B
B ! 0 |1
Write synthesized attribute values corresponding to each of the productions to determine the S.Val. [Sup.Feb 2008, Set2]
4. Generate the three-address code for the following C program fragment: [16]
while(a > b)
{i
f (c < d) x = y + z;
else x = y – z;
}[Sup.Feb 2008, Set3]
5. What are L-attributed definitions? Explain with an example. [Sup.Feb 2008, Set4]
6. Draw the syntax tree for the following Boolean expression:
(P < Q AND R < S) OR (T < U AND R <Q). [Sup.Feb 2008, Set4]
7. Write a note on the specification of a simple type checker. [Apr/May 2008,Set1]
8. What is a type expression? Explain the equivalence of type expressions with an appropriate examples. [Apr/May 2008,Set1]
9. Write the quadruple, triple, indirect triple for the statement a := b_ – c + b_ – c. [Apr/May 2008,Set2]
10. Explain the role of intermediate code generator in compilation process. [Apr/May 2008,Set2]
11. Write short notes on the following:
(a) S-attributed definitions.
(b) L-attributed definitions.
(c) Dependency graph. [Apr/May 2008,Set4]

Leave a Reply

How to add comment : 1) Type your comment below. 2) Type your name. 3) Post comment.

www.pdfquestion.in © 2021

Contact Us   Privacy Policy   SiteMap