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

Preliminary refactoring: added annotations to *Decl

parent 7014aa3a
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,9 @@ aspect Annotations {
syn boolean Annotation.isIntention() = false;
eq Intention.isIntention() = true;
inh TypeInstance Annotation.parentInstance();
inh ASTNode Annotation.parentInstance();
eq TypeInstance.getAnnotation(int i).parentInstance() = this;
eq Decl.getAnnotation(int i).parentInstance() = this;
coll Set<Intention> TypeInstance.intentionSet() [new HashSet<Intention>()] with add;
......
Specification ::= Decl*;
abstract Decl ::= TypeInstance /Signature/;
abstract Decl ::= TypeInstance Annotation* /Signature/;
TypeInstance ::= DataType <Name:String> Annotation*;
......
......@@ -82,10 +82,10 @@ Field var_decl =
;
TypeDecl type_decl =
TYPEDEF type_instance.t SEMICOLON {: return new TypeDecl(t); :} ;
annotations.a TYPEDEF type_instance.t SEMICOLON {: return new TypeDecl(t, a); :} ;
SampleDecl sample_decl =
SAMPLE type_instance.t SEMICOLON {: return new SampleDecl(t); :} ;
annotations.a SAMPLE type_instance.t SEMICOLON {: return new SampleDecl(t, a); :} ;
DataType type =
prim_type.p {: return p; :}
......
......@@ -11,4 +11,12 @@ aspect Refactoring {
this(t, n, new List<Annotation>());
System.out.println("WARNING! TypeInstance(DataType, String) ignoring intention list");
}
public TypeDecl.TypeDecl(TypeInstance t) {
this(t, new List<Annotation>());
System.out.println("WARNING! TypeDecl(TypeInstance) ignoring intention list");
}
public SampleDecl.SampleDecl(TypeInstance t) {
this(t, new List<Annotation>());
System.out.println("WARNING! SampleDecl(TypeInstance) ignoring intention list");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment