Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about elimination of ε production #1

Open
ghost opened this issue Jun 4, 2022 · 0 comments
Open

Question about elimination of ε production #1

ghost opened this issue Jun 4, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 4, 2022

Hi Angel,

I have read your code about removing useless symbols and productions. But I test some cases and don't know if this program can eliminate the epsilon production.

The productions of type S → ε are called ε productions. These type of productions can only be removed from those grammars that do not generate ε.

Firstly I guess the symbol ~ in your test files means the epsilon symbol, but the output result also has the epsilon. My test case is here, and the # means the epsilon symbol which should be removed.

4
a b c d
5
S A B C D
S -> a | bA | B | ccD
A -> abB | #
B -> aA
C -> ddC
D -> ddd

So can this program deal with the ε productions and remove unit productions, or it can only deal with removing useless symbols?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants