pretty-printer

generating program structure (nodes) using bison and flex

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...