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

CD Q4 PDF

The document discusses topics in compiler design including: 1. Sets of symbols that can begin or follow other symbols in a grammar. 2. Shift-reduce and reduce-reduce conflicts that can occur in LALR(1) parsing. 3. Whether an attribute definition is syntactic (S-attributed) or semantic (L-attributed) based on the order attributes can be evaluated in. 3 sentences or less while hitting the key high level points covered in the document.

Uploaded by

bhavesh agrawal
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)
104 views

CD Q4 PDF

The document discusses topics in compiler design including: 1. Sets of symbols that can begin or follow other symbols in a grammar. 2. Shift-reduce and reduce-reduce conflicts that can occur in LALR(1) parsing. 3. Whether an attribute definition is syntactic (S-attributed) or semantic (L-attributed) based on the order attributes can be evaluated in. 3 sentences or less while hitting the key high level points covered in the document.

Uploaded by

bhavesh agrawal
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/ 2

COMPILER DESIGN

1.

S → aA | *S
A → +S | (S | ε

Set { +, ( } will be in the

(a) First (A) (b) First (E)


(c) Follow (E) (d) Follow (A)

2. Which of the following is True?

(a) Handle of a string is a sub string that matches left hand side of production
(b) RR conflicts never occur in LALR(1)
(c) SR conflicts occur in LALR(1)
(d) None of these

3. If attribute can be evaluated in depth-first order then definition is

(a) S – attributed (b) L – attributed


(c) Both (a) and (b) (d) None of these

4. S → Sa | b

Which of the following is True?

(a) There will be SR conflict during parsing


(b) There will be RR conflict during Parsing
(c) There will be both conflict
(d) There will be no conflict

5. The equivalent expression for the DAG is

1
(a) ((a + b) *c) *(b*(c – a)) (b) a + (b*c – a)
(c) (a + (b*c))*((b*c) – a) (d) a*(a + b * c) – a

6.

P → PαQ | Q
Q → QβR | R
R → num

If 2α3α4β1α2β1 is evaluated to 18, then which of the following is the correct value for α and β?

(a) +, * (b) +, –
(c) *, – (d) –, +

7. The above transition rule used to evaluate 7α4β2α2β1. The result will be

(a) 10 (b) 14
(c) 17 (d) 20

You might also like