[erlang-questions] yecc and compiler warnings

Hugo Mills hugo@REDACTED
Tue Jun 30 16:10:10 CEST 2015


On Mon, Jun 29, 2015 at 05:44:44PM +0000, Hugo Mills wrote:
>    I'm writing a small domain-specific language using leex and yecc
> (under R17 at the moment), and I'm getting a bunch of these from the
> module produced by yecc:
> 
> ebin/linseed_parser.erl:409: Warning: function yeccpars2_3/7 is unused
> ebin/linseed_parser.erl:808: Warning: function yeccpars2_87/7 is unused
> ebin/linseed_parser.erl:822: Warning: function yeccpars2_89/7 is unused
> ebin/linseed_parser.erl:827: Warning: function yeccpars2_90/7 is unused
> ebin/linseed_parser.erl:949: Warning: function yeccgoto_line_sequence/7 is unused
> src/linseed_parser.yrl:20: Warning: function yeccpars2_89_/1 is unused
> src/linseed_parser.yrl:22: Warning: function yeccpars2_90_/1 is unused
> src/linseed_parser.yrl:27: Warning: function yeccpars2_87_/1 is unused
> 
>    The latter three lines (linseed_parser.yrl:20 and so on) do not
> seem to correspond to anything sensible in linseed_parser.yrl: line 20
> is empty, line 22 is the first line of a production, and line 27 is
> the second line of a different production.
> 
>    Are these warnings expected from using yecc, or is there something
> wrong with my grammar? If the latter, how do I identify what it is
> from the warning messages above?

   I think I've worked this out, eventually. To answer the question
for posterity, my grammar doesn't have an explicit terminating symbol,
so I removed the "Endsymbol" line from the yecc file. After doing
that, the unused functions vanished, and I get a clean compile of the
parser.

   Hugo.

-- 
Hugo Mills             | ©1973 Unclear Research Ltd
hugo@REDACTED carfax.org.uk |
http://carfax.org.uk/  |
PGP: E2AB1DE4          |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150630/1c551bc2/attachment.bin>


More information about the erlang-questions mailing list