Macros in generator aspect
Hello forum!
I have a question regarding macros in the generator aspect in use with macros. I want to explain my problem with a simple example.
The class diagram looks like this:
Calls -> <<abstract>> -> FamilyCalls -> CallFromFather, CallFromMother, CallFromChild...
My code looks like this:
Unfortunately, I'm not able to add a new tag or macro after </callFather>, although I've tried several short-cuts.
Is it possible to achieve something like this in the generator of my language?
Thanks!
Kind regards
msch95
I have a question regarding macros in the generator aspect in use with macros. I want to explain my problem with a simple example.
The class diagram looks like this:
Calls -> <<abstract>> -> FamilyCalls -> CallFromFather, CallFromMother, CallFromChild...
My code looks like this:
<calls> $LOOP$$IF$<callFather>$name</callFather> </calls>
Unfortunately, I'm not able to add a new tag or macro after </callFather>, although I've tried several short-cuts.
Is it possible to achieve something like this in the generator of my language?
if(node.isConcept(callFather) then <callFather>Chuck</callFather> else if (node.isConcept(callMother) then <callMother>Alice</callFMother> else if ...
Thanks!
Kind regards
msch95
Please sign in to leave a comment.
to me this looks like you should be using the $COPY_SRC$ macro inside the LOOP instead and have reduction rules defined for different types of calls. A SWITCH macro might also work, I think.
Vaclav