error recovery

Hank Dietz hankd at ee.ecn.purdue.edu
Mon May 1 02:46:33 AEST 1989


An MS student of mine named Terence Parr has been building a really spiffy
lexical analyzer generator and LL(1) parser generator program for his MS
thesis.  It accepts a yacc+lex-like input syntax, but generates BOTH parser
and lexer from a single unified description.  Beyond that, it accepts the
usual EBNF extensions for 0-or-more, alternative, and optional subrules and
supports dynamically-allocated/deallocated attributes (e.g., by default, all
$ variables are variable-length strings).

The lexers generated are DFAs very similar to those built by lex, but with a
more direct implementation (bigger but faster).  The parsers are recursive
descent C code, but use switches and mapping tables where appropriate, rather
than the usual binary comparisons, to find the next alternative to apply and
to give rather decent error messages (based on first sets).  In non-trivial
test cases, the recognizers it builds have run consistently upwards of 25K
lines per second....

We will be putting this stuff in PD within the next few months.  If anyone
is interested in testing "alpha" versions of the package, send me email.

						-hankd at ee.ecn.purdue.edu

PS: Some of you may recall me mentioning a lexer generator a while back...
    well, that's part of this package.
--
Send compilers articles to compilers at ima.isc.com or, perhaps, Levine at YALE.EDU
Plausible paths are { decvax | harvard | yale | bbn}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers.  Meta-mail to ima!compilers-request



More information about the Comp.lang.c mailing list