Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with sml-yacc

29 views
Skip to first unread message

Chris Toshok

unread,
Sep 7, 1993, 4:14:32 PM9/7/93
to
Hello all,

I have a question about sml-yacc. I am using the version distributed
with SML/NJ 0.93. I am using sml-yacc to build a parser for Haskell, and
am running into problems when I try to use productions that have values and
those that don't. The problem is, I have a non-terminal opt_Semi, with the
productions:

opt_Semi:
(* empty *) ()
| SEMI ()

This non-terminal is used in other productions, and does not need to have a
value, but when I run sml-yacc on the file, I get back:

haskell-grm, line 508: Error: syntax error: deleting BOGUS_VALUE
? smlyacc: uncaught exception Semantic

I have tried using 'a option as the return type for opt_Semi and putting
NONE in the parenthesis, but the error stays the same. What does this
error message mean, and how do I get rid of it. When the grammar had no
values associated with the productions (a recognizer, not a parser) the
error did not show up. It only surfaced when I added values to the other
productions.

Help.

--
====================================================================
Chris Toshok | "To tuple is human,
| to curry, divine"
tos...@snake.cs.uidaho.edu | - anonymous functional
| programmer
====================================================================

David Tarditi

unread,
Sep 8, 1993, 1:30:33 PM9/8/93
to
In article <CD02w9...@cs.cmu.edu> tos...@snake.cs.uidaho.edu (Chris Toshok) writes:
>Hello all,
>
> I have a question about sml-yacc.
<much stuff deleted>

>value, but when I run sml-yacc on the file, I get back:
>
> haskell-grm, line 508: Error: syntax error: deleting BOGUS_VALUE
> ? smlyacc: uncaught exception Semantic

There is a bug in sml-yacc; comments are not being allowed
within the code for an action. This message will appear when
a comment is placed within an action.

The lexer is converting a comment in an action into the token
BOGUS_VALUE, and returning that to the parser. This confuses
the parser, and causes a spurious syntax error report.

A bug fix for this will appear when the next version of sml-yacc
is released with a major release of SML/NJ.

David Tarditi


0 new messages