|Integrating Xbase in my DSL. How to activate scoping and validation? [message #1743395]
||Wed, 14 September 2016 22:49
| Florian König
Registered: June 2014
I want to create an extension for my DSL that can integrate Xbase code for special behavior. The new DSL shall :
- import EClasses from an ecore model file in the workspace (this works)
- specify methods with parameters, return values and a Xbase expression block
My current prototype can do this, but the scoping and validation of the Xbase block does not work.
The following is my example code:
grammar examplesystem.dsl.MyDsl with org.eclipse.xtext.xbase.Xbase
generate myDsl "http://www.dsl.examplesystem/MyDsl"
import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
'operation' name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' 'returns' type=[ecore::EClassifier]
Xtext with broken scoping and validation:
Now my question: What do I have to change to fix the problems? Is there a proper guide or tutorial for Xtext 2.10?
I have added my example projects as attachment to this post.
Thanks in advance,
Powered by FUDForum
. Page generated in 0.02150 seconds