Accounting and Financial Management (3) Analog and Digital Communication (2) Artificial Intelligence (2) BE(Civil) (2) BE(CSE) (83) BE(ECE) (11) BE(Mech) (10) Business Processes (3) C# and .NET Framework (2) Communication Skills (1) Compiler Design (1) COMPONENT BASED TECHNOLOGY (1) COMPUTER ARCHITECTURE (1) COMPUTER GRAPHICS and MULTIMEDIA SYSTEMS (6) COMPUTER INTEGRATED MANUFACTURING (1) Computer Networks (9) Computer Organization (2) Computer Programming (1) Consumer Behaviour (1) Control Systems (1) Cryptography and Network Security (3) Datastructures and Algorithms (10) Datawarehousing and Mining (1) DBMS (5) DESIGN AND ANALYSIS OF ALGORITHMS (9) DESIGN OF MACHINE ELEMENTS (1) DIGITAL PRINCIPLES AND SYSTEMS DESIGN (3) Discrete Mathematics (1) DISTRIBUTED COMPUTING (2) DSP (8) DYNAMICS OF MACHINERY (2) Economic Foundations (1) ELECTRICAL ENGINEERING (1) ELECTRICAL ENGINEERING AND CONTROL SYSTEMS (1) Electromagnetic Fields (3) ELECTRONIC CIRCUITS (1) ELECTRONIC COMMERCE (4) ELECTRONIC DEVICES AND CIRCUITS (1) EMBEDDED SYSTEMS (1) FUNDAMENTALS OF COMPUTING (2) Graphics and Multimedia (3) HEAT AND MASS TRANSFER (1) HUMAN RESOURCE MANAGEMENT (1) Internet Programming (9) INTRODUCTION TO FINITE ELEMENT ANALYSIS (1) Legal Aspects of Business (1) MANAGEMENT INFORMATION SYSTEMS (1) Marketing Management (1) MATHEMATICAL FOUNDATIONS OF COMPUTER SCIENCE (4) MATHEMATICS - I (1) MBA (9) MCA (83) MCA QUESTION BANK (2) MECHATRONICS (1) MicroProcessor and Controllers (4) MICROPROCESSORS AND APPLICATIONS (5) MIDDLE WARE TECHNOLOGIES (3) MOBILE COMPUTING (5) NETWORK PROGRAMMING (1) NUMERICAL METHODS (1) OBJECT ORIENTED ANALYSIS AND DESIGN (5) Object Oriented Programming (18) Operating System (2) OPERATING SYSTEMS (9) Organizational Behaviour (2) POWER ELECTRONICS (1) Principles of Management (8) PROBABILITY AND QUEUEING THEORY (2) Probability and Statistics (1) PROBLEM SOLVING AND PROGRAMMING (2) PROCESS PLANNING AND COST ESTIMATION (1) PROFESSIONAL ETHICS AND HUMAN VALUES (1) RANDOM PROCESSES (1) RESOURCE MANAGEMENT TECHNIQUES (2) ROBOTICS (1) Security analysis (1) Service Marketing (1) SIGNALS AND SYSTEMS (1) Software Engineering (8) SOFTWARE PROJECT MANAGEMENT (4) SOFTWARE QUALITY MANAGEMENT (2) System Software (2) TCP/IP PROTOCOL SUITE (3) Theory of Computation (4) Total Quality Management (2) UNIX AND NETWORK PROGRAMMING (4) Visual Programming (2) WEB GRAPHICS (2) WEB TECHNOLOGY (2) XML AND WEB SERVICES (4)

Friday, July 4, 2008

PRINCIPLES OF COMPILER DESIGN MAY08 - B.E

                                                                                                 T3185

B.E DEGREE EXAMINATION,  APRIL/MAY 2008

SIXTH semester

Regulation 2004

Cs1352 –PRINCIPLES OF COMPILER DESIGN

 

Part –a

1.       Differentiate Compiler And Interpreter

2.       Write short notes on buffer pair.

3.       Construct a parse tree (a+b)*c  for the grammar E->E+E/E*E/(E)/id.

4.       Eliminate immediate left recursion for the following grammar E->E+T/T, T->T*F/F, F->(E)/id.

5.       Write short notes on global data flow analysis.

6.       Define back patching with an example.

7.       Give syntax directed translation for the following statement call p1 (int a, int b).

8.       How can you find the leaders in basic block.

9.       Define code motion

10.   Define basic block and flow graph.

 

Part –b

11.   A) i. explain the phases of compiler, with the neat schematic.

     ii. write short notes on compiler construction tools.

Or

 

b) i. explain grouping of phases.

     ii. explain specification o f tokens.

 

12.   A) find the SLR parsing table for the given grammar and parse the sentence (a+b)*c  , E->E+E/E*E/(E)/id.

 

Or

b)  find the predictive parser for the given grammar and parse the sentence (a+b)*c , E->E+T/T, T->T*F/F, F->(E)/id.

 

13.   A)generate intermediate code for the following code segment along with the required syntax directed translation scheme.

i.                    If(a>b)

X=a+b

Else

X=a-b

Where a&x are of real and b of int type data

ii.                  Int a,b;

Float c;

A=10;

Switch(a)

{case 10:c=1;

Case20:c=2;}

 

 

Or

           b)  i. generate intermediate code for the following code segment along with required syntax directed translation scheme.

I=1; s=0;

While (i<=10)

S=s+a[i][i][i]

I=i+1

ii.write short note on back patching.

14.   a)  i. explain the various issues in the design of code generation.

ii.explain code generation phase with simple code generation algorithm.

or

b) i. generate DAG representation of the following code and list out the applications of DAG representation.

I=1;s=0;

While (i<=10)

S=s+a[i][i]

I=i+1

 ii. write short notes on next use information with suitable example.

15). A) i. explain principle sources of optimization.

                ii. write short notes on          a. storage organization    b. parameter passing

Or

b).i. optimize the following code using various optimization techniques.

I=1.s=0;

For(i=1;i<=3;i++)

For(j=1;j<=3;j++)

C[i][j]=c[i][j]+a[i][j]+b[i][j]

ii.write short notes on access to non-local names.

 

 

No comments:

Post a Comment