xref: /original-bsd/usr.bin/yacc/NEW_FEATURES (revision ac325c73)
1*ac325c73Scorbett     The -r option has been implemented.  The -r option tells Yacc to
2*ac325c73Scorbettput the read-only tables in y.tab.c and the code and variables in
3*ac325c73Scorbetty.code.c.  Keith Bostic asked for this option so that :yyfix could be
4*ac325c73Scorbetteliminated.
56ca2fe9dSbostic
66ca2fe9dSbostic     The -l and -t options have been implemented.  The -l option tells
76ca2fe9dSbosticYacc not to include #line directives in the code it produces.  The -t
86ca2fe9dSbosticoption causes debugging code to be included in the compiled parser.
96ca2fe9dSbostic
106ca2fe9dSbostic     The code for error recovery has been changed to implement the same
116ca2fe9dSbosticalgorithm as AT&T Yacc.  There will still be differences in the way
126ca2fe9dSbosticerror recovery works because AT&T Yacc uses more default reductions
13*ac325c73Scorbettthan Berkeley Yacc.
146ca2fe9dSbostic
156ca2fe9dSbostic     The environment variable TMPDIR determines the directory where
166ca2fe9dSbostictemporary files will be created.  If TMPDIR is defined, temporary files
176ca2fe9dSbosticwill be created in the directory whose pathname is the value of TMPDIR.
186ca2fe9dSbosticBy default, temporary files are created in /tmp.
196ca2fe9dSbostic
206ca2fe9dSbostic     The keywords are now case-insensitive.  For example, %nonassoc,
216ca2fe9dSbostic%NONASSOC, %NonAssoc, and %nOnAsSoC are all equivalent.
226ca2fe9dSbostic
236ca2fe9dSbostic     Commas and semicolons that are not part of C code are treated as
246ca2fe9dSbosticcommentary.
256ca2fe9dSbostic
266ca2fe9dSbostic     Line-end comments, as in BCPL, are permitted.  Line-end comments
276ca2fe9dSbosticbegin with // and end at the next end-of-line.  Line-end comments are
286ca2fe9dSbosticpermitted in C code; they are converted to C comments on output.
296ca2fe9dSbostic
306ca2fe9dSbostic     The form of y.output files has been changed to look more like
316ca2fe9dSbosticthose produced by AT&T Yacc.
326ca2fe9dSbostic
336ca2fe9dSbostic     A new kind of declaration has been added.  The form of the declaration
346ca2fe9dSbosticis
356ca2fe9dSbostic
366ca2fe9dSbostic	  %ident string
376ca2fe9dSbostic
386ca2fe9dSbosticwhere string is a sequence of characters begining with a double quote
396ca2fe9dSbosticand ending with either a double quote or the next end-of-line, whichever
406ca2fe9dSbosticcomes first.  The declaration will cause a #ident directive to be written
416ca2fe9dSbosticnear the start of the output file.
426ca2fe9dSbostic
436ca2fe9dSbostic     If a parser has been compiled with debugging code, that code can be
446ca2fe9dSbosticenabled by setting an environment variable.  If the environment variable
456ca2fe9dSbosticYYDEBUG is set to 0, debugging output is suppressed.  If it is set to 1,
466ca2fe9dSbosticdebugging output is written to standard output.
47