move parser to C++