Bug 189101 - yacc(1): In FreeBSD yacc, %nonassoc doesn't work correctly
Summary: yacc(1): In FreeBSD yacc, %nonassoc doesn't work correctly
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 10:10 UTC by ksmakoto
Modified: 2017-07-09 20:22 UTC (History)
1 user (show)

See Also:


Attachments
file.shar (1.68 KB, text/plain)
2014-04-29 10:10 UTC, ksmakoto
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ksmakoto 2014-04-29 10:10:00 UTC
In yacc, an operator which specified %nonassoc should has non associativity,
and cause syntax error for runtime ambiguous input.

But FreeBSD's /usr/bin/yacc doesn't.

Fix: Patch attached with submission follows:
How-To-Repeat: ( see attached sample )
$ echo -n "1-2-3" | ./calc_by  # FreeBSD BYacc
-4
$ echo -n "1-2-3" | ./calc_9y  # devel/9base's Yacc
syntax error
$ echo -n "1-2-3" | ./calc_bi  # GNU Bison
syntax error
Comment 1 Thomas E. Dickey 2017-07-09 18:34:48 UTC
I happened to recall this today, and checking, see that my version of byacc gives the expected syntax error (someone might check/close this bug).