[Acceleo] use of macro / let(loop) [message #667644] |
Sat, 30 April 2011 10:21  |
Eclipse User |
|
|
|
Hello,
im trying do use a macro, but it simply wont work.
For Example, the following will return something like
" org.eclipse.emf.ecore.impl.DynamicEObjectImpl@2f1e34 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@167ed25 (name: OclInvalid_Class) (instanceClassName: null) (abstract: false, interface: false)) "
code:
[comment encoding = UTF-8 /]
[module generate('http://www.test.com/test/1.0')/]
[template public generate(aClass : Class)]
[comment @main /]
[test(aClass)/]
[/template]
[macro public test(arg : Class) : String]
[arg.name/]
[/macro]
i'm trying to use macros, so the code of the template gets clearer. What have i done wrong ^^?
Also, im trying to use a let block in a for loop, something like:
for[ aClass : Class | package.eContents(Class)]
[let var: String = aClass.name]
[var/]
[/let]
[/for]
This returns same "error" as above, although all classes have names. If i do aClass.name "manually" it works.
I have a working template to generate vhdl code, but it is really hard to read, since a lot of code is just copy paste of really long expressions. would be nice to be able to tidy up.
Thanks for any help 
greetz
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04252 seconds