diff --git a/compiler/2014/DeclNames.jrag b/compiler/2014/DeclNames.jrag index c82ad18543e289b87a53da896d23ba87237f742e..3f23cda84e212b723401b4a9cf26576865d82c0d 100644 --- a/compiler/2014/DeclNames.jrag +++ b/compiler/2014/DeclNames.jrag @@ -5,10 +5,10 @@ aspect DeclNames { inh String Field.declName(); eq StructType.getField(int i).declName() = declName(); - //TODO: aspect should be renamed to parent-something + //TODO: aspect should be renamed to parent-something - inh Decl DataType.parentDecl(); - inh Decl Field.parentDecl(); - eq Decl.getTypeInstance().parentDecl() = this; - eq StructType.getField(int i).parentDecl() = parentDecl(); + inh Decl DataType.parentDecl(); + inh Decl Field.parentDecl(); + eq Decl.getTypeInstance().parentDecl() = this; + eq StructType.getField(int i).parentDecl() = parentDecl(); } diff --git a/compiler/2014/LabCommParser.parser b/compiler/2014/LabCommParser.parser index b1252acc99ad701597684181669adffffbe25586..3a5d77423c2b590472ac32e1e6bea35df19cdd1e 100644 --- a/compiler/2014/LabCommParser.parser +++ b/compiler/2014/LabCommParser.parser @@ -61,9 +61,7 @@ TypeInstance type_instance = ; Field var_decl = - type.t IDENTIFIER SEMICOLON {: return new Field(t, IDENTIFIER); :} - | type.t IDENTIFIER dim_list.d SEMICOLON - {: return new Field(new ParseArrayType(t, d), IDENTIFIER); :} + concrete_type.t SEMICOLON {: return new Field(t); :} ; TypeDecl type_decl = diff --git a/lib/java/se/lth/control/labcomm2014/ASTbuilder.java b/lib/java/se/lth/control/labcomm2014/ASTbuilder.java index c21c881c06cd0a6c009dd85fce1deae1fe1f4b0d..dccb39c3c681215433c4f5c3375a81ea7281d80d 100644 --- a/lib/java/se/lth/control/labcomm2014/ASTbuilder.java +++ b/lib/java/se/lth/control/labcomm2014/ASTbuilder.java @@ -52,10 +52,10 @@ public class ASTbuilder implements TypeDefParser.ParsedSymbolVisitor { private void assertStacksEmpty() throws RuntimeException { if(!typeStack.isEmpty()) { - throw new RuntimeException("Error: type stack not empty"); + throw new RuntimeException("Error: type stack not empty"); } if(!fieldStack.isEmpty()) { - throw new RuntimeException("Error: field stack not empty"); + throw new RuntimeException("Error: field stack not empty"); } } @@ -144,7 +144,7 @@ public class ASTbuilder implements TypeDefParser.ParsedSymbolVisitor { throw new RuntimeException("Internal error: parsed labcomm declaration has errors: "+sb.toString()); } } - + public Specification makeSpecification(TypeDefParser.ParsedTypeDef d) { assertStacksEmpty(); List<Decl> ds = new List<Decl>();