Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » duplicate validation
duplicate validation [message #1198438] Wed, 20 November 2013 10:17 Go to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
I'm a Xtext newbie!

At the moment, i have implement my grammar and i can start a runtime eclipse to testing my editor.
Now, i will validate the code.
How can i check because duplicated identifier?

For Example:

Grammar:

Layer:
	'Layer' name=ID '{'
	description=Description
	('RequiredLayer' reqlayer+=[Layer|ID])?
	'}';


How can i prohibit doublets (layer name must be unique)?

Tanks
Simon



Re: duplicate validation [message #1198891 is a reply to message #1198438] Wed, 20 November 2013 15:15 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
in your GenerateMyDsl.mwe2 file next to your xtext file, uncomment the NamesAreUniqueValidator
// Xtend-based API for validation
fragment = validation.ValidatorFragment auto-inject {
// composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
Re: duplicate validation [message #1200423 is a reply to message #1198891] Thu, 21 November 2013 08:30 Go to previous message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Thank you!

best regards
Simon
Previous Topic:Yet another parsing rule question (cross reference)
Next Topic:Problem running GMFTools with Xtext/GMF integration
Goto Forum:
  


Current Time: Sat Apr 20 02:59:15 GMT 2024

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

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

Back to the top