0% found this document useful (0 votes)
51 views2 pages

Toc 3

The document is a past exam paper for a Theory of Computation and Compiler Design course. It contains 5 questions: 1. Check if grammars are ambiguous and determine the number of variables in a grammar converted to CNF. 2. Determine the class of a grammar and parse a string using LR(1) parsing. 3. Construct an operator precedence parser and functions for a grammar and parse a string. 4. Construct a PDA and determine if it accepts a string, and find the language of a PDA diagram. 5. Construct a TM to accept palindrome strings and discuss its operation, and construct a grammar to generate a language.

Uploaded by

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

Toc 3

The document is a past exam paper for a Theory of Computation and Compiler Design course. It contains 5 questions: 1. Check if grammars are ambiguous and determine the number of variables in a grammar converted to CNF. 2. Determine the class of a grammar and parse a string using LR(1) parsing. 3. Construct an operator precedence parser and functions for a grammar and parse a string. 4. Construct a PDA and determine if it accepts a string, and find the language of a PDA diagram. 5. Construct a TM to accept palindrome strings and discuss its operation, and construct a grammar to generate a language.

Uploaded by

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

A1+TA1 SLOT 23-09-2018

School of Computer Science & Engineering

Continuous Assessment Test -II


CSE2002-Theory of Computation and Compiler Design
Time: 1:30 Hrs Max.Marks:50
Answers ALL the questions
1. (a) Check whether the grammar is ambiguous or not [5+4+1]
*

1. S0S1/SS/ ϵ W= 0011

2. SAB/aaB , Aa/AA, Bb W= aab

3. SSbS/a W=abababa

4. SaSb/ab W=aaabbb

5. RR+R/RR/R*/a/b/c W=a+b*C

(b) EE+T E T T(E) T i How many variables does the above grammar have when converted
to CNF?

(c) The __________ running time of CYK is O(n3 .|G|) where n is the length of the parse string and |G| is
the size of the context free grammar G

2. G: [ 3+4+5+3 ]

SX a↑

XYb|YZc

Yd and Zb

For each of the the following grammar classes , if G is of that class, give the appropriate parsing
table. If it is not of that class, Fully explain(Prove) why it is not, and also parsing the i/p ↑abbc↑
using option c).

a) LL(0) b) LR(0) c) LR(1) d) SLR(1) e) LALR(1)

1|Pa g e
A1+TA1 SLOT 23-09-2018

3. Consider the following grammar [4+4]

S→(L)|a
L→L,S|S
Construct the operator precedence parser and operator precedence functions. Then parse the following
string: ( a , ( ( a , a ) ,(a , a) ,a ) )

n s s 2n
4 (a) Construct Pushdown automata for L = {a a d(ba) c ∈ {a, b, c, d} ∗ | n, s ≥ 0}.Show that
whether the PDA accepts the word aaadbabacc ?
(b) Find the language L(M) for the given PDA transition diagram. [5+3]

5. (a) Construct a TM that accepts all strings of Palindrome over the alphabet {a,b}. Given the input strings, abba
and ababa, discuss the ID (instantaneous descriptions) of the TM. Explain the logic that how the Turing machine
works and give the corresponding transition rules.

(b) Construct an unrestricted grammar (G: SACaB CaaaC CBDB CBE aDDa ADAC aEEa
i
2
AE ϵ ) to accept { 0 | i≥1 } [5+4]

2|Pa g e

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