Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

22
yacc Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# yacc
> Generate an LALR parser (in C) with a 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}}`