PrinterOutput

class PrinterOutput(nodePrinters: Map<KClass<*>, NodePrinter>, nodePrinterOverrider: (node: Node) -> NodePrinter? = { _ -> null })

This provides a mechanism to generate code tracking indentation, handling lists, and providing other facilities. This is used in the implementation of NodePrinter and in ASTCodeGenerator.

Constructors

Link copied to clipboard
constructor(nodePrinters: Map<KClass<*>, NodePrinter>, nodePrinterOverrider: (node: Node) -> NodePrinter? = { _ -> null })

Functions

Link copied to clipboard
fun associate(ast: Node, generation: PrinterOutput.() -> Unit)
Link copied to clipboard
fun dedent()
Link copied to clipboard
fun indent()
Link copied to clipboard
fun print(text: Char)
fun print(value: Int)
fun print(text: String)
fun print(ast: Node?, prefix: String = "", postfix: String = "")
fun print(text: String?, prefix: String = "", postfix: String = "")
Link copied to clipboard
Link copied to clipboard
fun printFlag(flag: Boolean, text: String)
Link copied to clipboard
fun <T : Node> printList(elements: List<T>, separator: String = ", ")
fun <T : Node> printList(prefix: String, elements: List<T>, postfix: String, printEvenIfEmpty: Boolean = false, separator: String = ", ")
Link copied to clipboard
fun println()
fun println(text: String = "")
fun println(ast: Node?, prefix: String = "", postfix: String = "")
Link copied to clipboard
fun text(): String