Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USE JAVA PLEASE AND MAKE IT SO IT PROMPTS THE USER FOR A TEXT FILE AND READS THE FILE PLEASE Project Problem: Simplification of Context

USE JAVA PLEASE AND MAKE IT SO IT PROMPTS THE USER FOR A TEXT FILE AND READS THE FILE PLEASE Project Problem: Simplification of Context-Free Grammars We learned three context-free grammar (CFG) simplification techniques in our classes: removing \epsi -rules, unit- rules, and useless rules. In this project, read a CFG from a txt file, simplify it by removing \epsi -rules and useless rules, and print out the simplified equivalent CFG. No need to care or remove unit-rules. For example, given the following CFG in a txt file (0 denotes empty string and - denotes arrow head ->): S-aA|aBB A-aaA|0 B-bB|bbC C-B After processing, your program should print out the following simplified equivalent CFG: S-aA|a A-aaA|aa The following are a few more examples you can use to test your program (I highly recommend that you come up with more examples to make sure the correctness of your program): (1) S-AaBaCbD A-0|a B-0|b C-0|c D-0|d For the above CFG, the print out should be S-aab|Aaab|aBab|AaBab|aaCb|AaaCb|aBaCb|AaBaCb|aabD|AaabD|aBabD|AaBabD|aaCbD|AaaCbD|aBaCbD|AaBaCbD A-a B-b C-c D-d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

List the five major symptoms of schizophrenia spectrum disorders.

Answered: 1 week ago