Hierarchical and Recursive State Machines with Context-Dependent Properties