|
|
Re: [Acceleo] More inheritance bugs? [message #642497 is a reply to message #642387] |
Wed, 01 December 2010 15:33 |
Glenview Jeff Messages: 79 Registered: September 2010 |
Member |
|
|
Here's a boiled down version of the code. The generated code for edit gets the same execute body as the code for delete. Delete generates correctly. A workaround would be greatly appreciated.
[module main()/]
[template public mainTop(anItem : Item)]
[comment @main /]
[for (aDelete : Delete | anItem.menu.items->select(oclIsKindOf(Delete)))]
[aDelete.Delete(anItem)/]
[/for]
[for (anEdit : Edit | anItem.menu.items->select(oclIsKindOf(Edit)))]
[anEdit.Edit(anItem)/]
[/for]
[/template]
[module Edit() extends MenuItemTemplate /]
[template public menuItemExecuteBody(anItem : Item) overrides menuItemExecuteBody]
anItem.execute1(anItem.execute1);
[/template]
[template public Edit(e : Edit, anItem : Item)]
[file ('/src/com/xyz/menuitems/'.concat(e.name.toUpperFirst().concat('.java')), false, 'Cp1252')]
[menuItemMain(e,anItem)/]
[/file]
[/template]
[module Delete() extends MenuItemTemplate/]
[template public Delete(d : Delete, anItem : Item)]
[file ('/src/com/xyz/menuitems/'.concat(d.name.toUpperFirst().concat('.java')), false, 'Cp1252')]
[menuItemMain(d,anItem)/]
[/file]
[/template]
[template public menuItemExecuteBody(anItem : Item) overrides menuItemExecuteBody]
execute2(an[anItem.name.toUpperFirst()/])
[/template]
[module MenuItemTemplate()/]
[template public menuItemTemplate(m : Item, anItem : Item)]
[menuItemMain(m, anItem)/]
[/template]
[template public menuItemMain(m : Item, anItem : Item)]
[menuItemPackage(anItem)/]
[menuItemImports(anItem)/]
[menuItemClass(m, anItem)/]
[/template]
[template public menuItemClass(m : Item, anItem : Item)]
public class [m.name.toUpperFirst()/] implements MenuItem {
[menuItemExecuteMethod(anItem)/]
}
[/template]
[template public menuItemPackage(anItem : Item)]
package com.xyz.[anItem.name.toLower()/].menuitems;
[/template]
[template public menuItemImports(anItem : Item)]
import com.xyz.[anItem.name.toLower()/].[anItem.name.toUpperFirst()/];
[/template]
[template public menuItemExecuteMethod(anItem : Item)]
public void execute(final [anItem.name.toUpperFirst()/] an[anItem.name.toUpperFirst()/]) {
[menuItemExecuteBody()/]
}
[/template]
[template public menuItemExecuteBody(anItem : Item)]
error: unimplemented (by the way Acceleo team, it would be nice if there were language support for erroring here with an abstract keyword.)
[/template]
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03571 seconds