[xtext2]Problem with JvmArgumentTypeReference when referring to declared JvmTypeParameter [message #726793] |
Mon, 19 September 2011 15:14 |
Victor Noël Messages: 112 Registered: June 2010 |
Senior Member |
|
|
Hi,
I have a really strange behaviour using an Xbase based grammar.
I'm porting a working grammar to xtext2 and I was used the following kind of construct:
Infrastructure:
"infrastructure" name=ID ("[" typeParameters+=JvmTypeParameter ("," typeParameters+=JvmTypeParameter)* "]")? "{"
( provides+=ProvidedPort
| requires+=RequiredPort
| components+=InfrastructureInstance
| species+=Species
)*
"}";
ProvidedPort:
"provides" name=ID ":" typeReference=JvmTypeReference
And when I am editing an instance of such a grammar, for example something like that:
infrastructure I[A] {
provides p1: java.util.List<A>
}
It doesn't see A as a valid.
And the strange part here, is that I first overridden JvmTypeReference in my grammar in order to use my own syntax as following:
JvmParameterizedTypeReference:
type=[types::JvmType|QualifiedName] (=> "[" arguments+=JvmArgumentTypeReference ("," arguments+=JvmArgumentTypeReference)* "]")?;
And then, it was working half of the time: completion was proposing me the A, and it was validated as ok, then if I changed some stuffs in my model it wasn't working anymore.
It seems that the declaration of A is the problem, because I have another rule to refer to a declared Infrastructure and a validation rule to check that all its parameters are set, and it always see the number of parameters as 0...
If someone has an idea, it would be helpful
Victor
[Updated on: Wed, 21 September 2011 10:27] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03473 seconds