[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Eliminating conflicts of parenthesized subexpressions
From: |
Akim Demaille |
Subject: |
Re: Eliminating conflicts of parenthesized subexpressions |
Date: |
Tue, 14 Sep 2004 08:53:12 +0200 |
Le 13 sept. 04, à 19:30, Hans Aberg a écrit :
At 10:59 +0200 2004/09/13, Akim Demaille wrote:
So a simple form of type checking might also do the trick here;
however, type checking is better not done in the grammar, I think.
I looked a bit in Aho, Sethi & Ullman, "Compilers..." (the Dragon
book), p. 351 ff., and they do it in the actions.
Choose your "better" and then the discussion will be meaningful. If
you're not interested in performances, Vincent is definitely right.
I find it hard to parse this one :-): If one should be able to catch
semantic type errors, then the actions must contain some code
indicating
how those types should be computed. Then that must be checked at
sometime.
What is the performance issue you have in your mind here?
One pass is faster than two. Multiplying passes over the text/AST is
more modular, but more CPU, and less performance. That's why most
industrial strength compilers are not very modular.
And let's face it at least once: The Dragon Book is obsolete (another
edition is expected though).
People say that, but it probably depends on what one wants to do. It
probably only wants to provide the basics, anyhow.
Even for the basics I do not recommend it to newcomers.
And I figure computer
language constructors and implementers do better to not stare to
deeply in
books, but use their own mind, as well hanging out in suitable
newsgroups
and mailing lists.
There are many more books, some much better for beginners, IMHO.
I recently read a book that for some reason was on my bookshelf:
David A. Watt, "Programming Language Concepts and Paradigms".
The interesting thing with this book, is even though it is also
obsolete,
being written in 1989 and oblivious about the developments in the
1990'ies,
it has some insightful remarks about the limitations of the computer
languages of the day, which are still valid today in newer computer
languages. So, one can get some information out of also older books.
The dragon books also has nice pieces of information. If you have spare
time to read longish books, you will be rewarded. But if you don't,
let's take a more efficient book.
- Eliminating conflicts of parenthesized subexpressions, Hans Aberg, 2004/09/09
- Re: Eliminating conflicts of parenthesized subexpressions, Vincent Zweije, 2004/09/09
- Re: Eliminating conflicts of parenthesized subexpressions, Hans Aberg, 2004/09/09
- Re: Eliminating conflicts of parenthesized subexpressions, Akim Demaille, 2004/09/13
- Re: Eliminating conflicts of parenthesized subexpressions, Hans Aberg, 2004/09/13
- Re: Eliminating conflicts of parenthesized subexpressions,
Akim Demaille <=
- Re: Eliminating conflicts of parenthesized subexpressions, Hans Aberg, 2004/09/14
- Re: Eliminating conflicts of parenthesized subexpressions, Akim Demaille, 2004/09/14
- Re: Eliminating conflicts of parenthesized subexpressions, Hans Aberg, 2004/09/15
- Re: Eliminating conflicts of parenthesized subexpressions, Akim Demaille, 2004/09/16
- Re: Eliminating conflicts of parenthesized subexpressions, Hans Aberg, 2004/09/16