Skip to content

Instantly share code, notes, and snippets.

@mlcollard
Created October 6, 2014 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlcollard/cf82db1c795976d38477 to your computer and use it in GitHub Desktop.
Save mlcollard/cf82db1c795976d38477 to your computer and use it in GitHub Desktop.
srcML - Example of libsrcml convenience functions
/*
libsrcml_convenience.cpp
Demonstrates basic use of libsrcml convenience function srcml()
for converting to and from the srcML format
Error handling removed for clarity
*/
#include <srcml.h>
int main() {
// Translate source file main.cpp -> srcML file main.cpp.xml
srcml("main.cpp", "main.cpp.xml");
// Translate srcML file main.cpp.xml -> source file newmain.cpp
srcml("main.cpp.xml", "newmain.cpp");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment