compiler construction - A proposal to add statemachine support to C++-like language -
As part of my working day recently, I am learning IBM Rapsidi and it is from UML to C ++ I'm using to create code.
Tomorrow it hit me that it would be good to think about adding state machine support to my C ++ compiler, so I put some notes here:
To do this My motives for this are:
- It seems like a calm idea.
- The compiler may do better semantic probes (with better error checking) than the current concept / general C ++ compiler.
- There are several customizable possibilities available when the compiler understands the state machine structure itself.
I can try to increase my grammar by leaving something like motion to see how well it works.
What is your opinion about the proposal? Is it readable? Does it seem worthwhile?
Edit:
Thank you for the answers that recommended specific libraries to the state machines, but this was not my question. I have applied several state machines, which I have written. And both are using libraries and codes.
I was really looking for ideas, criticisms, etc. about the design of a state machine extension for language like C ++. Think about this change as a domain specific extension about whether this change would be appropriate for the addition of standard C ++, where my My Domain is a real-time control application.
I have started implementing the extension in my compiler as described here:
So far the proposal to implement the concept has not changed much, but some changes in the details And I am refining my understanding of the words of the problem.
The time indicates whether the whole concept has any value, though. ; -)
With a few exceptions, C ++ has traditionally been extended using class libraries That is, new keyword state machines can be easily implemented using such libraries, so I do not think there is a lot of chance in your proposal.
One problem I see in my proposal is to go to another state, 'Goto' What if I want to use goto in my code within the state's transition?
Comments
Post a Comment