Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » duplicate a term(duplicate a term)
duplicate a term [message #732265] Tue, 04 October 2011 11:15 Go to next message
samir  is currently offline samir Friend
Messages: 27
Registered: September 2011
Junior Member
hello
I describe my problem, this is my grammar

Term : Var | Abs | App|Uq|Tapp ;
Var : name = variable;
Abs : '\\('param = variable ':' type = T').'body = Term;
App : '('t1 = Term ')' t2= Term;
Uq : '/\\'var = tvar'.'term = Term;
Tapp: => '('term = Term')'type = T;


T : tvar|tvar '->' (T)+|'/\\' tvar '.'T;

terminal variable : ('a'..'z')+;
terminal tvar : ('A'..'Z')+;


the problem is when I try to write a term such as "(a)a"
does not accept it, and tells me the term "a" is duplicate.
how can I do to allow duplicate of terms?
Re: duplicate a term [message #732269 is a reply to message #732265] Tue, 04 October 2011 11:28 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

reason is that you have now 2 terms with name a.
a check for this is configured with
composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"

in your language workflow

you have following possibilities
(a) remove org.eclipse.xtext.validation.NamesAreUniqueValidator
(b) customize org.eclipse.xtext.validation.NamesAreUniqueValidator (INamesAreUniqueValidationHelper)
(c) rename "name" to something or fix it in the IQualifiedNameProvider to get unique names

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Using Unreferenced Objects in Scope
Next Topic:how to create across reference in the local scope
Goto Forum:
  


Current Time: Sat Apr 20 02:50:20 GMT 2024

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

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

Back to the top