|
NAMEcastxml - C-family Abstract Syntax Tree XML OutputSYNOPSIScastxml ( <castxml-opt> | <clang-opt> | <src> )... DESCRIPTIONParse C-family source files and optionally write a subset of the Abstract Syntax Tree (AST) to a representation in XML.Source files are parsed as complete translation units using an internal Clang compiler. XML output is enabled by the --castxml-output=<v> or --castxml-gccxml option. OPTIONSThe following command-line options are interpreted by castxml. Remaining options are given to the internal Clang compiler.
<cc> names a compiler (e.g. /usr/bin/gcc or cl) and <cc-opt>... specifies options that may affect its target (e.g. -m32). The target platform detected from the given compiler may be overridden by a separate Clang -target option. The language standard level detected from the given compiler may be overridden by a separate Clang -std= option.
OUTPUT FORMAT VERSIONSWith --castxml-output=<v>The XML root element tag will be of the form:<CastXML format="1.0.0">
With --castxml-gccxmlThe XML root element tag will be of the form:<GCC_XML version="0.9.0" cvs_revision="1.139"> The version number corresponds to the last gccxml version that was ever released (for backward compatibility). The cvs_revision number is a running number that is incremented for each minor change in the xml format. PREPROCESSINGCastXML preprocesses source files using an internal Clang compiler using its own predefined macros for the target platform by default. The --castxml-cc-<id> option switches the predefined macros to match those detected from the given compiler command. In either case, CastXML always adds the following predefined macros:
Source files may use these to identify the tool that is actually doing the preprocessing even when --castxml-cc-<id> changes the predefined macros. FAQWhy are C++ function bodies not dumped in XML?This feature has not been implemented because the driving project for which CastXML was written had no need for function bodies.Is there a DTD specifying the XML format dumped?No.Why don't I see templates in the output?This feature has not been implemented because the driving project for which CastXML was written had no need for uninstantiated templates. Template instantiations will still be dumped, though. For example:template <class T> struct foo {}; typedef foo<int>::foo foo_int; will instantiate foo<int>, which will be included in the output. However, there will be no place that explicitly lists the set of types used for the instantiation other than in the name. This is because the proper way to do it is to dump the templates too and reference them from the instantiations with the template arguments listed. Since the features will be linked they should be implemented together. COPYRIGHT2013-2015 Kitware, Inc.
Visit the GSP FreeBSD Man Page Interface. |