1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
The -p option can be used to change the symbol prefix to something
other than "yy" in the generated code. This allows multiple parsers to be
included in a program. See the man page for further details.
The -P option causes Perl code to be generated. This is useful for
rapid prototyping of a grammar. In Perl mode, %type, %union, etc., are
checked, but not used in the output. The user must supply &yylex, &yyerror,
and a main program to call &yyparse. An example of a simple calculator is
included. A version of getdate.y that has been modified for Perl yacc is
also included.
The -r option has been implemented. The -r option tells Yacc to put
the read-only tables in y.tab.c and the code and variables in y.code.c.
Keith Bostic asked for this option so that :yyfix could be eliminated.
The -l and -t options have been implemented. The -l option tells Yacc
not to include #line directives in the code it produces. The -t option
causes debugging code to be included in the compiled parser.
The code for error recovery has been changed to implement the same
algorithm as AT&T Yacc. There will still be differences in the way error
recovery works because AT&T Yacc uses more default reductions than Berkeley
Yacc.
The environment variable TMPDIR determines the directory where
temporary files will be created. If TMPDIR is defined, temporary files will
be created in the directory whose pathname is the value of TMPDIR. By
default, temporary files are created in /tmp.
The keywords are now case-insensitive. For example, %nonassoc,
%NONASSOC, %NonAssoc, and %nOnAsSoC are all equivalent.
Commas and semicolons that are not part of C code are treated as
commentary.
Line-end comments, as in BCPL, are permitted. Line-end comments begin
with // and end at the next end-of-line. Line-end comments are permitted in
C code; they are converted to C comments on output.
The form of y.output files has been changed to look more like those
produced by AT&T Yacc.
A new kind of declaration has been added. The form of the declaration
is
%ident string
where string is a sequence of characters begining with a double quote and
ending with either a double quote or the next end-of-line, whichever comes
first. The declaration will cause a #ident directive to be written near the
start of the output file.
If a parser has been compiled with debugging code, that code can be
enabled by setting an environment variable. If the environment variable
YYDEBUG is set to 0, debugging output is suppressed. If it is set to 1,
debugging output is written to standard output.
|