finish core: convert grammar to XRegExp