BISON(1) User Commands BISON(1)

# [NAME](#NAME)

bison - GNU Project parser generator (yacc replacement)

# [SYNOPSIS](#SYNOPSIS)

**bison** \[*OPTION*]... *FILE*

# [DESCRIPTION](#DESCRIPTION)

*Bison* is a parser generator in the style of [*yacc*(1)](/man/os/bison/yacc.1). It should be upwardly compatible with input files designed for *yacc*.

Input files should follow the *yacc* convention of ending in **.y**. Unlike *yacc*, the generated files do not have fixed names, but instead use the prefix of the input file. Moreover, if you need to put *C++* code in the input file, you can end his name by a C++-like extension (.ypp or .y++), then bison will follow your extension to name the output file (.cpp or .c++). For instance, a grammar description file named **parse.yxx** would produce the generated parser in a file named **parse.tab.cxx**, instead of *yacc*'s **y.tab.c** or old *Bison* version's **parse.tab.c**.

This description of the options that can be given to *bison* is adapted from the node **Invocation** in the **bison.texi** manual, which should be taken as authoritative.

*Bison* supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with **--** instead of **-**. Abbreviations for option names are allowed as long as they are unique. When a long option takes an argument, like **--file-prefix**, connect the option name and the argument with **=**.

Generate a deterministic LR or generalized LR (GLR) parser employing [LALR(1)](/man/os/bison/LALR.1), [IELR(1)](/man/os/bison/IELR.1), or canonical [LR(1)](/man/os/bison/LR.1) parser tables.

Mandatory arguments to long options are mandatory for short options too. The same is true for optional arguments.

## [Operation Modes:](#Operation_Modes:)

[**-h**, **--help**](#h)

display this help and exit

[**-V**, **--version**](#V)

output version information and exit

[**--print-localedir**](#print)

output directory containing locale-dependent data and exit

[**--print-datadir**](#print~2)

output directory containing skeletons and XSLT and exit

[**-u**, **--update**](#u)

apply fixes to the source grammar file and exit

[**-f**, **--feature**\[=*FEATURES*\]](#f)

activate miscellaneous features

## [FEATURES is a list of comma separated words that can include:](#FEATURES_is_a_list_of_comma_separated_words_that_can_include:)

[caret, diagnostics-show-caret](#caret,)

show errors with carets

[fixit, diagnostics-parseable-fixits](#fixit,)

show machine-readable fixes

[syntax-only](#syntax)

do not generate any file

[all](#all)

all of the above

[none](#none)

disable all of the above

## [Diagnostics:](#Diagnostics:)

[**-W**, **--warnings**\[=*CATEGORY*\]](#W)

report the warnings falling in CATEGORY

[**--color**\[=*WHEN*\]](#color)

whether to colorize the diagnostics

[**--style**=*FILE*](#style)

specify the CSS FILE for colorizer diagnostics

## [Warning categories include:](#Warning_categories_include:)

[conflicts-sr](#conflicts)

S/R conflicts (enabled by default)

[conflicts-rr](#conflicts~2)

R/R conflicts (enabled by default)

[counterexamples, cex](#counterexamples,)

generate conflict counterexamples

[dangling-alias](#dangling)

string aliases not attached to a symbol

[deprecated](#deprecated)

obsolete constructs

[empty-rule](#empty)

empty rules without %empty

[midrule-values](#midrule)

unset or unused midrule values

[precedence](#precedence)

useless precedence and associativity

[yacc](#yacc)

incompatibilities with POSIX Yacc

[other](#other)

all other warnings (enabled by default)

[all](#all~2)

all the warnings except 'counterexamples', 'dangling-alias' and 'yacc'

[no-CATEGORY](#no)

turn off warnings in CATEGORY

[none](#none~2)

turn off all the warnings

[error\[=CATEGORY\]](#error_=CATEGORY_)

treat warnings as errors

## [WHEN can be one of the following:](#WHEN_can_be_one_of_the_following:)

[always, yes](#always,)

colorize the output

[never, no](#never,)

don't colorize the output

[auto, tty](#auto,)

colorize if the output device is a tty

## [Tuning the Parser:](#Tuning_the_Parser:)

[**-L**, **--language**=*LANGUAGE*](#L)

specify the output programming language

[**-S**, **--skeleton**=*FILE*](#S)

specify the skeleton to use

[**-t**, **--debug**](#t)

instrument the parser for tracing same as '-Dparse.trace'

[**--locations**](#locations)

enable location support

[**-D**, **--define=NAME**\[=*VALUE*\]](#D)

similar to '%define NAME VALUE'

[**-F**, **--force-define=NAME**\[=*VALUE*\]](#F)

override '%define NAME VALUE'

[**-p**, **--name-prefix**=*PREFIX*](#p)

prepend PREFIX to the external symbols deprecated by '-Dapi.prefix={PREFIX}'

[**-l**, **--no-lines**](#l)

don't generate '#line' directives

[**-k**, **--token-table**](#k)

include a table of token names

[**-y**, **--yacc**](#y)

emulate POSIX Yacc

## [Output Files:](#Output_Files:)

[**-H**, **--header**=*\[FILE\]*](#H)

also produce a header file

[**-d**](#d)

likewise but cannot specify FILE (for POSIX Yacc)

[**-r**, **--report**=*THINGS*](#r)

also produce details on the automaton

[**--report-file**=*FILE*](#report)

write report to FILE

[**-v**, **--verbose**](#v)

same as '--report=state'

[**-b**, **--file-prefix**=*PREFIX*](#b)

specify a PREFIX for output files

[**-o**, **--output**=*FILE*](#o)

leave output to FILE

[**-g**, **--graph**\[=*FILE*\]](#g)

also output a graph of the automaton

[**--html**\[=*FILE*\]](#html)

also output an HTML report of the automaton

[**-x**, **--xml**\[=*FILE*\]](#x)

also output an XML report of the automaton

[**-M**, **--file-prefix-map**=*OLD=NEW* replace prefix OLD with NEW when writing file paths](#M)

in output files

## [THINGS is a list of comma separated words that can include:](#THINGS_is_a_list_of_comma_separated_words_that_can_include:)

[states](#states)

describe the states

[itemsets](#itemsets)

complete the core item sets with their closure

[lookaheads](#lookaheads)

explicitly associate lookahead tokens to items

[solved](#solved)

describe shift/reduce conflicts solving

[counterexamples, cex](#counterexamples,~2)

generate conflict counterexamples

[all](#all~3)

include all the above information

[none](#none~3)

disable the report

# [AUTHOR](#AUTHOR)

Written by Robert Corbett and Richard Stallman.

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs to &lt;bug-bison@gnu.org&gt;.  
GNU Bison home page: &lt;https://www.gnu.org/software/bison/&gt;.  
General help using GNU software: &lt;https://www.gnu.org/gethelp/&gt;.

Report translation bugs to &lt;https://translationproject.org/team/&gt;.  
For complete documentation, run: info bison.

# [COPYRIGHT](#COPYRIGHT)

Copyright © 2021 Free Software Foundation, Inc.  
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# [SEE ALSO](#SEE_ALSO)

[**lex**(1)](/man/os/bison/lex.1), [**flex**(1)](/man/os/bison/flex.1), [**yacc**(1)](/man/os/bison/yacc.1).

The full documentation for **bison** is maintained as a Texinfo manual. If the **info** and **bison** programs are properly installed at your site, the command

**info bison**

should give you access to the complete manual.

September 2026 GNU Bison 3.8.2

---

Document: bison(1) from bison 3.8.2-r63 (Chainguard OS)
Source: https://git.savannah.gnu.org/git/bison.git
