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

added empty intention list to type expressions

parent ad8d7fda
Branches
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ Specification ::= Decl*;
abstract Decl ::= TypeInstance /Signature/;
TypeInstance ::= DataType <Name:String>;
TypeInstance ::= DataType <Name:String> Intention*;
TypeDecl : Decl;
SampleDecl : Decl;
......@@ -29,6 +29,9 @@ UserType : DataType ::= <Name:String>;
StructType : DataType ::= Field*;
ParseArrayType : DataType ::= DataType Dim*;
abstract ArrayType : DataType ::= DataType Exp*;
Intention ::= <Key:String> <Value:String>;
VariableArrayType : ArrayType;
FixedArrayType : ArrayType;
......
......@@ -54,14 +54,16 @@ List var_decl_list =
| var_decl_list.l var_decl.v {: return l.add(v); :}
;
List intentions = {: return new List(); :}
TypeInstance type_instance =
type.t IDENTIFIER {: return new TypeInstance(t, IDENTIFIER); :}
| type.t IDENTIFIER dim_list.d
{: return new TypeInstance(new ParseArrayType(t, d), IDENTIFIER); :}
intentions.i type.t IDENTIFIER {: return new TypeInstance(t, IDENTIFIER, i); :}
| intentions.i type.t IDENTIFIER dim_list.d
{: return new TypeInstance(new ParseArrayType(t, d), IDENTIFIER, i); :}
;
Field var_decl =
concrete_type.t SEMICOLON {: return new Field(t); :}
type_instance.t SEMICOLON {: return new Field(t); :}
;
TypeDecl type_decl =
......
......@@ -4,6 +4,11 @@ aspect Refactoring {
syn DataType Decl.getDataType() = getTypeInstance().getDataType();
public Field.Field(TypeInstance t) {
this(t.getDataType(), t.getName());
this(t.getDataType(), t.getName(), t.getAnnotationList());
}
public TypeInstance.TypeInstance(DataType t, String n) {
this(t, n, new List<Annotation>());
System.out.println("WARNING! TypeInstance(DataType, String) ignoring intention list");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment