Docsity

Compiler Design: Lexical Analysis and Parsing, Exercises of Compiler Design

Toggle sidebar
bg1
UNIT-1
1)a)Explain about Language processing system in detail. [6M][L2]
b)what is the role of lexical analyzer and Explain briefly.[4M][L2]
2)a)Explain about Specifications of Tokens.[5M][L3]
b)What is Bootstrapping? Explain briefly about bootstrapping. [5M][L1]
3)a)Demonstrate the role of lexical analyzer .[5M][L2]
b)What is Finite Automata? Explain different types of Finite Automata. [5M][L1]
4)a)Explain detail about Input Buffering Technique. [5M][L3]
b)Explain about DFA and NFA one example for conversion of NFA to DFA conversion. [5M][L2]
5)Explain in detail about the phases of compilers . [10M][L2]
6)a)Explain the role of lexical analyzer .[5M][L2]
b)Explain in detail about Input buffering. [5M][L2]
7)a)Explain in detail about Input buffering. [5M][L2]
b)Explain the structure of Lexical Analyzer Generator. [5M][L1]
8) Explain detail about Recognition of tokens and their examples. [10M][L2]
9)a)What is the use of Regular definition in specification of tokens. [5M][L1]
b)Define Token,Attribute,Lexeme. [5M][L1]
10) a)What is LEX? Explain detail about general format of LEX program. [6M][L1]
b)Explain about structure of LEX. [4M][L1]
UNIT-II
1)a) Explain the role of a parser. [5M][L2]
b) consider the grammar given below
E ->E+E | E*E | E-E | a |b obtain leftmost right derivations and their parse trees for the
string โ€œa+b*a+bโ€. [5M][L3]
2)Explain the problems in top down parsing. [10M] [L2]
3)a) What is left recursion and left factoring? Explain with an example. [5M][L1]
b) Compute First and Follow for the grammar E->E+T/T, T->T*F/F, F-> (E)/id. [5M][L2]
4) a) Illustrate recursive descent parser for the grammar. [5M][L2]
pf3

Partial preview of the text

Download Compiler Design: Lexical Analysis and Parsing and more Exercises Compiler Design in PDF only on Docsity!

UNIT- 1

1)a)Explain about Language processing system in detail. [6M] [L2] b)what is the role of lexical analyzer and Explain briefly.[4M] [L2] 2)a)Explain about Specifications of Tokens.[5M] [L3] b)What is Bootstrapping? Explain briefly about bootstrapping. [5M] [L1] 3)a)Demonstrate the role of lexical analyzer .[5M] [L2] b)What is Finite Automata? Explain different types of Finite Automata. [5M] [L1] 4)a)Explain detail about Input Buffering Technique. [ 5 M] [L3] b)Explain about DFA and NFA one example for conversion of NFA to DFA conversion. [5M] [L2] 5)Explain in detail about the phases of compilers. [10M] [L2] 6)a)Explain the role of lexical analyzer .[5M] [L2] b)Explain in detail about Input buffering. [5M] [L2] 7)a)Explain in detail about Input buffering. [5M] [L2] b)Explain the structure of Lexical Analyzer Generator. [5M] [L1] 8 ) Explain detail about Recognition of tokens and their examples. [10M] [L2] 9)a)What is the use of Regular definition in specification of tokens. [5M] [L1] b)Define Token,Attribute,Lexeme. [5M] [L1] 10 ) a)What is LEX? Explain detail about general format of LEX program. [6M] [L1] b)Explain about structure of LEX. [4M] [L1] UNIT-II 1)a) Explain the role of a parser. [5M] [L2] b) consider the grammar given below E - >E+E | EE | E-E | a |b obtain leftmost right derivations and their parse trees for the string โ€œa+ba+bโ€. [5M] [L3] 2)Explain the problems in top down parsing. [10M] [L2] 3)a) What is left recursion and left factoring? Explain with an example. [ 5 M] [L1] b) Compute First and Follow for the grammar E->E+T/T, T->TF/F, F-> (E)/id*. [5M] [L2]

  1. a) Illustrate recursive descent parser for the grammar. [ 5 M] [L2]

S - >cAd A - >ab|a with a string cad b) Construct the LL ( 1 ) for the following grammar [5M] [L3] S โ€“ >(L) | a L โ€“ >L, S | S 5) Construct predictive parsing table for the grammar [10M] [L3] E - >E + T | T T - >TF | F F - >F | a |b* 6 ) a)What are the limitations of recursive descent parsers. [ 5 M] [L3] b) Explain in brief about the shift reduce parser with example. [5M] [L2] 7 )a) Explain the role of a parser. [5M] [L2] b) Construct the predictive parse table for the given grammar. [5M] [L3] E - > E+E E - > EE E* - > E-E E - > (E) | id. 8)What is recursive descent parser? Construct a recursive descent parser for the following grammar. E - > E+T | T T - > TF | F F* - > (E) | id. [10M] [L1] 9 ) Construct Predictive parsing table for the grammar [10M] [L3] E - >E + T | T T - >TF | F F - >F | a |b* 10 ) Explain about error recovery in predictive parsing. [10M] [L1] UNIT-III 1)Construct the CLR parsing table for the following grammar: [10M] [L3] *S->L=R | R L-> R | id R->L