Skip to content
Snippets Groups Projects
Commit a0bc4617 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

WiP annotations. small changes

parent 2519db57
Branches
Tags
No related merge requests found
......@@ -23,21 +23,6 @@ aspect SigAnnotations {
syn boolean ASTNode.isTypeInstance() = false;
eq TypeInstance.isTypeInstance() = true;
}
aspect Signature {
syn boolean Decl.isSampleDecl();
eq TypeDecl.isSampleDecl() = false;
eq SampleDecl.isSampleDecl() = true;
syn boolean Decl.sendOnlyFlatSignatures(Java_env env) = (env.version==2006);
eq Decl.getSignature().parentDecl() = this;
eq Signature.getSignatureList().parentDecl() = parentDecl();
inh Decl Signature.parentDecl();
inh Decl SignatureList.parentDecl();
/// TESTING
syn String Decl.getAnnotationString() {
......@@ -52,6 +37,18 @@ aspect Signature {
return sb.toString();
}
syn int TypeInstance.fooHash() {
List<Annotation> ints = getAnnotationList();
int result=0;
for(Annotation i : ints) {
if(i.isIntention()) {
result += i.toString().hashCode();
}
}
return result;
}
syn String TypeInstance.getAnnotationString() {
StringBuilder sb = new StringBuilder();
List<Annotation> ints = getAnnotationList();
......@@ -67,13 +64,29 @@ aspect Signature {
public void TypeInstance.debugAnnotations(String context) {
if(hasAnnotations()){
System.out.println(context+".annotations: " + getAnnotationString());
System.out.println(context+".annotations: " + fooHash() + " : " + getAnnotationString());
} else {
System.out.println(context+": NO ANNOTATIONS ");
System.out.println(context + " : " + fooHash() + " : " + ": NO ANNOTATIONS ");
}
}
// TESTING END
}
aspect Signature {
syn boolean Decl.isSampleDecl();
eq TypeDecl.isSampleDecl() = false;
eq SampleDecl.isSampleDecl() = true;
syn boolean Decl.sendOnlyFlatSignatures(Java_env env) = (env.version==2006);
eq Decl.getSignature().parentDecl() = this;
eq Signature.getSignatureList().parentDecl() = parentDecl();
inh Decl Signature.parentDecl();
inh Decl SignatureList.parentDecl();
syn nta Signature Decl.getSignature() {
SignatureList sl = new SignatureList();
genSigLineForDecl(sl, true, this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment