Re: [Jastadd] [Q] Def-Use analysis in JastAddJ

From: Na, Hyunik <>
Date: Tue, 10 Jan 2012 18:42:20 +0900

Thank you for this information.

This is definitely what I need (a data-flow analysis).


The source code in the zip file builds successfully with two simple


           . flow-20110613/build.xml:

                     beaver.jar ā beaver-ant.jar

           . Java1.4Frontend/CatchClause.jrag:

                     abstract CatchClause ::= Block; ā abstract
CatchClause ::= Parameter:ParameterDeclaration Block;


The version of my local JastAddJ is the most current one. (9196).


Thank you again.


- Hyunik.


From: Görel Hedin []
Sent: Tuesday, January 10, 2012 5:27 PM
To: Na, Hyunik
Subject: Re: [Jastadd] [Q] Def-Use analysis in JastAddJ


Hi Hyunik,


You should take a look at the Flow Analysis extension. See

It covers Java 5, i.e., it doesn't cover the Java 7 extensions yet.





10 jan 2012 kl. 00.54 skrev Na, Hyunik:

By ‘def’ in def-use analysis, I (and most compiler books as far as I know)
mean ‘assignment’.


In the following example,



int i = 0;


if ( … )

           i = 1;

else if ( … )

           i = 2;

else if ( … )

           i = 3


System.out.println( “ i = “ + i ); // use of i



def-sites corresponding to the i’s use-site are the 4 assignments.

VarAccess.decls() returns only the first assignment (the declaration of i),
doesn’t it?


Now, I’m reading DefiniteAssignment.jrag.

Considering what the definite assignment check does, I expect that it

some hints which is helpful in implementing the analysis.


- Hyunik




From: [] On Behalf
Of Jesper Oqvist
Sent: Monday, January 09, 2012 7:13 PM
Subject: Re: [Jastadd] [Q] Def-Use analysis in JastAddJ


What about VarAccess.decls() ? Declared in LookupVariable.jrag at line 232.


On 01/09/2012 10:44 AM, Na, Hyunik wrote:

Hello JastAddJ developers,


I need def-use analysis for java programs.

More specifically, I need some attribute like


syn/inh SimpleSet VarAccess.defSites() = …


I couldn’t find one when I quickly scanned the source code.

Isn’t there such an attribute in JastAddJ?


If not, I have to implement the def-use analysis.

Any advice will be appreciated for the implementation in JastAddJ.


- Hyunik

JastAdd mailing list


JastAdd mailing list

Received on Tue Jan 10 2012 - 10:47:33 CET

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