Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Migrating to xtext 2.0
Migrating to xtext 2.0 [message #713920] Tue, 09 August 2011 11:41 Go to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
Hi,

Im actually using xtext2 but durin the miration i found some problem with the nodeadapter

private CompositeNode getCompositeNode(EObject semanticElement) {
NodeAdapter nodeAdapter = NodeUtil.getNodeAdapter(semanticElement);
if (nodeAdapter != null) {
final CompositeNode parserNode = nodeAdapter.getParserNode();
return parserNode;
			}
return null;
		}

any idea how can i solve this
thanks
Re: Migrating to xtext 2.0 [message #713927 is a reply to message #713920] Tue, 09 August 2011 12:15 Go to previous messageGo to next message
Xavier Seignard is currently offline Xavier SeignardFriend
Messages: 52
Registered: June 2010
Member
You should use NodeModelUtils now. Node model has been rewritten.

Regards,
Xavier
Re: Migrating to xtext 2.0 [message #713931 is a reply to message #713927] Tue, 09 August 2011 12:23 Go to previous messageGo to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member

Yes thats right,i check up http://www.eclipse.org/Xtext/documentation/2_0_0/213-migrating-from-1.0.php , but the problem i got is with NodeAdapter what it becomes in xtext2

thanks
Re: Migrating to xtext 2.0 [message #713932 is a reply to message #713931] Tue, 09 August 2011 12:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you don't need NodeAdapter anymore, use NodeModelUtils

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Migrating to xtext 2.0 [message #713952 is a reply to message #713932] Tue, 09 August 2011 13:35 Go to previous messageGo to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
Hi,
Intersting, thanks for the reply, so something like below should work
private ICompositeNode getCompositeNode(EObject semanticElement) {
				final ICompositeNode parserNode = NodeModelUtils.findActualNodeFor(semanticElement);
				return parserNode;
		}

[Updated on: Tue, 09 August 2011 13:35]

Report message to a moderator

Re: Migrating to xtext 2.0 [message #713964 is a reply to message #713952] Tue, 09 August 2011 13:50 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Yes

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Folding on EReferences
Next Topic:A rule that consumes everything until certain char/string?
Goto Forum:
  


Current Time: Tue Apr 23 09:49:12 GMT 2024

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

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

Back to the top