Sign in

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.

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 withTopicWhat differs
FreeBSD-P meaningSolnix 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 streamSolnix 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 meaningSolnix yacc has no -h option. FreeBSD yacc -h prints a usage message to standard error.
Source: illumos yacc(1) SYNOPSIS; FreeBSD yacc(1) -h
FreeBSDoutput file name controlSolnix 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
FreeBSDoptions missing on SolnixSolnix 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
FreeBSDversion stamping -QSolnix 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 outputFreeBSD 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
FreeBSDstdin and -- handlingFreeBSD 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
FreeBSDconcurrent runsThe 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
FreeBSDlocale and EUC handlingSolnix 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

TaskSolnixFreeBSD
generate a parser from a grammar fileyacc fileyacc filename
also write the token-definition header fileyacc -d fileyacc -d filename
write a parser description and conflict reportyacc -v file—
use a custom prefix for output file namesyacc -b file_prefix fileyacc -b file_prefix filename
use a custom prefix for generated symbol namesyacc -p sym_prefix fileyacc -p symbol_prefix filename
compile runtime debugging code into the parseryacc -t fileyacc -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, -t and -v in portable build rules. They appear on both Solnix and FreeBSD. Avoid -P, -V, -o and -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.