Class DotGraphPrinter
- java.lang.Object
-
- ch.usi.si.seart.treesitter.printer.DotGraphPrinter
-
- All Implemented Interfaces:
TreePrinter
public class DotGraphPrinter extends Object implements TreePrinter
Printer used for generating DOT graph representations of trees. Unlike its sister classes, it does not rely on an iterative approach, relying instead on the internaltree-sitterAPI.- Since:
- 1.2.0
- Author:
- Ozren Dabić
-
-
Constructor Summary
Constructors Constructor Description DotGraphPrinter(@NotNull Tree tree)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Fileexport()Generates a DOT graph of the tree, writing it directly to a file.Stringprint()Generates a DOT graph of the tree.
-
-
-
Constructor Detail
-
DotGraphPrinter
public DotGraphPrinter(@NotNull @NotNull Tree tree)
-
-
Method Detail
-
print
public String print()
Generates a DOT graph of the tree.- Specified by:
printin interfaceTreePrinter- Returns:
- A DOT graph string of the tree
-
export
public File export() throws IOException
Generates a DOT graph of the tree, writing it directly to a file.- Specified by:
exportin interfaceTreePrinter- Returns:
- A file containing the DOT graph of the tree
- Throws:
IOException- if an I/O error occurs
-
-