updated MainGenerator to take the parser and print visitor and print the ast.