Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [xtext] Is URI terminal gone ?
[xtext] Is URI terminal gone ? [message #659059] Thu, 10 March 2011 20:07 Go to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Hi everyone,

we finally migrated our oaw xtext grammar to the new TMF xtext 1.0. The
migration had several problems, but didnt become too painful. Took me
like one day.

Now, I wonder what happened to that useful URI terminal. Has it been
renamed, or just excluded from the basic terminals?

Thanks and congratulations for such a beautiful framework :D
Víctor.
Re: [xtext] Is URI terminal gone ? [message #659062 is a reply to message #659059] Thu, 10 March 2011 20:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

welcome to the wonderful world of Eclipse Xtext

the replacement for

Import: 
     'import' model=URI ';';


is

Import : 
  'import' importURI=STRING; 


(name of the feature must be importURI)

note you have to do some changes to the workflow too if you want to use global scopes based on imports

...
			// scoping and exporting API
			 fragment = scoping.ImportURIScopingFragment {}
			 fragment = exporting.SimpleNamesFragment {}

			// scoping and exporting API 
//			fragment = scoping.ImportNamespacesScopingFragment {}
//			fragment = exporting.QualifiedNamesFragment {}
//			fragment = builder.BuilderIntegrationFragment {}
...


btw - maybe reading the migration guides might help
0.7.x -> 1.0.x http://www.eclipse.org/Xtext/documentation/1_0_1/xtext.html# migrating_from_0_7
oAW -> 0.7.x http://www.eclipse.org/Xtext/documentation/0_7_2/xtext.html# from_oaw_to_tmf

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 10 March 2011 20:24]

Report message to a moderator

Re: [xtext] Is URI terminal gone ? [message #659154 is a reply to message #659062] Fri, 11 March 2011 10:12 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
*Aparently yesterdays response didn't get to the newsgroup. Here it is
again*

Hi Christian,

thanks for your prompt response. I'm afraid im not following you.
I have no clue what you mean with imports, and I don't see how that
helps me having a URI terminal. Maybe I wasn't clear enough.

One of the rules I defined used to be like this:

FromClassName: (fromModifier=FromModifier)? (nsuri = URI)? objectSource
= ID;

Do you suggest that if I replace "nsuri" with "importURI" and "URI" with
"STRING", it would work as it used to?

It seems a bit odd to me the need to modify the workflow and using
specific feature names just to have an URI terminal.

Thanks!
Víctor.

El 10/03/2011 19:23, Christian Dietrich escribió:
> Hi,
>
> welcome to the wonderful world of Eclipse Xtext
> the replacement for
>
>
> Import: 'import' model=URI ';';
>
>
> is
>
>
> Import : 'import' importURI=STRING;
>
> (name of the feature must be importURI)
>
> note you have to do some changes to the workflow too if you want to use
> global scopes based on imports
>
>
> ..
> // scoping and exporting API
> fragment = scoping.ImportURIScopingFragment {}
> fragment = exporting.SimpleNamesFragment {}
>
> // scoping and exporting API // fragment =
> scoping.ImportNamespacesScopingFragment {}
> // fragment = exporting.QualifiedNamesFragment {}
> // fragment = builder.BuilderIntegrationFragment {}
> ..
>
>
> btw - maybe reading the migration guides might help
> oAW -> 0.7.x
> http://www.eclipse.org/Xtext/documentation/1_0_1/xtext.html# migrating_from_0_7
>
> 0.7.x -> 1.0.x
> http://www.eclipse.org/Xtext/documentation/0_7_2/xtext.html# from_oaw_to_tmf
>
> ~Christian
Re: [xtext] Is URI terminal gone ? [message #659169 is a reply to message #659154] Fri, 11 March 2011 10:41 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

in your original project you should be able to find the definition of the URI terminal. Simply copy it to your grammar, or better: write a corresponding datatype rule in order to prevent clashes of terminal definitions.

Alex
Re: [xtext] Is URI terminal gone ? [message #659173 is a reply to message #659169] Fri, 11 March 2011 11:32 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Hi Alex,

so I assume the answer is: yes, it is gone. Right?

Given that, yes, the only thing I can do is create one myself ;)

Thanks!
Víctor.

El 11/03/2011 9:42, Alexander Nittka escribió:
> Hi,
>
> in your original project you should be able to find the definition of
> the URI terminal. Simply copy it to your grammar, or better: write a
> corresponding datatype rule in order to prevent clashes of terminal
> definitions.
>
> Alex
Re: [xtext] Is URI terminal gone ? [message #659176 is a reply to message #659173] Fri, 11 March 2011 11:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

Yes, it is gone - and - this is why talked on imports - the usual usecase for it where imports.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [xtext] Is URI terminal gone ? [message #659177 is a reply to message #659173] Fri, 11 March 2011 11:55 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

at least this terminal is not defined in the default terminals grammar you usually start with when creating a new Xtext project. You can easily navigate to that grammar using F3 in Eclipse.

Alex
Re: [xtext] Is URI terminal gone ? [message #659185 is a reply to message #659176] Fri, 11 March 2011 12:16 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Thanks Christian, I should have explained myself better ;)

Cheers!

El 11/03/2011 10:55, Christian Dietrich escribió:
> Hi,
>
> Yes, it is gone - and - this is why talked on imports - the usual
> usecase for it where imports.
>
> ~Christian
Re: [xtext] Is URI terminal gone ? [message #660236 is a reply to message #659059] Thu, 17 March 2011 13:57 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
I found a topic xtext documentation that explain why this token was
removed. It sugests to rewrite the rule using STRING instead.

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .xtext.doc/help/differences.html
Previous Topic:Accessing properties file through jar
Next Topic:Listen to model changes
Goto Forum:
  


Current Time: Fri Apr 26 23:18:28 GMT 2024

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

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

Back to the top