Professional Documents
Culture Documents
There are some errors in the given block of code. Which of the
errors will be found by the lexical analyzer and which will not?
Correct only the lexical errors. Then convert the corrected block of
code into stream of tokens.
Page | 1
CO1 2. (a) Consider the following context free grammars (CFG): 5
i. ii.
B→ dBb | bBd | dCb E→FG
C→aC | Ɛ F→ fgFg | fgGg | f
G→ g
CO1 (b) Write down the regular expression and draw the transition 5
X→ Xcd | Yb | Zc
Y→b
Z→a| Ɛ
Show the simulation of Table-Driven Predictive Parsing using the
above grammar for the input string “bbcd”, if possible.
[Here, replace c in every case with the first letter of your name (in
Page | 2
lowercase character)]
Page | 3