jp-embedded / scxmlcc

The SCXML state machine to C++ compiler
GNU General Public License v3.0
136 stars 34 forks source link

LCA? #44

Open ringlej opened 6 years ago

ringlej commented 6 years ago

In the README.md, you mention LCA:

LCA calculation is done (mostly) compile time.

I've been trying to figure out what is meant by LCA... Do you mean LCCA (Least Common Compound Ancestor) that is mentioned in https://www.w3.org/TR/scxml/#LCCA ?

jp-embedded commented 6 years ago

Yes, LCA in hierarchical state machines is the Least Common Ancestor which is called LCCA in scxml. But since LCA is always a compound state they are the same.

It is my intention describe this in more detail in the documentation. So it's fine you have opened an issue on this. I will try to prioritize it.

Basically, the LCA is needed when a transition is made. Then the exit action must be called on all states from the transitions source state and up to LCA and all enter actions must be called from the transitions destination state and up to LCA (in reverse order). This is actually possible to to compile time, so there is no code logic added to calculate this in the generated state machines.