States are generated as NULL
Translates state machine into a target programming language.
Brought to you by:
cwrapp
We are currently using smc 6.6.0.
Using the latest SMC 7.3.0 version bin/Smc.jar file and the command,
"java -jar smc/bin/Smc.jar -c++ -noex sample.sm"
the sample_sm.cpp file is generating but the state names are generated as NULL as below,
XXXFsm_Start XXXFsm::Start(NULL, 0);
XXXFsm_State XXXFsm::State(NULL, 1);
Is there anything else to modify in the above command while using the smc.jar file from 7.3.0 version to get the correct .cpp files?
Is this the correct way to follow to generate .cpp files using the SMC 7.3.0?
Thank you in advance.
Regards,
Swathi
Error will be corrected release 7.4.0.
The generated code is working as designed. See net.sf.smc.generator.SmcCppGenerator.java, line 246 - 252:
Source code comments explain why the state name is set to NULL. Therefore SMC generator is working as designed. Note that the SMC library does not leave the state name value as NULL but sets it to "NAME NOT SET".
That said, a state name is still needed for I/O streams and debug tracing. Since either I/O streams or TRACE is called in statemap.h and both access State::getName(), there is always a need to define the state name. This will be done in SMC 7.4.0.
Corrected in SMC release 7.4.0.