Re: [Jastadd] Problem with latest change to JastAdd2

From: Emma Söderberg <emma.soderberg_at_cs.lth.se>
Date: Sat, 24 Sep 2011 19:45:54 +0200

Hi,

I'm looking into the same problem. The support for not including a
"when" part in a "contributes" clause must have disappeared at some
point. The code in the ControlFlowGraph module Eric is using has those
kinds of contributes clauses. I'm adding a test case to the jastadd2
test suite to catch this. There might also be some problem with
attributes on interfaces, but I'm not sure yet.

/Emma

On 09/24/2011 07:41 PM, Jesper Öqvist wrote:
> 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
>>
>
> _______________________________________________
> JastAdd mailing list
> JastAdd_at_cs.lth.se
> https://mail1.cs.lth.se/cgi-bin/mailman/listinfo/jastadd
Received on Sat Sep 24 2011 - 19:46:39 CEST

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