Code2Code.net: XML Parser web service

>Home   >Docs

What the web service do?

This web service parses C++ code (passed in as a string), and returns a code DOM object (e.g. function containing statements, statements in turn contain expressions). The web service will produce very bad results for template classes and template functions.

What does the XML output look like?

The output is a <CompileRun> object.
Nested inside that are top level objects, e.g.
  • Class
  • Enum
  • Struct
  • Union
  • Namespace
  • VariableDecl
  • TypeDef
  • FunctionDecl
  • Function
  • Define
Inside a function, you have statements.
Inside a statement, there are expressions.

Perhaps the best way to understand is to examime a sample XML document:
Click here for XML output of the sample below.

For more specific questions, consider downloading the sample code and examining source code of the 'c_DOM' project.

URL of the web service

The URL of the web service is http://code2code.net/WebService.asmx
The corresponding WSDL file is here.

Discussion thread for XML format

Comments, suggestions?
Please post your comments in the XML thread.

Sample code in C#

This sample searches the C++ source code for cast expressions.
You can download the entire source code here: code2code_ws_sample.tar.bz2 (BZIP2 format)

Output

This sample produces the following output:
Found a cast expression [B]:ExprCast
Found a cast expression [A]:ExprCast