Home » Modeling » TMF (Xtext) » Two DSL, single project, Activator&injector issues
| |
Re: Two DSL, single project, Activator&injector issues [message #1755645 is a reply to message #1755352] |
Mon, 06 March 2017 13:58 |
Rodrigo Ruiz Messages: 28 Registered: March 2017 |
Junior Member |
|
|
Hi,
thanks for your reply.
I'm attaching the stack trace (it's too large, i omitted some of the repetitions)
I have this grammar A that only handles expressions, since i need to provide expression level validation, i implemented it as a separated project, the initial definition is:
grammar com.mentor.SaphireExp with org.eclipse.xtext.common.Terminals
generate saphireExp "http://www.mentor.com/SaphireExp"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
ExtExpression: testExpr=TestExpr | expr=Expression ;
Expression: OrExpression ;
TestExpr:
'?' (var=VarName | alias=ID) '->' (comparators+= Comparator)+ ('default' ':' defaultExpr=Expression)?
;
Comparator:
((alias=ID| string=STRING) ':' expression=Expression ";" )
;
(etc...)
And then i have grammar B, which handles structural and definition aspects, including many expressions as part of said structure. It is using grammar A:
rammar com.mentor.SaphireRL with com.mentor.SaphireExp
generate saphireRL "http://www.mentor.com/SaphireRL"
import "http://www.mentor.com/SaphireExp" as saphireExp
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
Model :
(sections+=Section)*;
(etc...)
I merged both projects just copying the xtext file from grammar A, including the mwe2 file for it, into grammarB.
When i want to generate the code, i first run mew2 for grammar A, then the workflow for grammar B, which is modified as seen in my first post.
Everything works fine, my both extensions are recognized (meaning i can parse and validate expressions and the complex language), but i cannot use the generated eclipse project, because it fails when tryin to open my files with the stack trace attached.
I hope this clarifies a bit more my problem, maybe i'm missing some additional steps when merging the projects, but i wouldn't know where to start looking.
thanks again for your help, it's very appreciated.
|
|
| | | | |
Re: Two DSL, single project, Activator&injector issues [message #1755677 is a reply to message #1755672] |
Mon, 06 March 2017 18:32 |
|
Hi,
i still cannot reproduce. it might have todo with generated once files.
maybe you can create a fresh project and copy the xtexts there
language = StandardLanguage {
name = "com.mentor.SaphireExp"
fileExtensions = "exp"
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}
language = StandardLanguage {
referencedResource = "platform:/resource/org.xtext.example.mydsl/model/generated/SaphireExp.genmodel"
name = "com.mentor.SaphireRL"
fileExtensions = "rl"
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
| | | | |
Goto Forum:
Current Time: Fri Sep 20 08:58:51 GMT 2024
Powered by FUDForum. Page generated in 0.05171 seconds
|