change file extension to xigua, cleaned up parser.cpp