gccxml_gem 0.9-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. data/Rakefile +75 -0
  2. data/bin/gccxml +0 -0
  3. data/bin/gccxml_cc1plus +0 -0
  4. data/gccxml.rb +50 -0
  5. data/share/doc/gccxml-0.9/Copyright.txt +55 -0
  6. data/share/doc/gccxml-0.9/gccxml.html +168 -0
  7. data/share/doc/gccxml-0.9/gccxml.txt +293 -0
  8. data/share/gccxml-0.9/GCC/2.95/algorithm +76 -0
  9. data/share/gccxml-0.9/GCC/2.95/bitset +17 -0
  10. data/share/gccxml-0.9/GCC/2.95/cctype +24 -0
  11. data/share/gccxml-0.9/GCC/2.95/clocale +14 -0
  12. data/share/gccxml-0.9/GCC/2.95/cmath +33 -0
  13. data/share/gccxml-0.9/GCC/2.95/complex +38 -0
  14. data/share/gccxml-0.9/GCC/2.95/csetjmp +13 -0
  15. data/share/gccxml-0.9/GCC/2.95/csignal +14 -0
  16. data/share/gccxml-0.9/GCC/2.95/cstdarg +12 -0
  17. data/share/gccxml-0.9/GCC/2.95/cstddef +13 -0
  18. data/share/gccxml-0.9/GCC/2.95/cstdio +55 -0
  19. data/share/gccxml-0.9/GCC/2.95/cstdlib +66 -0
  20. data/share/gccxml-0.9/GCC/2.95/cstring +34 -0
  21. data/share/gccxml-0.9/GCC/2.95/ctime +24 -0
  22. data/share/gccxml-0.9/GCC/2.95/cwchar +65 -0
  23. data/share/gccxml-0.9/GCC/2.95/cwctype +31 -0
  24. data/share/gccxml-0.9/GCC/2.95/deque +19 -0
  25. data/share/gccxml-0.9/GCC/2.95/exception +20 -0
  26. data/share/gccxml-0.9/GCC/2.95/fstream +23 -0
  27. data/share/gccxml-0.9/GCC/2.95/functional +64 -0
  28. data/share/gccxml-0.9/GCC/2.95/gccxml_bitset +1066 -0
  29. data/share/gccxml-0.9/GCC/2.95/iomanip +20 -0
  30. data/share/gccxml-0.9/GCC/2.95/iosfwd +20 -0
  31. data/share/gccxml-0.9/GCC/2.95/iostream +27 -0
  32. data/share/gccxml-0.9/GCC/2.95/iterator +39 -0
  33. data/share/gccxml-0.9/GCC/2.95/list +19 -0
  34. data/share/gccxml-0.9/GCC/2.95/map +20 -0
  35. data/share/gccxml-0.9/GCC/2.95/memory +21 -0
  36. data/share/gccxml-0.9/GCC/2.95/new +13 -0
  37. data/share/gccxml-0.9/GCC/2.95/numeric +15 -0
  38. data/share/gccxml-0.9/GCC/2.95/pthread.h +16 -0
  39. data/share/gccxml-0.9/GCC/2.95/queue +20 -0
  40. data/share/gccxml-0.9/GCC/2.95/set +20 -0
  41. data/share/gccxml-0.9/GCC/2.95/sstream +24 -0
  42. data/share/gccxml-0.9/GCC/2.95/stack +19 -0
  43. data/share/gccxml-0.9/GCC/2.95/std/bastring.cc +524 -0
  44. data/share/gccxml-0.9/GCC/2.95/std/complext.h +397 -0
  45. data/share/gccxml-0.9/GCC/2.95/std/dcomplex.h +92 -0
  46. data/share/gccxml-0.9/GCC/2.95/std/fcomplex.h +88 -0
  47. data/share/gccxml-0.9/GCC/2.95/std/gslice_array.h +170 -0
  48. data/share/gccxml-0.9/GCC/2.95/std/indirect_array.h +157 -0
  49. data/share/gccxml-0.9/GCC/2.95/std/ldcomplex.h +96 -0
  50. data/share/gccxml-0.9/GCC/2.95/std/mask_array.h +154 -0
  51. data/share/gccxml-0.9/GCC/2.95/std/slice_array.h +156 -0
  52. data/share/gccxml-0.9/GCC/2.95/std/std_valarray.h +728 -0
  53. data/share/gccxml-0.9/GCC/2.95/std/straits.h +162 -0
  54. data/share/gccxml-0.9/GCC/2.95/std/valarray_meta.h +1035 -0
  55. data/share/gccxml-0.9/GCC/2.95/stdexcept +17 -0
  56. data/share/gccxml-0.9/GCC/2.95/stl_alloc.h +1057 -0
  57. data/share/gccxml-0.9/GCC/2.95/stl_bvector.h +836 -0
  58. data/share/gccxml-0.9/GCC/2.95/stl_deque.h +1699 -0
  59. data/share/gccxml-0.9/GCC/2.95/stl_list.h +843 -0
  60. data/share/gccxml-0.9/GCC/2.95/stl_tree.h +1331 -0
  61. data/share/gccxml-0.9/GCC/2.95/stl_vector.h +828 -0
  62. data/share/gccxml-0.9/GCC/2.95/string +26 -0
  63. data/share/gccxml-0.9/GCC/2.95/strstream +23 -0
  64. data/share/gccxml-0.9/GCC/2.95/typeinfo +11 -0
  65. data/share/gccxml-0.9/GCC/2.95/utility +25 -0
  66. data/share/gccxml-0.9/GCC/2.95/valarray +52 -0
  67. data/share/gccxml-0.9/GCC/2.95/vector +19 -0
  68. data/share/gccxml-0.9/GCC/2.96/sstream +305 -0
  69. data/share/gccxml-0.9/GCC/3.0/pthread.h +16 -0
  70. data/share/gccxml-0.9/GCC/3.1/pthread.h +16 -0
  71. data/share/gccxml-0.9/GCC/3.2/bits/fstream.tcc +500 -0
  72. data/share/gccxml-0.9/GCC/3.2/bits/istream.tcc +1207 -0
  73. data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.h +1810 -0
  74. data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.tcc +2397 -0
  75. data/share/gccxml-0.9/GCC/3.2/bits/messages_members.h +108 -0
  76. data/share/gccxml-0.9/GCC/3.2/bits/ostream.tcc +713 -0
  77. data/share/gccxml-0.9/GCC/3.2/bits/sstream.tcc +241 -0
  78. data/share/gccxml-0.9/GCC/3.2/bits/stl_deque.h +1682 -0
  79. data/share/gccxml-0.9/GCC/3.2/bits/stl_list.h +989 -0
  80. data/share/gccxml-0.9/GCC/3.2/bits/stl_tree.h +1462 -0
  81. data/share/gccxml-0.9/GCC/3.2/bits/stl_vector.h +1085 -0
  82. data/share/gccxml-0.9/GCC/3.2/bits/valarray_meta.h +1063 -0
  83. data/share/gccxml-0.9/GCC/3.2/fstream +579 -0
  84. data/share/gccxml-0.9/GCC/3.2/pthread.h +16 -0
  85. data/share/gccxml-0.9/GCC/3.2/sstream +384 -0
  86. data/share/gccxml-0.9/GCC/3.3/bits/fstream.tcc +530 -0
  87. data/share/gccxml-0.9/GCC/3.3/bits/list.tcc +378 -0
  88. data/share/gccxml-0.9/GCC/3.3/bits/locale_facets.h +2050 -0
  89. data/share/gccxml-0.9/GCC/3.3/bits/messages_members.h +108 -0
  90. data/share/gccxml-0.9/GCC/3.3/bits/sstream.tcc +243 -0
  91. data/share/gccxml-0.9/GCC/3.3/bits/stl_deque.h +1603 -0
  92. data/share/gccxml-0.9/GCC/3.3/bits/stl_list.h +1167 -0
  93. data/share/gccxml-0.9/GCC/3.3/bits/stl_tree.h +1462 -0
  94. data/share/gccxml-0.9/GCC/3.3/bits/stl_vector.h +992 -0
  95. data/share/gccxml-0.9/GCC/3.3/bits/valarray_meta.h +1135 -0
  96. data/share/gccxml-0.9/GCC/3.3/fstream +842 -0
  97. data/share/gccxml-0.9/GCC/3.3/gccxml_builtins.h +22 -0
  98. data/share/gccxml-0.9/GCC/3.3/sstream +638 -0
  99. data/share/gccxml-0.9/GCC/3.4/gccxml_builtins.h +91 -0
  100. data/share/gccxml-0.9/GCC/4.0/gccxml_builtins.h +128 -0
  101. data/share/gccxml-0.9/GCC/4.1/bits/gthr-default.h +618 -0
  102. data/share/gccxml-0.9/GCC/4.1/gccxml_builtins.h +131 -0
  103. data/share/gccxml-0.9/GCC/4.2/gccxml_builtins.h +131 -0
  104. data/share/gccxml-0.9/GCC/find_flags +105 -0
  105. data/share/gccxml-0.9/Intel/find_flags +56 -0
  106. data/share/gccxml-0.9/Intel/pthread.h +16 -0
  107. data/share/gccxml-0.9/MIPSpro/7.3/exception +9 -0
  108. data/share/gccxml-0.9/MIPSpro/7.3/gccxml_mpro_internals.h +21 -0
  109. data/share/gccxml-0.9/MIPSpro/7.3/iomanip +161 -0
  110. data/share/gccxml-0.9/MIPSpro/7.3/ostream +9 -0
  111. data/share/gccxml-0.9/MIPSpro/7.3/stddef.h +9 -0
  112. data/share/gccxml-0.9/MIPSpro/7.3/stl_config.h +9 -0
  113. data/share/gccxml-0.9/MIPSpro/7.3/stl_locale.h +17 -0
  114. data/share/gccxml-0.9/MIPSpro/7.3/stl_monetary.h +14 -0
  115. data/share/gccxml-0.9/MIPSpro/7.3/stl_numeric_facets.h +13 -0
  116. data/share/gccxml-0.9/MIPSpro/7.3/stl_threads.h +11 -0
  117. data/share/gccxml-0.9/MIPSpro/7.3/string +18 -0
  118. data/share/gccxml-0.9/MIPSpro/find_flags +137 -0
  119. data/share/gccxml-0.9/Sun/5.8/adaptation.patch +168 -0
  120. data/share/gccxml-0.9/Sun/README +8 -0
  121. data/share/gccxml-0.9/Sun/adapt_headers.sh +24 -0
  122. data/share/gccxml-0.9/Sun/find_flags +69 -0
  123. data/share/gccxml-0.9/gccxml_config +2 -0
  124. data/share/gccxml-0.9/gccxml_find_flags +93 -0
  125. data/share/man/man1/gccxml.1 +246 -0
  126. metadata +204 -0
data/Rakefile ADDED
@@ -0,0 +1,75 @@
1
+ require 'rake/testtask'
2
+ require 'rake/rdoctask'
3
+ require 'rake/gempackagetask'
4
+
5
+ PROJECT_NAME = "gccxml_gem"
6
+ GCCXML_VERSION = "0.9"
7
+ RUBYFORGE_USERNAME = "jameskilton"
8
+
9
+ desc "Build gccxml for this system"
10
+ task :build_gccxml => [:clean, :unpack, :build, :install]
11
+
12
+ task :unpack do
13
+ cd "ext" do
14
+ sh "tar xzvf gccxml.tar.gz"
15
+ mkdir "gccxml-build"
16
+ end
17
+ end
18
+
19
+ task :build do
20
+ install_path = File.expand_path(File.dirname(__FILE__))
21
+ cd "ext/gccxml-build" do
22
+ sh "cmake -DCMAKE_INSTALL_PREFIX:PATH=#{install_path} ../gccxml"
23
+ sh "make"
24
+ end
25
+ end
26
+
27
+ task :install do
28
+ cd "ext/gccxml-build" do
29
+ sh "make install"
30
+ end
31
+
32
+ sh "chmod a+x bin/*"
33
+ sh "chmod -R a+rx share/"
34
+ end
35
+
36
+ desc "Clean up everything"
37
+ task :clean => [:clobber] do
38
+ rm_rf "ext/gccxml"
39
+ rm_rf "ext/gccxml-build"
40
+ rm_rf "bin"
41
+ rm_rf "share"
42
+ end
43
+
44
+ spec = Gem::Specification.new do |s|
45
+ s.platform = Gem::Platform::CURRENT
46
+ s.name = PROJECT_NAME
47
+ s.version = GCCXML_VERSION
48
+ s.summary = 'Easy install for GCCXML'
49
+ s.homepage = 'http://rbplusplus.rubyforge.org/'
50
+ s.rubyforge_project = "rbplusplus"
51
+ s.author = 'Jason Roelofs'
52
+ s.email = 'jameskilton@gmail.com'
53
+
54
+ s.description = <<-END
55
+ Because GCCXML is difficult to install on all platforms,
56
+ this binary gem is provided for ease of installing
57
+ and using RbGCCXML.
58
+ END
59
+
60
+ patterns = [
61
+ 'Rakefile',
62
+ '*.rb',
63
+ 'bin/*',
64
+ 'share/**/*'
65
+ ]
66
+
67
+ s.files = patterns.map {|p| Dir.glob(p) }.flatten
68
+
69
+ s.require_paths = ['.']
70
+ end
71
+
72
+ Rake::GemPackageTask.new(spec) do |pkg|
73
+ pkg.need_zip = true
74
+ pkg.need_tar = true
75
+ end
data/bin/gccxml ADDED
Binary file
Binary file
data/gccxml.rb ADDED
@@ -0,0 +1,50 @@
1
+ require 'rbconfig'
2
+
3
+ # This class takes care of finding and actually calling the gccxml executable,
4
+ # setting up certain use flags according to what was specified.
5
+ class GCCXML
6
+
7
+ def initialize()
8
+ @exe = find_exe.strip.chomp
9
+ @includes = []
10
+ end
11
+
12
+ # Add an include path for parsing
13
+ def add_include(path)
14
+ @includes << path
15
+ end
16
+
17
+ # Run gccxml on the header file(s), sending the output to the passed in
18
+ # file.
19
+ def parse(header_file, to_file)
20
+ includes = @includes.flatten.uniq.map {|i| "-I#{i.chomp}"}.join(" ").chomp
21
+ cmd = "#{@exe} #{includes} #{header_file} -fxml=#{to_file}"
22
+ system(cmd)
23
+ end
24
+
25
+ private
26
+
27
+ def find_exe
28
+ ext = if PLATFORM =~ /mswin/
29
+ ".exe"
30
+ else
31
+ ""
32
+ end
33
+
34
+ path = File.expand_path(File.join(File.dirname(__FILE__), "bin", "gccxml#{ext}"))
35
+ path.chomp!
36
+
37
+ if `#{path} --version 2>&1` !~ /GCC-XML/
38
+ if File.exists?(path)
39
+ # This is the Rubygems <= 1.1.1 bug of not setting file attributes properly
40
+ dir = File.expand_path(File.dirname(__FILE__))
41
+ raise "Unable to execute gccxml. Please run 'sudo chmod -R a+x #{dir}'"
42
+ else
43
+ raise "Unable to find gccxml executable: #{path}"
44
+ end
45
+ end
46
+
47
+ path
48
+ end
49
+
50
+ end
@@ -0,0 +1,55 @@
1
+ GCC-XML - XML output for GCC
2
+
3
+ Copyright (c) 2002-2007 Kitware, Inc., Insight Consortium
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice,
9
+ this list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ * The names of Kitware, Inc., the Insight Consortium, or the names of any
16
+ consortium members, or of any contributors, may not be used to endorse or
17
+ promote products derived from this software without specific prior written
18
+ permission.
19
+
20
+ * Modified source versions must be plainly marked as such, and must not be
21
+ misrepresented as being the original software.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
24
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
27
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+
34
+ ------------------------------------------------------------
35
+
36
+ gccxml_cc1plus - A GCC parser patched for XML dumps of translation units
37
+
38
+ Copyright (c) 2002-2007 Kitware, Inc., Insight Consortium
39
+
40
+ This program is free software; you can redistribute it and/or modify it under
41
+ the terms of the GNU General Public License as published by the Free Software
42
+ Foundation; either version 2 of the License, or (at your option) any later
43
+ version.
44
+
45
+ This program is distributed in the hope that it will be useful, but WITHOUT
46
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
47
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
48
+ details.
49
+
50
+ You should have received a copy of the GNU General Public License along with
51
+ this program; if not, write to the
52
+ Free Software Foundation, Inc.
53
+ 51 Franklin Street, Fifth Floor
54
+ Boston, MA 02110-1301 USA
55
+
@@ -0,0 +1,168 @@
1
+ <html>
2
+ <body>
3
+ <h2>How to Run GCC-XML</h2>
4
+ <blockquote><code>
5
+ gccxml [options] &lt;input-file&gt; -fxml=&lt;output-file&gt;
6
+ </code></blockquote>
7
+ GCC-XML parses a C++ source file as it is seen by the compiler when it is built. An easy-to-parse XML representation of the class, function, and namespace declarations is dumped to a specified file. Full C preprocessing transforms the file into a C++ translation unit as seen by the compiler. This means that GCC-XML should make use of the same standard library and other header files as the compiler. GCC-XML can be configured to simulate any of several popular compilers.
8
+ <h2>Command-line Options</h2>
9
+ The following options are available for running GCC-XML:
10
+ <ul>
11
+ <li>
12
+ <b><code>--copyright</code></b>: Print the GCC-XML copyright and exit.
13
+ </li>
14
+ <li>
15
+ <b><code>--debug</code></b>: Print extra debugging information. This option causes GCC-XML to print the executable name and command-line arguments used to execute the patched GCC C++ parser. This is useful when attempting to simulate an unsupported compiler.
16
+ </li>
17
+ <li>
18
+ <b><code>-fxml=&lt;output-file&gt;</code></b>: Specify the XML output file. This option is passed directly on to the patched GCC C++ parser. It enables the XML dump and specifies the output file name.
19
+ </li>
20
+ <li>
21
+ <b><code>-fxml-start=&lt;xxx&gt;[,...]</code></b>: Specify a list of starting declarations. This option is passed directly on to the patched GCC C++ parser. It is meaningful only if -fxml= is also specified. This specifies a comma-separated list of named starting declarations. GCC-XML will dump only the subset of the declarations in the translation unit that is reachable through a sequence of source references from one of the specified starting declarations.
22
+ </li>
23
+ <li>
24
+ <b><code>--gccxml-compiler &lt;xxx&gt;</code></b>: Set GCCXML_COMPILER to "xxx".
25
+ </li>
26
+ <li>
27
+ <b><code>--gccxml-cxxflags &lt;xxx&gt;</code></b>: Set GCCXML_CXXFLAGS to "xxx".
28
+ </li>
29
+ <li>
30
+ <b><code>--gccxml-executable &lt;xxx&gt;</code></b>: Set GCCXML_EXECUTABLE to "xxx".
31
+ </li>
32
+ <li>
33
+ <b><code>--gccxml-cpp &lt;xxx&gt;</code></b>: Set GCCXML_CPP to "xxx".
34
+ </li>
35
+ <li>
36
+ <b><code>--gccxml-config &lt;xxx&gt;</code></b>: Set GCCXML_CONFIG to "xxx".
37
+ </li>
38
+ <li>
39
+ <b><code>--gccxml-root &lt;xxx&gt;</code></b>: Set GCCXML_ROOT to "xxx".
40
+ </li>
41
+ <li>
42
+ <b><code>--gccxml-gcc-options &lt;xxx&gt;</code></b>: Read GCC options from file "xxx". This option specifies a file from which to read options to pass to the patched GCC C++ parser. This is useful for specifying a long list of include directories. Each line in the file becomes one option. Empty lines and lines beginning in '#' are ignored.
43
+ </li>
44
+ <li>
45
+ <b><code>--help</code></b>: Print full help and exit. Full help displays most of the documentation provided by the UNIX man page. It is provided for use on non-UNIX platforms, but is also convenient if the man page is not installed.
46
+ </li>
47
+ <li>
48
+ <b><code>--help-html</code></b>: Print full help in HTML format. This option is used by GCC-XML authors to help produce web pages.
49
+ </li>
50
+ <li>
51
+ <b><code>--man</code></b>: Print a UNIX man page and exit. This option is used by GCC-XML authors to generate the UNIX man page.
52
+ </li>
53
+ <li>
54
+ <b><code>--print</code></b>: Print configuration settings and exit. GCC-XML has many configuration options to help it simulate another compiler. Using this option will cause GCC-XML to configure itself as if it were going to parse the C++ source, but stop and print the configuration found. This is useful for checking the configuration.
55
+ </li>
56
+ <li>
57
+ <b><code>--preprocess</code></b>: Preprocess the input and exit. GCC-XML simulates the proprocessor of another compiler. Using this option will cause GCC-XML to configure itself as if it were going to parse the C++ source, but stop after preprocessing. This is useful for debugging problems related to simulation of the other compiler.
58
+ </li>
59
+ <li>
60
+ <b><code>-E</code></b>: Alias for --preprocess.
61
+ </li>
62
+ <li>
63
+ <b><code>--version</code></b>: Show program name/version banner and exit.
64
+ </li>
65
+ </ul>
66
+ Other flags, such as -I and -D, are passed on to the patched GCC C++ parser executable.
67
+ <h2>Configuration Settings</h2>
68
+ GCC-XML is designed to simulate a compiler's parser while reading C++ source code. Some configuration settings are needed to determine how to simulate a particular compiler of the user's choice. The following settings can be used to configure GCC-XML:
69
+ <ul>
70
+ <li>
71
+ <b><code>GCCXML_COMPILER</code></b>: The C++ compiler to be simulated. GCC-XML will attempt to automatically determine how to simulate the compiler specified by this setting. The compiler is specified by its executable name (such as "g++"). For Visual Studio, the compiler is specified by "msvc6", "msvc7", "msvc71", or "msvc8" (if "cl" is given, GCC-XML attempts to guess which VS to use).
72
+ </li>
73
+ <li>
74
+ <b><code>GCCXML_CXXFLAGS</code></b>: The flags for the C++ compiler to be simulated. The behavior of most compilers can be adjusted by specifying flags on the command line. When GCC-XML attempts to automatically determine how to simulate a compiler, these flags are taken into consideration.
75
+ </li>
76
+ <li>
77
+ <b><code>GCCXML_CONFIG</code></b>: The configuration file for common settings. When non-default settings are often used, it is convenient to write a single file containing them. When such a file is specified, it will be read to configure any settings that are not yet known. Each line of the file consists of one assignment of the form KEY="VALUE" (for example, GCCXML_COMPILER="g++").
78
+ </li>
79
+ <li>
80
+ <b><code>GCCXML_EXECUTABLE</code></b>: Specify the patched GCC C++ parser executable. The GCC-XML program as seen by the user is actually a front-end that determines the flags needed to configure the patched GCC C++ parser to simulate another compiler. This setting specifies the real executable to run once the flags have been determined. Users should rarely need to change this value from its default.
81
+ </li>
82
+ <li>
83
+ <b><code>GCCXML_CPP</code></b>: Specify the GCC C preprocessor executable. The GCC-XML program as seen by the user is actually a front-end that determines the flags needed to configure the patched GCC C++ parser to simulate another compiler. This setting specifies the preprocessor to run with the flags that have been determined for debugging purposes. Users should rarely need to change this value from its default.
84
+ </li>
85
+ <li>
86
+ <b><code>GCCXML_ROOT</code></b>: The GCC-XML support library directory. Since GCC-XML is only one C++ parser, it cannot exactly duplicate the functionality of every compiler it tries to simulate. Some compilers provide standard headers with code that GCC-XML cannot directly handle. To work around this limitation, a support library is provided for each compiler. This consists of a set of header files that are used in place of the compiler's system headers. These files contain slight tweaks and then include the corresponding real header. The root of the directory tree containing these support library headers is specified by this setting. Users should rarely need to change this value from its default.
87
+ </li>
88
+ <li>
89
+ <b><code>GCCXML_FLAGS</code></b>: Flags used to simulate the other compiler. When GCC-XML runs the patched GCC C++ parser, these flags are passed to the program to tell it how to simulate a particular compiler. This setting is usually detected automatically from the other settings, but it can be specified directly by advanced users. Most users should not attempt to change this value from the automatic configuration.
90
+ </li>
91
+ <li>
92
+ <b><code>GCCXML_USER_FLAGS</code></b>: Additional user flags for compiler simulation. When GCC-XML runs the patched GCC C++ parser, these flags are passed in addition to those specified by GCCXML_FLAGS. This allows advanced users to tweak the compiler simulation while still using the automatic configuration of GCCXML_FLAGS. Users should rarely need to change this value from its default.
93
+ </li>
94
+ </ul>
95
+ There are several means by which these settings are configured. They are listed here in order of precedence (highest first):
96
+ <ul>
97
+ <li>
98
+ <b><code>Command-line Options</code></b>: Settings can be specified by their corresponding options. When a setting's corresponding command-line option is provided, it is used in favor over any other means of configuration. If GCCXML_CONFIG is set on the command-line, settings are read from the file with precedence just slightly lower than other command-line options.
99
+ </li>
100
+ <li>
101
+ <b><code>Environment Variables</code></b>: Settings are configured by name in the environment. Each setting not already known is read from an environment variable with its name. If GCCXML_CONFIG is set by the environment, settings are read from the file with precedence just slightly lower than other environment variables.
102
+ </li>
103
+ <li>
104
+ <b><code>Configuration Files</code></b>: A search for GCCXML_CONFIG is performed. If GCCXML_CONFIG has not yet been set, an attempt is made to find a configuration file automatically. First, if the file $HOME/.gccxml/config exists, it will be used. Second, if GCC-XML is being executed from its build directory, a config file from that directory will be used. Finally, if a config file is found in the installation's support library directory, it will be used. Once found, any unknown settings are read from the configuration file.
105
+ </li>
106
+ <li>
107
+ <b><code>Guessing</code></b>: Guesses are made based on other settings. Once GCCXML_COMPILER has been set, it is used to automatically find the setting for GCCXML_FLAGS. If it is not set, the "CXX" environment variable is checked as a last-resort to find the compiler setting and determine GCCXML_FLAGS.
108
+ </li>
109
+ </ul>
110
+ Most users should not have to adjust the defaults for these settings. There is a default GCCXML_CONFIG file provided in the support library directory after installation. It configures GCC-XML to simulate the compiler that was used to build it.
111
+ <h2>Supported Compilers</h2>
112
+ GCC-XML can simulate any of the following compilers:
113
+ <ul>
114
+ <li>
115
+ <b><code>GCC</code></b>: Versions 4.2, 4.1, 4.0, 3.4, 3.3, 3.2, 2.95.x
116
+ </li>
117
+ <li>
118
+ <b><code>Visual C++</code></b>: Versions 8, 7.1, 7.0, and 6 (sp5)
119
+ </li>
120
+ <li>
121
+ <b><code>Borland, Intel, SGI</code></b>: formerly supported but no longer tested
122
+ </li>
123
+ </ul>
124
+ The following extra C preprocessor definitions are provided:
125
+ <ul>
126
+ <li>
127
+ <b><code>-D__GCCXML__=MMmmpp</code></b>: MM, mm, and pp are the major, minor, and patch versions of GCC-XML. This preprocessor symbol identifies GCC-XML to the source code as it is preprocessed. It can be used to enable GCC-XML-specific information.
128
+ </li>
129
+ <li>
130
+ <b><code>-D__GCCXML_GNUC__=M</code></b>: Defined to internal GCC parser major version.
131
+ </li>
132
+ <li>
133
+ <b><code>-D__GCCXML_GNUC_MINOR__=m</code></b>: Defined to internal GCC parser minor version.
134
+ </li>
135
+ <li>
136
+ <b><code>-D__GCCXML_GNUC_PATCHLEVEL__=p</code></b>: Defined to internal GCC parser patchlevel.
137
+ </li>
138
+ </ul>
139
+ Advanced users can simulate other compilers by manually configuring the GCCXML_FLAGS setting. Contact the mailing list for help.
140
+ <h2>C++ Meta Information</h2>
141
+ GCC-XML has added a new attribute to the legal set of C/C++ attributes. The attribute is used to attach meta information to C/C++ source code, which will then appear in the XML output. The syntax for declaring an attribute is as follows:
142
+ <ul>
143
+ <li>
144
+ <b><code>__attribute((gccxml(&lt;string&gt;, &lt;string&gt;, ...)))</code></b>: Here &lt;string&gt; is a quoted string. There must be at least one argument to the 'gccxml' attribute, but there is no upper limit to the total number of arguments. Each argument is verified to be a string - if a non-string argument is found, the attribute is ignored.
145
+ </li>
146
+ </ul>
147
+ The XML output for the code element that is tagged with the attribute will then contain the following:
148
+ <ul>
149
+ <li>
150
+ <b><code>attributes=" ... gccxml(&lt;string&gt;,&lt;string&gt;,&lt;string&gt; ...) ... "</code></b>: The 'attributes' XML attribute contains all attributes applied to the code element. Each argument of the attribute is printed without enclosing quotes, so if an argument contains the ',' character, the argument will appear to be multiple arguments.
151
+ </li>
152
+ </ul>
153
+ The 'gccxml' attribute can be applied to any declaration including structs, classes, fields, parameters, methods, functions, variables, and typedefs. The only exception is that GCC's handling of the '__attribute' language element is currently broken for enumerations and constructors with an inlined body. The 'gccxml' attribute can be used any number of times on a given declaration.
154
+ As an example of how this attribute can be used to attach meta information to C++ declarations, consider the following macro:
155
+ <ul>
156
+ <li>
157
+ <b><code>#define _out_ __attribute((gccxml("out")))</code></b>: Here '_out_' has been defined to be the gccxml attribute where the first argument is the string "out". It is recommended that the first argument be used as a unique string name for the type of meta information begin applied.
158
+ </li>
159
+ </ul>
160
+ Now a method declaration can be written as follows:
161
+ <ul>
162
+ <li>
163
+ <b><code>void getInteger(_out_ int&amp; i);</code></b>: This will cause the XML output to contain meta information for the '_out_' attribute, in the form "gccxml(out)".
164
+ </li>
165
+ </ul>
166
+ Using the 'gccxml' attribute enables meta information to be included directly within C++ source code, without the need for a custom parser to extract the meta information. The 'gccxml' attribute is provided for convenience only - there is no guarantee that future versions of GCC will accept the '__attribute' language element in a bug-free manner.
167
+ </body>
168
+ </html>
@@ -0,0 +1,293 @@
1
+ Usage:
2
+
3
+ gccxml [options] <input-file> -fxml=<output-file>
4
+
5
+ GCC-XML parses a C++ source file as it is seen by the compiler when it is
6
+ built. An easy-to-parse XML representation of the class, function, and
7
+ namespace declarations is dumped to a specified file. Full C preprocessing
8
+ transforms the file into a C++ translation unit as seen by the compiler.
9
+ This means that GCC-XML should make use of the same standard library and
10
+ other header files as the compiler. GCC-XML can be configured to simulate
11
+ any of several popular compilers.
12
+
13
+ ----------------------------------------------------------
14
+ The following options are available for running GCC-XML:
15
+
16
+ --copyright
17
+ Print the GCC-XML copyright and exit.
18
+
19
+ --debug
20
+ Print extra debugging information.
21
+ This option causes GCC-XML to print the executable name and
22
+ command-line arguments used to execute the patched GCC C++ parser.
23
+ This is useful when attempting to simulate an unsupported compiler.
24
+
25
+ -fxml=<output-file>
26
+ Specify the XML output file.
27
+ This option is passed directly on to the patched GCC C++ parser. It
28
+ enables the XML dump and specifies the output file name.
29
+
30
+ -fxml-start=<xxx>[,...]
31
+ Specify a list of starting declarations.
32
+ This option is passed directly on to the patched GCC C++ parser. It
33
+ is meaningful only if -fxml= is also specified. This specifies a
34
+ comma-separated list of named starting declarations. GCC-XML will
35
+ dump only the subset of the declarations in the translation unit that
36
+ is reachable through a sequence of source references from one of the
37
+ specified starting declarations.
38
+
39
+ --gccxml-compiler <xxx>
40
+ Set GCCXML_COMPILER to "xxx".
41
+
42
+ --gccxml-cxxflags <xxx>
43
+ Set GCCXML_CXXFLAGS to "xxx".
44
+
45
+ --gccxml-executable <xxx>
46
+ Set GCCXML_EXECUTABLE to "xxx".
47
+
48
+ --gccxml-cpp <xxx>
49
+ Set GCCXML_CPP to "xxx".
50
+
51
+ --gccxml-config <xxx>
52
+ Set GCCXML_CONFIG to "xxx".
53
+
54
+ --gccxml-root <xxx>
55
+ Set GCCXML_ROOT to "xxx".
56
+
57
+ --gccxml-gcc-options <xxx>
58
+ Read GCC options from file "xxx".
59
+ This option specifies a file from which to read options to pass to the
60
+ patched GCC C++ parser. This is useful for specifying a long list of
61
+ include directories. Each line in the file becomes one option. Empty
62
+ lines and lines beginning in '#' are ignored.
63
+
64
+ --help
65
+ Print full help and exit.
66
+ Full help displays most of the documentation provided by the UNIX man
67
+ page. It is provided for use on non-UNIX platforms, but is also
68
+ convenient if the man page is not installed.
69
+
70
+ --help-html
71
+ Print full help in HTML format.
72
+ This option is used by GCC-XML authors to help produce web pages.
73
+
74
+ --man
75
+ Print a UNIX man page and exit.
76
+ This option is used by GCC-XML authors to generate the UNIX man page.
77
+
78
+ --print
79
+ Print configuration settings and exit.
80
+ GCC-XML has many configuration options to help it simulate another
81
+ compiler. Using this option will cause GCC-XML to configure itself as
82
+ if it were going to parse the C++ source, but stop and print the
83
+ configuration found. This is useful for checking the configuration.
84
+
85
+ --preprocess
86
+ Preprocess the input and exit.
87
+ GCC-XML simulates the proprocessor of another compiler. Using this
88
+ option will cause GCC-XML to configure itself as if it were going to
89
+ parse the C++ source, but stop after preprocessing. This is useful
90
+ for debugging problems related to simulation of the other compiler.
91
+
92
+ -E
93
+ Alias for --preprocess.
94
+
95
+ --version
96
+ Show program name/version banner and exit.
97
+
98
+ Other flags, such as -I and -D, are passed on to the patched GCC C++ parser
99
+ executable.
100
+
101
+ ----------------------------------------------------------
102
+ GCC-XML is designed to simulate a compiler's parser while reading C++ source
103
+ code. Some configuration settings are needed to determine how to simulate a
104
+ particular compiler of the user's choice. The following settings can be used
105
+ to configure GCC-XML:
106
+
107
+ GCCXML_COMPILER
108
+ The C++ compiler to be simulated.
109
+ GCC-XML will attempt to automatically determine how to simulate the
110
+ compiler specified by this setting. The compiler is specified by its
111
+ executable name (such as "g++"). For Visual Studio, the compiler is
112
+ specified by "msvc6", "msvc7", "msvc71", or "msvc8" (if "cl" is given,
113
+ GCC-XML attempts to guess which VS to use).
114
+
115
+ GCCXML_CXXFLAGS
116
+ The flags for the C++ compiler to be simulated.
117
+ The behavior of most compilers can be adjusted by specifying flags on
118
+ the command line. When GCC-XML attempts to automatically determine
119
+ how to simulate a compiler, these flags are taken into consideration.
120
+
121
+ GCCXML_CONFIG
122
+ The configuration file for common settings.
123
+ When non-default settings are often used, it is convenient to write a
124
+ single file containing them. When such a file is specified, it will
125
+ be read to configure any settings that are not yet known. Each line
126
+ of the file consists of one assignment of the form KEY="VALUE" (for
127
+ example, GCCXML_COMPILER="g++").
128
+
129
+ GCCXML_EXECUTABLE
130
+ Specify the patched GCC C++ parser executable.
131
+ The GCC-XML program as seen by the user is actually a front-end that
132
+ determines the flags needed to configure the patched GCC C++ parser to
133
+ simulate another compiler. This setting specifies the real executable
134
+ to run once the flags have been determined. Users should rarely need
135
+ to change this value from its default.
136
+
137
+ GCCXML_CPP
138
+ Specify the GCC C preprocessor executable.
139
+ The GCC-XML program as seen by the user is actually a front-end that
140
+ determines the flags needed to configure the patched GCC C++ parser to
141
+ simulate another compiler. This setting specifies the preprocessor to
142
+ run with the flags that have been determined for debugging purposes.
143
+ Users should rarely need to change this value from its default.
144
+
145
+ GCCXML_ROOT
146
+ The GCC-XML support library directory.
147
+ Since GCC-XML is only one C++ parser, it cannot exactly duplicate the
148
+ functionality of every compiler it tries to simulate. Some compilers
149
+ provide standard headers with code that GCC-XML cannot directly
150
+ handle. To work around this limitation, a support library is provided
151
+ for each compiler. This consists of a set of header files that are
152
+ used in place of the compiler's system headers. These files contain
153
+ slight tweaks and then include the corresponding real header. The
154
+ root of the directory tree containing these support library headers is
155
+ specified by this setting. Users should rarely need to change this
156
+ value from its default.
157
+
158
+ GCCXML_FLAGS
159
+ Flags used to simulate the other compiler.
160
+ When GCC-XML runs the patched GCC C++ parser, these flags are passed
161
+ to the program to tell it how to simulate a particular compiler. This
162
+ setting is usually detected automatically from the other settings, but
163
+ it can be specified directly by advanced users. Most users should not
164
+ attempt to change this value from the automatic configuration.
165
+
166
+ GCCXML_USER_FLAGS
167
+ Additional user flags for compiler simulation.
168
+ When GCC-XML runs the patched GCC C++ parser, these flags are passed
169
+ in addition to those specified by GCCXML_FLAGS. This allows advanced
170
+ users to tweak the compiler simulation while still using the automatic
171
+ configuration of GCCXML_FLAGS. Users should rarely need to change
172
+ this value from its default.
173
+
174
+ There are several means by which these settings are configured. They are
175
+ listed here in order of precedence (highest first):
176
+
177
+ Command-line Options
178
+ Settings can be specified by their corresponding options.
179
+ When a setting's corresponding command-line option is provided, it is
180
+ used in favor over any other means of configuration. If GCCXML_CONFIG
181
+ is set on the command-line, settings are read from the file with
182
+ precedence just slightly lower than other command-line options.
183
+
184
+ Environment Variables
185
+ Settings are configured by name in the environment.
186
+ Each setting not already known is read from an environment variable
187
+ with its name. If GCCXML_CONFIG is set by the environment, settings
188
+ are read from the file with precedence just slightly lower than other
189
+ environment variables.
190
+
191
+ Configuration Files
192
+ A search for GCCXML_CONFIG is performed.
193
+ If GCCXML_CONFIG has not yet been set, an attempt is made to find a
194
+ configuration file automatically. First, if the file
195
+ $HOME/.gccxml/config exists, it will be used. Second, if GCC-XML is
196
+ being executed from its build directory, a config file from that
197
+ directory will be used. Finally, if a config file is found in the
198
+ installation's support library directory, it will be used. Once
199
+ found, any unknown settings are read from the configuration file.
200
+
201
+ Guessing
202
+ Guesses are made based on other settings.
203
+ Once GCCXML_COMPILER has been set, it is used to automatically find
204
+ the setting for GCCXML_FLAGS. If it is not set, the "CXX" environment
205
+ variable is checked as a last-resort to find the compiler setting and
206
+ determine GCCXML_FLAGS.
207
+
208
+ Most users should not have to adjust the defaults for these settings. There
209
+ is a default GCCXML_CONFIG file provided in the support library directory
210
+ after installation. It configures GCC-XML to simulate the compiler that was
211
+ used to build it.
212
+
213
+ ----------------------------------------------------------
214
+ GCC-XML can simulate any of the following compilers:
215
+
216
+ GCC
217
+ Versions 4.2, 4.1, 4.0, 3.4, 3.3, 3.2, 2.95.x
218
+
219
+ Visual C++
220
+ Versions 8, 7.1, 7.0, and 6 (sp5)
221
+
222
+ Borland, Intel, SGI
223
+ formerly supported but no longer tested
224
+
225
+ The following extra C preprocessor definitions are provided:
226
+
227
+ -D__GCCXML__=MMmmpp
228
+ MM, mm, and pp are the major, minor, and patch versions of GCC-XML.
229
+ This preprocessor symbol identifies GCC-XML to the source code as it
230
+ is preprocessed. It can be used to enable GCC-XML-specific
231
+ information.
232
+
233
+ -D__GCCXML_GNUC__=M
234
+ Defined to internal GCC parser major version.
235
+
236
+ -D__GCCXML_GNUC_MINOR__=m
237
+ Defined to internal GCC parser minor version.
238
+
239
+ -D__GCCXML_GNUC_PATCHLEVEL__=p
240
+ Defined to internal GCC parser patchlevel.
241
+
242
+ Advanced users can simulate other compilers by manually configuring the
243
+ GCCXML_FLAGS setting. Contact the mailing list for help.
244
+
245
+ ----------------------------------------------------------
246
+ GCC-XML has added a new attribute to the legal set of C/C++ attributes. The
247
+ attribute is used to attach meta information to C/C++ source code, which will
248
+ then appear in the XML output. The syntax for declaring an attribute is as
249
+ follows:
250
+
251
+ __attribute((gccxml(<string>, <string>, ...)))
252
+ Here <string> is a quoted string. There must be at least one argument
253
+ to the 'gccxml' attribute, but there is no upper limit to the total
254
+ number of arguments. Each argument is verified to be a string - if a
255
+ non-string argument is found, the attribute is ignored.
256
+
257
+ The XML output for the code element that is tagged with the attribute will
258
+ then contain the following:
259
+
260
+ attributes=" ... gccxml(<string>,<string>,<string> ...) ... "
261
+ The 'attributes' XML attribute contains all attributes applied to the
262
+ code element. Each argument of the attribute is printed without
263
+ enclosing quotes, so if an argument contains the ',' character, the
264
+ argument will appear to be multiple arguments.
265
+
266
+ The 'gccxml' attribute can be applied to any declaration including structs,
267
+ classes, fields, parameters, methods, functions, variables, and typedefs.
268
+ The only exception is that GCC's handling of the '__attribute' language
269
+ element is currently broken for enumerations and constructors with an inlined
270
+ body. The 'gccxml' attribute can be used any number of times on a given
271
+ declaration.
272
+
273
+ As an example of how this attribute can be used to attach meta information to
274
+ C++ declarations, consider the following macro:
275
+
276
+ #define _out_ __attribute((gccxml("out")))
277
+ Here '_out_' has been defined to be the gccxml attribute where the
278
+ first argument is the string "out". It is recommended that the first
279
+ argument be used as a unique string name for the type of meta
280
+ information begin applied.
281
+
282
+ Now a method declaration can be written as follows:
283
+
284
+ void getInteger(_out_ int& i);
285
+ This will cause the XML output to contain meta information for the
286
+ '_out_' attribute, in the form "gccxml(out)".
287
+
288
+ Using the 'gccxml' attribute enables meta information to be included directly
289
+ within C++ source code, without the need for a custom parser to extract the
290
+ meta information. The 'gccxml' attribute is provided for convenience only -
291
+ there is no guarantee that future versions of GCC will accept the
292
+ '__attribute' language element in a bug-free manner.
293
+