Consider the following test module:

module test
imports libstratego-lib libjava-front

strategies

main =

where(cbds := |[ public int f1; public int f2;]|)
;
! compilation-unit |[

     public class Foo {
    
     private Long id;
    
     public void setId(Long id){
        this.id = id;
     }

     public Long getId(){
        return this.id;
     }
    
     ~*cbds
    
     @Override
     public boolean equals(Object o){

       if(o != null && o instanceof Foo){

           return this.id == ((Foo)o).getId();

       } else return false;

     }

    }

   ]|

Compiled using: trc -i test.str -o test -I ~/.nix-profile/share/java-front -I ~/.nix-profile/share/sdf/java-front -la stratego-lib -la ~/.nix-profile/lib/libjava-front.la yields the following error message:

[ strc | info ] Compiling ‘test.str’
** Error in definition main:
variable ‘Override’ used, but not bound
[ strc | error ] Compilation failed (3.19 secs)

Leaving out the ~*cbds anti-quotation eliminates this error, as well as putting the @Override between public and equals. Anti-quotation syntax possibly needs an explicit termination symbol to avoid this issue.

Submitted on 23 April 2007 at 15:08

Log in to post comments