Implement a constructor and modify the way grammars are held by CFSM.