Xtext: define 2 DSL's in one project

无人久伴 提交于 2019-12-11 19:28:15

问题


How do you define two DSL's in one Eclipse project?

The first DSL is used as input syntax where the user specify a design. The design needs to be converted into a different language. The different language is defined by the second DSL. For the transformation I intend to use Epsilon Transformation Language (ETL).


回答1:


having two dsl in one project is not neccessary for your usecase. if you want to do it anyway you can add multiple language sections to the workflow like

    language = StandardLanguage {
        name = "org.xtext.example.mydsl.MyDsl"
        fileExtensions = "mydsl"

        serializer = {
            generateStub = false
        }
        validator = {
            // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
        }
    }

    language = StandardLanguage {
        name = "org.xtext.example.otherdsl.OtherDsl"
        fileExtensions = "mydsl2"

        serializer = {
            generateStub = false
        }
        validator = {
            // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
        }
    }


来源:https://stackoverflow.com/questions/37447810/xtext-define-2-dsls-in-one-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!