Finally converted the parser to javascript.