Menu

#75 better target language support for transition guards

None
wont-fix
5
2021-01-01
2010-11-12
Anonymous
No

I am new to SMC. For a new project I need to implement a state machine, and after reading the SMC documentation I think the SMC compiler is an excellent tool for this purpose.
But there is a problem: I need to use several target languages for the same state machine (currently Java, Objective-C, supposably C++ at a later time).
Because the transition guards must contain a condition that a is valid target source code, I have to maintain an own sm-file for each target language, which is time-consuming and error-prone.
I would like to have a more sophisticated target language support for the guards, but I also understand that due to the broad range of target language syntax, this is difficult to realize.
One improvment could be to prefix the condition with an optional target language specifier. That way the conditions for all target languages could be written below each other. That would at least reduce the error-proness, because there would be only one sm-file for all target languages, which would it make easier to keep all target language version up to date.

Example:

Transition
java [ java-syntax condition ]
objc [ obejctive-c syntax condition ]
c++ [ c++-syntax condition ]

NextState
{
Action()
}

Discussion

  • Francois Perrad

    Francois Perrad - 2010-11-26

    Having a single source is a good goal.

    You could achieve it, with a filter or preprocessor which transforms your syntax with multi-language guard into a set of regular SMC source (one for each target language)

     
  • Charles Rapp

    Charles Rapp - 2021-01-01
    • status: open --> wont-fix
    • assigned_to: Charles Rapp
    • Group: -->
     

Log in to post a comment.