problems with global scoping [message #1699239] |
Mon, 22 June 2015 21:56 |
peter luthardt Messages: 22 Registered: March 2014 |
Junior Member |
|
|
I have created a xtext project with the eclipse wizard.
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.xbase.annotations.XbaseWithAnnotations
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
'package' name = QualifiedName
(imports = XImportSection)?
content +=Content*
;
Content:
TypeDef|TypeRef
;
TypeDef:
'def' name=ValidID type=JvmTypeReference 'length' length=INT
;
TypeRef:
'ref' name=ValidID ('extends' superType=[TypeRef|QualifiedName])?
types += TypeRefValDef*
;
TypeRefValDef:
'val' name=ValidID type=[TypeDef|QualifiedName]
;
Now running the dsl as eclipse project adding the following to files:
package test
def def1 String length 10
ref Ref1
val d def1
package test
ref Ref extends test.Ref1
In the last I get the message Couldn't resolve reference to TypeRef 'test.Ref1'.
I read lots about GlobalScopeProvider, XtextResourceDescriptionStrategy, ... etc., and I think I start to understand the big picture,
I have the strange feeling, that the ResourceDecriptions (Index) is not build correctly.
When I try to read allResourceDescriptions from the ResourceDescriptionsProvider I get an empty List.
I have no idea what I am missing.
Xtext 2.8.1
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03953 seconds