/** * Prints the postscript parsetree to a .ps file with the given name * * @param filename used to generate a file of the form <filename>.ps */ public void outputPSGraphToFile(String filename) { try { rootCtx.save(Arrays.asList(parser.getRuleNames()), filename + ".ps"); } catch (IOException | PrintException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } }