|
Re: [acceleo 3.2] Don't understand the error/problem with a simple query modification [message #756957 is a reply to message #756887] |
Tue, 15 November 2011 17:36 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Marc
Puzzling, but you're using Acceleo 3.2, for which IMHO the builder just
doesn't work (https://bugs.eclipse.org/bugs/show_bug.cgi?id=363651). You
may need to try a variety of tricks to actually get a rebuild to build.
I suggest trying your 'bad' code again, and then make significant
changes like adding another query and verifying that the *.emtl files
acquire a new date.
Regards
Ed Willink
On 15/11/2011 12:44, Marc wrote:
> Hello (again),
>
> I have this query, that works fine:
>
> [query private uppers(aPrio : PriorityDeclaration) :
> Sequence(Sequence(PriorityDeclaration)) =
> let retSeq : Sequence(Sequence(riorityDeclaration)) =
> fusionPrioSeq(aPrio.upper()
> ->collectNested(uPrio :
> PriorityDeclaration |uPrio.uppers() ) )
>
> ->collectNested(e:Sequence(PriorityDeclaration)| e->prepend(aPrio) ) in
> if retSeq->isEmpty() then
> Sequence{Sequence{aPrio}}
> else
> retSeq
> endif
> /]
> And it's called by a template:
>
> [template private genPriorityCondition(aPrioDecl :
> PriorityDeclaration) post(trim())
> {
> ups : Sequence(Sequence(PriorityDeclaration)) =
> aPrioDecl.uppers();
> }]
> ...
>
>
> Suppose I want to add an extra argument to the query. I have now:
> [query private uppers(aPrio : PriorityDeclaration, i: Integer) :
> Sequence(Sequence(PriorityDeclaration)) =
> let retSeq : Sequence(Sequence(PriorityDeclaration)) =
> fusionPrioSeq(aPrio.upper()
> ->collectNested(uPrio :
> PriorityDeclaration | uPrio.uppers(1) ) )
>
> ->collectNested(e:Sequence(PriorityDeclaration)| e->prepend(aPrio) ) in
> if retSeq->isEmpty() then
> Sequence{Sequence{aPrio}}
> else
> retSeq
> endif
> /]
>
> Unfortunately, this gives me the following output:
>
> org.eclipse.acceleo.engine.AcceleoEvaluationException: Undefined
> argument upper(aPrio)->collectNested(uPrio : PriorityDeclaration |
> uppers(1)) of invocation at line 0 in Module generateType for block
> fusionPrioSeq(upper(aPrio)->collectNested(uPrio : PriorityDeclaration
> | uppers(1))). Last recorded value of self was
> bla.priority.impl.PriorityDeclarationImpl@1144ba2 (name: ND).
> org.eclipse.acceleo.engine.AcceleoEvaluationException: Invalid result
> for expression let retSeq : Sequence(Sequence(PriorityDeclaration)) =
> fusionPrioSeq(upper(aPrio)->collectNested(uPrio : PriorityDeclaration
> | uppers(1)))->collectNested(e : Sequence(PriorityDeclaration) |
> e->prepend(aPrio)) in if retSeq->isEmpty() then Sequence {Sequence
> {aPrio}} else retSeq endif at line 160 in Module generateType for
> query uppers(PriorityDeclaration,Integer). Last recorded value of self
> was bla.priority.impl.PriorityDeclarationImpl@1144ba2 (name: ND).
> org.eclipse.acceleo.engine.AcceleoEvaluationException: Invalid loop
> iteration at line 180 in Module generateType for block for (ups)
> separator(' || '). Last recorded value of self was
> bla.priority.impl.PriorityDeclarationImpl@1144ba2 (name: ND).
> at
> generateType.genPriorityCondition(PriorityDeclaration)(generateType.mtl:180)
>
> But if I change the recursive call, from uPrio.uppers(1) to
> uppers(uPrio, 1), it works...
>
> I guess I'm not using correctly something, but I can't understand what
> and how...
|
|
|
Re: [acceleo 3.2] Don't understand the error/problem with a simple query modification [message #757675 is a reply to message #756957] |
Mon, 21 November 2011 08:57 |
|
Ed,
The builder does seem to "forget" rebuilding things, but the problem at hand is not one of these "things" : the builder should always rebuild the module that is being edited. Only the modules that depend on this "edited" one will be forgotten. We rebuild the "depending" modules only if one of the "edited"'s signatures change; and it seems like we don't rebuild them in all possible cases (though I couldn't pinpoint which). Marc's issue has obviously nothing to do with the builder though.
Marc,
The recursive call should have worked ... we might have an issue with recursive query resolution, but we'll need to isolate a simpler minimal use case.
Laurent Goubet
Obeo
[Updated on: Mon, 21 November 2011 09:23] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01850 seconds