Re: [Jastadd] Expr, Stmt and coll attributes

From: Patrick Lam <p.lam_at_ece.uwaterloo.ca>
Date: Fri, 23 Mar 2012 10:26:41 -0700

Hi Emma,

Thanks for the quick reply.

I can successfully run your example, and I do see that Expr gets the
cdd() value. However, I don't see any propagation from Expr to the
containing Stmt. (I'm working on adding a rule to manually propagate it,
but I haven't managed to get that working yet).

I changed the example so that it prints out the def() and cdd() sets for
Stmts instead, and they are set for the VariableDeclaration statements,
but not for the ExprStmts, which is what I'm trying to compute.

Wouldn't one normally want to know about the variables that are defined
at a Stmt level, not at an Expr level?

pat

On 03/23/2012 05:51 AM, Emma Söderberg wrote:
> Hi Patrick,
>
> I have trouble reproducing your problem. Which revision of the IntraFlow
> module are you using? I'm using r769, and then r9236 for the JastAddJ
> frontend. I tested to run your example but I get contributions for all
> roots: BodyDecl, Stmt and Expr. I'm attaching the example so that you
> can compare. The example program ("Analyzer.java") will print the
> content of "cdd()" and "def()" for expression nodes in methods. Hope
> this helps.
>
> Regards,
> Emma
>
> On 03/23/2012 08:19 AM, Patrick Lam wrote:
>> Hi,
>>
>> Thanks for the work on JastAdd. It makes certain things a lot easier
>> to express.
>>
>> Using code from SVN, I'm encountering something strange.
>>
>> In particular I'm using r9236 of the Java1.4Frontend, and I'm trying
>> to use def() from the IntraFlow extension. But I can reproduce the
>> problem with the following two lines:
>>
>> coll SmallSet CFGNode.cdd() [emptySmallSet().mutable()] with add root
>> BodyDecl;
>> VarAccess contributes decl() when isDest() to CFGNode.cdd() for this;
>>
>>
>> I'm not getting any contributions from VarAccess with a simple method
>> like this one:
>>
>> class Foo {
>> public Foo fob() {
>> Foo tt, rr;
>> tt = this;
>> rr = tt;
>> return rr;
>> }
>> }
>>
>> def() from JavaDeadAssigns doesn't seem to work right either; it only
>> catches VariableDeclaration and not VarAccess.
>>
>> In particular, if I collect on Stmt, then I get a bunch of
>> contributions. But if I collect on Expr or any descendant, I get
>> nothing. Am I doing something wrong?
>>
>> Thanks!
>>
>> pat
>> _______________________________________________
>> JastAdd mailing list
>> JastAdd_at_cs.lth.se
>> https://mail1.cs.lth.se/cgi-bin/mailman/listinfo/jastadd
>
>
>
> _______________________________________________
> JastAdd mailing list
> JastAdd_at_cs.lth.se
> https://mail1.cs.lth.se/cgi-bin/mailman/listinfo/jastadd
Received on Fri Mar 23 2012 - 18:26:56 CET

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