migrate to C++ scanner and parser