BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
586 stars 165 forks source link

unused terminals: 1 #79

Closed gdetrez closed 10 years ago

gdetrez commented 10 years ago

I'm using BNF Converter, 2.6a.

I recently wrote a grammar as part of an university assignment, and was puzzled by the message unused terminals: 1 when running make. However, I didn't think that there was an unused terminal in my grammar. I then went ahead and simplified my grammar as much as possible, but that message persisted.

Here is my final result:

Prog.   Program ::= Integer ;

I still get the message unused terminals: 1 with this grammar, but this doesn't seem to be correct. Implementing Programming Languages (p.20) defines 'terminals' as string literals, but there are no string literals in this grammar.

(reported by @gregorulm on the mailing list)

gdetrez commented 10 years ago

Apparently, bnfc will systematically generate a terminal

L_err    { _ }

There is no explaination why, the only comment is GF literals which is a bit confusing: what has GF anything to do with this?

gdetrez commented 10 years ago

Fixed in 45bcaefeb2a1ff