added codegen.cpp and updated grammar for xml parser