Learn more about IndiaStudyChannel
Install Alexa Toolbar
and earn more...
 
Communities Members BookmarksPolls Fresher Jobs Funny Photos B.Tech Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter




Download Model question papers & previous years question papers

Posted By: ADITYA       Member Level: Gold       Posted Date: 24 May 2008

2006 Anna University B.E Computer Science PRINCIPLES OF COMPLIER DESIGN Question paper



Course: B.E Computer Science   University: Anna University




ANNA UNIVERSITY :: CHENNAI – 600 025

VI SEMESTER
B.E. COMPUTER SCIENCE AND ENIGNEERING
CS337 - PRINCIPLES OF COMPLIER DESIGN

Time: Three Hours Maximum: 100 Marks

Answer All The Questions
PART – A (10 x 2 = 20 Marks)

1. List any two complier construction tools, indicating their inputs and outputs.
2. Briefly explain any two language conventions that impact the difficulty of lexical analysis.
3. Write regular definition for the following language over {0,1} A string of 0’s and 1’s, which has 0 at the third position when counted from night.
4. Formally define a nondeterministic finite automation (NFA)
5. Prove that the following grammar is ambiguous: S? aSbS ¦bSaS¦ ?
6. Write down the predictive parsing algorithm.
7. Give the algorithm for generating the closure of a set of LR (0) items.
8. Translate the expression : - (a+b) * (a+b+c) into quadruples and indirect triples.
9. Give the grammar for generating binary numbers. Add semantic rules to the above grammar to compute the decimal equivalent of the binary number, generated.
10. Write down the algorithm that partitions the given sequence of three-address statements into basic books.

Part – B (5 x 16 = 80 Marks)

11. Draw the transition diagram for the lexical analyzer that recognize the following tokens.
Identifiers, relational operators. Use the following rules to form the identifier

• begins with an alphabet
• consists of alphabets, digits and hyphen
• should not end with an hyphen
• not two hyphens appear together

12.a) Draw the NFA for the following regular expression using Thompson’s Construction and then convert it into an equivalent DFA.
(a/b) * (a/c) * b

(OR)
12.b)i) List the tasks performed by a lexical analyzer
ii) Give the complete algorithm that takes a NFA and converts it into an equivalent DFA.

13.a) Remove left recursion from the following grammar and build the predictive parsing table.
S ? (L) ¦a
L ? (L, S) ¦S
(OR)
13.b) Build LR(1) parsing table for the grammar:
S ? Aa ¦bAc ¦Bc ¦bBa

A ? d
B ? d

14.a) Write down the translation scheme for generating three address code for evaluating Boolean expressions using back patching. Explain the attributes used. Use the above and generate three address code for:

While ( (ad) ) do
begin

if(p=q) then p = 1
else p = 2
While (p>q) do
Begin
P: = x+y
q: = x-y
end
end
(OR)
14.b) Explain how declarations are processed by the computer. Take into consideration nested procedures also. Explain clearly the attributes used. Show with an example how the symbol tables are formed.

15.a)i) Explain how ‘next use’ information about names in basic blocks can be collected.
ii) Discuss about the actions performed by a simple code generator while generating code for a typical three-address statement of a form x: = y op z.
(OR)
15.b)i) Write the syntax directed definition that computers and prints the post-fix equivalent of the given infix expression.

ii) Write down the unambiguous CFG for generating Boolean expressions.
-----





Return to question paper search

Next Question Paper: C# AND .NET FRAMEWORK

Previous Question Paper: SOFTWARE ENGINEERING

Related Question Papers:


  • CE337 – STRUCTURAL DESIGN – II


  • semester 4


  • Electronics and Instrumentation Engineering-ELECTRICAL MEASUREMENTS AND INSTRUMENTS


  • DEGREE EXAMINATION, 2007- English


  • MA 131 - Mathematics I


  • Categories


    Submit Previous Years University Question Papers and make money from adsense revenue sharing program

    Are you preparing for a university examination? Download model question papers and practise before you write the exam.

    Watch TV Channels



    Contact Us    Editors    Privacy Policy    Terms Of Use   

    ISC Technologies. 2006 - 2008 All Rights Reserved.