Content-Length: 230934 | pFad | http://github.com/Strumenta/kolasu/tree/main/lionweb-ksp

79 kolasu/lionweb-ksp at main · Strumenta/kolasu · GitHub
Skip to content

Files

Failed to load latest commit information.

Latest commit

 Cannot retrieve latest commit at this time.

History

History

lionweb-ksp

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

This is a ksp processor (i.e., a lightweight compiler plugin) that find all AST classes and generate the Kotlin code for the corresponding Language definition.

For example, it could generate something like this:

package com.strumenta.math

import com.strumenta.kolasu.lionweb.LanguageGeneratorCommand
import com.strumenta.kolasu.lionweb.KolasuLanguage
import com.strumenta.kolasu.lionweb.LionWebLanguageExporter
import io.lionweb.lioncore.java.language.Language

val kLanguage = KolasuLanguage("com.strumenta.math").apply {
    addClass(Expression::class)
    addClass(BinaryExpression::class)
    addClass(SumExpression::class)
    addClass(SubExpression::class)
    addClass(IntLiteralExpr::class)
}

val lwLanguage: Language by lazy {
    val importer = LionWebLanguageExporter()
    importer.export(kLanguage)
}

fun main(args: Array<String>) {
    LanguageGeneratorCommand(lwLanguage).main(args)
}                    









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Strumenta/kolasu/tree/main/lionweb-ksp

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy