Rewrite ebnf parser using FS machine