6 views

Uploaded by dddd

question nbank

- Regular Expressions
- compiler design – 2 marks question set with answers _ TUTOR4CS.pdf
- MC7203 System Software
- UNIT1- Lexical Analysis1
- PDF2015_Paper II_J 8715 Paper II Computer Science
- lexnyacc
- Principles of Compiler Design
- R7411904 Automata & Compiler Design
- Open Information Extraction Using Wikipedia
- Using Regular Expressions With PHP V413HAV
- n Language Processing
- Lect08 Parse
- 35142272 Anna Univ Coimbatore Syllabus for IT 5 8sem
- Beautiful Soup Documentation — Beautiful Soup 4.4
- CS1352_NOV07
- Compiler
- Common Lisp PDF Parser
- Project Overview
- RegularExpression(Biểu Thức Chính Quy
- CLEF2013wn-QA4MRE-BanerjeeEt2013

You are on page 1of 4

Question Bank

2) What is regular expression, give all the algebraic properties of regular expression.

3) Explain the analysis synthesis model of compilation. List the factors that affect the design of

compiler. Also List major functions done by compiler.

4) Find the Regular Expression corresponding to given statement, subset of {0,1}*

A. The Language of all strings containing at least one 0 and at least one

B. The Language of all strings containing 0s and 1s both are even.

C. The Language of all strings containing at most one pair of consecutive 1s.

5) The Language of all strings that do not end with 01.

6) Construct a DFA for a given regular expression (010+00)*(10)*.

7) Write a regular definition for the language of all strings of 0s and 1s with an even number of

0s and odd number of 1s.

8) Draw the DFA for the regular expression (a|b)*abb using set construction method only.

9) Draw the state transition diagram for the unsigned numbers.

10) What is a pass in a compiler? What is the effect of reducing the number of passes?

11) Convert the following regular expression into deterministic finite automata. (a+b)* abb

(a+b)*.

12) Write the two methods used in lexical analyser for buffering the input. Which technique is

used for speeding up the lexical analyser?

13) Find errors and identify the phase of compiler detecting them for Following C program

segment. Justify your answers.

int fi (int);

char a [10], * cptr;

int k = 1 ; int j = 2;

Float f;

cptr = a;

if (k);

fi (k);

fi ( j )

++k;

*(cptr + 1) = 0;

++ a;

n + *k;

14) Explain lexical analysis phase of a compiler and, for a statement given below, write output of

all phases (except of an optimization phase) of a complier. Assume a, b and c of type float a =

a + b * c * 2;

15) Construct a DFA without constructing NFA for following regular expression. Find minimized

DFA. a*b*a(a | b)*b*a#

16) Construct a NFA for following regular expression using Thompsons notation and then convert

it into DFA. aa*(b | c) a*c#

Shri Labhubhai Trivedi Institute of Engineering & Technology

Subject: COMPILER DESIGN (170701)

Question Bank

18) Write short note on context free grammar (CFG) explain it using suitable example.

19) Where do we use operator precedence parsing technique? Give the general precedence table

for operating precedence parsing, considering all the generalized rules.

20) What is left recursion? Eliminate the left recursion from the following grammar. And also

design the FIRST SET and FOLLOW SET for the following grammar.

E -> E + T | T

T ->T * F | F

F -> (E) | id

21) Translate the expression (a*b) +(c*d) + (a*b*c) into

1. Quadruples

2. Triples

3. Indirect triples

22) Explain how type checking & error reporting is performed in compiler. Draw syntax tree and

DAG for the statement a = (a * b + c) ^ (b + c) * b + c. Write three address codes from both.

23) Explain peephole optimization.

24) Differentiate SLR, Canonical LR and LALR. Also justify the statement A class of grammar that

can be parsed using LR methods is a proper subset of the class of grammars that can be parsed

with predictive parser.

25) What is an activation record? Explain how they are used to access local and global variables.

26) Explain Semantic Analysis and Syntax Analysis phases of compiler with suitable example. Also

explain the reporting errors by these two phases.

27) Write a short note on Symbol Table Management.

28) Construct DFA for following Regular expression. Use firstpos, lastpos and followpos functions

to construct DFA. ( a * | b * ) *

29) Explain various dynamic storage allocation techniques.

30) Explain any three code optimization techniques with example.

31) Explain various issues in design of code generator.

32) Explain LALR parser in detail. Support your answer with example.

33) Give the translation scheme that converts infix to postfix expression for the following

grammar and also generate the annotated parse tree for input string 7+3+2.

E -> E+T

E ->T

T -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

34) Construct LL(1) parsing table for the following Grammar:

S -> (L) | a

L -> L, S | S

35) Check whether the following grammar is CLR or not.

S ->Aa | bAc | Bc | bBa

A ->d

B ->d

36) Construct SLR Parsing Table for the following grammar.

S-> 0S0 | 1S1 | 10

37) Explain Operator Precedence Parsing method with example.

Shri Labhubhai Trivedi Institute of Engineering & Technology

Subject: COMPILER DESIGN (170701)

Question Bank

38) Show syntax directed definition for simple desk calculator. Also show annotated parse tree

for 3*5+4n, where n indicates newline.

39) Explain the following:

1) The Handle

2) Left Factoring

3) Directed Acyclic Graph

4) Conflicts in LR Parsing

5) Parser Generator

6) Dependency Graph

7) Locality of reference

40) Discuss various code optimization techniques.

41) What is intermediate code? What is its importance? Discuss various representations of three

address code.

42) How top down and bottom up parser will parse the string bbd using grammar A -> bA | d.

Show all steps clearly.

43) Discuss synthesized and inherited attributes using a suitable grammar.

44) Construct the collection of sets of LR (0) items for the following grammar.

S-> Aa | bAc | dc | bda

A->d

45) Develop a predictive parser for the following grammar.

S->S

S->aA|b|cB|d

A->aA|b

B->cB|d

46) What do you understand by a handle? Explain the stack implementation of shift reduce parser

with the help of example.

47) Explain various error recovery strategy of compilers

48) Explain with an appropriate example how to perform bottom up evaluation of an inherited

attributes.

49) Describe algorithm for global common sub expression elimination.

50) Explain Buffer pairs and Sentinels.

51) Explain recursive-descent and predictive parsing.

52) What is the pass of a compiler? Explain how the single and multi-pass compilers work.

53) Write a note on static and dynamic memory allocation. What do you mean by dangling

reference?

54) Write a brief note on input buffering techniques.

55) Explain the roles of Linker and Loader.

56) List out phases of a compiles. Write a brief not on Lexical Analyser.

57) Define lexeme, token and pattern. Identify the lexemes that make up the tokens inthe

following program segment. Indicate corresponding token and pattern.

void swap (int a, int b)

{

int k;

k = a;

Shri Labhubhai Trivedi Institute of Engineering & Technology

Subject: COMPILER DESIGN (170701)

Question Bank

a = b;

b = k;

}

58) Convert the following NFA- into equivalent NFA. Here is a -transition.

For Improvement test the question numbers are 23 to 31, 40, 41, and 46 to 58

- Regular ExpressionsUploaded byThi Ha
- compiler design – 2 marks question set with answers _ TUTOR4CS.pdfUploaded byshekhar kumar
- MC7203 System SoftwareUploaded byGopal Krishna
- UNIT1- Lexical Analysis1Uploaded byBirendra Kumar
- PDF2015_Paper II_J 8715 Paper II Computer ScienceUploaded byPreeti Singh
- lexnyaccUploaded byravi
- Principles of Compiler DesignUploaded bySathyamurthy Duraikkannu
- R7411904 Automata & Compiler DesignUploaded bysivabharathamurthy
- Open Information Extraction Using WikipediaUploaded byhouyufang
- Using Regular Expressions With PHP V413HAVUploaded byspedhome1
- n Language ProcessingUploaded byalmarimekhaled
- Lect08 ParseUploaded bywelyn astilla
- 35142272 Anna Univ Coimbatore Syllabus for IT 5 8semUploaded byR.d. Senthil
- Beautiful Soup Documentation — Beautiful Soup 4.4Uploaded byzakariansu
- CS1352_NOV07Uploaded bysridharanc23
- CompilerUploaded byrajputmanish
- Common Lisp PDF ParserUploaded byCrystal
- Project OverviewUploaded byswasthikamanaram
- RegularExpression(Biểu Thức Chính QuyUploaded byHoang Hai Nam
- CLEF2013wn-QA4MRE-BanerjeeEt2013Uploaded byanon_46092178
- chartparsing.4psUploaded byKevin Davalos
- AlgorithmUploaded byNitesh
- SRC-123Uploaded bypostscript
- wst09Uploaded byJemjem Tan
- Toward a Name Entity Aligned Bilingual CorpusUploaded byigi48
- Chapter 1 PLUploaded byJerald Balbanera
- Sec TextParsingUploaded byDeepakGupta
- GREPUploaded byirshad
- Sed - An Introduction and TutorialUploaded bysarvesh_mishra
- Beek Et Al. - 2014 - LOD Laundromat a Uniform Way of Publishing Other People's Dirty DataUploaded bypeter

- Programing ProjectUploaded bySyaiful Maulana Abbidin
- Nortel Option 11 Pbx at HomeUploaded byVenkataanjinareddy
- At DestroyerUploaded byRicardo Lavado Palomino
- Creo 2 0 AdvancedUploaded byAchintyaParadkar
- Active Directory ReplicationUploaded byPrakash Ray
- D2342P ManualUploaded byAttila Hegedűs
- Linux QuestionUploaded byShashi Gururani
- To Design a Circuit Diagram for Mute Keypad Vocalizer using ARDUINO UNOUploaded byEditor IJTSRD
- Durham Three Year Technology Plan for Greendale Community College LibraryUploaded byMegan Durham
- Siebel 8 Sizing Questionnaire_MetroUploaded byAstrx Astrixescu
- polar loop ManualUploaded bypetar
- mEv811 Ellipse Excel Import VHA 11April2012Uploaded byJovanni Ivan Jabat
- Maintenance Arguments & BenefitsUploaded byDian Aprilia II
- Oracle Data Guard 12c.pdfUploaded bySrinivas Ellendula
- Uovision UM565 3G 12MP-English User ManualUploaded byjuho email
- Osl LanguagespecUploaded bykenanbb
- M6712v1.4Uploaded byBarnabás Ferenc
- Appian Architecture and Supported Platforms v6 6 08312011Uploaded byVijay Baalu
- MongoDB-manual.pdfUploaded byDante Llimpe
- Dice GameUploaded byDuy Le
- 120112 GrandMA2 LightUploaded byrajeev
- DSC2010CatalogUploaded byFairasouder
- Ltgs17 Manual l d842m Nd Spa EngUploaded byMariana Paredes
- Kiosk CompaniesUploaded byShohan_1234
- Generic CollectionsUploaded byson2483
- UCSD p-System Virtual Machine Reference Manual version 0.11Uploaded bypsc098
- Windows Server 2012 R2 VDI DatasheetUploaded byCan dien tu Thai Binh Duong
- UbuntuUploaded byLu ROm
- UAD Apollo Software ManualUploaded byPeter
- Change LogUploaded bybangbang134