From: | Hans-Peter Diettrich <DrDiettrich1@aol.com> |
Newsgroups: | comp.compilers |
Date: | 22 Dec 2006 01:08:33 -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 06-12-076 06-12-078 |
Keywords: | C++, C, parse |
Posted-Date: | 22 Dec 2006 01:08:33 EST |
George Neuner wrote:
> I would think that it is always possible to delay categorizing an
> identifier until after parsing. The difficulty lies in designing an
> initial IR which incorporates the ambiguities in addition to the
> unambiguous canon IR.
>
> For example, in the case of "a = (b)-c", the parser could construct an
> AST like the following
[...]
IMO you disregard the amount of postprocessing, or error recovery
(backtracking), when the first assumption was wrong. Argument binding,
operator precedence, and more, might be different for typecasts and
binary "-" or other operators like "(". When a tree has to be
reorganized later, why construct an tree in the first pass at all?
Weren't a multi-level grammar the simpler approach to (such) ambiguities?
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.