You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sumedh Arani edited this page Mar 13, 2016
·
1 revision
The program prompts the user to enter a file name. The file will contain a grammar (assuming that the given grammar will be in Chomsky Normal Form). Then the program prompts the user to enter a string. It then outputs whether or not this string so entered belongs to the language of the grammar specified in the input file.
An example input file:
S -> AB | a
A -> SA | BS | BB | c
B -> AS | AA | b
Assumptions about the grammar file:
Assuming that all non-terminals are in uppercase and all terminals are in lowercase.
There can be multiple |'s (as shown above), or even none (such as for instance, S -> BA) for a given production.
-There can be same non terminal appearing more than once in the LHS.