Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Domain model: member access
Domain model: member access [message #700425] Sat, 23 July 2011 11:57 Go to next message
amazuzu  is currently offline amazuzu Friend
Messages: 17
Registered: May 2011
Junior Member

I want to impl member access in domain model example (I mean xtext 1.0 example without xtend or xbase ).

Here what I change in grammar
        PackageDeclaration | Type | Import | MemberAccess;

	"memberaccess" entity=[Entity] "." attribute = [Attribute];

dsl looks following
datatype int

entity Foo{

memberaccess //Couldn't resolve reference to Attribute 'foo'

what i'm doing wrong?
Re: Domain model: member access [message #700428 is a reply to message #700425] Sat, 23 July 2011 12:02 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13940
Registered: July 2009
Senior Member

Qualified names a built by the elements names and their parents names.
so the Attribute foo has the FQN

so you have to change the grammar too

	 attribute = [Attribute|FQN];
FQN: ID ("." ID)*;

or change to local scoping for attibute by putting the attributes under their simple name into scope

	public IScope scope_MemberAccess_attribute(MemberAccess memberAccess, EReference ref) {
		return Scopes.scopeFor(Iterables.filter(memberAccess.getEntity().getFeatures(), Attribute.class));


Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :

[Updated on: Sat, 23 July 2011 12:09]

Report message to a moderator

Previous Topic:Single Character compete versus INT and ID
Next Topic:[Xtext2] Extending XbaseCompiler
Goto Forum:

Current Time: Mon May 17 16:07:03 GMT 2021

Powered by FUDForum. Page generated in 0.02021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top