|
|
Re: Yet Another Question about Cross Referencing Languages [message #956726 is a reply to message #955932] |
Wed, 24 October 2012 19:08 |
|
var grammarURI = "classpath:/sfg/lng/LNG.xtext"
var file.extensions = "lng"
var projectName = "sfg.lng.lng"
var runtimeProject = "../${projectName}"
Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
// The following two lines can be removed, if Xbase is not used.
registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
registerGenModelFile = "platform:/resource/sfg.lng.lng2/src-gen/sfg/lng/lng2.genmodel"
}
component = DirectoryCleaner {
directory = "${runtimeProject}/src-gen"
}
component = DirectoryCleaner {
directory = "${runtimeProject}.ui/src-gen"
}
component = Generator {
pathRtProject = runtimeProject
pathUiProject = "${runtimeProject}.ui"
pathTestProject = "${runtimeProject}.tests"
projectNameRt = projectName
projectNameUi = "${projectName}.ui"
language = {
uri = grammarURI
fileExtensions = file.extensions
// Java API to access grammar elements (required by several other fragments)
fragment = grammarAccess.GrammarAccessFragment {}
// generates Java API for the generated EPackages
fragment = ecore.EcoreGeneratorFragment {
// referencedGenModels = "
// platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel,
// platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel
// "
}
// Serializer 2.0
fragment = serializer.SerializerFragment {
generateStub = false
}
// the serialization component (1.0)
// fragment = parseTreeConstructor.ParseTreeConstructorFragment {}
// a custom ResourceFactory for use with EMF
fragment = resourceFactory.ResourceFactoryFragment {
fileExtensions = file.extensions
}
// The antlr parser generator fragment.
fragment = parser.antlr.XtextAntlrGeneratorFragment {
// options = {
// backtrack = true
// }
}
// java-based API for validation
fragment = validation.JavaValidatorFragment {
// composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
// scoping and exporting API
fragment = scoping.ImportURIScopingFragment {}
fragment = exporting.SimpleNamesFragment {}
// scoping and exporting API
fragment = scoping.ImportNamespacesScopingFragment {}
fragment = exporting.QualifiedNamesFragment {}
fragment = builder.BuilderIntegrationFragment {}
// generator API
fragment = generator.GeneratorFragment {
generateMwe = false
generateJavaMain = false
}
// formatter API
fragment = formatting.FormatterFragment {}
// labeling API
fragment = labeling.LabelProviderFragment {}
// outline API
fragment = outline.OutlineTreeProviderFragment {}
fragment = outline.QuickOutlineFragment {}
// quickfix API
fragment = quickfix.QuickfixProviderFragment {}
// content assist API
fragment = contentAssist.JavaBasedContentAssistFragment {}
// generates a more lightweight Antlr parser and lexer tailored for content assist
fragment = parser.antlr.XtextAntlrUiGeneratorFragment {}
// generates junit test support classes into Generator#pathTestProject
fragment = junit.Junit4Fragment {}
// project wizard (optional)
// fragment = projectWizard.SimpleProjectWizardFragment {
// generatorProjectName = "${projectName}"
// modelFileExtension = file.extensions
// }
// rename refactoring
fragment = refactoring.RefactorElementNameFragment {}
// provides the necessary bindings for java types integration
// fragment = types.TypesGeneratorFragment {}
// generates the required bindings only if the grammar inherits from Xbase
fragment = xbase.XbaseGeneratorFragment {}
// provides a preference page for template proposals
fragment = templates.CodetemplatesGeneratorFragment {}
// provides a compare view
fragment = compare.CompareFragment {
fileExtensions = file.extensions
}
}
}
}
Follow me on Twitter @andreasindico
[Updated on: Wed, 24 October 2012 19:11] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Yet Another Question about Cross Referencing Languages [message #958656 is a reply to message #958575] |
Fri, 26 October 2012 05:42 |
|
OK ! I have finally got it and the workflow runs now thank you for your kind help.
Now the problem is that when I execute the generated editor for a client language model I can't impot (as importedURI in the client language grammar) a target language model. The import actually works if I try to import other models of the client language type.
Follow me on Twitter @andreasindico
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29401 seconds