help-bison
[Top][All Lists]
Advanced

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

Re: Graphical output for bison's debug information


From: Luca
Subject: Re: Graphical output for bison's debug information
Date: Tue, 12 Jan 2010 21:48:49 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

Il 11/01/2010 13.32, Matthias Bartelt ha scritto:
hi,
i was looking around for a tool to obtain a graphical
tree out of bison's debug output. does such a tool
already exist?

kind regards


_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison

bison output is something similar to

Stack now 0 2 18
Entering state 37
Next token is token "IDENTIFIER" (5.3-5.15: )
Shifting token "IDENTIFIER" (5.3-5.15: )

and you can trace your parser setting
yydebug=1;
I think it is difficult to find a graphical tool for this output.

You can generate an output graphical representation of the LALR(1) grammar automaton using the -g option and then you can display this file using graphviz (http://www.graphviz.org/) ; but I think it isn't very useful to debug a grammar.

If you want to debug your grammar in a smart way, just build a syntax tree (in the actions) and then walk it. You can print out an XML node for each syntax node; after building a XML file you can use a browser or a grafical tool (for example yed, http://www.yworks.com/en/products_yed_about.html) to display it.

Luca




reply via email to

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