aix版本：AIX bomcht4 1 6 00C72F964C00
gcc:Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,java --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix220.127.116.11 --target=powerpc-ibm-aix18.104.22.168 --build=powerpc-ibm-aix22.214.171.124 --disable-libjava-multilib
Thread model: aix
gcc version 4.2.
Target "all" is up to date.
rm -f stamp-h1
/bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
yacc -b prefix=__gettext -p plural.c plural.y
yacc: 1285-742 The escape is not valid or pure_parser is not a reserved word. Line 46
make: 1254-004 The error code from the last command is 1.
make: 1254-004 The error code from the last command is 2.
make: 1254-004 The error code from the last command is 2.
bash-4.2$ man yacc
Generates an LALR(1) parsing program from input consisting of a context-free grammar specification.
yacc [ -b Prefix ] [ -C ] [ -d ] [ -l ] [ -NnNumber ] [ -NmNumber ] [ -NrNumber ] [ -p Prefix ] [ -s ] [ -t ] [ -v ] [ -y Path ] Grammar
The yacc command converts a context-free grammar specification into a set of tables for a simple automaton that executes an LALR(1) parsing algorithm. The grammar can be ambiguous;
specified precedence rules are used to break ambiguities.
You must compile the output file, y.tab.c, with a C language compiler to produce a yyparse function. This function must be loaded with the yylex lexical analyzer, as well as with
the main subroutine and the yyerror error-handling subroutine (you must provide these subroutines). The lex command is useful for creating lexical analyzers usable by the yyparse
subroutine. Simple versions of main and yyerror subroutines are available through the yacc library, liby.a. Also, yacc can be used to generate C++ output.
You can compile the yacc-generated C file (y.tab.c) with the -DYACC_MSG option to include code necessary to use the Message Facility. When you use this option during compilation,
error messages generated by the yyparse subroutine and the YYBACKUP macro are extracted from the yacc_user.cat catalog.
This allows you to receive error messages in languages other than English in non-English locales. If the catalog cannot be found or opened, the yyparse and YYBACKUP subroutines
display the default English messages.
The yacc command is affected by the LANG, LC_ALL, LC_CTYPE, and LC_MESSAGES environment variables.
Use Prefix instead of y as the prefix for all output file names. 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) are changed to Prefix.tab.c, Prefix.tab.h, and Prefix.output, respectively.
Produces the y.tab.C file instead of the y.tab.c file for use with a C++ compiler. To use the I/O Stream Library for input and output, define the macro, _CPP_IOSTREAMS.
Produces the file y.tab.h. This contains the #define statements that associate the yacc-assigned token codes with your token names. This allows source files other than y.tab.c
to access the token codes by including this header file.
Does not include any #line constructs in y.tab.c. Use this only after the grammar and associated actions are fully debugged.
Changes the size of the token and nonterminal names array to Number. The default value is 8000. Valid values are only those greater than 8000.
Changes the size of the memory states array to Number. Default value is 40000. Valid values are only those greater than 40000.
Changes the internal buffer sizes to handle large grammars. The default value is 2000. Valid values are only those greater than 2000.
Use Prefix instead of yy as the prefix for all external names created by the yacc command. External names affected include: yychar, yylval, yydebug, yyparse( ), yylex( ), and
yyerror( ). (Previously, -p was used to specify an alternate parser; now, -yPath can be used to specify an alternate parser.)
Breaks the yyparse function into several smaller functions. Since its size is somewhat proportional to that of the grammar, it is possible for the yyparse function to become
too large to compile, optimize, or execute efficiently.
Compiles run-time debugging code. By default, this code is not included when y.tab.c is compiled. However, the run-time debugging code is under the control of the preprocessor
macro, YYDEBUG. If YYDEBUG has a nonzero value, the C compiler (cc) includes the debugging code, regardless of whether the -t flag is used. YYDEBUG should have a value of 0 if
you don't want the debugging code included by the compiler. Without compiling this code, the yyparse subroutine will have a faster operating speed.
The -t flag causes compilation of the debugging code, but it does not actually turn on the debug mode. To get debug output, the yydebug variable must be set either by adding
the C language declaration, int yydebug=1 to the declaration section of the yacc grammar file or by setting yydebug through dbx.
Prepares the file y.output. It contains a readable description of the parsing tables and a report on conflicts generated by grammar ambiguities.
Uses the parser prototype specified by Path instead of the default /usr/lib/yaccpar file. (Previously, -p was used to specify an alternate parser.)
This command returns the following exit values:
An error occurred.
1 The following command:
draws yacc rules from the grammar.y file, and places the output in y.tab.c.
2 The following command:
yacc -d grammar.y functions the same as example 1, but it also produces the y.tab.h file which would contain C-style #define statements for each of the tokens defined in the
Contains a readable description of the parsing tables and a report on conflicts generated by grammar ambiguities.
Contains an output file.
Contains definitions for token names.
Contains parser prototype for C programs.
Contains a run-time library.