[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.tmf] Re: How to make a reference like model::someClassifier without a space in it?

Hi Eckle,

Using Xtext 0.7.2 I could not confirm this. I declared my grammar as follows and all I got was unresolved reference errors as I hadn't defined the scoping semantics:

Model :
    'model' package=[ecore::EPackage|STRING] ('as' alias=ID)?
    (refs+=UseMyRef)*;
UseMyRef :
    'using' name=ID 'for' modelElement=ModelElementRef;
ModelElementRef :
    (model=[Model] '::')? classifier=[ecore::EClassifier];

What version of Xtext are you using?

Hope that helps,

--knut

xx.eckle@xxxxxxxx wrote:
I need to built a reference to an EClassifier of a specific model like this is done in the xtext-Grammar (~ model::classifer).
It works fine, but there has to be a whitespace between "model" and the "::"-separator, else i get a validation-error in the ui (mismatched input 'model::Package' expecting RULE_ID).


My Reference, the Model and its usage is defined as follows:

ModelElementRef :
    (model=[Model] '::')? classifier=[ecore::EClassifier];
Model :
    'model' package=[ecore::EPackage|STRING] ('as' alias=ID)?;
UseMyRef :
    'using' name=ID 'for' modelElement=ModelElementRef;


When using the alias ID of a defined 'model', there needs to be a whitespace in it like


model ::Package

How can i get rid of this? Where is the point i have to intervene?