mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 05:22:09 +02:00
yacc: add page (#10439)
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
This commit is contained in:
parent
91b734cec8
commit
af571728d3
1 changed files with 17 additions and 0 deletions
17
pages/common/yacc.md
Normal file
17
pages/common/yacc.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
# 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 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}}`
|
Loading…
Add table
Reference in a new issue