Reputation: 51
I am writing a grammar for a simple Pascal compiler in bison and I would like to visualize the parse tree for my grammar which I specified in pascal.y. Is it possible to graphically show the syntax tree based on my pascal.y file?
Upvotes: 5
Views: 2073
Reputation: 687
Base on BRPocock's answer in details.
bison pascal.y --graph
. Now you will get pascal.dotgraphviz
. Download pagedot pascal.dot -T png -o pascal.png
Upvotes: 2
Reputation: 13934
Bison's --graph
option produces a source file that you can render with dot
from graphviz
.
Upvotes: 2