.TH EYACC 1 .UC .SH NAME eyacc \- modified yacc allowing much improved error recovery .SH SYNOPSIS .B eyacc [ .B \-v ] [ grammar ] .SH DESCRIPTION .I Eyacc converts a context-free grammar into a set of tables for a simple automaton which executes an LR(1) parsing algorithm. The grammar may be ambiguous; specified precedence rules are used to break ambiguities. .PP The output is .I y.tab.c, which must be compiled by the C compiler and loaded with any other routines required. If the .B \-v flag is given, the file .I y.output is prepared, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar. .PP .I Eyacc is a slight but significant modification of an old version of .IR yacc (1). The most important change is that .I eyacc fully enumerates test actions in its parser when an error token is in the look-ahead set. This prevents the parser from making undesirable reductions when an error occurs before the error is detected. .I Eyacc also uses a different encoding for the action tables to allow the parser to run faster. Because of the change in enumerating look-aheads, there are more frequently a series of `test' states in the parse tables. For this reason, test states are encoded as the arithmetic inverse of the value of the token to be tested for. This allows a much tighter inner loop in the parser and more than compensates for the extra tests required. (Of course, the same change could be made to the tables of .I yacc and it would then run significantly faster than .I eyacc, but error recovery of the kind performed using .I eyacc would not be possible without the enumerated look-aheads.) .PP Minor changes to .I yacc in .I eyacc include the recognition of a form-feed as a white space character, increased table size so as to handle larger grammars, and a change of the code for the error action (from 0 to 1) because of the change in the testing outlined above. For this reason it is not possible to use the standard .I yacc library with .I eyacc. This would be pointless in any case, because a different set of recovery routines is needed. .SH "SEE ALSO" `LR Parsing', by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974. .PP `The YACC Compiler-compiler', internal memorandum. .PP `Practical syntactic error recovery', by Susan L. Graham and Stephen P. Rhodes, CACM, November 1975. .PP pi(1), yacc(1) .SH AUTHOR S. C. Johnson .PP .I Eyacc modifications by Charles Haley and William Joy. .SH FILES y.output .br y.tab.c .br .SH DIAGNOSTICS The number of reduce-reduce and shift-reduce conflicts is reported on the standard output; a more detailed report is found in the .I y.output file. .SH BUGS An .I eyacc library should be available.