help-bison
[Top][All Lists]
Advanced

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

Re: (no subject)


From: Hans Aberg
Subject: Re: (no subject)
Date: Mon, 28 Jan 2008 23:41:57 +0100

On 28 Jan 2008, at 17:43, address@hidden wrote:

Hello, everyone,
I am now working on the subject "how to generate the syntax tree using Bison for given C/C++ code". I have a grammar file in which the C grammar is defined, however, it seems that Bison doesn't generate such a syntax tree when it is parsing. Note that I do not want to add tree-generating code as "action for each rule" into the bison files, since there are almost 1000 lines of grammar
rules.
    Is there any way to complement my objective?
    Thank you for reading the message and answering :)

The only way to make this happens seems to somehow get the stuff into the actions, as Bison uses an algorithm, a form of LALR(1), to translate the input grammar to instructions for a so called push-down automaton. So the problem is similar to generate the language code from the binary. But if you can automate another semantic value component for the parse tree, plus actions for it, it might be an interesting addition to the Bison project.

  Hans Aberg






reply via email to

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