add type declaration to grammar reader