Add class definition to grammar