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.
-
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 filey.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 ofy
:
yacc -d {{path/to/grammar_file.y}} -v -b {{prefix}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.