Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Multiple resources and validation problem
Multiple resources and validation problem [message #687781] Thu, 23 June 2011 08:21 Go to next message
Victor Noël is currently offline Victor Noël
Messages: 112
Registered: June 2010
Senior Member
Hi,

I defined a DSL exploiting scoping.ImportNamespacesScopingFragment, exporting.QualifiedNamesFragment and types.TypesGeneratorFragment to enable multiple resources to be referring to each others as long as they are in the same classpath, as well as refering to Java types.

The corresponding DSL constructs related to these fragments are:
Model returns Namespace:
	(	imports+=Import
	|	elements+=ModelElement
	)*;

Namespace:
	'namespace' name=FQN '{'
		(	imports+=Import
		|	elements+=ModelElement
		)*
	'}';

FQN:
	ID ('.' ID)*;

ImportedFQN:
	FQN ('.' '*')?;

Import:
	'import' importedNamespace=ImportedFQN;

ModelElement:
	Namespace | ParameterizedElement;

TypeParameter returns types::JvmTypeParameter:
	{TypeParameter} name=ID;

ReferenceTypeArgument returns types::JvmReferenceTypeArgument:
	typeReference=ParameterizedTypeReference;

ParameterizedTypeReference returns types::JvmParameterizedTypeReference:
	{ParameterizedTypeReference} type=[types::JvmType|FQN] ("[" arguments+=ReferenceTypeArgument ("," arguments+=ReferenceTypeArgument)* "]")?;


The problem is very precise: if I have 2 projects A and B, one resource of this dsl in each (RA in A and RB in B), a Java class JB in B.
RB is referring to JB and to an element inside RA.
A is in the classpath of B.

If I modify an element in RB, even one not referenced by RA, then RA shows as having errors, and if I look inside, there is grey crosses (and not red) in front of the lines where JB is referred to, and it says it can't resolve the reference to JB in the problem view (but the reference itself is not underlined).
Then I just have to make the Validator run (for example by modifying a bit RB) and then the errors disappears.

I don't know how to debug that, any idea??!

Thanks :)
Re: Multiple resources and validation problem [message #687783 is a reply to message #687781] Thu, 23 June 2011 08:24 Go to previous messageGo to next message
Victor Noël is currently offline Victor Noël
Messages: 112
Registered: June 2010
Senior Member
Sorry, I forgot, the version of Xtext is 1.0.1 with Eclipse Helios.
Re: Multiple resources and validation problem [message #692623 is a reply to message #687781] Mon, 04 July 2011 21:02 Go to previous message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2908
Registered: July 2009
Senior Member
Hi Victor,

are there any customizations in your validator or scope provider?
How does the content of RA and RB look like?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 23.06.11 10:21, Victor wrote:
> Hi,
>
> I defined a DSL exploiting scoping.ImportNamespacesScopingFragment,
> exporting.QualifiedNamesFragment and types.TypesGeneratorFragment to
> enable multiple resources to be referring to each others as long as they
> are in the same classpath, as well as refering to Java types.
>
> The corresponding DSL constructs related to these fragments are:
>
> Model returns Namespace:
> ( imports+=Import
> | elements+=ModelElement
> )*;
>
> Namespace:
> 'namespace' name=FQN '{'
> ( imports+=Import
> | elements+=ModelElement
> )*
> '}';
>
> FQN:
> ID ('.' ID)*;
>
> ImportedFQN:
> FQN ('.' '*')?;
>
> Import:
> 'import' importedNamespace=ImportedFQN;
>
> ModelElement:
> Namespace | ParameterizedElement;
>
> TypeParameter returns types::JvmTypeParameter:
> {TypeParameter} name=ID;
>
> ReferenceTypeArgument returns types::JvmReferenceTypeArgument:
> typeReference=ParameterizedTypeReference;
>
> ParameterizedTypeReference returns types::JvmParameterizedTypeReference:
> {ParameterizedTypeReference} type=[types::JvmType|FQN] ("["
> arguments+=ReferenceTypeArgument ("," arguments+=ReferenceTypeArgument)*
> "]")?;
>
>
> The problem is very precise: if I have 2 projects A and B, one resource
> of this dsl in each (RA in A and RB in B), a Java class JB in B.
> RB is referring to JB and to an element inside RA.
> A is in the classpath of B.
>
> If I modify an element in RB, even one not referenced by RA, then RA
> shows as having errors, and if I look inside, there is grey crosses (and
> not red) in front of the lines where JB is referred to, and it says it
> can't resolve the reference to JB in the problem view (but the reference
> itself is not underlined).
> Then I just have to make the Validator run (for example by modifying a
> bit RB) and then the errors disappears.
>
> I don't know how to debug that, any idea??!
>
> Thanks :)
Previous Topic:Error ruleMemo while creating new Xtext project
Next Topic:JDT independent DSL
Goto Forum:
  


Current Time: Sun Oct 26 05:21:34 GMT 2014

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

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