|Troubles understanding Qualified Name [message #1804320]
||Fri, 22 March 2019 11:34
| Maximilian Weißböck
Registered: March 2019
I have a simple DSL with definitions and imports and I need to use Qualified Names. Here an example of the DSL|
---- xtext dsl definition -----
grammar test.mydsl.MyDsl1 with org.eclipse.xtext.common.Terminals
generate myDsl1 "http : www mydsl test MyDsl1"
definitions += Definition*
imports += ImportDef*
'def' name = QualifiedID text = STRING ';'
'import' obiect = [Definition] 'as' name = ID ';'
ID ('.' ID)*
----- here an example for definitions ------
def aa.aa "this is aa.aa";
def aa.bb "this is aa.bb";
def cc "this is cc without namespace";
def dd "this is dd without namespace";
---- and here I like to use the definitions ------
import cc as CC;
import aa.aa as AA;
Now my problem is, in the import I can not use the qualified name, eg. aa.aa or aa.bb are not valid, this gives an error
But importing cc and dd works
also the context help only shows the non qualified definitions, cc and dd
I'm relatively new to Xtext (well, I did some small stuff long, long ago with oAW) and I'v read the book from Lorenzo Bettini, Second Edition, but this is still annoying to me.
Any hints how to solve this?
PS: as new user I'm not allowed to post URLs, so the url in the grammar file is invalid
Powered by FUDForum
. Page generated in 0.01972 seconds