Use !define inside a !define macro-function and use definitions in included file

0 votes
asked Mar 8, 2019 in Question / help by StefanDensow (280 points)

Hi all,

I'm constructing sequence diagrams using the preprocessor and macros like this:

!definelong CALL_METHOD(FROM_CLASS, TO_CLASS, FUNC_NAME)
    '!define RETURN FROM_CLASS <-- TO_CLASS
    FROM_CLASS -> TO_CLASS: FUNC_NAME()
    activate TO_CLASS
        !include_many TO_CLASS.iuml!FUNC_NAME
    FROM_CLASS <-- TO_CLASS
    deactivate TO_CLASS
!enddefinelong

I use it like this:

CALL_METHOD(Taxi, Customer, getMoney)

This leads to the inclusion of the block getMoney from the file Customer.iuml at the position of the CALL_METHOD statement.

The second line in the macro (!define RETURN FROM_CLASS <-- TO_CLASS) is supposed to define the string RETURN in a way that it can be used inside the getMoney block, i.e. it should be expanded to FROM_CLASS <-- TO_CLASS and thereby generate an arrow pointing back to the caller (Taxi, in this case).

Is there a way I can make this work? Can I have a nested !define and have it visible in files, that are included in the scope of the CALL_METHOD macro?

Thanks for your help!

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...