Bug 189101

Summary: yacc(1): In FreeBSD yacc, %nonassoc doesn't work correctly
Product: Base System Reporter: ksmakoto
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: dickey
Priority: Normal    
Version: 10.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.shar none

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).