A statecharts interpreter and compiler with semantic variability