QualifiedName resolving [message #886841] |
Fri, 15 June 2012 14:00  |
Eclipse User |
|
|
|
Hi!
I am trying to make a (very) simple grammar with ecore files, and reference resolving, but even since I read so many documents and tried so many times, I cannot make it works.
Here is my problem:
The project contains some folders (that correspond to the "packages", but every single folder contains a file named package.mydsl that contains the definition of the package.
A package is simply defined as If the package is inside a package, the file only begins with

With the same way, we can define some models, with the same principle: if the model is inside a package, the file begins with and the model is defined like

The problem in my example, is when I want to create something in a package within another package like NAME1.NAME2

So, I have actually 2 problems:
- pack1.pack2 cannot be resolved...
- I can define 2 models called ModelA in the same package pack1... why?
Here is my grammar:
Program returns program::Program:
{program::Program}
( withinClause=Within ';')?
( clazzes+=ClazzDefinition ';')*
;
Within returns within::Within:
{within::Within}
('within' importedNamespace=[clazz::Package|QualifiedName])?
;
ClazzDefinition returns clazz::Clazz:
ModelDefinition | PackageDefinition
;
ModelDefinition returns clazz::Model:
{clazz::Model}
(finalPrefix?='final')?
(partialPrefix?='partial')?
'model' name=ID
'end' endName=ID
;
PackageDefinition returns clazz::Package:
{clazz::Package}
(finalPrefix?='final')?
(partialPrefix?='partial')?
'package' name=ID
'end' endName=ID
;
QualifiedName:
ID ('.' ID)*;
Is my problem because of the grammar? the scope? the mwe2 file?
I am kinda lost right now... any help will be much appreciated!!!
Thank You...
Attachment: v1.png
(Size: 78.36KB, Downloaded 371 times)
Attachment: v2.png
(Size: 77.62KB, Downloaded 339 times)
Attachment: v3.png
(Size: 72.56KB, Downloaded 332 times)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06033 seconds