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