Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ima!johnl From: johnl@ima.UUCP Newsgroups: comp.compilers Subject: Lex and Yacc - Availability? Message-ID: <646@ima.ISC.COM> Date: Wed, 12-Aug-87 10:27:53 EDT Article-I.D.: ima.646 Posted: Wed Aug 12 10:27:53 1987 Date-Received: Sat, 15-Aug-87 01:03:48 EDT Sender: johnl@ima.ISC.COM Reply-To: cullvax!drw@EDDIE.MIT.EDU (Dale Worley) Organization: Cullinet Software, Westwood, MA, USA Lines: 29 Approved: compilers@ima.UUCP I'm building a compiler for Algol 68, which presents some interesting tokenizing and parsing problems. Right now, I'm using a p.d. Lex, but I've heard bad things said about Lex in general, usually that it's slow. Does anyone out there know of a (semi-)p.d. Lex-type program that is better? Or, more generally, is there a truly better way to tokenize? As far as Yacc goes, it seems to me that the power of LALR vs. LL parsing, and the fact that it is table-driven are big wins, over and above the development advantages. (Table-driven gives you: smaller parsers for large languages, accessibility of the entire parse state for error diagnostics, ability to build other tools that use the same tables (e.g., for debugging the grammar)) People like to claim that Yacc is slow, but has anyone really investigated this? -- Dale Worley Cullinet Software ARPA: cullvax!drw@eddie.mit.edu UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw [Most people I know write lexers by hand, because it's so easy. Lex does indeed generate big slow lexers -- it's too powerful in the wrong way for lexing most computer languages. I've also heard that yacc is slow, but have never been persuaded that it makes any difference. What I'd really like to hear is how you deal with Algol-68's two-level grammar without expanding it to a context free grammar the size of a small planet. I've heard of no work on parsing such grammars directly. -John] -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.ARPA Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | cca}!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