You are here: Home JastAdd Forums JastAdd Refine attribute question
Document Actions

Refine attribute question

Up to JastAdd

Refine attribute question

Posted by Rodolfo Toledo at May 14. 2008
 

Hi,


I'm trying to refine the lookupType attribute declared in LookupType.jrag (line 105) of the Java 1.4 frontend using the following code:
aspect cbLookupFullyQualifiedTypes {
  refine LookupFullyQualifiedTypes eq Program.lookupType(String packageName, String typeName) {
    return null;
  }
}
But I get this error:
Can not find syn equation to refine in cbLookupType.jrag at line 2


cbLookupType.jrag is the file where I'm declaring the refinement.  Trying to figure out the reason of this error, I have looked into the Java 1.5 refinements of certain attributes and my code seems OK (at least syntactically).


Any help is really appreciated.
Best Regards,
Rodolfo Toledo.


Re: Refine attribute question

Posted by Torbjörn Ekman at May 27. 2008

Hi Rodolfo,


This is due to a bug/inconsistency in the JastAdd compiler. When you refine an equation you need to specify the file name of the .jrag file rather than the enclosing aspect. That is, the following refinement should have your desired behaviour:
refine LookupType eq Program.lookupType(String packageName, String typeName) {
    return null;
}


Regards
Torbjorn


Powered by Ploneboard