itemisCREATE / statecharts

YAKINDU Statechart Tools (http://www.statecharts.org)
Eclipse Public License 1.0
174 stars 84 forks source link

Iface names are missing using feature IdentifierSettings #3146

Closed rherrmannr closed 4 years ago

rherrmannr commented 4 years ago

By using the IdentifierSettings feature, the iface names disappear in the generated C code. Operations are affected.

Define an interface like this:

interface named:
operation someOp()

results the following prototype in the required header:

extern void myXsmIfaceNamed_someOp(const MyXsm* handle);

Turning on the IdentifierSettings feature like this:

GeneratorModel for yakindu::c {

    statechart myXsm {

        feature Outlet {
            targetProject = "test"
            targetFolder = "src-gen"
            libraryTargetFolder = "src"
        }

        feature IdentifierSettings {
            moduleName = "MyXsm_SM"
            statemachinePrefix = "MyXsm_SM"
            separator = "_"
        }
    }
}

results this function prototype:

extern void MyXsm_SM_someOp(const MyXsm_SM* handle);

where the name of the iface named is missing.

However, by defining an operation with the same name in another unnamed iface like this:

interface:
operation someOp()
interface named:
operation someOp()

results:

extern void myXsmIface_someOp(const MyXsm* handle);

extern void myXsmIfaceNamed_someOp(const MyXsm* handle);

The generated functions should "stable" and not change by adding operations in different interfaces.

rherrmannr commented 4 years ago

This was introduced with https://github.com/Yakindu/statecharts/issues/1239

The easiest way is always using the iface name. Thus, there will be no duplicate names.