Re: Generating a simple hand-coded like recursive descent parser

Hans-Peter Diettrich <DrDiettrich1@aol.com>
23 Dec 2006 13:37:52 -0500

          From comp.compilers

Related articles
[36 earlier articles]
Re: Generating a simple hand-coded like recursive descent parser boldyrev@cgitftp.uiggm.nsc.ru (Ivan Boldyrev) (2006-12-19)
Re: Generating a simple hand-coded like recursive descent parser DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-12-19)
Re: Generating a simple hand-coded like recursive descent parser walter@bytecraft.com (Walter Banks) (2006-12-19)
Re: Generating a simple hand-coded like recursive descent parser cfc@shell01.TheWorld.com (Chris F Clark) (2006-12-19)
Re: Generating a simple hand-coded like recursive descent parser bobduff@shell01.TheWorld.com (Robert A Duff) (2006-12-22)
Re: Generating a simple hand-coded like recursive descent parser bobduff@shell01.TheWorld.com (Robert A Duff) (2006-12-23)
Re: Generating a simple hand-coded like recursive descent parser DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-12-23)
Re: Generating a simple hand-coded like recursive descent parser boldyrev@cgitftp.uiggm.nsc.ru (Ivan Boldyrev) (2006-12-23)
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: 23 Dec 2006 13:37:52 -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-071 06-12-089
Keywords: parse
Posted-Date: 23 Dec 2006 13:37:52 EST

Robert A Duff wrote:


> Therefore, we don't know (based purely on a context-free grammar)
> whether Y is a subtree of the call or not. We don't even know how
> many nodes there are (call, indexing, call and indexing, dereference
> and call and indexing). Therefore, we must restructure the tree (a
> little) based on semantic information.


When in Ada *intentionally* the syntax for calls and array indexing is
the same, a parser IMO should produce the same tree structure for both
cases. Different handling is required only in further compiler stages
(semantical checks, code generation...), which could work with tree
node attributes, instead of restructuring the parse tree.


DoDi



Post a followup to this message

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