From: | Hans-Peter Diettrich <DrDiettrich1@aol.com> |
Newsgroups: | comp.compilers |
Date: | 19 Dec 2006 01:06:42 -0500 |
Organization: | Compilers Central |
References: | 06-09-029 06-09-042 06-09-048 06-09-060 06-09-078 06-09-093 06-12-064 06-12-066 |
Keywords: | parse, C |
Posted-Date: | 19 Dec 2006 01:06:42 EST |
First I apologize for the unintended re-post of an age old message. My
Mozilla even sent some deleted messages at the same time :-(
Robert A Duff wrote:
> P.S. Why do you say that the "a = (b)-c;" ambiguity is more practical
> than the "x * y;" ambiguity? They seem like more-or-less the same
> thing, to me: the parser wants to know whether each identifier is a type
> name.
In the case of "x * y;" the context can be used, to determine whether
declarations or expressions can occur at all. Even if both are allowed,
one might argue that the result of a multiplication should be used
somehow, e.g. assigned to a variable.
Not a very strong point, of course, but it leaves room for discussions.
The ambiguity of "a = (b)-c;" is out of question, both interpretations
of "(b)-c" result in a syntactically valid expression.
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.