Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven Gestegård Robertz
LabComm
Commits
a0dfc2fa
Commit
a0dfc2fa
authored
Mar 28, 2014
by
Sven Gestegård Robertz
Browse files
added names to error messages
parent
121b7a79
Changes
3
Hide whitespace changes
Inline
Side-by-side
compiler/DeclNames.jrag
0 → 100644
View file @
a0dfc2fa
aspect DeclNames {
inh String Type.declName();
eq Decl.getType().declName() = getName();
inh String Field.declName();
eq StructType.getField(int i).declName() = declName();
}
compiler/LabComm.java
View file @
a0dfc2fa
...
...
@@ -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
);
}
}
}
...
...
compiler/TypeCheck.jrag
View file @
a0dfc2fa
...
...
@@ -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");
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment