Define parsers in JavaScript