Re: Compiler Books? Parsers?

napi@cs.indiana.edu (Mohd Hanafiah Abdullah)
1 Nov 2003 12:03:43 -0500

          From comp.compilers

Related articles
Compiler Books? vicky7909@rediffmail.com (2003-10-27)
Re: Compiler Books? vbdis@aol.com (2003-10-31)
Re: Compiler Books? Parsers? napi@cs.indiana.edu (2003-11-01)
Re: Compiler Books? Parsers? napi@cs.indiana.edu (2003-11-01)
Re: Compiler Books? Parsers? henry@spsystems.net (2003-11-02)
Re: Compiler Books? Parsers? henry@spsystems.net (2003-11-08)
Re: Compiler Books? Parsers? Jeffrey.Kenton@comcast.net (Jeff Kenton) (2003-11-21)
Re: Compiler Books? Parsers? cfc@shell01.TheWorld.com (Chris F Clark) (2003-12-03)
Re: Compiler Books? Parsers? rbates@southwind.net (Rodney M. Bates) (2003-12-08)
Re: Compiler Books? Parsers? nick.roberts@acm.org (Nick Roberts) (2003-12-08)
[9 later articles]
| List of all articles for this month |

From: napi@cs.indiana.edu (Mohd Hanafiah Abdullah)
Newsgroups: comp.compilers
Date: 1 Nov 2003 12:03:43 -0500
Organization: Computer Science, Indiana University
References: 03-10-113 03-10-145
Keywords: books, parse
Posted-Date: 01 Nov 2003 12:03:43 EST



<vbdis@aol.com> wrote:
>vicky7909@rediffmail.com (v796) schreibt:
>IMO top-down parsers are easier to understand than bottom-up
>parsers. Even if both types can be used for C and Pascal, bottom-up
>parsers are commonly described and used for C, and top-down parsers
>for Pascal and other "Wirthian" languages.
>
>If you are free in the design of the language, you may choose a Pascal
>like language, for simpler implementation of the parser and
>compiler. But if your language has to be somewhat compatible with C,
>you have to go the harder way.




I agree that top-down parsers are easier to understand than bottom-up
ones. And this applies to C or Pascal or any other Algol-like
language. Plus, top down parsers are easier to implement by hand if
you choose to although there are parser generators out there.
Personally I have manually written top-down parsers using LL(k)
grammar for both C and Pascal and of course I spent more time on C due
to the language's various features and idiosyncracies. But, overall
the degree of difficulty was the same.


I have never used parser generators such as yacc/bison or antlr.
Would be nice to know people's opinion on manual implementation vs
automation of parsers, especially from those who have done both; in
terms of efficiency, readability, maintainability,
ease-of-development, and so forth.


But a parser although fun is a small portion of an optimizing
compilers, and to me the more challenging phases are the semantic
analyzer, optimizer, and code generator.


Napi
--
http://www.cs.indiana.edu/hyplan/napi.html


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.