Commit a0dfc2fa authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

added names to error messages

parent 121b7a79
aspect DeclNames {
inh String Type.declName();
eq Decl.getType().declName() = getName();
inh String Field.declName();
eq StructType.getField(int i).declName() = declName();
}
......@@ -249,6 +249,10 @@ public class LabComm {
if (prettyOnStdout) {
ast.pp(System.out);
}
} else {
// Catch-all for compilation errors
System.err.println("Error in specification");
System.exit(3);
}
}
}
......
......@@ -18,19 +18,19 @@ aspect TypeCheck {
public void Field.nullTypeCheck() {
if(getType().isNull()) {
error("field " + getName() + " may not be of type void");
error("field " + getName() + " of struct "+ declName()+ " may not be of type void");
}
}
public void ParseArrayType.nullTypeCheck() {
if(getType().isNull()) {
error("array elements may not be of type void");
error("elements of array "+declName()+" may not be of type void");
}
}
public void ArrayType.nullTypeCheck() {
if(getType().isNull()) {
error("array elements may not be of type void");
error("elements of array "+declName()+" may not be of type void");
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment