Grammar writer for new PMCFG format