Question: Date: 2 7 . 0 2 . 2 0 2 4 Aim : To write a C + + Program to find first and follow

Date: 27.02.2024
Aim : To write a C++ Program to find first and follow of a Grammar
Refer the lecture material to know about the detailed procedure for finding first and follow of a Grammar.
Input format
Number of non-terminals in the grammar
Number of terminal in the grammar
List of non-terminals (separated by one white space)
List of terminals (separated by one white space)
Production rules of the grammar
Output format
\table[[Non Terminal (NT),First(NT),Follow(NT)]]
Test case1 Grammar
SABCD
Ab|E|
BC
C
De
Sample Input
5
4
S A B C D
bcde
RHS of S: A B C D
RHS of A: b,epsilon (If two rules, separate them using comma)
RHS of B:C
RHS of C:d
 Date: 27.02.2024 Aim : To write a C++ Program to find

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!