Xtext 2.7
pulled out common logic into statemachine API