All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.moe.tlaster.ktml.Ktml.kt Maven / Gradle / Ivy

There is a newer version: 0.0.7
Show newest version
package moe.tlaster.ktml

import moe.tlaster.ktml.dom.Node
import moe.tlaster.ktml.parser.SimpleParser
import moe.tlaster.ktml.parser.StringReader
import moe.tlaster.ktml.parser.Tokenizer
import moe.tlaster.ktml.parser.token.Token

object Ktml {
    internal fun tokenize(text: String): List {
        val reader = StringReader(text)
        val tokenizer = Tokenizer()
        tokenizer.parse(reader)
        return tokenizer.tokens
    }

    fun parse(text: String): Node {
        val tokens = tokenize(text)
        return SimpleParser.parse(tokens)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy