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

Problem with empty terminals #149

Closed
sirdude opened this issue Jul 2, 2015 · 2 comments
Closed

Problem with empty terminals #149

sirdude opened this issue Jul 2, 2015 · 2 comments
Milestone

Comments

@sirdude
Copy link
Contributor

sirdude commented Jul 2, 2015

The following grammar works with bnfc -c or --cpp but does not build with haskell

Prog. Program ::= Defin ;
Pe. Program ::= "" ;
Def. Defin ::= "woo" ;

It will generate files but when trying to make I get the following:
% make
happy -gca ParTest.y
alex -g LexTest.x
LexTest.x:25:3: parse error

@gdetrez
Copy link
Contributor

gdetrez commented Jul 3, 2015

BNFC chokes on empty terminals. If you want an empty production do this instead:

Prog. Program ::= Defin ;
Pe. Program ::= ;
Def. Defin ::= "woo" ;

@gdetrez
Copy link
Contributor

gdetrez commented Jul 3, 2015

Fixed in a3a4149.

@gdetrez gdetrez closed this as completed Jul 3, 2015
@andreasabel andreasabel added this to the 2.8.1 milestone Nov 4, 2018
@andreasabel andreasabel changed the title Problem with haskell version of bnfc Problem with empty terminals Nov 4, 2018
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

3 participants