help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parse tree


From: Hans Aberg
Subject: Re: parse tree
Date: Thu, 18 Apr 2002 22:29:35 +0200

At 15:52 -0400 2002/04/18, Aurelian Melinte wrote:
>I will soon need to modify a grammar to build a parse tree. As bison does
>not offer such a functionality , I thought it would be nice to put it
>straight into it. At least, I could not find it and I am surprised to be
>the first one to have thought to.

I am not sure what property you are asking for; what are you going to use
it for?

-- Then Bison generated parser build the parser tree via the actions in
given in the .y file. Thus, if all the rules have the form
  x: x_1 ... x_n { $$ = node(root: name_of(x), leaves: x_1, ..., x_n }
then you get your tree at runtime. This could easily be implemented under
C++ using a polymorphic hierarchy.

Do you want that to be automated as a debugging feature?

  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]