printing of expanded grammar.  MustFix: refactoring of gen_stack_tree and fix next rule expansion