LinuxCommandLibrary

yacc

Generate an LALR parser (in C) with a given formal grammar specification file.

TLDR

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]
copy


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
copy


Compile a grammar file, and prefix output filenames with prefix instead of y
$ yacc -d [path/to/grammar_file.y] -v -b [prefix]
copy

SYNOPSIS

yacc [OPTION]... FILE

DESCRIPTION

Yacc (Yet Another Compiler Compiler) is a parser generator. This version is a simple wrapper around bison(1). It passes option -y, --yacc to activate the upward compatibility mode. See bison(1) for more information.

REPORTING BUGS

Report bugs to <bug-bison@gnu.org>.

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

lex(1), flex(1), bison(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.

AUTHOR

Written by Paul Eggert.

Copied to clipboard