Question: Question # 2 (25 Marks) Consider a CFG in which the Terminals appear only on the left hand side. i.e. Stmt-sequence;Statement Statement -> Stmt-sequence If-Stmt|Iterative-Stmt

Question # 2 (25 Marks) Consider a CFG in which the Terminals appear only on the left hand side. i.e. Stmt-sequence;Statement Statement -> Stmt-sequence If-Stmt|Iterative-Stmt -> Statement if Expr { Stmt-sequence } -> If-Stmt Find out the Terminal and Non-Terminals also display even number of Terminals and odd number of Terminals. Then find out the first sets. Remember first set only contains even count Terminals. Note: Write down any 3 productions of CFG of your choice for running your program based on the above examples scheme. Question # 2 (25 Marks) Consider a CFG in which the Terminals appear only on the left hand side. i.e. Stmt-sequence;Statement Statement -> Stmt-sequence If-Stmt|Iterative-Stmt -> Statement if Expr { Stmt-sequence } -> If-Stmt Find out the Terminal and Non-Terminals also display even number of Terminals and odd number of Terminals. Then find out the first sets. Remember first set only contains even count Terminals. Note: Write down any 3 productions of CFG of your choice for running your program based on the above examples scheme
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
