Menu ▾ ▴

#233 States are generated as NULL

SMC 7.4.0
closed-fixed
None
9
2022-11-15
2022-11-07
Swathi
No

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

Discussion

  • Charles Rapp

    Charles Rapp - 2022-11-12
     
  • Charles Rapp

    Charles Rapp - 2022-11-12

    Error will be corrected release 7.4.0.

     
  • Charles Rapp

    Charles Rapp - 2022-11-12

    The generated code is working as designed. See net.sf.smc.generator.SmcCppGenerator.java, line 246 - 252:

                // Are exception throws turned on?
                if (mNoExceptionFlag)
                {
                    // Exceptions turned off. Do no set state
                    // name since it will not be used.
                    mTarget.print("NULL, ");
                }
    

    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.

     
  • Charles Rapp

    Charles Rapp - 2022-11-15
    • status: open --> closed-fixed
     
  • Charles Rapp

    Charles Rapp - 2022-11-15

    Corrected in SMC release 7.4.0.

     
  • Charles Rapp

    Charles Rapp - 2022-11-15
    • Group: SMC 7.3.0 --> SMC 7.4.0
     

Log in to post a comment.