Save as PDF

Opens your browser print dialog — select "Save as PDF" to download.

Total No. of Questions : 8 Total No. of Printed Pages : 4
Roll No .....................................

CS-603 (C) (GS)

B.Tech., VI Semester

Examination, May 2024

Grading System (GS)

Compiler Design

Time: Three Hours Maximum Marks : 70

Note: i) Attempt any five questions.

किन्हीं पाँच प्रश्नों को हल कीजिए।

ii) All questions carry equal marks.

सभी प्रश्नों के समान अंक हैं।

iii) In case of any doubt or dispute the English version question should be treated as final.

किसी भी प्रकार के संदेह अथवा विवाद की स्थिति में अंग्रेजी भाषा के प्रश्न को अंतिम माना जायेगा।

1.

Discuss the analysis and synthesis model of compilation.

Explain each phase by using the input:

a = (b + c) * (b + c) + 2

संकलन के विश्लेषण और संश्लेषण मॉडल पर चर्चा करें। इनपुट का उपयोग करके प्रत्येक चरण की व्याख्या करें:

a = (b + c) * (b + c) + 2

2.

Explain the various Compiler Construction Tools.

विभिन्न कम्पाइलर कंस्ट्रक्शन टूल्स के बारे में बताएं।

3.
a)

Differentiate Top Down Parser and Bottom Up Parser? Give Example for each?

टॉप डाउन पार्सर और बॉटम अप पार्सर में अंतर करें। प्रत्येक के लिए उदाहरण दें।

b)

Prepare and Eliminate the left recursion for the grammar व्याकरण के लिए left recursion तैयार करें और Eliminate करें

S ��� Aa | b

S → Ac | Sd | ε

4.
a)

What are the issues to be considered in the design of lexical analyzer? Why is buffering used in lexical analysis?

लेक्सिकल एनालाइजर के डिजाइन में किन मुद्दों पर विचार किया जाना चाहिए? लेक्सिकल विश्लेषण में बफरिंग का उपयोग क्यों किया जाता है?

b)

Consider the grammar

E→E+T

E→T

T→T*F

T→F

F→(E)

F→id

Construct a LALR parsing table for the grammar given above. Verify whether the input string id * id * id is accepted by the grammar or not.

व्याकरण पर विचार करें

E→E+T

E→T

T→T*F

T→F

F→(E)

F→id

ऊपर दिए गए व्याकरण के लिए एक LALR पार्सिंग टेबल बनाएं। इनपुट स्ट्रिंग id * id * id व��याकरण द्वारा स्वीकार की जाती है या नहीं सत्यापित करें।

b)

What are the various conflicts that occur during shift reduce parsing?

Shift reduce parsing के दौरान होने वाले विभिन्न conflicts क्या हैं?

5.
a)

What is a DAG? Draw the DAG for the statement a = (a + b) * c - (a + b) + c

DAG क्या है? कथन a = (a + b) * c - (a + b) + c के लिए DAG बनाएं।

b)

Explain synthesized attribute and inherited attribute with suitable examples.

सिंथेसाइज्ड एट्रीब्यूट और इनहेरिटेड एट्रीब्यूट को उपयुक्त उदाहरणों के साथ समझाएं।

6.
a)

Discuss the various storage allocation strategies in detail.

विभिन्न भंडारण आवंटन रणनीतियों पर विस्तार से चर्चा करें।

b)

Write the three address code sequence for the assignment statement.

असाइनमेंट स्टेटमेंट के लिए तीन एड्रेस कोड अनुक्रम लिखें।

P : = (X + Y) + (X - C)

7.
a)

Represent the following in flow graph: i=1; sum=0; while (i<=10){sum=sum+i; i++;}

फ़्लो ग्राफ़ में निम्नलिखित का प्रतिनिधित्व करें: i=1; sum=0; while (i<=10){sum=sum+i; i++;}

b)

What are the different source of optimization in basic blocks?

Basic ब्लॉकों में ऑप्टिमाइजेशन के विभिन्न स्रोत क्या हैं?

8.

Write brief notes: (any three)

संक्षिप्त नोट्स लिखें: (कोई तीन)

a)

Peephole Optimization

पीपहोल ऑप्टिमाइजेशन

b)

Global data flow equations

ग्लोबल डेटा फ्लो इक्वेशंस

c)

Dynamic Storage Allocation

डायनामिक स्टोरेज एलोकेशन

d)

Error Detection and Recovery

एरर डिटेक्शन एंड रिकवरी