0% found this document useful (0 votes)
27 views1 page

cs3501 CD

question paper

Uploaded by

vimala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

cs3501 CD

question paper

Uploaded by

vimala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SKR ENGINEERING COLLEGE, CHENNAI - 600123.

INTERNAL TEST 1 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


INTERNAL TEST 1

Subject code: CS3501 Date: Subject code: CS3501 Date:


Subject Title: COMPILER DESIGN Time : Subject Title: COMPILER DESIGN Time :
Branch / Year: Max. Marks: 50 Branch / Year: Max. Marks: 50

PART-A (12×2 = 24 Marks)


PART-A (12×2 = 24 Marks)
1. What are the two parts of a compilation and its function?
1. What are the two parts of a compilation and its function?
2. Mention some of the cousins of a compiler.
2. Mention some of the cousins of a compiler.
3. Describe the possible error recovery actions in lexical analyzer
3. Describe the possible error recovery actions in lexical analyzer
4. Discriminate tokens, patterns and lexemes.
4. Discriminate tokens, patterns and lexemes.
5. List the various error recovery strategies for a lexical analysis.
5. List the various error recovery strategies for a lexical analysis.
6. What is a sentinel? What is its usage?
6. What is a sentinel? What is its usage?
7. Why buffering used in lexical analysis?
7. Why buffering used in lexical analysis?
8. State the interactions between the lexical analyzer and the parser.
8. State the interactions between the lexical analyzer and the parser.
9. Define ambiguous grammar
9. Define ambiguous grammar
10. Define left factoring.
10. Define left factoring.
11. Eliminate left recursion from the following grammar A->Ac/Aad/bd/c.
11. Eliminate left recursion from the following grammar A->Ac/Aad/bd/c.
12. What is operator precedence parser?
12. What is operator precedence parser?
PART-B -ANSWER ALL QUESTIONS (2 x13=26 MARKS)
PART-B -ANSWER ALL QUESTIONS (2 x13=26 MARKS)
13)a) Elaborate on the different phases of a compiler with a neat sketch. Show
13)a) Elaborate on the different phases of a compiler with a neat sketch. Show
the output of each phases of the compiler when the following statement is
the output of each phases of the compiler when the following statement is
parsed.
parsed.
SI=(p*n*r)/100
SI=(p*n*r)/100
Where, n should be an integer P and r could be a floating point numbers
Where, n should be an integer P and r could be a floating point numbers
(OR)
(OR)
b) What are the Role and issues in Lexical Analysis?
b) What are the Role and issues in Lexical Analysis?
14)a) Construct stack implementation of shift reduce parsing for the grammar
14)a) Construct stack implementation of shift reduce parsing for the grammar
E->E+S E->E*E E->( E ) E->id and the input string id1+id2*id3
E->E+S E->E*E E->( E ) E->id and the input string id1+id2*id3
(OR)
(OR)
b) Check whether the following grammar can be implemented using predictive
b) Check whether the following grammar can be implemented using predictive
parser.Check whether the string “abfg” is accepted or not using predictive
parser.Check whether the string “abfg” is accepted or not using predictive
parsing. A->A A->aB|Ad B->bBC|f C->g
parsing. A->A A->aB|Ad B->bBC|f C->g

You might also like