0% found this document useful (0 votes)
11 views

CD

Uploaded by

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

CD

Uploaded by

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

CD questions :

chapter 1:
1. Explain the phases of compiler with an example (7 marks )
2. What is compiler? What is front-end and back-end of compiler? (3 marks )
3. Explain input, output and action performed by each phases of compiler with
example. ( 7 marks )
4. complier vs interpreter ( 4 marks )

chapter 2:
0. what is inputbuffer. ( 3 marks )
1. Write a brief note on input buffering techniques. ( 4 marks )
2 . Define token, lexeme and pattern. Identify the lexemes that makes up the
tokens for the following code ( 7 marks )
const p = 10;
if( a < p)
{ a++ ;
If(a== 5)
continue ;
}

3. Define lexeme, token and pattern. Identify the tokens from the following
program segment ( 4 marks )
void change (int c, int d)
{ int m; m = c; c= d; d = m; }

4. Construct deterministic finite automata without constructing NFA for


following regular expression. ( 7 marks )
(a/b)abb.

5. What is lexical analysis? Which are the tasks performed by lexical


analyzer. ( 3marks )

6. Write RE the following language.. ( 3 marks )


1. All string of 0’s and 1’s that do not contain 11.
2. All string of 0’s and 1’s that every 1 is followed by 00
1) The Language of all strings containing exactly three 1’s
2) The Language of all strings begins or ends with 00
3) The Language of all strings that contain at least three 1’s

7. Draw DFA for the following regular expression without construction of


NFA. ( 7marks )
( a | b) * a (a | b)#

8 . Find out FIRST & FOLLOW set for all the Nonterminals ( 4 marks )
S-> 1AB | ϵ
A-> 1AC | 0C
B-> 0S
C-> 1

9. Write short note on LEX( 4 marks )

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

11. Draw NFA from regular expression using Thomson’s construction and convert
it into DFA. (a | b)* a b* a ( 7marks )

12. Describe Ambiguous Grammar with example.( 3 marks )

chapter 3:

1. Construct SLR parsing table for the following grammar : ( 7 marks )


S → (L) | a
L→ L,S | S

2. Check the following grammar is SLR(1) or not ( 7 marks )


S → Aa | bAc | Bc | bBa
A → d
B → d

3. What is left factoring in CFG? Perform the Left factoring of following


Grammar.
S → iEtS / iEtSaS / a
E → b

4. What is Left Recursion? Give an example for eliminating the same ( 4 marks )

5. Explain recursive-descent parsing with suitable example ( 7 marks )

6 . Draw the parse tree and derive the left most derivation using the following ( 3
marks )
grammar for the input string: (a + a) * (a * a).
E → E + T | T
T → T * F | F
F → ( E ) | a

7. Explain a rule of Left factoring a grammar and give Example. (7 marks )

8 . Define the following terms and give suitable example for it.
i. Augmented Grammar
ii. LR(0) Item
iii.LR(1) Item

9. Describe Ambiguous Grammar with example.( 4 marks )

10. Differentiate Top Down Parsing and Bottom up parsing ( 3marks )

11. Construct CLR parsing table for following grammar.( 7 marks )


S -> aSA | €
A -> bS | c

combine chapter question:

Define the following terms:


1. 1) LL(1) Grammar 2) Ambiguous Grammar 3) Operator Grammar
2. Define following terms:
i. Compiler
ii. Interpreter
iii.Token

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy