Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Compiler Books? Parsers?



<[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (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



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.