gv.addln("};");
} catch (Exception e) {}
} else { // Parser type 2.
gv.addln("digraph G {");
if (this.getRules().stream().allMatch(r -> r.getRightSide().getWordLength() > 0)) {
CtxtFreeGrammar gramm = new CtxtFreeGrammar(this);
try {
if (this.parseTreesFromLastCalculation == null || this.dontRecalculateParseTrees == null) {
this.parseTreesFromLastCalculation = ChartParser.parse(gramm, this.wordToParse, null);
}
gv.addln(parseTreesFromLastCalculation[this.displayParseTreeNum % parseTreesFromLastCalculation.length].toString());