Miksilo
Miksilo copied to clipboard
Introduce a more rigid structure for languages
First something unrelated to Delta's:
trait Language[Program] {
def syntax: Syntax[Program]
def semantics: Semantics[Program]
}
trait Pipeline[In, Core, Out] {
def language: Language[Core]
def inputSyntax: Syntax[In]
def outputSyntax: Syntax[Out]
def desugaring: In => Core
def compilation: Core => Out
}
trait Syntax[Program] {
def getParser
def getPrinter
}
And then adding Delta's
trait LanguageDelta {
def extendSyntax
def extendSemantics
}
trait CompilationDelta {
def transformOutputSyntax
// Pass is added to the end of the pipeline
def transformProgram
}
trait DesugaringDelta {
def transformInputSyntax
// Pass is added to the start of the pipeline
def transformProgram
}