SYSTEM SOFTWARE AND COMPILER DESIGN
[As per Choice Based Credit System (CBCS) scheme]
(Effective from the academic year 2017 - 2018)
SEMESTER - VI
Subject Code 17CS63
IA Marks 40
Number of Lecture Hours/Week 4
Exam Marks 60
SYSTEM SOFTWARE AND COMPILER DESIGN
Important Questions - MODULE - 4
These Questions are being framed for helping the students in the "FINAL Exams" Only (Remember for Internals the Question Paper is set by your respective teachers). Questions may be repeated, just to show students how VTU can frame Questions.
- ADMIN
17CS63 - SYSTEM SOFTWARE AND COMPILER DESIGN
Question Bank - MODULE - 4
1. What is the role of parser? Explain the different error recovery strategies. (08 Marks) (Dec.2019/Jan.2020)
2. Construct the LL(1) parsing table for the following productions:
3. E+E + T/T ; T -> T * F/F ; F -> (E)/id (08 Marks) (Dec.2019/Jan.2020)
4. Using operator-precedence parsing algorithm, construct, the table and parse the input string id + id * id. (12 Marks) (Dec.2019/Jan.2020)
5. Define Handle, viable prefixes. (04 Marks) (Dec.2019/Jan.2020)
6. Define left recursion grammer, eliminate left recursion from the following grammer:
S -> aB|ac|sd|se
B -> bBc|f
C -> g (03 Marks) (June/July 2019)
7. Consider the following context free grammer S -> SS + | SS * | a and the input string aa + a*
i) Give LMD and RMD
ii) Parse tree
iii) Is the grammer ambiguous? Why
iv) Describe the language generated by the grammer
v) Left factor the grammer. (05 Marks) (June/July 2019)
8. Consider the following grammer with terminals
(, [, ), ]
S ->TS|[S]S|)S|e
T ->(x)
X -> TX|[X] X|e
i) Construct first and follow sets
ii) Construct its LL(1) parsing table
iii) Is this grammer LL(1)?
(08 Marks) (June/July 2019)
9. The following is ambiguous grammer
S ->AS|b
A ->SA|a
Construct for this grammer its collection of sets of LR(O) items. IF we try to build an LR - parsing table for the grammer, there are certain conflicting actions what are they? Suppose we tried to use the parsing table by non-deterministically choosing a possible action whenever there is a conflict, show all the possible sequences of actions on input abab$.
(10 Marks) (June/July 2019)
10. What are the actions of a shift - reduce parser. Design shift - reduce parser for the following grammer on the input 10201 S -> 0 S 0|1 S 1 2. (06 Marks) (June/July 2019)
11. What is shift reduce parser? Explain the conflicts that may occur during shift reduce parsing (04 Marks) (Dec.2018/Jan.2019)
12. Construct LALR parsing tables for the grammar shown below using LR(1) items.
S -> S
S -> Ce
C -> eC|d(08 Marks) (Dec.2018/Jan.2019)
13. How left recursion can be eliminated from grammars the simple arithmetic expression grammar and rewrite the grammar after removing left recursion. (04 Marks) (Dec.2018/Jan.2019)
14. What is left factoring? Rewrite the following grammer after "left factored"
S -> iEts | iEiSeS|a
E -> b (04 Marks) (Dec.2018/Jan.2019)
15. Write a note on the parser generator yaac (04 Marks) (Dec.2018/Jan.2019)
16. Construct canonical LR(1) items for, augmented grammer
S' -> S :
S -> Ce
C -> eC|d (08 Marks) (Dec.2018/Jan.2019)
17. What is top down parser? What are key problems in top down parsing? (08 Marks) (June/July 2018)
18. Explain the ambiguity in arithmetic expression. What is the ambiguity in parsing 2 +3 « 42 Explain the solution for it. (08 Marks) (June/July 2018)
19. What is meant by handle processing? How it helps on shift reduce parsing? List the actions of a shift reduce parser. (08 Marks) (June/July 2018)
20. 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. (08 Marks) (June/July 2018)
-ADMIN
ANSWER SCRIP FOR THESE QUESTIONS WILL BE UPLOADED "AS SOON AS POSSIBLE"
Visit: https://hemanthrajhemu.github.io/AnswerScript/
For immediate Notification Join the Telegram Channel
-ADMIN
T = Text book
QB = Question Bank
AS = Amswer Script
-ADMIN