|
Quick links About
yacc Syntax Related commands
Linux / Unix main page
About yacc
Short for yet another compiler-compiler, yacc is a
compiler.
Syntax
yacc [-d] [-l] [-t] [-V] [-v] [ -b file_prefix ] [ -Q
[y | n ] ] [ -P parser ] [ -p sym_prefix ] file
| -d |
Generates the file y.tab.h with the #define
statements that associate the yacc user-assigned "token codes" with the user-declared "token
names." This association allows source files otherthan y.tab.c to access the token codes. |
| -l |
Specifies that the code produced in y.tab.c will not contain any #line constructs. This option should only be used after the grammar and the
associated actions are fully debugged. |
| -t |
Compiles runtime debugging code by default.
Runtime debugging code is always generated in y.tab.c under conditional compilation control. By default, this code is not included when y.tab.c is
compiled. Whether or not the -t option is used, the runtime debugging code is under the control of YYDEBUG , a preprocessor symbol. If
YYDEBUG has a non-zero value, then the debugging code is included. If its value is 0, then the code will not be included. The size and execution time of a program produced without the runtime debugging
code will be smaller and slightly faster. |
| -v |
Prepares the file y.output, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar. |
| -V |
Prints on the standard error output the version information for yacc. |
| -b file_prefix |
Use file_prefix instead of y as the prefix for all output files. The code file y.tab.c, the header
file y.tab.h (created when -d is specified), and the description file y.output (created when -v is
specified), will be changed to file_prefix.tab.c,
file_prefix.tab.h, and file_prefix.output, respectively. |
| -Q [y|n] |
The -Qy option puts the version stamping
information in y.tab.c. This allows you to know what version of yacc built the file. The -Qn option (the
default) writes no version information. |
| -P parser |
Allows you to specify the parser of your choice instead of /usr/ccs/bin/yaccpar. For example, you
can specify:
example% yacc -P ~/myparser parser.y |
| -p sym_prefix |
Use sym_prefix instead of yy as the prefix for all external names produced by yacc . The names
affected include the functions yyparse(), yylex() and yyerror(), and the variables yylval, yychar
and yydebug. (In the remainder of this section, the six symbols cited are referenced using their default names only as a notational convenience.) Local names may also be affected by the -p option; however, the -p option does not affect #define
symbols generated by yacc . |
| file |
A path name of a file containing instructions for which a parser is to be created. |
Related commands
cc lex
|
|
| Resolved | Were you able to locate the answer to your questions? |
|
|