Re: Ambiguous AST ?

Joachim Durchholz <joachim_d@gmx.de>
11 Mar 2002 02:17:02 -0500

          From comp.compilers

Related articles
Ambiguous AST ? nob@fibertel.com.ar (2002-03-09)
Re: Ambiguous AST ? idbaxter@semdesigns.com (Ira D. Baxter) (2002-03-11)
Re: Ambiguous AST ? joachim_d@gmx.de (Joachim Durchholz) (2002-03-11)
Re: Ambiguous AST ? vbdis@aol.com (2002-03-11)
| List of all articles for this month |

From: Joachim Durchholz <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 11 Mar 2002 02:17:02 -0500
Organization: Compilers Central
References: 02-03-042
Keywords: parse
Posted-Date: 11 Mar 2002 02:17:01 EST

Nicolás Ojeda Bär wrote:
> My question is the following: since I have no way of knowing which
> case it is without symbol table information (which I have not
> collected during parsing time), would it be
> practical/logical/realistic to have an "ambiguous" ast data structure
> (an ast node that doesn't specify which of the two cases I have
> encountered) and then translate that (during semantic analysis) to the
> corresponding data structure (according to the info collected while
> processing the declarations).


Yes.
It's really not different from type information. It's possible to have
types in the syntax, but nobody does this because it's impractical. Same
with function call vs. variable name: simply call the syntactic entity
"atomic_expression" or "entity" or "name" or whatever suits your
terminology best, and affix the variable/function call distinction just
as you'd affix type information.


Regards,
Joachim
--


Post a followup to this message

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