Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Scope for EObject with Qualified Name
Scope for EObject with Qualified Name [message #1064645] Thu, 20 June 2013 11:48 Go to next message
Günther Fiedler is currently offline Günther FiedlerFriend
Messages: 21
Registered: February 2013
Junior Member
Hello,

I´m currently working on an Expression Grammar for my Statemachine. Therefore I implemented a Rule:

//FeatureCall returns Expression:
//ElementReferenceExpression ({FeatureCall.owner=current} '.' feature=[ecore::EObject]
//( =>operationCall?='('
//(args+=Expression (',' args+=Expression)*)?
//')')?
//)*
//;

For my "feature" Reference I get now all the EObjects. This works perfectly fine. But some EObjects contain other Objects just like action or events. I want them referenced by Fqn.

MY Idea was a Scope to solve this problem. Because i´m pretty new in Xtext and Java, i´m not sure hwo to implement this Scope.

I hope that somebody could help me!

Thx,
Günther
Re: Scope for EObject with Qualified Name [message #1064650 is a reply to message #1064645] Thu, 20 June 2013 12:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
feature=[ecore::EObject] is short for feature=[ecore::EObject|ID]
=> only ID will be parsed

=> change it to
feature=[ecore::EObject|FQN]
or something like that
(with FQN: ID ("." ID)*;)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Scope for EObject with Qualified Name [message #1064652 is a reply to message #1064650] Thu, 20 June 2013 12:18 Go to previous messageGo to next message
Günther Fiedler is currently offline Günther FiedlerFriend
Messages: 21
Registered: February 2013
Junior Member
Hello Christian,

I´ve tried this, but i get an error while generating the Xtext Artifacts.

warning(200): ../christ.xtext.statemachinediagram.sdsl/src-gen/christ/xtext/statemachinediagram/sdsl/parser/antlr/internal/InternalSDsl.g:3639:1: Decision can match input such as "'.' RULE_ID" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
Semantic predicates were present but were hidden by actions.

For further Information i have two rules:

Interface:
'interface' name=ID '{'
('attribute' (attributes+=Attribute))*
(('in' | 'out') 'event' method+=Method )*
('action' action += Activity)*
'}';
Activity:
name = Fqn ':' datType = DataType ;

What i want to write is something like: User.disconnect => (interfacename.action)

Of Course i only get the Interface-Objects if i use feature=[ecore::EObject]
Re: Scope for EObject with Qualified Name [message #1064653 is a reply to message #1064652] Thu, 20 June 2013 12:29 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Loolks like i did not get your problem. you may be looking for http://christiandietrich.wordpress.com/2013/05/18/xtext-and-dot-expressions/

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:After linking|Scoping but before Generator and second language
Next Topic:Performing automatic corrections
Goto Forum:
  


Current Time: Thu Apr 25 20:01:10 GMT 2024

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

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

Back to the top