Converted TM grammar to NDF.