[Jastadd] [Q] When is a lazy attribute not cached?

From: Na, Hyunik <hina_at_kaist.ac.kr>
Date: Tue, 17 Apr 2012 12:07:05 +0900

Hello JastAdd developers,

 

It seems that a lazy attribute is not always cached.

 

For example, I found that the MethodAccess.decls() attribute (which is
declared lazy) is not cached, but calculated many times

in a case when it leads to the type checking process that I added to
JastAddJ.

 

Perhaps, the answer is in the following line appearing in the decls() method
of MethodAccess.java which JastAdd generates.

 

           if(isFinal && num == state().boundariesCrossed) decls_computed =
true;

 

It seems that the 'decls_computed' field decides whether to use the cached
value or not,

and it is set only when the condition, "isFinal && num ==
state().boundariesCrossed", is satisfied.

And, it seems that my type checking process makes that condition
unsatisfied.

 

What does the condition mean?

And, how can I cache all my lazy attributes?

 

Thank you.

 

- Hyunik.
Received on Tue Apr 17 2012 - 05:07:15 CEST

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