- changed component to code generation
Collection attribute contributions on ASTNode yield broken Java code
If an equation for a collection attribute is given for ASTNode
, malformed Java code is generated.
Example: Generic error handling support
coll java.util.List<ASTNode> ErrorBuilder.ErrorNodes()
[new java.util.LinkedList<ASTNode>()] with add;
ASTNode contributes this when IsErrorNode() to ErrorBuilder.ErrorNodes()
for ErrorBuilder();
IsErrorNode()
decides for each node if it has errors and ErrorBuilder()
is an inherited attribute distributing an unique ErrorBuilder
node.
JastAdd generates the following code in ASTNode
:
protected void contributeTo_ErrorBuilder_ErrorBuilder_ErrorNodes(java.util.List<ASTNode> collection) {
super.contributeTo_ErrorBuilder_ErrorBuilder_ErrorNodes(collection);
if (IsErrorNode())
collection.add(this);
}
Obviously, the super
call is invalid. ASTNode
has no super class with a super.contributeTo_ErrorBuilder_ErrorBuilder_ErrorNodes
method.
Comments (7)
-
reporter -
reporter - edited description
-
Thank you for reporting the issue! The JastAdd regression tests did not have anything covering this yet!
I probably caused this error because I was changing collection code generation recently.
-
-
assigned issue to
Assigned myself.
-
assigned issue to
-
- changed status to resolved
-
reporter Hi Jesper,
thanks a lot!
Is there a way to get the most recent jar without building on my own?
Best Regards, Christoff
-
If you have an account on our Jenkins instance you can get the latest build here: http://jasttest.cs.lth.se:8080/job/JastAdd2/lastSuccessfulBuild/artifact/jastadd2.jar
- Log in to comment