error recovery

David Goodenough dg at lakart.UUCP
Tue Apr 25 06:34:59 AEST 1989


djones at megatest.UUCP (Dave Jones) sez:
> Why? For one thing, error-recovery in a recursive descent parser is even
> trickier than in an LR parser!

The hell it is!!!

I suggest you dig out the source of the PDP 11, V6 UNIX C compiler. Written
in C, without YACC, uses recursive descent, and does error recovery so
gracefully, and correctly, it is a pleasure to use. It requires one longjmp
call to recover, but with the exception of a for loop (which could generate
a spurious error about imbalanced parentheses, due to overloading the ';'
operator) it never made a mistake. Would that pcc, the GreenHills family etc.
could do the same.

I'd suggest that all these guys talk to Leor Zohlman, the writer of
BDS-C. I suspect that he uses RD, whatever the case I rate his error
recovery way above _ANYTHING_ I have come across in UNIX since the V6
days. Are you listening guys????
-- 
	dg at lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at xait.xerox.com		  	  +---+



More information about the Comp.lang.c mailing list