views:

32

answers:

0

I would like to write myself a pretty printer for java using bison and flex. I have written a pretty printer for a script language, but I was only writing visitors, which made the printing. How can I turn a program using my formal grammar into a tree of nodes (made using C++ classes), that afterwards I could visit using my visitor? Maybe you could give me some link with an example of this? What i need to put into flex/bison files?