Re: [Jastadd] Problem with latest change to JastAdd2

From: Jesper Öqvist <jesper.oqvist_at_cs.lth.se>
Date: Sat, 24 Sep 2011 19:41:51 +0200

Hello,
I've had a look at jrag/CollectionAttributes.jrag in the JastAdd2
repository to see if I could find what's causing this bug.

I found that there are some if-statements surrounding the code
generation for (conditional) collection contributions which look like this:

   if (c.getCondition() != null) ...

I tried adding the following

&& c.getCondition().trim().length()>0

at all such occurrences and that seems to solve the bug. The problem was
that the getCondition method used to return null if there was no
condition but now this method can return an empty String instead.

/Jesper

On 09/24/2011 05:54 PM, Emma Söderberg wrote:
> Hi Eric,
>
> I suspect that is related to the latest update of JastAdd2 and perhaps
> a missing test case in our test suite. I'll look into it and see what
> I can do.
>
> Concerning the contributes clause, you can find more info about it here:
> http://jastadd.org/web/documentation/reference-manual.php#Collection
>
> Sorry for the hassle,
> Emma
>
> On 09/24/2011 04:29 PM, Eric Bodden wrote:
>> Dear JastAdders.
>>
>> A few days ago "jesper" updated the code base to use JastAdd2. (change
>> set to revision 9146) Since then, I am seeing a lot of compile errors
>> in the generated Java code, due to missing expressions in
>> conditionals. For instance, Expr.java contains this method:
>>
>> protected void
>> contributeTo_CFGNode_CFGNode_collPred(SmallSet<CFGNode> collection) {
>> super.contributeTo_CFGNode_CFGNode_collPred(collection);
>> if()
>> collection.add(this);
>> }
>>
>> As you can see, the if()-statement is missing its expression. All the
>> buggy code seems to be related to "contributes" statements such as:
>>
>> Expr contributes this to CFGNode.collPred() for each succ();
>>
>> (By the way: This feature is still unknown to me. Is there any
>> documentation about what "contributes" does?)
>>
>> I would appreciate if you could let me know if I am missing something
>> or if there is just something wrong with the current version of
>> JastAdd and thus this issue is beyond my control?
>>
>> Best wishes,
>> Eric
>
Received on Sat Sep 24 2011 - 19:41:53 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 16 2014 - 17:19:06 CEST