Home /University Of Sargodha (UOS) /Compiler Construction

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.

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. — page 1

Discussion

Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.

Your email is only used to send you replies and occasional Ustadni updates. It is never shown publicly.

Log in to post under your name

No questions yet — be the first to ask.

More Compiler Construction papers

See all

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