fix statemachine to basec codegen for new declaration syntax