Interface TreePrinter
-
- All Known Implementing Classes:
DotGraphPrinter,SymbolicExpressionPrinter,SyntaxTreePrinter,XMLPrinter
public interface TreePrinterContract for classes that can generate string representations of Abstract Syntax Trees (ASTs). Implementations of this interface are responsible for traversing trees and producing a specific representation.- Since:
- 1.2.0
- Author:
- Ozren Dabić
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Fileexport()Generates a file containing the string representation of an Abstract Syntax Tree (AST).Stringprint()Generates a string representation of an Abstract Syntax Tree (AST).
-
-
-
Method Detail
-
print
String print()
Generates a string representation of an Abstract Syntax Tree (AST).- Returns:
- A string representation of the tree
-
export
File export() throws IOException
Generates a file containing the string representation of an Abstract Syntax Tree (AST). This method should be preferred overprint()when dealing with extremely wide, or deep trees.- Returns:
- A file containing the string representation of the tree
- Throws:
IOException- if an I/O error occurs
-
-