Question: 2 . Consider the following CFG S - > Stmt Stmt - > Var = Expr Expr - > Var | Num | Expr +

2. Consider the following CFG
S -> Stmt
Stmt -> Var = Expr
Expr -> Var | Num | Expr + Expr | Expr Expr
Var -> a | b | c || z
Num ->0|1|2||9
Give the derivations fot the following strings:
(a) x =5
(b) y = x +3
(c) z = y 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!