yacc(1) on Solnix vs Linux and the BSDs
On Solnix, yacc is the illumos yacc at /usr/bin/yacc, with only -b, -d, -l, -p, -P, -Q, -t, -v and -V. FreeBSD's Berkeley Yacc has more options, and its -P asks for a reentrant parser where Solnix -P names a parser skeleton file.
The manual pages
- Solnix: yacc(1) from
pkgs.solnix.illumos-world-man; the default on Solnix · illumos.org - FreeBSD: yacc(1) 15.1-RELEASE
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
yacc
What Solnix runs
A default Solnix system runs the illumos yacc at /usr/bin/yacc; no other illumos variants are shipped. GNU Bison is not installed by default: add pkgs.solnix.bison to get bison(1), which its page says should be upwardly compatible with yacc input files. Unlike yacc, Bison names its output files after the input file; -y emulates POSIX Yacc.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD | -P meaning | Solnix yacc -P parser uses the named parser file instead of /usr/share/lib/ccs/yaccpar. FreeBSD yacc -P creates a reentrant parser (like %pure-parser) and takes no argument.Source: illumos yacc(1) -P; FreeBSD yacc(1) -P |
| FreeBSD | -V output stream | Solnix yacc -V writes the version information to standard error. FreeBSD yacc -V writes the version number to standard output.Source: illumos yacc(1) -V; FreeBSD yacc(1) -V |
| FreeBSD | -h meaning | Solnix yacc has no -h option. FreeBSD yacc -h prints a usage message to standard error.Source: illumos yacc(1) SYNOPSIS; FreeBSD yacc(1) -h |
| FreeBSD | output file name control | Solnix yacc can only change the output prefix with -b. FreeBSD also has -o output_file, which overrides -b, and -H defines_file, which names the token header instead of y.tab.h.Source: illumos yacc(1) SYNOPSIS, -b; FreeBSD yacc(1) -o, -H |
| FreeBSD | options missing on Solnix | Solnix yacc does not document FreeBSD's -B, -g, -i, -L, -r, -s or -y. FreeBSD yacc itself ignores -y.Source: illumos yacc(1) SYNOPSIS; FreeBSD yacc(1) -B, -g, -i, -L, -r, -s, -y |
| FreeBSD | version stamping -Q | Solnix yacc has -Q[y|n]. -Qy puts version stamping information into y.tab.c, and -Qn (the default) writes none. The FreeBSD page documents no -Q option.Source: illumos yacc(1) -Q; FreeBSD yacc(1) SYNOPSIS |
| FreeBSD | -t debug output | FreeBSD yacc -t debug output goes to standard output. The Solnix -t text says the debugging code is compiled in, controlled by YYDEBUG, and does not say where its output goes.Source: illumos yacc(1) -t; FreeBSD yacc(1) -t |
| FreeBSD | stdin and -- handling | FreeBSD yacc reads the grammar from standard input when the filename is a single "-", and honours "--" as end of options. The Solnix page describes file as a required path name and says nothing about "-" or "--". Source: FreeBSD yacc(1) DESCRIPTION (last paragraph); illumos yacc(1) OPERANDS |
| FreeBSD | concurrent runs | The Solnix page says that because output file names are fixed, at most one yacc process can be active in a directory at a time. The FreeBSD page makes no such statement. Source: illumos yacc(1) NOTES; FreeBSD yacc(1) -o, -b |
| FreeBSD | locale and EUC handling | Solnix yacc documents EUC single-character quoted terminals, with yylex() returning a wchar_t value. It lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH. The FreeBSD page documents no environment variables. Source: illumos yacc(1) ENVIRONMENT VARIABLES; FreeBSD yacc(1) DESCRIPTION |
Everyday tasks
| Task | Solnix | FreeBSD |
|---|---|---|
| generate a parser from a grammar file | yacc file | yacc filename |
| also write the token-definition header file | yacc -d file | yacc -d filename |
| write a parser description and conflict report | yacc -v file | — |
| use a custom prefix for output file names | yacc -b file_prefix file | yacc -b file_prefix filename |
| use a custom prefix for generated symbol names | yacc -p sym_prefix file | yacc -p symbol_prefix filename |
| compile runtime debugging code into the parser | yacc -t file | yacc -t filename |
Standards
- POSIX: yacc is a POSIX.1-2024 utility.
- Solnix: ATTRIBUTES: Interface Stability is Committed; Standard: see standards(7).
Writing portable scripts
- Use only
-b,-d,-l,-p,-tand-vin portable build rules. They appear on both Solnix and FreeBSD. Avoid-P,-V,-oand-y. - Run concurrent yacc jobs in separate directories on Solnix: the page says that because the output names are fixed, at most one yacc process can be active in a directory at a time.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.