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.
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 ↓
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
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 ↓
Paper text
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.
Objective Part
(Compulsory)
Q.1.
Write short answers of the following in 2-3 lines on your answer sheet.
(2*16)
What is Assembler?
What is the responsibility of Loader?
What is the difference between language converter and language rewriter?
Why we use cross compilers
In analysis-synthesis model of compilation what is the benefit of analysis.
зне.
What we do in the second pass of assembler
Is it possible to use a common back end for different front ends?
What are compiler construction tools?
Perform dirg loxical analysis of the following statement
If (ida-0) idx - 100:
Chat is the difference between syntax tree and passe foe
Consider the following grammar: -
S→ A
4 → A+A| B++
B→ y
ustadni.
Show a leftmost derivation of "y + ++ y++"
Name the layers associated with front end?
ustadni.com
What happens in semantic analysis?
Regular Expression or Finite Automata are used in which phase of compiler.
What is the difference between Lexeme and pattern?
What is meant by ambiguous grammar?
Subjective Part
(4*12)
Q.No.2
[6+6]
Show that the grammar
B → d
a. IS LR(1)
b. NOT SLR(1)
Q.N0.3
What is the importance of syntax analysis phase in compilation process? Why CFGs (Context Free
Grammars) are used for defining syntax rules?
What is code optimization? Briefly describe the principal sources of code optimization.
Q.No.5-
14+8]
Given the following CFG.
-В-Ехр → В-Ехр && В-Ехр
В-Ехр → В-Ехр || В-Ехр
В-F*О→ В-Вхр| В-5хр
В-РХр → В-Ехр = В-Ехр
ustadn! B-Exp -+ B-Exp & B-Exp
B-Exp → B-T
B-T → b-id
8.
b.
Prove the grammar is ambiguous tadni.com
Ini.com
Make the grammar unambiguous using the table below. (Low number means less precedence)
Operator
Precedence
Association
=
Right to left
2
Left to right
&
Left to right
&&
Left to right
Left to right
visit website: ustadni.com