EJ – 831

*EJ831*

VIII Semester B.E. (CSE/ISE) Degree Examination, January 2013 (2K6 Scheme) CI 8.2/IS 8.4.1 : COMPILER DESIGN Time : 3 Hours

Max. Marks : 100

Instruction : Answer five full question selecting atleast two from each Part. PART – A 1. a) Explain with a neat-diagram the various phases of compiler. Discuss the need for error handler, symbol table.

10

b) Explain the different errors recovery stages in hexical phase.

4

c) Design a hexical analyser for identifying a relational operator pattern.

6

2. a) A fibonacci string is defined as follows δ1 = b, S2 = a, Sk = Sk–1 Sk–2 for K > 2. What is the length of δn ? Construct the failure function for δ 6 .

10

b) Obtain the predictive parsing table for the following grammar δ → iEtδS′ a δ′ → eS ∈ E → b.

10

3. a) Consider the following grammar E→E+ T T T → T *F F F → (E) id

Construct SLR parsing table for this grammar.

10

b) Construct the SLR parsing table for the following grammar and explain how it is ambiguous S → iSes S → is S→a.

10 P.T.O.

EJ – 831

-2-

4. a) Explain with an example an operator precedence parser.

*EJ831* 6

b) Consider the following grammar D → TL T → Int T → float L → L1, id L → id D → TL L.in = T.type D → TL L.in = T.type T → Int T.type = Integer T → real T.type = real L → L1, id L1.in = L.in

add type (identry, L.in) add type (identry, L.in) L → id

Construct annotated tree, dependency graph for ld1, id2, id3, id4. c) Define terms with example : i) Synthesized attribute ii) In herited attribute.

10 4

*EJ831*

-3-

EJ – 831

PART – B 5. a) Describe general structure of activation record explain, the purpose of each item in activation record.

8

b) Explain in detail different dynamic storage allocation strategies.

8

c) Distinguish between static and dynamic scope.

4

6. a) Draw DAG for arithematic expression a + a (b – c) + (b – c) * d show steps for constructing DAG.

6

b) What are tree-address codes ? Write three-address code statements for Boolean expression, Declaration Statement.

10

c) Construct Quadruple, triple representation for expression a = b* –c + b* – c. 7. a) What do you mean by calling sequence ? Explain the action performed during i) function call ii) return.

4 8

b) For the following program segment for i = 1 to 10 do for j = 1 to 10 do a[i, j] = 0.0 for i = 1 to 10 do a[i, i] = 1.0 Generate Intermediate codes identify basic block and flow graph.

12

8. a) Generate code using simple code generator for the following expression x = (a + b) * (c – d).

8

b) With example, explain optimization of basic block.

6

c) Briefly explain main issues in code generation.

6

———————

Compiler design.pdf

c) Briefly explain main issues in code generation. 6. ———————. Whoops! There was a problem loading this page. Compiler design.pdf. Compiler design.pdf.

68KB Sizes 5 Downloads 345 Views

Recommend Documents

COMPILER DESIGN.pdf
b) Explain the various strategies used for register allocation and assignment. 10. 8. Write short notes on : i) Error recovery in LR parsers. ii) Loops in flow graphs.

ClamAV Bytecode Compiler - GitHub
Clam AntiVirus is free software; you can redistribute it and/or modify it under the terms of the GNU ... A minimalistic release build requires 100M of disk space. ... $PREFIX/docs/clamav/clambc-user.pdf. 3 ...... re2c is in the public domain.

Compiler design.pdf
3. a) Consider the following grammar. E → E + T T. T → T *F F. F → (E) id. Construct SLR parsing table for this grammar. 10. b) Construct the SLR parsing table ...

compiler design__2.pdf
Page 1 of 11. COMPILER DEDIGN SET_2 SHAHEEN REZA. COMPILER DEDIGN SET_2. Examination 2010. a. Define CFG, Parse Tree. Ans: CFG: a context ...

compiler design_1.pdf
It uses the hierarchical structure determined by the. syntax-analysis phase to identify the operators and operands of. expressions and statements. Page 1 of 7 ...

CS6612-COMPILER-LABORATORY- By EasyEngineering.net.pdf ...
1. Implementation of symbol table. 2. Develop a lexical analyzer to recognize a few patterns in c (ex. Identifers, constants,. comments, operators etc.) 3. Implementation of lexical analyzer using lex tool. 4. Generate yacc specification for a few sy

Compiler Design Syllabus.pdf
software design(PO→BCG ). iv. Working skills in theory and application of finite state machines, recursive descent,. production rules, parsing, and language ...

CSE401 Introduction to Compiler Construction
intrinsicState. ConcreteFlyweight. Operation(extrinsicState). allState. UnsharedConcreteFlyweight. CSE403 Sp10. 10. Participants. • Flyweight (glyph in text example). – Interface through which flyweights can receive and act on extrinsic state. â€

Emscripten: An LLVM-to-JavaScript Compiler - GitHub
May 14, 2013 - Emscripten, or (2) Compile a language's entire runtime into ...... html.) • Poppler and FreeType: Poppler12 is an open source. PDF rendering ...

Teaching Compiler Development to Undergraduates ...
large software systems. In this paper, we ... The C- programming language is basically a small trac- ..... on the C- file name and all the C- code is translated to.

interpreter vs compiler pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. interpreter vs ...

Basics of Compiler Design
So why do most computer science institutions offer compiler courses and often make ... programmers and computer scientists. ..... consists entirely of as and bs.

Test Suite Compiler (TSC)
Mar 27, 2016 - redirects stdout to a string buffer. After. sizeOfBuffer bytes printed, the test is aborted with a FATAL failure. int _printFault(const char* limit,.

Benchmarking the Compiler Vectorization for Multimedia Applications
efficient way to exploit the data parallelism hidden in ap- plications. ... The encoder also employs intra-frame analysis when cost effective. ... bigger set of data.

Emscripten: An LLVM-to-JavaScript Compiler - GitHub
Apr 6, 2011 - written in languages other than JavaScript on the web: (1). Compile code ... pile that into JavaScript using Emscripten, or (2) Compile a ... detail the methods used in Emscripten to deal with those ..... All the tests were run on a Len

Concurrency-aware compiler optimizations for hardware description ...
semantics, we extend the data flow analysis framework to concurrent threads. .... duce two auxiliary concepts—Event Vector and Sensitivity Vector—in section 6, ...

Improving Compiler Heuristics with Machine Learning
uses machine-learning techniques to automatically search the space ..... We employ depth-fair crossover, which equally weighs each level of the tree [12]. ...... Code to Irregular DSPs with the Retargetable,. Optimizing Compiler COGEN(T). In Internat

principles of compiler design pdf
Download. Connect more apps... Try one of the apps below to open or edit this item. principles of compiler design pdf. principles of compiler design pdf. Open.

Guest lecture for Compiler Construction, Spring 2015
references and (user-defined) exceptions. ✓ modules, signatures, abstract types. The CakeML language. = Standard ML without I/O or functors. The verified machine-code implementation: parsing, type inference, compilation, garbage collection, bignums

bottom up parsing in compiler design pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. bottom up ...