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
_______________________________________________
help-bison@gnu.org 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
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison