yacc

Generate an LALR parser (in C) with a given formal grammar specification file. See also: bison. More information: <https://manned.org/man/yacc.1p>.

Install

All systems
curl cmd.cat/yacc.sh
Debian Debian
apt-get install 9base
Ubuntu
apt-get install 9base
Alpine
apk add byacc
Arch Arch Linux
pacman -S 9base
image/svg+xml Kali Linux
apt-get install 9base
CentOS
yum install byacc
Fedora
dnf install byacc
Windows (WSL2)
sudo apt-get update sudo apt-get install 9base
OS X
brew install byacc
Raspbian
apt-get install 9base
Docker
docker run cmd.cat/yacc yacc powered by Commando

Generate an LALR parser (in C) with a given formal grammar specification file. See also: bison. More information: <https://manned.org/man/yacc.1p>.

  • Create a file `y.tab.c` containing the C parser code and compile the grammar file with all necessary constant declarations for values. (Constant declarations file `y.tab.h` is created only when the `-d` flag is used):
    yacc -d path/to/grammar_file.y
  • Compile a grammar file containing the description of the parser and a report of conflicts generated by ambiguities in the grammar:
    yacc -d path/to/grammar_file.y -v
  • Compile a grammar file, and prefix output filenames with `prefix` instead of `y`:
    yacc -d path/to/grammar_file.y -v -b prefix

© tl;dr; authors and contributors