JsonGenerator

Converts an AST to JSON. Note that ASTs may also be exported to the EMF-JSON format, which is different.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun generateFile(root: Node, file: File, withIds: IdentityHashMap<Node, String>? = null)
fun generateFile(result: ParsingResult<out Node>, file: File, withIds: IdentityHashMap<Node, String>? = null)
fun generateFile(result: Result<out Node>, file: File, withIds: IdentityHashMap<Node, String>? = null)
Link copied to clipboard
fun generateJSON(result: ParsingResult<out Node>, withIds: IdentityHashMap<Node, String>? = null): JsonElement
fun generateJSON(result: Result<out Node>, withIds: IdentityHashMap<Node, String>? = null): JsonElement

Converts "results" to JSON format.

fun generateJSON(root: Node, withIds: IdentityHashMap<Node, String>? = null, withOriginIds: IdentityHashMap<Node, String>? = null, withDestinationIds: IdentityHashMap<Node, String>? = null): JsonElement

Converts an AST to JSON format.

Link copied to clipboard
fun generateJSONWithStreaming(root: Node, writer: JsonWriter, shortClassNames: Boolean = false)

fun generateJSONWithStreaming(result: Result<out Node>, writer: JsonWriter, shortClassNames: Boolean = false)

Converts "results" to JSON format.

Link copied to clipboard
fun generateString(root: Node, withIds: IdentityHashMap<Node, String>? = null): String
fun generateString(result: ParsingResult<out Node>, withIds: IdentityHashMap<Node, String>? = null): String
fun generateString(result: Result<out Node>, withIds: IdentityHashMap<Node, String>? = null): String
Link copied to clipboard
fun registerCustomSerializer(type: KType, serializer: JsonSerializer<*>)

Properties

Link copied to clipboard