I have to make a program that gets a string and then finds out if it is accepted by the CFG(cintext free grammer),
I want to first do the Simplification of CFG but I really don't know what data structure I have to use,
for example I want to get rid of useless symbols(those that do
not participate in any derivation of a terminal string.)
here i have the file that keeps the grammer for example
then I have to get ride of B cuz not genarating termenals so the grammer would be :
then get rid of A cuz not reachable from S,so:
Eric Lippert of the C# compiler team is the midst of writing a series on binary trees, arbitrary trees, and "every program there is" along these very same lines. ... ... ... ... ... ... ... Part 6 will probably be up Thursday.