Skip to content
Snippets Groups Projects
Commit 9308d174 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Added workarounds for JavaCC-related bugs in latest JastAdd.

parent 406f14dc
No related branches found
No related tags found
No related merge requests found
/* -*-Java-*- */
/*
* Copyright (C) 2007 Anders Nilsson <anders.nilsson@cs.lth.se>
*
* This file is part of XmlSchemaCompiler.
*/
aspect Fixes {
int ASTNode.numChildren;
int ASTNode.numChildren() {return jjtGetNumChildren();}
int List.getNumNoTransformChild() {return getNumChildNoTransform();}
int Opt.getNumChildNoTransfrom() {return getNumChildNoTransform();}
}
\ No newline at end of file
......@@ -40,6 +40,8 @@ aspect MergeActors {
}
i.merge(i.next);
i.setName(i.name()+"_"+i.next.name());
i.next.remove_me = true;
i.next.is$Final(false);
i.next = i.next.next;
}
}
......@@ -73,11 +75,16 @@ aspect Misc {
}
aspect Rewrites {
boolean Connection.remove_me = false;
boolean ComplexElement.remove_me = false;
rewrite Connection {
when (remove_me) to ComplexElement {
return new ComplexElement();
}
}
rewrite Instance
when (remove_me) to ComplexElement {
return new ComplexElement();
}
}
}
\ No newline at end of file
/* -*-Java-*- */
/*
* Copyright (C) 2009 Anders Nilsson <anders.nilsson@cs.lth.se>
*
* This file is part of Actors model compiler.
*/
import java.util.HashSet;
aspect Merge {
public void design.merge(design dest) {
HashSet<operation> ops = getOperations(new HashSet<operation>());
for (Element e : getElements()) {
if (e.isAction()) {
for (operation o : ops) {
((module) e).addElement(o);
}
}
}
}
}
aspect Operations {
syn HashSet<operation> Element.getOperations(HashSet<operation> ops) = ops;
eq ComplexElement.getOperations(HashSet<operation> ops) {
for (Element e : getElements()) {
ops = e.getOperations(ops);
}
return ops;
}
eq operation.getOperations(HashSet<operation> ops) {
ops.add(this);
return ops;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment