Home » Modeling » TMF (Xtext) » Two DSL, single project, Activator&injector issues
Two DSL, single project, Activator&injector issues [message #1755248] |
Wed, 01 March 2017 10:45  |
Eclipse User |
|
|
|
Hi guys,
i merged my two dsl in a single project, where dsl A uses DSL B for expressions.
I Also merged my workflow into a single file like this>
Workflow {
component = XtextGenerator {
configuration = {
project = StandardProjectConfig {
baseName = "com.mentor.saphirerl"
rootPath = rootPath
runtimeTest = {
enabled = true
}
eclipsePlugin = {
enabled = true
}
eclipsePluginTest = {
enabled = true
}
createEclipseMetaData = true
}
code = {
encoding = "windows-1252"
lineDelimiter = "\r\n"
fileHeader = "/*\n * generated by Xtext \${version}\n */"
}
}
language = StandardLanguage {
name = "com.mentor.SaphireExp"
fileExtensions = "exp"
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}
language = StandardLanguage {
name = "com.mentor.SaphireRL"
fileExtensions = "srl"
referencedResource = "platform:/resource/com.mentor.saphirerl/model/generated/SaphireExp.genmodel"
}
}
}
When using the DSLs in my external program i have no problem, but when trying to use the eclipse generated app, i get this error:
Quote:
(removed).ui.internal.SaphirerlActivator - Failed to create injector for (removed).SaphireRL
saphirerl.ui.internal.SaphirerlActivator - com.google.inject.internal.util.$ComputationException: java.lang.StackOverflowError
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
at com.google.inject.internal.FailableCache.get(FailableCache.java:50)
And then i can't open my files.
Do you have any tip how what's going on and how to fix it?
Thanks and best regards!
|
|
| |
Re: Two DSL, single project, Activator&injector issues [message #1755645 is a reply to message #1755352] |
Mon, 06 March 2017 08:58   |
Eclipse User |
|
|
|
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.
|
|
| | | | | | | | | |
Goto Forum:
Current Time: Wed Jul 09 09:18:58 EDT 2025
Powered by FUDForum. Page generated in 0.07256 seconds
|