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

Tutorial Questions II: C Byregowda Institute of Technology

The document contains 12 questions related to system software and compiler design. The questions cover topics such as formal language definitions, regular expressions, lexical analysis, parsing techniques including LL, LR, SLR and LALR parsing. Specific questions involve constructing parsers like recursive descent parsers and parsing tables for given context-free grammars. The document tests the understanding of fundamental concepts in compilers like grammars, parsing, ambiguity and techniques to remove ambiguity from grammars.
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)
29 views2 pages

Tutorial Questions II: C Byregowda Institute of Technology

The document contains 12 questions related to system software and compiler design. The questions cover topics such as formal language definitions, regular expressions, lexical analysis, parsing techniques including LL, LR, SLR and LALR parsing. Specific questions involve constructing parsers like recursive descent parsers and parsing tables for given context-free grammars. The document tests the understanding of fundamental concepts in compilers like grammars, parsing, ambiguity and techniques to remove ambiguity from grammars.
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/ 2

C BYREGOWDA INSTITUTE OF TECHNOLOGY

Department: Computer Science and Engineering


Tutorial questions II
System Software & Compiler Design (15CS63)

Date: 05-04-2019

1. Give the formal definitions of operation on languages with notations

2. Write the regular definitions for i) identifier ii) unsigned number

3. Write the Lex program that recognizes the tokens ws, if, then, else, id, number and relational
operator.

4. Design the NFA for the regular expression (a|b)*abb

5. Consider the grammar

E->E+E|E*E|(E)|I
I->a|b|Ia|Ib|I0|I1
i) Check whether the grammar is ambiguous or not for the input a*b+a
ii) If ambiguous obtain an equivalent unambiguous grammar.
6. What is left recursion? Write an algorithm to eliminate left recursion. Eliminate left recursion
from the following grammar.
S->(L)|a
L->L,S|S
7. What is recursive decent parser? Trace and explain working of the recursive descent parser for
the input “bcd” and grammar:
A->bCd
C->ce|c
8. Construct the predictive parsing table by making necessary changes to the grammar given
below
E->E+T|T
T->T*F|F
F->(E)|id
9. What is Handle pruning? Give Bottom up parses for the input string aaa*a++ using the
grammar
S->SS+ | SS* | a

10. Show that following grammar is not SLR(1)


S->L=R|R
L->*R|id
R->L
11. Show that the following grammar is not LL(1)
S->iCtSS`|a
S`->eS|ϵ
C->b

12. Form the Action/Goto table for the following grammar


S->Aa|bAc|Ba|bBa
A->d
B->d
Justify whether the grammar is LR(0) or not

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