University of Sargodha BS 6* Term Examination 2015 Subject: Computer Science Paper: Compiler Construction (CS-443) Time Allowed: 2:30 Hours 12BSCS SIS Maximum Marks: 80
Discussion
Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.
No questions yet — be the first to ask.
More Compiler Construction papers
See all
Compiler Construction BSCS 2018 UOS
Uploaded 3 years ago
Download ↓
Salman University of Sargodha M. Sc. I. T, 4"' Term Exam 2015. Subject: Information Technology Paper: Compiler Construction (IT: 696) Allowed: 2:30 Hour ustadni.com
Uploaded 3 years ago
Download ↓
Q.No.6 Q.No.7 Write a hote on errot recovery techniques. [6+6] a) Remove left recursion from following grammar E→E + T
Uploaded 3 years ago
Download ↓
BS 7" Term Examination 2017 Subject: Computer Science Paper: Complier Construction (CS: 4141) Time Allowed: 2:30 Hours Maximum Marks: 80 Note: Objective part is compulsory. Attempt any four questions from subjective part.
Uploaded 3 years ago
Download ↓
Paper text
University of Sargodha
BS 6* Term Examination 2015
Subject: Computer Science Paper: Compiler Construction (CS-443)
Time Allowed: 2:30 Hours
12BSCS SIS
Maximum Marks: 80
Objective Part Compulsory
Q.NO.1:-Answer the following questions in 2-3 lines having 2 marks each
I. Differentiate among source code, intermediate code and object code?
2. What are the main components of context-free grammar.
S/Define lexical analyzer
4. Define canonical-LR
5. What is the Predictive Parsing
6 Define Three-Address Code
7 What are the Lexical Errors
& What type of errors the lexical analyzer report? Support your answer with example.
2 Where the produced tokens will be kept during lexical phase also discuss, how to create lexemes.
L0. Discuss any two functions of pre-processor?
L. Differentiate among compiler, language translator and cross compiler?
12. Write down the Principles of Compilation
13. Differentiate between Register allocation, and Register assignment
ustadni.co
J4. Deline Dead Code Elimination
15. Explain retargetable compiler
• 16 Define Peephole optimization
32 marks
Subjective Part
Note: Attempt any four Questions. All carry equal marks
[12x4=48]
Q. No.2.
a) Define and Explain intermediate code generation and their representation techniques in detail.
b) Explain predictive parser algorithm with the help of an example and also write grammar for it.
Q.No.ta) Write a CFG and then draw a parse tree for the following expression. ((4-8)*2(7*4)
b. Briefly explain The Structure of a Compiler.
Q.No.4 Construct a syntax-directed translation scheme that translates arithmetic expressions from
postfix notation into infix notation. Give annotated parse trees for the inputs 95-2* and 952*-.
QNo.5 Construct the minimum-state DFA's for the following regular expressions:
a) (alb)*a(alb).
b) (alb) *a(alb) (alb).
c) (alb)*a(alb)(alb) (alb)
Q. No.6. Construct the DAG and identify the value numbers for the sub expressions of the following
US expressions. assuming + associates from the left.
a) a+b+(a+b).
US
0) a + b + a + b
c) ata+((a+a+a+(ata+a+a)).
ustadni.com
Q. No.7. Translate the arithmetic expression a + -(b +
c) into:
a) A syntax tree.
b) Quadruples.
c) Triples.
d) Indirect triples.
visit website: ustadni.com