DLP Assignment
DLP Assignment
: 2024-25
Sr. Aim CO
No.
1. What is a compiler? What is the front-end and back-end of the compiler? 1
2. Write a brief note on input buffering techniques. 1
3. Explain the input, output, and action performed by each phases of compiler 3
with example.
4. Explain error recovery strategies. 2
5. What is lexical analysis? Which are the tasks performed by lexical 1
analyzer.
6. Give the rule to remove left recursive grammar. And Eliminate left 4
recursion from following grammar.
S → Aa | b
A → Ac | Sd | f
7. What is left factoring in CFG? Perform the Left factoring of following 4
Grammar.
S → iEtS / iEtSaS / a
E→b
8. Define token, lexeme, and pattern. Identify the lexemes that makes up the 1
tokens for the following code
const p = 10;
if( a < p)
{ a++ ;
If(a== 5)
continue ;
}
9. Consider the following grammar: 4
S’ = S#
S -> ABC
A -> a|bbD
B -> a| Ꜫ
C -> b| Ꜫ
D -> c| Ꜫ
Construct FIRST and FOLLOW for the grammar
10. Explain handle and handle pruning 2
11. Explain the language-dependent and machine-independent phases of 1
a compiler. Also, a List of major functions is done by the compiler.
12. What do you mean by left recursion and how is it eliminated? 4
13. What is ambiguous grammar? Show that 4
S -> aS|Sa|a
is an ambiguous grammar. If ambiguous then remove the ambiguity
14. Design FIRST and FOLLOW set for the following grammar and solve it 4
using LL(1) grammar.
S→ 1AB | ε
A→1AC | 0C
B→0S
C→1
15. Explain the activation tree. 2
16. Explain Syntax Error Handling. 2
17. What is a language processor? 1
18. Explain role of the parser. 3
19. Explain non-recursive predictive parsing. 3
20. Construction of Non-recursive Predictive Parsing Table. 3