Related articles |
---|
[6 earlier articles] |
Re: Why separate Lexical & Parser Generators wrs@apple.com (Walter Smith) (1994-10-10) |
Re: Why separate Lexical & Parser Generators cef@geodesic.com (Charles Fiterman) (1994-10-11) |
Re: Why separate Lexical & Parser Generators pardo@cs.washington.edu (1994-10-11) |
Re: Why separate Lexical & Parser Generators johnl@cs.indiana.edu (John Lacey) (1994-10-12) |
Re: Why separate Lexical & Parser Generators hagerman@ece.cmu.edu (1994-10-14) |
Re: Why separate Lexical & Parser Generators adrian@platon.cs.rhbnc.ac.uk (1994-10-21) |
Re: Why separate Lexical & Parser Generators hbaker@netcom.com (1994-10-22) |
Newsgroups: | comp.compilers |
From: | hbaker@netcom.com (Henry G. Baker) |
Keywords: | lex, parse |
Organization: | Compilers Central |
References: | 94-10-028 94-10-124 |
Date: | Sat, 22 Oct 1994 17:30:32 GMT |
John Heron <heronj@smtplink.NGC.COM> writes:
>Pardon me if this question is naive. Why have a separate parser generator
>and lexical analyzer generator? ...
adrian@platon.cs.rhbnc.ac.uk (A Johnstone) writes:
>2. Efficiency: recursive descent parsers like the ones generated by
>PCCTS, PRECC, RDP and CoCo tend to do a lot of function calling.
>That's OK at phrase level, but down at the character-by-character
>level a monolithic lump of code is what you need using iteration rather
^^^^^^^^^
>than recursion. Anyone who doubts the importance of efficient scanning
^^^^^^^^^
>should profile their favorite compiler. You'd be surprised how much of
>the time many compilers spend in the scanner.
Haven't compiler people ever heard of tail call optimizations which
automatically turn recursions of this sort into iterations?
>5. Cleverness on the part of the language designer: anybody looking
>for a really frustrating student project might consider building a
>parser for Occam, in which there are no explicit brackets for compound
>statements but nesting is indicated by indentation.
Cut yourself on Occam's razor, I see. :-)
Henry Baker
Read ftp.netcom.com:/pub/hbaker/README for info on ftp-able papers.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.