To synthesize Python code from the model description, the user may execute the following command:
scc -lpython HelloWorld.des
HelloWorld.py will be generated. The following information is printed on the console:
----- Time spent on compilation: 0.010 (sec) File(s) generated: HelloWorld.py ----- Command to compile the source: (N/A) Command to run the compiled code: python HelloWorld.py -----
This output tells the user that:
python HelloWorld.py
Now execute HelloWorld.py and enter some events in the console:
Hello World Example ['A'] > e ['B'] > exit
When the execution is started, the model description is printed, and a prompt for input appears. The current state of the model is also displayed in the format of Python list. If event e is entered, the model correctly changes to state B. Command exit ends the execution and stops the program.
One may notice that the ``Hello World!'' message was not printed as it was printed in the simulation in SVM. This is because the output of the transition is ignored by SCC, which defaults not to generate any action code for the target code. To synthesize code with support for action code, the user should execute the following command instead:
scc -lpython --ext HelloWorld.des
Again, similar information about the code synthesis is printed on the console:
----- Time spent on compilation: 0.015 (sec) File(s) generated: HelloWorld.py ----- Command to compile the source: (N/A) Command to run the compiled code: python HelloWorld.py -----
Now execute the target code again. The result should look like:
Hello World Example ['A'] > e Hello World! ['B'] > exit
This execution result is exactly the same as simulating the model in SVM:
svm -t HelloWorld.des