Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2011-02-28 14:48:13 -0500
committerAndrew Overholt2011-02-28 14:48:16 -0500
commit836c04ddfee98e7b963af0a1df3bee0b48785225 (patch)
treeb60971bcb08ed20e536e830c98d8c0b1728fbf46
parent398db8147b87f9c258d97a4460e0abad7e73c27e (diff)
parentf20b9d5b73bab79ecbc832a1a7b81d0e45095a0e (diff)
downloadorg.eclipse.linuxtools-836c04ddfee98e7b963af0a1df3bee0b48785225.tar.gz
org.eclipse.linuxtools-836c04ddfee98e7b963af0a1df3bee0b48785225.tar.xz
org.eclipse.linuxtools-836c04ddfee98e7b963af0a1df3bee0b48785225.zip
Merge libhover 0.5.1
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/.project17
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/ChangeLog57
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/about.html33
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/build.properties4
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/epl-v10.html320
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.properties112
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.xml59
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/.project22
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/ChangeLog42
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/META-INF/MANIFEST.MF9
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/about.html33
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/build.properties5
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.properties12
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml23
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml7
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/.project22
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/ChangeLog29
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/META-INF/MANIFEST.MF9
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/about.html33
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/build.properties4
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.properties12
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.xml11
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/toc.xml6
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.classpath7
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.project17
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/ChangeLog33
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/META-INF/MANIFEST.MF12
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/about.html33
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/build.properties6
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.properties12
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml23
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java537
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml7
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/.project17
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/ChangeLog20
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/about.html33
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/build.properties4
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/epl-v10.html320
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.properties112
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.xml34
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/.project22
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/ChangeLog32
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/META-INF/MANIFEST.MF9
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/about.html33
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/build.properties5
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.properties12
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.xml23
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml9
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.classpath6
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.project17
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/ChangeLog55
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/README12
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml15
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java645
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java661
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java881
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java564
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java733
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.classpath7
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.project28
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/ChangeLog196
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF21
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/build.properties9
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.properties14
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.xml12
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/schema/org.eclipse.linuxtools.cdt.libhover.library.exsd216
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java123
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java134
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java37
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java24
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java79
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java133
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java118
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/utils/BuildFunctionInfos.java213
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java575
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java218
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java41
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.properties16
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/CheckboxFieldEditor.java394
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java79
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java20
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java37
-rw-r--r--libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/properties/LibHoverPropertyPage.java465
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/ChangeLog14
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java223
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java16
88 files changed, 9163 insertions, 155 deletions
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/.project
new file mode 100644
index 0000000000..4150d2047b
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/ChangeLog
new file mode 100644
index 0000000000..295d7455ef
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/ChangeLog
@@ -0,0 +1,57 @@
+2010-02-08 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Capitalize "library" in featureName.
+
+2009-11-10 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Make featureName a bit more user-friendly.
+
+2009-08-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Remove newlib as included feature.
+
+2009-08-05 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Rename to org.eclipse.linuxtools.cdt.libhover.
+
+2009-05-19 Andrew Overholt <overholt@redhat.com>
+
+ Bug #273931
+
+ * feature.properties: Change provider from Eclipse.org to Eclipse.
+
+2009-05-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Bump up to 0.2.0. Add libhover newlib feature as
+ optional included feature. Add libhover libstdcxx plugin.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Bump up to 0.1.1.
+
+2009-01-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Add .qualifier to version id.
+
+2009-01-06 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: 1.0.0 -> 0.1.0. Add update site information.
+ * build.properties: Add feature.properties and epl-v10.html.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Use feature.properties. Add "(Incubation)".
+ * feature.properties: Initial checkin.
+ * epl-v10.html: Likewise.
+
+2008-10-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Add org.eclipse.linuxtools.cdt.libhover.library_docs plugin.
+ Also change org.eclipse.linuxtools.cdt.libhover.glibc reference to be plugin
+ instead of fragment.
+
+2008-10-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Initial check-in.
+ * about.html: Ditto.
+ * build.properties: Ditto.
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/about.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/build.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/build.properties
new file mode 100644
index 0000000000..65a4460540
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/build.properties
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ about.html,\
+ feature.properties,\
+ epl-v10.html
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/epl-v10.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/epl-v10.html
new file mode 100644
index 0000000000..9320c9f37c
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/epl-v10.html
@@ -0,0 +1,320 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="ProgId" content="Word.Document">
+<meta name="Generator" content="Microsoft Word 9">
+<meta name="Originator" content="Microsoft Word 9">
+<link rel="File-List" href="http://www.eclipse.org/legal/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head><body style="" lang="EN-US">
+
+<div class="Section1">
+
+<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p>
+
+<p><span style="font-size: 10pt;">"Contribution" means:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear="left">
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+changes to the Program, and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+additions to the Program;</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style="font-size: 10pt;">"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style="font-size: 10pt;">"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p>
+
+<p><span style="font-size: 10pt;">A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+its license agreement:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style="color: blue;"> </span></span></p>
+
+<p><span style="font-size: 10pt;">When the Program is made available in source
+code form:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it must be made available under this Agreement; and </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style="font-size: 10pt;">Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style="font-size: 10pt;">For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p>
+
+<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style="font-size: 10pt;">If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class="MsoNormal"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></p>
+
+</div>
+
+</body></html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.properties
new file mode 100644
index 0000000000..98ce13dd82
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.properties
@@ -0,0 +1,112 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+featureName=C/C++ Library API Documentation Hover Help (Incubation)
+description=Plugins for C/C++ library hover help.
+provider=Eclipse
+copyright=Copyright 2008 Red Hat, Inc.
+licenseURL=epl-v10.html
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.xml
new file mode 100644
index 0000000000..42e614f618
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover-feature/feature.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.cdt.libhover"
+ label="%featureName"
+ version="0.2.0.qualifier"
+ provider-name="%provider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="epl-v10.php">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Update Site" url="http://download.eclipse.org/technology/linuxtools/update"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.ui" version="3.4.0" match="compatible"/>
+ <import plugin="org.eclipse.core.runtime" version="3.4.0" match="compatible"/>
+ <import plugin="org.eclipse.core.resources" version="3.4.0" match="compatible"/>
+ <import plugin="org.eclipse.help" version="3.3.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.ui" version="5.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.filesystem" version="1.2.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.libhover"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.libhover.library_docs"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.libhover.glibc"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.libhover.libstdcxx"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/.project
new file mode 100644
index 0000000000..b2adfe68b5
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/.project
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover.glibc</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/ChangeLog
new file mode 100644
index 0000000000..7201d35f18
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/ChangeLog
@@ -0,0 +1,42 @@
+2009-08-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #285867
+ * plugin.properties: Change Provider to Eclipse instead of Eclipse.org.
+
+2009-02-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump up version to 1.0.1.
+ * plugin.xml: Change to use new libhover library interface which requires
+ the location of a serialized LibHoverInfo instance rather than an xml document.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add .qualifier to version.
+
+2008-11-03 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Add plugin.properties.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.properties: Initial checkin.
+ * META-INF/MANIFEST.MF: Use plugin.properties. Add "(Incubation)".
+
+2008-10-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Modify library name which shows up in the Project properties C/C++ General
+ Documentation page.
+
+2008-10-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Add toc.xml to binary build files.
+
+2008-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * fragment.xml: Removed.
+ * plugin.xml: New file.
+ * build.properties: Specify about.html in src build.
+ * META-INF/MANIFEST.MF: Require org.eclipse.linuxtools.cdt.libhover.library-docs
+ instead of org.eclipse.linuxtools.cdt.autotools-docs.
+ * toc.xml: Change to use moreclibdocs anchor instead of moregnutools
+ anchor which is in autotools-docs.
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/META-INF/MANIFEST.MF b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..29e9546217
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.libhover.glibc;singleton:=true
+Bundle-Version: 1.0.1.qualifier
+Bundle-Vendor: %provider
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.linuxtools.cdt.libhover.library_docs;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/about.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/build.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/build.properties
new file mode 100644
index 0000000000..2220fabe27
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/build.properties
@@ -0,0 +1,5 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ toc.xml,\
+ plugin.properties
+src.includes = about.html
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.properties
new file mode 100644
index 0000000000..85eadef628
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=Glibc Libhover (Incubation)
+provider=Eclipse \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml
new file mode 100644
index 0000000000..4556b44f00
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ id="library"
+ name="Glibc C Library"
+ point="org.eclipse.linuxtools.cdt.libhover.library">
+ <library
+ docs="http://www.gnu.org/software/libc/manual/html_node/index.html"
+ location="http://www.sourceware.org/eclipse/libhover/glibc-2.7-2.libhover"
+ name="glibc library"
+ type="C">
+ </library>
+ </extension>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="false">
+ </toc>
+ </extension>
+
+</plugin>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml
new file mode 100644
index 0000000000..8ef4df17d7
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="glibc library" link_to="../org.eclipse.linuxtools.cdt.libhover.library_docs/toc.xml#moreclibdocs">
+ <topic href="http://www.gnu.org/software/libc/manual/html_node/index.html" label="glibc">
+ </topic>
+</toc>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/.project
new file mode 100644
index 0000000000..c02f456009
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/.project
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover.library-docs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/ChangeLog
new file mode 100644
index 0000000000..48cf6c8812
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/ChangeLog
@@ -0,0 +1,29 @@
+2009-08-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #285867
+ * plugin.properties: Change Provider to Eclipse instead of Eclipse.org.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add .qualifier to version and bump to 1.0.1.
+
+2008-11-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Remove doc.zip.
+ * doc.zip: Removed.
+
+2008-11-03 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Add plugin.properties.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.properties: Initial import.
+ * META-INF/MANIFEST.MF: Use plugin.propeties. Add "(Incubation)".
+
+2008-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * toc.xml: Initial release.
+ * doc.zip: Ditto.
+ * plugin.xml: Ditto.
+ * about.html: Ditto. \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/META-INF/MANIFEST.MF b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..f5fd146af1
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.libhover.library_docs;singleton:=true
+Bundle-Version: 1.0.1.qualifier
+Bundle-Vendor: %provider
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.help
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/about.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/build.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/build.properties
new file mode 100644
index 0000000000..1d9ab88309
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/build.properties
@@ -0,0 +1,4 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ toc.xml,\
+ plugin.properties \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.properties
new file mode 100644
index 0000000000..fd1b56190e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=Libhover C/C++ Library Documentation Plug-in (Incubation)
+provider=Eclipse \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.xml
new file mode 100644
index 0000000000..08f7cebc17
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/plugin.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true"/>
+ </extension>
+
+</plugin>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/toc.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/toc.xml
new file mode 100644
index 0000000000..de69a8aa73
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.library-docs/toc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="C/C++ Library Documentation">
+ <anchor id="moreclibdocs"/>
+</toc>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.classpath b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.project
new file mode 100644
index 0000000000..134e131c9e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover.libstdcxx</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.settings/org.eclipse.jdt.core.prefs b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..15fdc96a8c
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Jan 30 16:39:40 EST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/ChangeLog
new file mode 100644
index 0000000000..ae928bb42d
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/ChangeLog
@@ -0,0 +1,33 @@
+2009-08-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #285867
+ * plugin.properties: Change Provider to Eclipse instead of Eclipse.org.
+
+2009-08-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.properties: New file to fill in bundlename and provider.
+
+2009-05-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java (getParameters):
+ New method.
+ (getReturn): Ditto.
+ (buildDoxygenCPPInfo): Add code to get detailed description and break this up into
+ parameters and return value. For return type, use refid to find a referenced class.
+ (getElementText): Fix to be recursive.
+
+2009-02-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * .project: New file.
+ * toc.xml: Add missing toc file referenced by plugin.
+
+2009-02-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Initial creation.
+ * plugin.properties: Ditto.
+ * toc.xml: Ditto.
+ * build.properties: Ditto.
+ * META-INF/MANIFEST.MF: Ditto.
+ * about.html: Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java: New file
+ for creating serialized LibHover info from libstdc++ Doxygen xml documentation. \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/META-INF/MANIFEST.MF b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..111bb39736
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.libhover.libstdcxx;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %provider
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.linuxtools.cdt.libhover.library_docs;bundle-version="1.0.0",
+ org.eclipse.linuxtools.cdt.libhover;bundle-version="1.0.1",
+ org.eclipse.core.filesystem;bundle-version="1.2.0",
+ org.eclipse.core.runtime;bundle-version="3.4.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/about.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/build.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/build.properties
new file mode 100644
index 0000000000..b26ffbea3b
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/build.properties
@@ -0,0 +1,6 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ toc.xml,\
+ plugin.properties
+src.includes = about.html,\
+ src/
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.properties
new file mode 100644
index 0000000000..337bfacc18
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=Libstdc++ Libhover (Incubation)
+provider=Eclipse \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml
new file mode 100644
index 0000000000..f81634e197
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ id="library"
+ name="Libstdc++ Library"
+ point="org.eclipse.linuxtools.cdt.libhover.library">
+ <library
+ docs="http://gcc.gnu.org/onlinedocs/libstdc++/manual/spine.html"
+ location="http://www.sourceware.org/eclipse/libhover/libstdc++-v3.libhover"
+ name="libstdc++ library"
+ type="C++">
+ </library>
+ </extension>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="false">
+ </toc>
+ </extension>
+
+</plugin>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
new file mode 100644
index 0000000000..bb139e83a2
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
@@ -0,0 +1,537 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover.libstdcxx;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectOutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.linuxtools.cdt.libhover.LibHoverInfo;
+import org.eclipse.linuxtools.cdt.libhover.ClassInfo;
+import org.eclipse.linuxtools.cdt.libhover.MemberInfo;
+import org.eclipse.linuxtools.cdt.libhover.TypedefInfo;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+
+public class DoxygenCPPInfo {
+
+ private Document document;
+ private LibHoverInfo cppInfo = new LibHoverInfo();
+ private HashMap<String, ClassInfo> classesById = new HashMap<String, ClassInfo>();
+
+ public DoxygenCPPInfo(Document document) {
+ this.document = document;
+ }
+
+ public Document getDocument() {
+ return document;
+ }
+
+ private String[] getTypedefTypes(String def) {
+ String[] result = null;
+ if (def.startsWith("typedef ")) { // $NON-NLS-1$
+ int startIndex = 8;
+ int count = 0;
+ int i = def.length() - 1;
+ // To break up types, we look for first blank outside of a template, working backwards.
+ // We need to work backwards because the transformed type may contain actual numeric parameters
+ // which could use the shift operators and we won't know whether they are shift operators or
+ // template specifiers without some actual parsing.
+ while (i >= 0) {
+ char ch = def.charAt(i);
+ if (ch == '<') {
+ --count;
+ }
+ else if (ch == '>') {
+ ++count;
+ }
+ // We look at last blank not in a template as being the delimeter between
+ // type name and definition.
+ if (count == 0 && ch == ' ') {
+ startIndex = i + 1;
+ break;
+ }
+ --i;
+ }
+ result = new String[2];
+ result[1] = def.substring(startIndex);
+ // Following is a bit of a hack knowing the docs don't add the namespace when the transformed
+ // type is in the same space
+ int namespace = result[1].indexOf("::"); // $NON-NLS-1$
+ if (namespace < 0)
+ result[0] = def.substring(8, startIndex).trim();
+ else
+ result[0] = result[1].substring(0, namespace) + "::" + def.substring(8, startIndex).trim(); // $NON-NLS-1$
+ }
+ return result;
+ }
+
+ private String getElementText(Node node) {
+ StringBuffer d = new StringBuffer();
+ NodeList nl = node.getChildNodes();
+ for (int x = 0; x < nl.getLength(); ++x) {
+ Node text = nl.item(x);
+ if (text.getNodeType() == Node.TEXT_NODE)
+ d.append(text.getNodeValue());
+ else
+ d.append(getElementText(text));
+ }
+ return d.toString();
+ }
+
+ public ClassInfo getClassInfo(String className) {
+ String typedefName = className.replaceAll("<.*>", "<>"); // $NON-NLS-1$ // $NON-NLS-2$
+ TypedefInfo typedef = cppInfo.typedefs.get(typedefName);
+ if (typedef != null) {
+ className = typedef.getTransformedType(className); // Reset class name to typedef transformation
+ }
+ int index = className.indexOf('<');
+ // Check if it is a template reference.
+ if (index != -1) {
+ // It is. We want to see if there are partial specific templates
+ // and we choose the first match. If nothing matches our particular
+ // case, we fall back on the initial generic template.
+ ClassInfo info = cppInfo.classes.get(className.substring(0, index));
+ if (info == null)
+ return null;
+ ArrayList<ClassInfo> children = info.getChildren();
+ if (children != null && children.size() > 0) {
+ for (int x = 0; x < children.size(); ++x) {
+ ClassInfo child = children.get(x);
+ if (className.matches(child.getClassName())) {
+ info = child;
+ break;
+ }
+ }
+ }
+ return info;
+ }
+ // Otherwise no template, just fetch the class info directly.
+ return cppInfo.classes.get(className);
+ }
+
+ public void buildDoxygenCPPInfo(String fileName) {
+ try {
+ // Create a hash table of all the class nodes mapped by class name. Trim any template info
+ // for the class name key value.
+ NodeList nl = getDocument().getElementsByTagName("compounddef"); // $NON-NLS-1$
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node n = nl.item(i);
+ NamedNodeMap attrs = n.getAttributes();
+ Node kind = attrs.getNamedItem("kind"); // $NON-NLS-1$
+ Node id = attrs.getNamedItem("id"); // $NON-NLS-1$
+ Node prot = attrs.getNamedItem("prot"); // $NON-NLS-1$
+ // We are only interested in cataloging public classes.
+ if (id != null && prot != null && prot.getNodeValue().equals("public") // $NON-NLS-1$
+ && kind != null && kind.getNodeValue().equals("class")) { // $NON-NLS-1$
+ NodeList nl2 = n.getChildNodes();
+ ClassInfo d = null;
+ String hashName = null;
+ for (int j = 0; j < nl2.getLength(); ++j) {
+ Node n2 = nl2.item(j);
+ String name2 = n2.getNodeName();
+ if (name2.equals("compoundname")) { // $NON-NLS-1$
+ String text = n2.getTextContent();
+ if (text != null && !text.equals("")) {
+ String className = text;
+ text = text.replaceAll("<\\s*", "<"); // $NON-NLS-1$ // $NON-NLS-2$
+ text = text.replaceAll("\\s*>", ">"); // $NON-NLS-1$ // $NON-NLS-2$
+ int index = text.indexOf('<');
+ hashName = text;
+ if (index > 0)
+ hashName = text.substring(0, index);
+ d = new ClassInfo(className, id.getNodeValue(), n);
+ classesById.put(id.getNodeValue(), d);
+ ClassInfo e = cppInfo.classes.get(hashName);
+ if (e != null) { /* We are dealing with a partial specific template...add it to list */
+ if (!d.areTemplateParmsFilled())
+ d.setTemplateParms(getTemplateParms(n));
+ String[] templateParms = d.getTemplateParms();
+ // For each template parameter, replace with a generic regex so later we can compare
+ // and identify a match (e.g. A<_a, _b> and A<char, _b> are defined and we have an instance
+ // of A<char, int>. We want to to match with A<char, _b> and replace all occurrences of "_b"
+ // with "int". For speed, we assume that the template parameter is not a subset of any
+ // other variable (e.g. if _A is used, there is no __A or _AB). If this proves untrue in
+ // any instance, more refinement of the initial value to replace will be required.
+ for (int k = 0; k < templateParms.length; ++k) {
+ text = text.replaceAll(templateParms[k], "[a-zA-Z0-9_: *]+"); // $NON-NLS-1$
+ }
+ d.setClassName(text);
+ e.addTemplate(d);
+ }
+ else
+ cppInfo.classes.put(hashName, d);
+ }
+ } else if (name2.equals("templateparamlist")) {
+ ArrayList<String> templates = new ArrayList<String>();
+ NodeList params = n2.getChildNodes();
+ int paramsLength = params.getLength();
+ for (int j2 = 0; j2 < paramsLength; ++j2) {
+ Node n3 = params.item(j2);
+ if (n3.getNodeName().equals("param")) {
+ NodeList types = n3.getChildNodes();
+ int typesLength = types.getLength();
+ for (int j3 = 0; j3 < typesLength; ++j3) {
+ Node n4 = types.item(j3);
+ if (n4.getNodeName().equals("declname")) {
+ templates.add(getElementText(n4));
+ }
+ }
+ }
+ }
+ String[] templateNames = new String[templates.size()];
+ d.setTemplateParms(templates.toArray(templateNames));
+ } else if (name2.equals("includes")) { // $NON-NLS-1$
+ String include = getElementText(n2);
+ if (d != null)
+ d.setInclude(include);
+ } else if (name2.equals("basecompoundref")) { // $NON-NLS-1$
+ // We have a base class. If public, add it to the list of nodes to look at in case we don't find the member
+ // in the current class definition.
+ NamedNodeMap m = n2.getAttributes();
+ if (m != null) {
+ Node refid = m.getNamedItem("refid"); // $NON-NLS-1$
+ Node prot2 = m.getNamedItem("prot"); // $NON-NLS-1$
+ if (prot2 != null && prot2.getNodeValue().equals("public")) { // $NON-NLS-1$
+ ClassInfo baseClass = null;
+ if (refid != null) {
+ // If we have been given the id of the base class, fetch it directly
+ baseClass = classesById.get(refid.getNodeValue());
+ } else {
+ // We probably have a template that needs resolution
+ String baseClassName = n2.getTextContent();
+// System.out.println("base class name is " + baseClassName);
+ baseClass = getClassInfo(baseClassName);
+ }
+ if (d != null && baseClass != null)
+ d.addBaseClass(baseClass);
+ }
+ }
+ } else if (name2.equals("sectiondef")) { // $NON-NLS-1$
+ // We are only interested in public member functions which are in their own section.
+ NamedNodeMap m = n2.getAttributes();
+ if (m != null) {
+ Node kind2 = m.getNamedItem("kind"); // $NON-NLS-1$
+ if (kind2 != null && kind2.getNodeValue().equals("public-func")) { // $NON-NLS-1$
+ NodeList pubfuncs = n2.getChildNodes();
+ int pubfuncLength = pubfuncs.getLength();
+ for (int j1 = 0; j1 < pubfuncLength; ++j1) {
+ Node n3 = pubfuncs.item(j1);
+ // Add all public member functions to the list of members
+ if (n3.getNodeName().equals("memberdef")) { // $NON-NLS-1$
+ NamedNodeMap m3 = n3.getAttributes();
+ if (m3 != null) {
+ Node m3Kind = m3.getNamedItem("kind"); // $NON-NLS-1$
+ if (m3Kind != null && m3Kind.getNodeValue().equals("function")) { // $NON-NLS-1$
+ String name = null;
+ String type = null;
+ String args = null;
+ String desc = null;
+ ArrayList<String> parms = new ArrayList<String>();
+ NodeList nl4 = n3.getChildNodes();
+ int memberLength = nl4.getLength();
+ for (int k = 0; k < memberLength; ++k) {
+ Node n4 = nl4.item(k);
+ String n4Name = n4.getNodeName();
+ if (n4Name.equals("type")) { // $NON-NLS-1$
+ NodeList nl5 = n4.getChildNodes();
+ type = new String(""); // $NON-NLS-1$
+ for (int x = 0; x < nl5.getLength(); ++x) {
+ Node n5 = nl5.item(x);
+ if (n5.getNodeType() == Node.TEXT_NODE)
+ type += n5.getNodeValue();
+ else if (n5.getNodeName().equals("ref")) { // $NON-NLS-1$
+ NamedNodeMap n5m = n5.getAttributes();
+ Node n5id = n5m.getNamedItem("refid");
+ if (n5id != null) {
+ String refid = n5id.getNodeValue();
+ ClassInfo refClass = classesById.get(refid);
+ if (refClass != null)
+ type += refClass.getClassName();
+ }
+ }
+ }
+ } else if (n4Name.equals("name")) { // $NON-NLS-1$
+ name = n4.getTextContent();
+ } else if (n4Name.equals("argsstring")) { // $NON-NLS-1$
+ args = getElementText(n4);
+ } else if (n4Name.equals("param")) { // $NON-NLS-1$
+ NodeList nl5 = n4.getChildNodes();
+ for (int x = 0; x < nl5.getLength(); ++x) {
+ Node n5 = nl5.item(x);
+ if (n5.getNodeName().equals("type")) { // $NON-NLS-1$
+ parms.add(getElementText(n5));
+ }
+ }
+ } else if (n4Name.equals("briefdescription")) { // $NON-NLS-1$
+ NodeList nl5 = n4.getChildNodes();
+ for (int x = 0; x < nl5.getLength(); ++x) {
+ Node n5 = nl5.item(x);
+ if (n5.getNodeName().equals("para")) { // $NON-NLS-1$
+ if (desc == null)
+ desc = new String("");
+ desc += "<p>" + getElementText(n5) + "</p>"; // $NON-NLS-1$ // $NON-NLS-2$
+ }
+ }
+ } else if (n4Name.equals("detaileddescription")) { // $NON-NLS-1$
+ NodeList nl5 = n4.getChildNodes();
+ for (int x = 0; x < nl5.getLength(); ++x) {
+ Node n5 = nl5.item(x);
+ if (n5.getNodeName().equals("para")) { // $NON-NLS-1$
+ if (desc == null)
+ desc = new String(""); // $NON-NLS-1$
+ NodeList nl6 = n5.getChildNodes();
+ Node n6 = nl6.item(0);
+ if (n6.getNodeType() == Node.TEXT_NODE)
+ desc += "<p>" + getElementText(n5) + "</p>"; // $NON-NLS-1$ // $NON-NLS-2$
+ else {
+ for (int x2 = 0; x2 < nl6.getLength(); ++x2) {
+ n6 = nl6.item(x2);
+ if (n6.getNodeName().equals("parameterlist")) { // $NON-NLS-1$
+ desc += getParameters(n6);
+ } else if (n6.getNodeName().equals("simplesect")) { // $NON-NLS-1$
+ desc += getReturn(n6);
+ }
+ }
+ }
+ }
+ }
+ } else if (n4Name.equals("location")) {
+ // Location is after all descriptions so we can now add the member
+ if (name != null) {
+ MemberInfo member = new MemberInfo(name);
+ member.setReturnType(type);
+ member.setPrototype(args);
+ member.setDescription(desc);
+ String[] argNames = new String[parms.size()];
+ member.setParamTypes(parms.toArray(argNames));
+ d.addMember(member);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ // Create a hash table of all the typedefs. Keep any template info.
+ nl = getDocument().getElementsByTagName("memberdef"); // $NON-NLS-1$
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node n = nl.item(i);
+ NamedNodeMap attrs = n.getAttributes();
+ if (attrs != null) {
+ Node kind = attrs.getNamedItem("kind"); // $NON-NLS-1$
+ Node prot = attrs.getNamedItem("prot"); // $NON-NLS-1$
+ if (kind != null && kind.getNodeValue().equals("typedef") // $NON-NLS-1$
+ && prot != null && prot.getNodeValue().equals("public")) { // $NON-NLS-1$
+ NodeList list = n.getChildNodes();
+ for (int x = 0; x < list.getLength(); ++x) {
+ Node n2 = list.item(x);
+ if (n2.getNodeName().equals("definition")) { // $NON-NLS-1$
+ String def = n2.getTextContent();
+ if (def != null && !def.equals("")) {
+ def = def.replaceAll("<\\s*", "<"); // $NON-NLS-1$ // $NON-NLS-2$
+ def = def.replaceAll("\\s*>", ">"); // $NON-NLS-1$ // $NON-NLS-2$
+ String[] types = getTypedefTypes(def);
+ TypedefInfo d = new TypedefInfo(types[1], types[0]);
+ String hashName = d.getTypedefName();
+ int index = hashName.indexOf('<');
+ if (index > 0) {
+ String className = hashName.substring(0, index);
+ hashName = hashName.replaceAll("<.*>", "<>"); // $NON-NLS-1$ // $NON-NLS-2$
+ ClassInfo e = cppInfo.classes.get(className);
+ if (e == null)
+ break;
+ ArrayList<ClassInfo> children = e.getChildren();
+ if (children != null && children.size() > 0) {
+ for (int y = 0; y < children.size(); ++y) {
+ ClassInfo child = children.get(y);
+ String childName = child.getClassName().replaceAll("\\*", "\\\\*"); // $NON-NLS-1$ // $NON-NLS-2$
+ childName = childName.replace("[]", "\\[\\]"); // $NON-NLS-1$ // $NON-NLS-2$
+ if (types[1].matches(childName.concat("::.*"))) { // $NON-NLS-1$
+ e = child;
+ break;
+ }
+ }
+ }
+ String[] templates = e.getTemplateParms();
+ d.copyTemplates(templates);
+
+ TypedefInfo f = cppInfo.typedefs.get(hashName);
+ if (f != null) {
+ String typedefName = d.getTypedefName();
+ for (int z = 0; z < templates.length; ++z) {
+ typedefName = typedefName.replaceAll(templates[z], "[a-zA-Z0-9_: ]+"); // $NON-NLS-1$
+ }
+ d.setTypedefName(typedefName);
+ f.addTypedef(d);
+ }
+ else
+ cppInfo.typedefs.put(hashName, d);
+ break;
+ } else {
+ // Otherwise we have a non-template typedef name. Just add it to the list.
+ cppInfo.typedefs.put(hashName, d);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ // Now, output the LibHoverInfo for caching later
+ FileOutputStream f = new FileOutputStream(fileName);
+ ObjectOutputStream out = new ObjectOutputStream(f);
+ out.writeObject(cppInfo);
+ out.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private String getParameters(Node n6) {
+ String desc = "<br><br><h3>Parameters:</h3>";
+ NodeList nl = n6.getChildNodes();
+ for (int x = 0; x < nl.getLength(); ++x) {
+ Node n = nl.item(x);
+ if (n.getNodeName().equals("parameteritem")) {
+ NodeList nl2 = n.getChildNodes();
+ for (int y = 0; y < nl2.getLength(); ++y) {
+ Node n2 = nl2.item(y);
+ if (n2.getNodeName().equals("parameternamelist")) {
+ NodeList nl3 = n2.getChildNodes();
+ for (int z = 0; z < nl3.getLength(); ++z) {
+ Node n3 = nl3.item(z);
+ if (n3.getNodeName().equals("parametername")) {
+ desc += getElementText(n3) + " - ";
+ }
+ }
+ } else if (n2.getNodeName().equals("parameterdescription")) {
+ desc += getElementText(n2) + "<br>";
+ }
+
+ }
+ }
+ }
+ return desc;
+
+ }
+
+ private String getReturn(Node n6) {
+ String desc = "";
+ NamedNodeMap m = n6.getAttributes();
+ Node kind = m.getNamedItem("kind");
+ if (kind != null && kind.getNodeValue().equals("return")) {
+ desc += "<br><h3>Returns:</h3>" + getElementText(n6) + "<br>";
+ }
+ return desc;
+ }
+
+ public String[] getTemplateParms(Node classNode) {
+ Node n = null;
+ ArrayList<String> templateArray = new ArrayList<String>();
+ NodeList list = classNode.getChildNodes();
+ for (int i = 0; i < list.getLength(); ++i) {
+ n = list.item(i);
+ if (n.getNodeName().equals("templateparamlist")) { // $NON-NLS-1$
+ break;
+ }
+ }
+ if (n != null) {
+ NodeList templateList = n.getChildNodes();
+ for (int j = 0; j < templateList.getLength(); ++j) {
+ Node p = templateList.item(j);
+ if (p.getNodeName().equals("param")) { // $NON-NLS-1$
+ NodeList paramList = p.getChildNodes();
+ for (int k = 0; k < paramList.getLength(); ++k) {
+ Node q = paramList.item(k);
+ if (q.getNodeName().equals("declname")) { // $NON-NLS-1$
+ String templateName = q.getTextContent();
+ templateArray.add(templateName);
+ }
+ }
+ }
+ }
+ }
+ String[] templates = new String[templateArray.size()];
+ return templateArray.toArray(templates);
+ }
+
+ /**
+ * Create LibHoverInfo serialized output
+ *
+ * @param args (args[0] = location of Doxygen xml document to parse (file or URL),
+ * args[1] = name of file to put serialized LibHoverInfo
+ */
+ public static void main(String[] args) {
+ URI acDoc;
+ try {
+ acDoc = new URI(args[0]);
+ IPath p = URIUtil.toPath(acDoc);
+ InputStream docStream = null;
+ if (p == null) {
+ URL url = acDoc.toURL();
+ docStream = url.openStream();
+ } else {
+ docStream = new FileInputStream(p.toFile());
+ }
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(false);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(docStream);
+ if (doc != null) {
+ DoxygenCPPInfo d = new DoxygenCPPInfo(doc);
+ d.buildDoxygenCPPInfo(args[1]);
+ }
+ System.out.println("Built " + args[1] + " from " + args[0]);
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ParserConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml
new file mode 100644
index 0000000000..e034d33e3e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="libstdc++ library" link_to="../org.eclipse.linuxtools.cdt.libhover.library_docs/toc.xml#moreclibdocs">
+ <topic href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/spine.html" label="libstdc++">
+ </topic>
+</toc>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/.project
new file mode 100644
index 0000000000..9773d04c6b
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover.newlib-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/ChangeLog
new file mode 100644
index 0000000000..f52d6c323f
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/ChangeLog
@@ -0,0 +1,20 @@
+2009-08-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #285867
+ * feature.properties: Change provider to Eclipse instead of Eclipse.org.
+
+2009-08-05 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Add ".qualifier" to version.
+
+2009-08-05 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Rename to org.eclipse.linuxtools.cdt.libhover.newlib.
+
+2009-05-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * about.html: Initial check-in.
+ * build.properties: Ditto.
+ * epl-v10.html: Ditto.
+ * feature.properties: Ditto.
+ * feature.xml: Ditto. \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/about.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/build.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/build.properties
new file mode 100644
index 0000000000..d361ddb536
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/build.properties
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ about.html,\
+ epl-v10.html,\
+ feature.properties
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/epl-v10.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/epl-v10.html
new file mode 100644
index 0000000000..9320c9f37c
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/epl-v10.html
@@ -0,0 +1,320 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="ProgId" content="Word.Document">
+<meta name="Generator" content="Microsoft Word 9">
+<meta name="Originator" content="Microsoft Word 9">
+<link rel="File-List" href="http://www.eclipse.org/legal/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head><body style="" lang="EN-US">
+
+<div class="Section1">
+
+<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p>
+
+<p><span style="font-size: 10pt;">"Contribution" means:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear="left">
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+changes to the Program, and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+additions to the Program;</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style="font-size: 10pt;">"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style="font-size: 10pt;">"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p>
+
+<p><span style="font-size: 10pt;">A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+its license agreement:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style="color: blue;"> </span></span></p>
+
+<p><span style="font-size: 10pt;">When the Program is made available in source
+code form:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it must be made available under this Agreement; and </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style="font-size: 10pt;">Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style="font-size: 10pt;">For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p>
+
+<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style="font-size: 10pt;">If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class="MsoNormal"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></p>
+
+</div>
+
+</body></html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.properties
new file mode 100644
index 0000000000..6844d99700
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.properties
@@ -0,0 +1,112 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+featureName=Libhover for Newlib Feature (Incubation)
+description=Hover help plugins for maintaining C projects using newlib.
+provider=Eclipse
+copyright=Copyright 2009 Red Hat, Inc.
+licenseURL=epl-v10.html
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.xml
new file mode 100644
index 0000000000..4beb8a6d1c
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib-feature/feature.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.cdt.libhover.newlib"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%provider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="epl-v10.php">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Update Site" url="http://download.eclipse.org/technology/linuxtools/update"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.linuxtools.cdt.libhover.library_docs" version="1.0.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.libhover.newlib"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/.project
new file mode 100644
index 0000000000..f3a0af0ef5
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/.project
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover.newlib</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/ChangeLog
new file mode 100644
index 0000000000..04a4fa75be
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/ChangeLog
@@ -0,0 +1,32 @@
+2009-08-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #285867
+ * plugin.properties: Change Provider to Eclipse instead of Eclipse.org.
+
+2009-02-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump up version to 1.0.2.
+ * plugin.xml: Change to use new libhover library interface which requires
+ the location of a serialized LibHoverInfo instance rather than an xml document.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add .qualifier to version and bump up to 1.0.1.
+
+2008-11-03 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Add plugin.properties.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.properties: Initial checkin.
+ * META-INF/MANIFEST.MF: Use plugin.properties. Add "(Incubation)".
+
+2008-10-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * .project: New plugin for newlib libhover.
+ * META-INF/MANIFEST.MF: New file.
+ * plugin.xml: Ditto.
+ * toc.xml: Ditto.
+ * about.html: Ditto.
+ * build.properties: Ditto. \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/META-INF/MANIFEST.MF b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..69e8682fef
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.libhover.newlib;singleton:=true
+Bundle-Version: 1.0.2.qualifier
+Bundle-Vendor: %provider
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.linuxtools.cdt.libhover.library_docs;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/about.html b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/build.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/build.properties
new file mode 100644
index 0000000000..2220fabe27
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/build.properties
@@ -0,0 +1,5 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ toc.xml,\
+ plugin.properties
+src.includes = about.html
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.properties
new file mode 100644
index 0000000000..31d8eaee5d
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=Newlib Libhover (Incubation)
+provider=Eclipse \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.xml
new file mode 100644
index 0000000000..3571976491
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/plugin.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ id="library"
+ name="Newlib C Library"
+ point="org.eclipse.linuxtools.cdt.libhover.library">
+ <library
+ docs="http://www.sourceware.org/newlib/libc.html"
+ location="http://www.sourceware.org/eclipse/libhover/newlib-1.16.0.libhover"
+ name="newlib library"
+ type="C">
+ </library>
+ </extension>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="false">
+ </toc>
+ </extension>
+
+</plugin>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml
new file mode 100644
index 0000000000..c73c418dab
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="newlib library" link_to="../org.eclipse.linuxtools.cdt.libhover.library_docs/toc.xml#moreclibdocs">
+ <topic href="http://www.sourceware.org/newlib/libc.html" label="newlib libc">
+ </topic>
+ <topic href="http://www.sourceware.org/newlib/libm.html" label="newlib libm">
+ </topic>
+</toc>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.classpath b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.classpath
new file mode 100644
index 0000000000..fb5011632c
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.classpath
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.project
new file mode 100644
index 0000000000..175b8a50b1
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover.texinfoparsers</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/ChangeLog
new file mode 100644
index 0000000000..ca197aa37b
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/ChangeLog
@@ -0,0 +1,55 @@
+2009-11-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ Refactor to org.eclipse.linuxtools.cdt.libhover.texinfoparsers.
+
+2008-10-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseNewlibTexinfo.java (DeftypefunPattern3): New
+ pattern for matching va_arg functions.
+ (RtnTypeVar): Ditto.
+ (HandleFunctionDefs): Fix so multi-line prototypes are read until the line doesn't
+ end with comma. Also add function pointer and va_arg function type support.
+ * src/com/redhat/eclipse/cdt/autotools/tools/TexinfoUtils.java (transformTags): Fix
+ table handling so like tables can be nested inside each other and/or can have @itemize
+ constructs between tables.
+
+2008-10-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseNewlibTexinfo.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/tools/TexinfoUtils.java (transformTags):
+ Handle @strong{x}.
+
+2007-11-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseGlibcTexinfo.java: Fix
+ include regexp to handle the case where a choice of headers are specified
+ with a blank between them. Take the last header in the list in this case.
+ Also clear the global IncludeList whenever an @end deftypefn is seen.
+
+2007-11-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseTexinfo.java: Renamed...
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseGlibcTexinfo.java: ...to this.
+ Code has been modified to use new TexinfoUtils class for tag stripping. All
+ lines in synopsis are marked with <eol> at end to allow proper processing.
+ Fixed comment stripping and added @include support for bringing in sample files
+ from examples directory.
+ * src/com/redhat/eclipse/cdt/autotools/tools/TexinfoUtils.java: New file to
+ support proper transformation of texinfo tags into xml format that can be used
+ by a C Help processor. Code was based on old killTags method, but rewritten to
+ handle many more types of scenarios found in glibc docs.
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseAutoconfHTML.java: Add
+ copyright statement.
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseAutoconfTexinfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseAutomakeTexinfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseAutoconfHTML.java: Removed.
+
+2007-11-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseAutomakeTexinfo.java: New file to
+ parse Automake documentation and create xml files to use with Autotools plugin.
+
+2007-06-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tools/ParseAutoconfTexinfo.java: New file to
+ parse Autoconf documentation and create xml files to use with Autotools plugin. \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/README b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/README
new file mode 100644
index 0000000000..600b5ec95b
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/README
@@ -0,0 +1,12 @@
+This project contains texinfo parsers used to create xml files for the purpose
+of use with the Linux Tools plug-ins. The parsers here were used to create the
+ xml files for glibc and newlib libhover and for autotools hover help for the
+autoconf editor. The glibc and newlib xml files were fed to the libhover
+plugin BuildFunctionInfos java executable found in the libhover plugin:
+
+ org.eclipse.linuxtools.cdt.libhover.utils/BuildFunctionInfos.java
+
+to create the libhover binary files used in the glibc and newlib libhover
+plugins.
+
+To build, right-click on the build.xml file and run as -> Ant Build.
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml
new file mode 100644
index 0000000000..9abc931009
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml
@@ -0,0 +1,15 @@
+<project name="Texinfo Parser" default="compile" basedir=".">
+ <property name="src" value="."/>
+ <property name="build" value="build"/>
+ <property name="build.compiler" value="modern"/>
+
+ <target name="init">
+ <tstamp/>
+ <mkdir dir="${build}"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="${src}" destdir="${build}" />
+ </target>
+</project>
+ \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java
new file mode 100644
index 0000000000..360d494fd8
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java
@@ -0,0 +1,645 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover.texinfoparsers;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+//This file contains a texinfo parser that can be
+//run to create the Autotools glibc.xml file.
+//Usage is as follows:
+//1. compile this file using javac
+//2. run this file using java, passing the
+//arguments: ${glibc_source_path}/manual glibc.xml
+
+public class ParseAutoconfTexinfo {
+
+ static final boolean DEBUG = false;
+
+ static final String ATcmd = "(@\\w*)";
+
+ // 0
+ static final String Defmac = "@defmac";
+ static final String Defmacx = "@defmacx";
+
+ // 1
+ static final String MacroName = "(\\w*)";
+ static final int MacroNameIndex = 1;
+
+ // 2 3
+ static final String Parms = "(\\((.*)\\))";
+ static final int ParmsIndex = 2;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern MacroPattern
+ = Pattern.compile("^" + Defmac + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPattern2
+ = Pattern.compile("^" + Defmac + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx
+ = Pattern.compile("^" + Defmacx + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx2
+ = Pattern.compile("^" + Defmacx + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+
+ private static Map macroMap;
+
+ static class MacroParms {
+ String[] parms;
+ MacroParms nextParms = null;
+
+ public MacroParms(String[] parms) {
+ this.parms = parms;
+ }
+ }
+
+ static class MacroDef {
+ String MacroName;
+ MacroParms Parameters;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static String killTagsParms(String tt) {
+ Matcher mm;
+
+ mm = ParmBracketPattern.matcher(tt);
+ tt= mm.replaceAll("$1");
+
+ mm = OVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1]");
+
+ mm = DVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1=$2]");
+
+ mm = VarPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = RPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = DotsPattern.matcher(tt);
+ tt = mm.replaceAll("...");
+
+ return tt;
+ }
+
+
+ private static String killTags(String tt) {
+ Matcher mm;
+ String ss = "";
+
+ while (ss != tt) {
+ mm = XrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern2.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NoIndentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<VAR>$1</VAR>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<small>...</small>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommandPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = KbdPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<KBD>$1</KBD>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EmphPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<EM>$1</EM>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = FilePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TT>$1</TT>");
+ }
+
+
+ ss = "";
+ while (ss != tt) {
+ mm = VerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = OptionPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre></td></tr></table>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndEnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.matches()) {
+ System.out.println("group 1 is " + mm.group(1));
+ System.out.println("group 2 is " + mm.group(2));
+ System.out.println("group 3 is " + mm.group(3));
+ }
+ tt = mm.replaceAll("$1<DT>'<SAMP>$2</SAMP>'\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT>$2\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndTablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ //FIXME: if there ever is a @itemize @bullet within a
+ // @itemize @minus or vice-versa, the following
+ // logic will get it wrong.
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeMinusPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<UL>$1</UL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeBulletPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>$1</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<LI>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ mm = AmpersandPattern.matcher(tt);
+ tt = mm.replaceAll("&amp;");
+
+ mm = LeftAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&lt;");
+
+ mm = RightAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&gt;");
+
+ // Clean up the eol markers we used to mark end of line for items
+ mm = EOLPattern.matcher(tt);
+ tt = mm.replaceAll("");
+
+ return tt;
+ }
+
+ private static MacroDef BuildMacroDef(Matcher m) {
+ MacroDef md = new MacroDef();
+
+ md.MacroName = m.group(MacroNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = killTagsParms(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ md.Parameters = new MacroParms(parms);
+ }
+ return md;
+ }
+
+ private static MacroParms AddMacroDefxParms(MacroParms mp, Matcher mx) {
+ if (null != mx.group(ParmsIndex)) {
+ String tt = killTagsParms(mx.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ MacroParms mpnew = new MacroParms(parms);
+ mp.nextParms = mpnew;
+ return mpnew;
+ }
+ return null;
+ }
+
+ private static MacroDef HandleMacroDef(BufferedReader is, String s) throws IOException {
+ MacroDef fd = null;
+
+ Matcher m = MacroPattern.matcher(s);
+
+ if (m.matches()) {
+ fd = BuildMacroDef(m);
+ }
+ else { // assume the line got split and retry
+ is.mark(100);
+ String il = is.readLine();
+ m = MacroPattern.matcher(s + il);
+ if (m.matches()) fd = BuildMacroDef(m);
+ else {
+ is.reset();
+ m = MacroPattern2.matcher(s);
+ if (m.matches()) {
+ fd = new MacroDef();
+ fd.MacroName = m.group(MacroNameIndex);
+ fd.Parameters = new MacroParms(new String[0]);
+ }
+ }
+ }
+
+ if (fd != null) {
+ // Look for @defmacx which are alternate prototypes for the macro
+ is.mark(100);
+ String il = is.readLine();
+ if (il != null) {
+ Matcher mx = MacroPatternx.matcher(il);
+ Matcher mx2 = MacroPatternx2.matcher(il);
+ MacroParms mp = fd.Parameters;
+ while (mx.matches() || mx2.matches()) {
+ if (mx.matches())
+ mp = AddMacroDefxParms(mp, mx);
+ else {
+ MacroParms mpnew = new MacroParms(new String[0]);
+ mp.nextParms = mpnew;
+ mp = mpnew;
+ }
+ is.mark(100);
+ il = is.readLine();
+ if (il != null) {
+ mx = MacroPatternx.matcher(il);
+ mx2 = MacroPatternx2.matcher(il);
+ }
+ }
+ is.reset();
+ }
+
+ if (macroMap.get(fd.MacroName) != null)
+ return null;
+ macroMap.put(fd.MacroName, fd);
+ }
+
+ return fd;
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
+ private static void CreateHeader(BufferedWriter os) throws IOException {
+ WriteString(os, "<!-- This file automatically generated by ParseAutoconfTexinfo utility -->");
+ WriteString(os, "<!-- cvs -d:pserver:anonymous@sources.redhat.com:/cvs/eclipse \\ -->");
+ WriteString(os, "<!-- co autotools/ParseTexinfo -->");
+ WriteString(os, "<!DOCTYPE macros [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macros (macro)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macro (prototype*,synopsis)>");
+ WriteString(os, " <!ATTLIST macro");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
+ }
+
+
+
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</macros>");
+ }
+
+ private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = killTags(Synopsis);
+ String[] tt = ss.split("\\s");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ if (tt[pp].equals("&lt;br&gt;")) {
+ WriteString(os, spaces + aa + "&lt;/P&gt;&lt;P&gt;\n");
+ aa = "";
+ }
+ else {
+ if ((aa.length() + tt[pp].length()) > 64) {
+ WriteString(os, spaces + aa);
+ aa = "";
+ }
+ aa = aa + " " + tt[pp];
+ }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static void HandleDefmacro(BufferedWriter os, BufferedReader is, String s) throws IOException {
+ String il;
+ MacroDef md;
+ List FDefs = new ArrayList();
+ String Synopsis = null;
+
+ if (null != (md = HandleMacroDef(is, s))) FDefs.add(md);
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@defmac")) {
+ if (null != (md = HandleMacroDef(is, il))) FDefs.add(md);
+ }
+ else if (il.startsWith("@comment") ||
+ il.startsWith("@c ")) { // comment -- ignore it
+ }
+ else if (il.startsWith("@end defmac")) {
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ md = (MacroDef)FDefs.get(kk);
+
+ WriteString(os, " <macro id=\"" + md.MacroName + "\">");
+
+ MacroParms mp = md.Parameters;
+ do {
+ WriteString(os, " <prototype>");
+ String[] parms = mp.parms;
+ for (int i = 0; i < parms.length; i++) {
+ WriteString(os, " <parameter content=\"" + parms[i] + "\"/>");
+ }
+ WriteString(os, " </prototype>");
+ mp = mp.nextParms;
+ } while (mp != null);
+
+ if (null != Synopsis) WriteSynopsis(os, Synopsis, false);
+
+ WriteString(os, " </macro>");
+ }
+ return;
+ }
+ else {
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br>" :
+ il.startsWith("@item") ? il + "<eol>" : il);
+
+ }
+ }
+ FDefs.clear();
+
+ }
+
+ private static class OnlyTexi implements FilenameFilter {
+ public boolean accept(File dir, String s) {
+ return (s.endsWith(".texi")) ? true : false;
+ }
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
+ try {
+ macroMap = new HashMap();
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<macros>");
+
+ try {
+ String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
+ for (int i = 0; i < dir.length; i++) {
+ String qFile = srcdir.endsWith("/")
+ ? srcdir + dir[i]
+ : srcdir + "/" + dir[i];
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@defmac")) { // handle @defmac x]
+ HandleDefmacro(os, is, il);
+ }
+ }
+ is.close();
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ }
+ }
+ catch (NullPointerException e) {
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ // arg[0] is input directory containing .texi documents to read
+ // arg[1] is output xml file to create
+ BuildXMLFromTexinfo(args[0], args[1]);
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java
new file mode 100644
index 0000000000..c61adc026a
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java
@@ -0,0 +1,661 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover.texinfoparsers;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+//This file contains a texinfo parser that can be
+//run to create the Autotools glibc.xml file.
+//Usage is as follows:
+//1. compile this file using javac
+//2. run this file using java, passing the
+//arguments: dir_to_automake_texi_files output_xml_file_name
+
+public class ParseAutomakeTexinfo {
+
+ static final boolean DEBUG = false;
+
+ static final String ATcmd = "(@\\w*)";
+
+ // Currently in automake docs, the macro section starts with
+ // a subsection as below and a table which contains macros which
+ // are item and itemx entries.
+ static final String MacrosStart = "@subsection\\sPublic\\smacros";
+ static final String OldMacrosStart = "@section\\sAutoconf\\smacros.*";
+ static final Pattern MacroSection1 = Pattern.compile(MacrosStart);
+ static final Pattern MacroSection2 = Pattern.compile(OldMacrosStart);
+ // 0
+ static final String Defmac = "@item";
+ static final String Defmacx = "@itemx";
+
+ // 1
+ static final String MacroName = "(\\w*)";
+ static final int MacroNameIndex = 1;
+
+ // 2 3
+ static final String Parms = "(\\((.*)\\))";
+ static final int ParmsIndex = 2;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern MacroPattern
+ = Pattern.compile("^" + Defmac + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPattern2
+ = Pattern.compile("^" + Defmac + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx
+ = Pattern.compile("^" + Defmacx + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx2
+ = Pattern.compile("^" + Defmacx + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index.*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern UrefPattern = Pattern.compile("@uref\\{([^,]*),\\s+([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+
+ private static Map macroMap;
+
+ static class MacroParms {
+ String[] parms;
+ MacroParms nextParms = null;
+
+ public MacroParms(String[] parms) {
+ this.parms = parms;
+ }
+ }
+
+ static class MacroDef {
+ String MacroName;
+ MacroParms Parameters;
+ String Synopsis;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static String killTagsParms(String tt) {
+ Matcher mm;
+
+ mm = ParmBracketPattern.matcher(tt);
+ tt= mm.replaceAll("$1");
+
+ mm = OVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1]");
+
+ mm = DVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1=$2]");
+
+ mm = VarPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = RPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = DotsPattern.matcher(tt);
+ tt = mm.replaceAll("...");
+
+ return tt;
+ }
+
+
+ private static String killTags(String tt) {
+ Matcher mm;
+ String ss = "";
+
+ while (ss != tt) {
+ mm = XrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern2.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NoIndentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<VAR>$1</VAR>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<small>...</small>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommandPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = UrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<A HREF=\"$1>$2</A>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = KbdPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<KBD>$1</KBD>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EmphPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<EM>$1</EM>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = FilePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TT>$1</TT>");
+ }
+
+
+ ss = "";
+ while (ss != tt) {
+ mm = VerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = OptionPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre></td></tr></table>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndEnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.matches()) {
+ System.out.println("group 1 is " + mm.group(1));
+ System.out.println("group 2 is " + mm.group(2));
+ System.out.println("group 3 is " + mm.group(3));
+ }
+ tt = mm.replaceAll("$1<DT>'<SAMP>$2</SAMP>'\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT>$2\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndTablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ //FIXME: if there ever is a @itemize @bullet within a
+ // @itemize @minus or vice-versa, the following
+ // logic will get it wrong.
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeMinusPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<UL>$1</UL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeBulletPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>$1</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<LI>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ mm = AmpersandPattern.matcher(tt);
+ tt = mm.replaceAll("&amp;");
+
+ mm = LeftAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&lt;");
+
+ mm = RightAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&gt;");
+
+ // Clean up the eol markers we used to mark end of line for items
+ mm = EOLPattern.matcher(tt);
+ tt = mm.replaceAll("");
+
+ return tt;
+ }
+
+ private static MacroDef BuildMacroDef(Matcher m) {
+ MacroDef md = new MacroDef();
+
+ md.MacroName = m.group(MacroNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = killTagsParms(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ md.Parameters = new MacroParms(parms);
+ }
+ return md;
+ }
+
+ private static MacroParms AddMacroDefxParms(MacroParms mp, Matcher mx) {
+ if (null != mx.group(ParmsIndex)) {
+ String tt = killTagsParms(mx.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ MacroParms mpnew = new MacroParms(parms);
+ mp.nextParms = mpnew;
+ return mpnew;
+ }
+ return null;
+ }
+
+ private static MacroDef HandleMacroDef(BufferedReader is, String s) throws IOException {
+ MacroDef fd = null;
+
+ Matcher m = MacroPattern.matcher(s);
+
+ if (m.matches()) {
+ fd = BuildMacroDef(m);
+ }
+ else { // assume the line got split and retry
+ is.mark(100);
+ String il = is.readLine();
+ m = MacroPattern.matcher(s + il);
+ if (m.matches()) fd = BuildMacroDef(m);
+ else {
+ is.reset();
+ m = MacroPattern2.matcher(s);
+ if (m.matches()) {
+ fd = new MacroDef();
+ fd.MacroName = m.group(MacroNameIndex);
+ fd.Parameters = new MacroParms(new String[0]);
+ }
+ }
+ }
+
+ if (fd != null) {
+ // Look for @defmacx which are alternate prototypes for the macro
+ is.mark(100);
+ String il = is.readLine();
+ if (il != null) {
+ Matcher mx = MacroPatternx.matcher(il);
+ Matcher mx2 = MacroPatternx2.matcher(il);
+ MacroParms mp = fd.Parameters;
+ while (mx.matches() || mx2.matches()) {
+ if (mx.matches())
+ mp = AddMacroDefxParms(mp, mx);
+ else {
+ MacroParms mpnew = new MacroParms(new String[0]);
+ mp.nextParms = mpnew;
+ mp = mpnew;
+ }
+ is.mark(100);
+ il = is.readLine();
+ if (il != null) {
+ mx = MacroPatternx.matcher(il);
+ mx2 = MacroPatternx2.matcher(il);
+ }
+ }
+ is.reset();
+ }
+
+ if (macroMap.get(fd.MacroName) != null)
+ return null;
+ macroMap.put(fd.MacroName, fd);
+ }
+
+ return fd;
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
+ private static void CreateHeader(BufferedWriter os) throws IOException {
+ WriteString(os, "<!-- This file automatically generated by ParseAutomakeTexinfo utility -->");
+ WriteString(os, "<!-- cvs -d:pserver:anonymous@sources.redhat.com:/cvs/eclipse \\ -->");
+ WriteString(os, "<!-- co autotools/ParseTexinfo -->");
+ WriteString(os, "<!DOCTYPE macros [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macros (macro)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macro (prototype*,synopsis)>");
+ WriteString(os, " <!ATTLIST macro");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
+ }
+
+
+
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</macros>");
+ }
+
+ private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = Synopsis;
+ String[] tt = ss.split("\\s");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ if (tt[pp].equals("&lt;br&gt;")) {
+ WriteString(os, spaces + aa + "&lt;/P&gt;&lt;P&gt;\n");
+ aa = "";
+ }
+ else {
+ if ((aa.length() + tt[pp].length()) > 64) {
+ WriteString(os, spaces + aa);
+ aa = "";
+ }
+ aa = aa + " " + tt[pp];
+ }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static void HandleDefmacro(BufferedWriter os, BufferedReader is, String s) throws IOException {
+ String il;
+ MacroDef md = null;
+ List FDefs = new ArrayList();
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith(Defmac)) {
+ if (null != (md = HandleMacroDef(is, il))) FDefs.add(md);
+ }
+ else if (il.startsWith("@comment") ||
+ il.startsWith("@c ")) { // comment -- ignore it
+ }
+ else if (il.startsWith("@subsection") ||
+ il.startsWith("@section")) {
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ md = (MacroDef)FDefs.get(kk);
+
+ WriteString(os, " <macro id=\"" + md.MacroName + "\">");
+
+ MacroParms mp = md.Parameters;
+ do {
+ WriteString(os, " <prototype>");
+ String[] parms = mp.parms;
+ for (int i = 0; i < parms.length; i++) {
+ WriteString(os, " <parameter content=\"" + parms[i] + "\"/>");
+ }
+ WriteString(os, " </prototype>");
+ mp = mp.nextParms;
+ } while (mp != null);
+
+ if (null != md.Synopsis) WriteSynopsis(os, md.Synopsis, false);
+
+ WriteString(os, " </macro>");
+ }
+ return;
+ }
+ else {
+ if (md != null)
+ md.Synopsis = ((md.Synopsis == null) ? "" : md.Synopsis + " " ) + ((il.length() == 0) ? "&lt;br&gt;&lt;br&gt;" :
+ il.startsWith("@item") ? killTags(il) + "<eol>" : killTags(il));
+ }
+ }
+ FDefs.clear();
+
+ }
+
+ private static class OnlyTexi implements FilenameFilter {
+ public boolean accept(File dir, String s) {
+ return (s.endsWith(".texi")) ? true : false;
+ }
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
+ try {
+ macroMap = new HashMap();
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<macros>");
+
+ try {
+ String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
+ for (int i = 0; i < dir.length; i++) {
+ String qFile = srcdir.endsWith("/")
+ ? srcdir + dir[i]
+ : srcdir + "/" + dir[i];
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+
+ while (null != (il = is.readLine())) {
+ Matcher mm1 = MacroSection1.matcher(il);
+ Matcher mm2 = MacroSection2.matcher(il);
+ if (mm1.matches() || mm2.matches()) {
+ HandleDefmacro(os, is, il);
+ }
+ }
+ is.close();
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ }
+ }
+ catch (NullPointerException e) {
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ // arg[0] is input directory containing .texi documents to read
+ // arg[1] is output xml file to create
+ BuildXMLFromTexinfo(args[0], args[1]);
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
new file mode 100644
index 0000000000..08f657c864
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
@@ -0,0 +1,881 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover.texinfoparsers;
+import java.io.*;
+import java.util.regex.*;
+import java.util.*;
+
+//This file contains a texinfo parser that can be
+//run to create the Autotools glibc.xml file.
+//Usage is as follows:
+//1. compile this file using javac
+//2. run this file using java, passing the
+//arguments: ${glibc_source_path}/manual glibc.xml
+
+public class ParseGlibcTexinfo {
+ static final boolean DEBUG = false;
+
+ // 1
+ static final String ATcmd = "(@\\w*)";
+
+
+ // 3 4
+ static final String RtnTypeM = "(\\{([^\\}]*)\\})";
+ static final int RtnTypeMIndex = 4;
+
+ // 5
+ static final String RtnTypeS = "(\\w*)";
+ static final int RtnTypeSIndex = 5;
+
+ // 2
+ static final String RtnType = "(" + RtnTypeM + "|" + RtnTypeS + ")";
+ // 6
+ static final String FunctionName = "(\\w*)";
+ static final int FunctionNameIndex = 6;
+
+ // 7 8
+ static final String Parms = "(\\((.*)\\))";
+ static final int ParmsIndex = 8;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern DeftypefunPattern
+ = Pattern.compile("^" + ATcmd + WhiteSpace +
+ RtnType + WhiteSpace +
+ FunctionName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final String TPDataType = "\\{[^\\}]*\\}";
+
+
+ // 3 4
+ static final String TPTypeM = "(\\{([^\\}]*)\\})";
+ static final int TPTypeMIndex = 4;
+
+ // 5
+ static final String TPTypeS = "(\\w*)";
+ static final int TPTypeSIndex = 5;
+
+ // 2
+ static final String TPType = "(" + TPTypeM + "|" + TPTypeS + ")";
+
+ static final Pattern DeftpPattern
+ = Pattern.compile("^" + ATcmd + WhiteSpace + TPDataType + WhiteSpace + TPType + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern IncludePattern = Pattern.compile("^@comment ((\\w*/)*\\w*\\.h\\s*)*\\s*$");
+ static final Pattern PindexPattern = Pattern.compile("^@pindex\\s*\\w*\\s*$");
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+ static List IncludeList = new ArrayList();
+
+
+ static class FunctionDef {
+ String ReturnType;
+ String FunctionName;
+ String[] Parameters;
+ Object[] IncludeList;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static FunctionDef BuildFunctionDef(Matcher m) {
+ FunctionDef fd = new FunctionDef();
+
+ fd.ReturnType = ((null != m.group(RtnTypeSIndex))
+ ? m.group(RtnTypeSIndex)
+ : m.group(RtnTypeMIndex));
+ fd.FunctionName = m.group(FunctionNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = TexinfoUtils.stripProtoTags(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ fd.Parameters = parms;
+ }
+
+ if (IncludeList.size() > 0) {
+ fd.IncludeList = IncludeList.toArray();
+ IncludeList.clear();
+ }
+ return fd;
+ }
+
+ private static void HandleDeftp(BufferedWriter os, BufferedReader is, String s) throws IOException {
+ TPDef td = new TPDef();
+ String il;
+ String Synopsis = null;
+ boolean ItemsAccumulating = false;
+ TPElement tpe = new TPElement();
+ List ElementList = new ArrayList();
+
+ Matcher m = DeftpPattern.matcher(s);
+ if (m.matches()) {
+ if (null != m.group(TPTypeMIndex)) {
+ String[] ss = m.group(TPTypeMIndex).split("\\s");
+ switch(ss.length) {
+ case 0:
+ td.TPType = "";
+ td.TPName = "type";
+ break;
+ case 1:
+ td.TPType = "type";
+ td.TPName = ss[0];
+ break;
+ case 2:
+ td.TPType = ss[0];
+ td.TPName = ss[1];
+ break;
+ default:
+ td.TPType = "type";
+ td.TPName = ss[ss.length - 1];
+ break;
+ }
+ }
+ else {
+ td.TPType = "dtype";
+ td.TPName = m.group(TPTypeSIndex);
+ }
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@end deftp")) {
+ WriteString(os, " <construct id=\"" + td.TPType + "-" + td.TPName
+ + "\" type=\"" + td.TPType + "\">");
+ WriteString(os, " <structure>");
+ if (null != td.TPSynopsis) WriteSynopsis(os, td.TPSynopsis, false);
+ if (ElementList.size() > 0) {
+ WriteString(os, " <elements>");
+ for (int ee = 0; ee < ElementList.size(); ee++) {
+ TPElement ttt = (TPElement)ElementList.get(ee);
+ WriteString(os, " <element content=\"" + ttt.Content + "\">");
+ if (null != ttt.Synopsis) WriteSynopsis(os, ttt.Synopsis, true);
+ WriteString(os, " </element>");
+ }
+ WriteString(os, " </elements>");
+ }
+ WriteString(os, " </structure>");
+ WriteString(os, " </construct>");
+ return;
+ }
+ else if (il.startsWith("@item")) {
+ if (ItemsAccumulating) {
+ tpe.Synopsis = Synopsis;
+ ElementList.add(tpe);
+ }
+ else {
+ td.TPSynopsis = Synopsis;
+ ItemsAccumulating = true;
+ }
+ Synopsis = null;
+ tpe = new TPElement();
+ tpe.Content = TexinfoUtils.transformTags(il.replaceFirst("@item ", ""));
+ }
+ else {
+ if (!il.startsWith("@table"))
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+ }
+ }
+ }
+
+ private static FunctionDef HandleFunctionDef(BufferedReader is, String s) throws IOException {
+ FunctionDef fd;
+
+ Matcher m = DeftypefunPattern.matcher(s);
+
+ if (m.matches()) fd = BuildFunctionDef(m);
+ else { // assume the line got split and retry
+ String il = is.readLine();
+ m = DeftypefunPattern.matcher(s + il);
+ if (m.matches()) fd = BuildFunctionDef(m);
+ else fd = null;
+ }
+
+ return fd;
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
+ private static void CreateHeader(BufferedWriter os) throws IOException {
+ WriteString(os, "<!-- This file automatically generated by an Eclipse utility -->");
+ WriteString(os, "<!DOCTYPE descriptions [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT descriptions (construct)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT construct (structure|function)*>");
+ WriteString(os, " <!ATTLIST construct");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " type CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT structure (synopsis?, elements?)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT elements (element*)>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT element (synopsis*)>");
+ WriteString(os, " <!ATTLIST element");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT function (prototype,headers?,synopsis)>");
+ WriteString(os, " <!ATTLIST function");
+ WriteString(os, " returntype CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT headers (header+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT header (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST header");
+ WriteString(os, " filename CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
+ }
+
+// // For now we will use an aggregate document license instead of one per
+// // document.
+// private static void CreateLicense(BufferedWriter os) throws IOException {
+// WriteString(os, "<!--");
+// WriteString(os, "A.1 GNU Free Documentation License");
+// WriteString(os,"Version 1.2, November 2002");
+// WriteString(os, "");
+// WriteString(os, "Copyright &copy; 2000,2001,2002 Free Software Foundation, Inc.");
+// WriteString(os, "59 Temple Place, Suite 330, Boston, MA 02111-1307, USA");
+// WriteString(os, "");
+// WriteString(os, "Everyone is permitted to copy and distribute verbatim copies");
+// WriteString(os, "of this license document, but changing it is not allowed.");
+// WriteString(os, "");
+// WriteString(os, "1. PREAMBLE");
+// WriteString(os, "");
+// WriteString(os, "The purpose of this License is to make a manual, textbook, or other");
+// WriteString(os, "functional and useful document free in the sense of freedom: to");
+// WriteString(os, "assure everyone the effective freedom to copy and redistribute it,");
+// WriteString(os, "with or without modifying it, either commercially or noncommercially.");
+// WriteString(os, "Secondarily, this License preserves for the author and publisher a way");
+// WriteString(os, "to get credit for their work, while not being considered responsible");
+// WriteString(os, "for modifications made by others.");
+// WriteString(os, "");
+// WriteString(os, "This License is a kind of \"copyleft\", which means that derivative");
+// WriteString(os, "works of the document must themselves be free in the same sense. It");
+// WriteString(os, "complements the GNU General Public License, which is a copyleft");
+// WriteString(os, "license designed for free software.");
+// WriteString(os, "");
+// WriteString(os, "We have designed this License in order to use it for manuals for free");
+// WriteString(os, "software, because free software needs free documentation: a free");
+// WriteString(os, "program should come with manuals providing the same freedoms that the");
+// WriteString(os, "software does. But this License is not limited to software manuals;");
+// WriteString(os, "it can be used for any textual work, regardless of subject matter or");
+// WriteString(os, "whether it is published as a printed book. We recommend this License");
+// WriteString(os, "principally for works whose purpose is instruction or reference.");
+// WriteString(os, "");
+// WriteString(os, "2. APPLICABILITY AND DEFINITIONS");
+// WriteString(os, "");
+// WriteString(os, "This License applies to any manual or other work, in any medium, that");
+// WriteString(os, "contains a notice placed by the copyright holder saying it can be");
+// WriteString(os, "distributed under the terms of this License. Such a notice grants a");
+// WriteString(os, "world-wide, royalty-free license, unlimited in duration, to use that");
+// WriteString(os, "work under the conditions stated herein. The \"Document\", below,");
+// WriteString(os, "refers to any such manual or work. Any member of the public is a");
+// WriteString(os, "licensee, and is addressed as \"you\". You accept the license if you");
+// WriteString(os, "copy, modify or distribute the work in a way requiring permission");
+// WriteString(os, "under copyright law.");
+// WriteString(os, "");
+// WriteString(os, "A \"Modified Version\" of the Document means any work containing the");
+// WriteString(os, "Document or a portion of it, either copied verbatim, or with");
+// WriteString(os, "modifications and/or translated into another language.");
+// WriteString(os, "");
+// WriteString(os, "A \"Secondary Section\" is a named appendix or a front-matter section");
+// WriteString(os, "of the Document that deals exclusively with the relationship of the");
+// WriteString(os, "publishers or authors of the Document to the Document's overall");
+// WriteString(os, "subject (or to related matters) and contains nothing that could fall");
+// WriteString(os, "directly within that overall subject. (Thus, if the Document is in");
+// WriteString(os, "part a textbook of mathematics, a Secondary Section may not explain");
+// WriteString(os, "any mathematics.) The relationship could be a matter of historical");
+// WriteString(os, "connection with the subject or with related matters, or of legal,");
+// WriteString(os, "commercial, philosophical, ethical or political position regarding");
+// WriteString(os, "them.");
+// WriteString(os, "");
+// WriteString(os, "The \"Invariant Sections\" are certain Secondary Sections whose titles");
+// WriteString(os, "are designated, as being those of Invariant Sections, in the notice");
+// WriteString(os, "that says that the Document is released under this License. If a");
+// WriteString(os, "section does not fit the above definition of Secondary then it is not");
+// WriteString(os, "allowed to be designated as Invariant. The Document may contain zero");
+// WriteString(os, "Invariant Sections. If the Document does not identify any Invariant");
+// WriteString(os, "Sections then there are none.");
+// WriteString(os, "");
+// WriteString(os, "The \"Cover Texts\" are certain short passages of text that are listed,");
+// WriteString(os, "as Front-Cover Texts or Back-Cover Texts, in the notice that says that");
+// WriteString(os, "the Document is released under this License. A Front-Cover Text may");
+// WriteString(os, "be at most 5 words, and a Back-Cover Text may be at most 25 words.");
+// WriteString(os, "");
+// WriteString(os, "A \"Transparent\" copy of the Document means a machine-readable copy,");
+// WriteString(os, "represented in a format whose specification is available to the");
+// WriteString(os, "general public, that is suitable for revising the document");
+// WriteString(os, "straightforwardly with generic text editors or (for images composed of");
+// WriteString(os, "pixels) generic paint programs or (for drawings) some widely available");
+// WriteString(os, "drawing editor, and that is suitable for input to text formatters or");
+// WriteString(os, "for automatic translation to a variety of formats suitable for input");
+// WriteString(os, "to text formatters. A copy made in an otherwise Transparent file");
+// WriteString(os, "format whose markup, or absence of markup, has been arranged to thwart");
+// WriteString(os, "or discourage subsequent modification by readers is not Transparent.");
+// WriteString(os, "An image format is not Transparent if used for any substantial amount");
+// WriteString(os, "of text. A copy that is not \"Transparent\" is called \"Opaque\".");
+// WriteString(os, "");
+// WriteString(os, "Examples of suitable formats for Transparent copies include plain");
+// WriteString(os, "ASCII without markup, Texinfo input format, LaTeX input");
+// WriteString(os, "format, SGML or XML using a publicly available");
+// WriteString(os, "DTD, and standard-conforming simple HTML,");
+// WriteString(os, "PostScript or PDF designed for human modification. Examples");
+// WriteString(os, "of transparent image formats include PNG, XCF and");
+// WriteString(os, "JPG. Opaque formats include proprietary formats that can be");
+// WriteString(os, "read and edited only by proprietary word processors, SGML or");
+// WriteString(os, "XML for which the DTD and/or processing tools are");
+// WriteString(os, "not generally available, and the machine-generated HTML,");
+// WriteString(os, "PostScript or PDF produced by some word processors for");
+// WriteString(os, "output purposes only.");
+// WriteString(os, "");
+// WriteString(os, "The \"Title Page\" means, for a printed book, the title page itself,");
+// WriteString(os, "plus such following pages as are needed to hold, legibly, the material");
+// WriteString(os, "this License requires to appear in the title page. For works in");
+// WriteString(os, "formats which do not have any title page as such, \"Title Page\" means");
+// WriteString(os, "the text near the most prominent appearance of the work's title,");
+// WriteString(os, "preceding the beginning of the body of the text.");
+// WriteString(os, "");
+// WriteString(os, "A section \"Entitled XYZ\" means a named subunit of the Document whose");
+// WriteString(os, "title either is precisely XYZ or contains XYZ in parentheses following");
+// WriteString(os, "text that translates XYZ in another language. (Here XYZ stands for a");
+// WriteString(os, "specific section name mentioned below, such as \"Acknowledgements\",");
+// WriteString(os, "\"Dedications\", \"Endorsements\", or \"History\".) To \"Preserve the Title\"");
+// WriteString(os, "of such a section when you modify the Document means that it remains a");
+// WriteString(os, "section \"Entitled XYZ\" according to this definition.");
+// WriteString(os, "");
+// WriteString(os, "The Document may include Warranty Disclaimers next to the notice which");
+// WriteString(os, "states that this License applies to the Document. These Warranty");
+// WriteString(os, "Disclaimers are considered to be included by reference in this");
+// WriteString(os, "License, but only as regards disclaiming warranties: any other");
+// WriteString(os, "implication that these Warranty Disclaimers may have is void and has");
+// WriteString(os, "no effect on the meaning of this License.");
+// WriteString(os, "");
+// WriteString(os, "3. VERBATIM COPYING");
+// WriteString(os, "");
+// WriteString(os, "You may copy and distribute the Document in any medium, either");
+// WriteString(os, "commercially or noncommercially, provided that this License, the");
+// WriteString(os, "copyright notices, and the license notice saying this License applies");
+// WriteString(os, "to the Document are reproduced in all copies, and that you add no other");
+// WriteString(os, "conditions whatsoever to those of this License. You may not use");
+// WriteString(os, "technical measures to obstruct or control the reading or further");
+// WriteString(os, "copying of the copies you make or distribute. However, you may accept");
+// WriteString(os, "compensation in exchange for copies. If you distribute a large enough");
+// WriteString(os, "number of copies you must also follow the conditions in section 3.");
+// WriteString(os, "");
+// WriteString(os, "You may also lend copies, under the same conditions stated above, and");
+// WriteString(os, "you may publicly display copies.");
+// WriteString(os, "");
+// WriteString(os, "4. COPYING IN QUANTITY");
+// WriteString(os, "");
+// WriteString(os, "If you publish printed copies (or copies in media that commonly have");
+// WriteString(os, "printed covers) of the Document, numbering more than 100, and the");
+// WriteString(os, "Document's license notice requires Cover Texts, you must enclose the");
+// WriteString(os, "copies in covers that carry, clearly and legibly, all these Cover");
+// WriteString(os, "Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on");
+// WriteString(os, "the back cover. Both covers must also clearly and legibly identify");
+// WriteString(os, "you as the publisher of these copies. The front cover must present");
+// WriteString(os, "the full title with all words of the title equally prominent and");
+// WriteString(os, "visible. You may add other material on the covers in addition.");
+// WriteString(os, "Copying with changes limited to the covers, as long as they preserve");
+// WriteString(os, "the title of the Document and satisfy these conditions, can be treated");
+// WriteString(os, "as verbatim copying in other respects.");
+// WriteString(os, "");
+// WriteString(os, "If the required texts for either cover are too voluminous to fit");
+// WriteString(os, "legibly, you should put the first ones listed (as many as fit");
+// WriteString(os, "reasonably) on the actual cover, and continue the rest onto adjacent");
+// WriteString(os, "pages.");
+// WriteString(os, "");
+// WriteString(os, "If you publish or distribute Opaque copies of the Document numbering");
+// WriteString(os, "more than 100, you must either include a machine-readable Transparent");
+// WriteString(os, "copy along with each Opaque copy, or state in or with each Opaque copy");
+// WriteString(os, "a computer-network location from which the general network-using");
+// WriteString(os, "public has access to download using public-standard network protocols");
+// WriteString(os, "a complete Transparent copy of the Document, free of added material.");
+// WriteString(os, "If you use the latter option, you must take reasonably prudent steps,");
+// WriteString(os, "when you begin distribution of Opaque copies in quantity, to ensure");
+// WriteString(os, "that this Transparent copy will remain thus accessible at the stated");
+// WriteString(os, "location until at least one year after the last time you distribute an");
+// WriteString(os, "Opaque copy (directly or through your agents or retailers) of that");
+// WriteString(os, "edition to the public.");
+// WriteString(os, "");
+// WriteString(os, "It is requested, but not required, that you contact the authors of the");
+// WriteString(os, "Document well before redistributing any large number of copies, to give");
+// WriteString(os, "them a chance to provide you with an updated version of the Document.");
+// WriteString(os, "");
+// WriteString(os, "5. MODIFICATIONS");
+// WriteString(os, "");
+// WriteString(os, "You may copy and distribute a Modified Version of the Document under");
+// WriteString(os, "the conditions of sections 2 and 3 above, provided that you release");
+// WriteString(os, "the Modified Version under precisely this License, with the Modified");
+// WriteString(os, "Version filling the role of the Document, thus licensing distribution");
+// WriteString(os, "and modification of the Modified Version to whoever possesses a copy");
+// WriteString(os, "of it. In addition, you must do these things in the Modified Version:");
+// WriteString(os, "");
+// WriteString(os, " 1. Use in the Title Page (and on the covers, if any) a title distinct");
+// WriteString(os, " from that of the Document, and from those of previous versions");
+// WriteString(os, " (which should, if there were any, be listed in the History section");
+// WriteString(os, " of the Document). You may use the same title as a previous version");
+// WriteString(os, " if the original publisher of that version gives permission.");
+// WriteString(os, "");
+// WriteString(os, " 2. List on the Title Page, as authors, one or more persons or entities");
+// WriteString(os, " responsible for authorship of the modifications in the Modified");
+// WriteString(os, " Version, together with at least five of the principal authors of the");
+// WriteString(os, " Document (all of its principal authors, if it has fewer than five),");
+// WriteString(os, " unless they release you from this requirement.");
+// WriteString(os, "");
+// WriteString(os, " 3. State on the Title page the name of the publisher of the");
+// WriteString(os, " Modified Version, as the publisher.");
+// WriteString(os, "");
+// WriteString(os, " 4. Preserve all the copyright notices of the Document.");
+// WriteString(os, "");
+// WriteString(os, " 5. Add an appropriate copyright notice for your modifications");
+// WriteString(os, " adjacent to the other copyright notices.");
+// WriteString(os, "");
+// WriteString(os, " 6. Include, immediately after the copyright notices, a license notice");
+// WriteString(os, " giving the public permission to use the Modified Version under the");
+// WriteString(os, " terms of this License, in the form shown in the Addendum below.");
+// WriteString(os, "");
+// WriteString(os, " 7. Preserve in that license notice the full lists of Invariant Sections");
+// WriteString(os, " and required Cover Texts given in the Document's license notice.");
+// WriteString(os, "");
+// WriteString(os, " 8. Include an unaltered copy of this License.");
+// WriteString(os, "");
+// WriteString(os, " 9. Preserve the section Entitled \"History\", Preserve its Title, and add");
+// WriteString(os, " to it an item stating at least the title, year, new authors, and");
+// WriteString(os, " publisher of the Modified Version as given on the Title Page. If");
+// WriteString(os, " there is no section Entitled \"History\" in the Document, create one");
+// WriteString(os, " stating the title, year, authors, and publisher of the Document as");
+// WriteString(os, " given on its Title Page, then add an item describing the Modified");
+// WriteString(os, " Version as stated in the previous sentence.");
+// WriteString(os, "");
+// WriteString(os, " 10. Preserve the network location, if any, given in the Document for");
+// WriteString(os, " public access to a Transparent copy of the Document, and likewise");
+// WriteString(os, " the network locations given in the Document for previous versions");
+// WriteString(os, " it was based on. These may be placed in the \"History\" section.");
+// WriteString(os, " You may omit a network location for a work that was published at");
+// WriteString(os, " least four years before the Document itself, or if the original");
+// WriteString(os, " publisher of the version it refers to gives permission.");
+// WriteString(os, "");
+// WriteString(os, " 11. For any section Entitled \"Acknowledgements\" or \"Dedications\", Preserve");
+// WriteString(os, " the Title of the section, and preserve in the section all the");
+// WriteString(os, " substance and tone of each of the contributor acknowledgements and/or");
+// WriteString(os, " dedications given therein.");
+// WriteString(os, "");
+// WriteString(os, " 12. Preserve all the Invariant Sections of the Document,");
+// WriteString(os, " unaltered in their text and in their titles. Section numbers");
+// WriteString(os, " or the equivalent are not considered part of the section titles.");
+// WriteString(os, "");
+// WriteString(os, " 13. Delete any section Entitled \"Endorsements\". Such a section");
+// WriteString(os, " may not be included in the Modified Version.");
+// WriteString(os, "");
+// WriteString(os, " 14. Do not retitle any existing section to be Entitled \"Endorsements\" or");
+// WriteString(os, " to conflict in title with any Invariant Section.");
+// WriteString(os, "");
+// WriteString(os, " 15. Preserve any Warranty Disclaimers.");
+// WriteString(os, "");
+// WriteString(os, "");
+// WriteString(os, "If the Modified Version includes new front-matter sections or");
+// WriteString(os, "appendices that qualify as Secondary Sections and contain no material");
+// WriteString(os, "copied from the Document, you may at your option designate some or all");
+// WriteString(os, "of these sections as invariant. To do this, add their titles to the");
+// WriteString(os, "list of Invariant Sections in the Modified Version's license notice.");
+// WriteString(os, "These titles must be distinct from any other section titles.");
+// WriteString(os, "");
+// WriteString(os, "You may add a section Entitled \"Endorsements\", provided it contains");
+// WriteString(os, "nothing but endorsements of your Modified Version by various");
+// WriteString(os, "parties - for example, statements of peer review or that the text has");
+// WriteString(os, "been approved by an organization as the authoritative definition of a");
+// WriteString(os, "standard.");
+// WriteString(os, "");
+// WriteString(os, "You may add a passage of up to five words as a Front-Cover Text, and a");
+// WriteString(os, "passage of up to 25 words as a Back-Cover Text, to the end of the list");
+// WriteString(os, "of Cover Texts in the Modified Version. Only one passage of");
+// WriteString(os, "Front-Cover Text and one of Back-Cover Text may be added by (or");
+// WriteString(os, "through arrangements made by) any one entity. If the Document already");
+// WriteString(os, "includes a cover text for the same cover, previously added by you or");
+// WriteString(os, "by arrangement made by the same entity you are acting on behalf of,");
+// WriteString(os, "you may not add another; but you may replace the old one, on explicit");
+// WriteString(os, "permission from the previous publisher that added the old one.");
+// WriteString(os, "");
+// WriteString(os, "The author(s) and publisher(s) of the Document do not by this License");
+// WriteString(os, "give permission to use their names for publicity for or to assert or");
+// WriteString(os, "imply endorsement of any Modified Version.");
+// WriteString(os, "");
+// WriteString(os, "6. COMBINING DOCUMENTS");
+// WriteString(os, "");
+// WriteString(os, "You may combine the Document with other documents released under this");
+// WriteString(os, "License, under the terms defined in section 4 above for modified");
+// WriteString(os, "versions, provided that you include in the combination all of the");
+// WriteString(os, "Invariant Sections of all of the original documents, unmodified, and");
+// WriteString(os, "list them all as Invariant Sections of your combined work in its");
+// WriteString(os, "license notice, and that you preserve all their Warranty Disclaimers.");
+// WriteString(os, "");
+// WriteString(os, "The combined work need only contain one copy of this License, and");
+// WriteString(os, "multiple identical Invariant Sections may be replaced with a single");
+// WriteString(os, "copy. If there are multiple Invariant Sections with the same name but");
+// WriteString(os, "different contents, make the title of each such section unique by");
+// WriteString(os, "adding at the end of it, in parentheses, the name of the original");
+// WriteString(os, "author or publisher of that section if known, or else a unique number.");
+// WriteString(os, "Make the same adjustment to the section titles in the list of");
+// WriteString(os, "Invariant Sections in the license notice of the combined work.");
+// WriteString(os, "");
+// WriteString(os, "In the combination, you must combine any sections Entitled \"History\"");
+// WriteString(os, "in the various original documents, forming one section Entitled");
+// WriteString(os, "\"History\"; likewise combine any sections Entitled \"Acknowledgements\",");
+// WriteString(os, "and any sections Entitled \"Dedications\". You must delete all");
+// WriteString(os, "sections Entitled \"Endorsements.\"");
+// WriteString(os, "");
+// WriteString(os, "7. COLLECTIONS OF DOCUMENTS");
+// WriteString(os, "");
+// WriteString(os, "You may make a collection consisting of the Document and other documents");
+// WriteString(os, "released under this License, and replace the individual copies of this");
+// WriteString(os, "License in the various documents with a single copy that is included in");
+// WriteString(os, "the collection, provided that you follow the rules of this License for");
+// WriteString(os, "verbatim copying of each of the documents in all other respects.");
+// WriteString(os, "");
+// WriteString(os, "You may extract a single document from such a collection, and distribute");
+// WriteString(os, "it individually under this License, provided you insert a copy of this");
+// WriteString(os, "License into the extracted document, and follow this License in all");
+// WriteString(os, "other respects regarding verbatim copying of that document.");
+// WriteString(os, "");
+// WriteString(os, "8. AGGREGATION WITH INDEPENDENT WORKS");
+// WriteString(os, "");
+// WriteString(os, "A compilation of the Document or its derivatives with other separate");
+// WriteString(os, "and independent documents or works, in or on a volume of a storage or");
+// WriteString(os, "distribution medium, is called an \"aggregate\" if the copyright");
+// WriteString(os, "resulting from the compilation is not used to limit the legal rights");
+// WriteString(os, "of the compilation's users beyond what the individual works permit.");
+// WriteString(os, "When the Document is included an aggregate, this License does not");
+// WriteString(os, "apply to the other works in the aggregate which are not themselves");
+// WriteString(os, "derivative works of the Document.");
+// WriteString(os, "");
+// WriteString(os, "If the Cover Text requirement of section 3 is applicable to these");
+// WriteString(os, "copies of the Document, then if the Document is less than one half of");
+// WriteString(os, "the entire aggregate, the Document's Cover Texts may be placed on");
+// WriteString(os, "covers that bracket the Document within the aggregate, or the");
+// WriteString(os, "electronic equivalent of covers if the Document is in electronic form.");
+// WriteString(os, "Otherwise they must appear on printed covers that bracket the whole");
+// WriteString(os, "aggregate.");
+// WriteString(os, "");
+// WriteString(os, "9. TRANSLATION");
+// WriteString(os, "");
+// WriteString(os, "Translation is considered a kind of modification, so you may");
+// WriteString(os, "distribute translations of the Document under the terms of section 4.");
+// WriteString(os, "Replacing Invariant Sections with translations requires special");
+// WriteString(os, "permission from their copyright holders, but you may include");
+// WriteString(os, "translations of some or all Invariant Sections in addition to the");
+// WriteString(os, "original versions of these Invariant Sections. You may include a");
+// WriteString(os, "translation of this License, and all the license notices in the");
+// WriteString(os, "Document, and any Warrany Disclaimers, provided that you also include");
+// WriteString(os, "the original English version of this License and the original versions");
+// WriteString(os, "of those notices and disclaimers. In case of a disagreement between");
+// WriteString(os, "the translation and the original version of this License or a notice");
+// WriteString(os, "or disclaimer, the original version will prevail.");
+// WriteString(os, "");
+// WriteString(os, "If a section in the Document is Entitled \"Acknowledgements\",");
+// WriteString(os, "\"Dedications\", or \"History\", the requirement (section 4) to Preserve");
+// WriteString(os, "its Title (section 1) will typically require changing the actual");
+// WriteString(os, "title.");
+// WriteString(os, "");
+// WriteString(os, "10. TERMINATION");
+// WriteString(os, "");
+// WriteString(os, "You may not copy, modify, sublicense, or distribute the Document except");
+// WriteString(os, "as expressly provided for under this License. Any other attempt to");
+// WriteString(os, "copy, modify, sublicense or distribute the Document is void, and will");
+// WriteString(os, "automatically terminate your rights under this License. However,");
+// WriteString(os, "parties who have received copies, or rights, from you under this");
+// WriteString(os, "License will not have their licenses terminated so long as such");
+// WriteString(os, "parties remain in full compliance.");
+// WriteString(os, "");
+// WriteString(os, "11. FUTURE REVISIONS OF THIS LICENSE");
+// WriteString(os, "");
+// WriteString(os, "The Free Software Foundation may publish new, revised versions");
+// WriteString(os, "of the GNU Free Documentation License from time to time. Such new");
+// WriteString(os, "versions will be similar in spirit to the present version, but may");
+// WriteString(os, "differ in detail to address new problems or concerns. See");
+// WriteString(os, "http://www.gnu.org/copyleft/.");
+// WriteString(os, "");
+// WriteString(os, "Each version of the License is given a distinguishing version number.");
+// WriteString(os, "If the Document specifies that a particular numbered version of this");
+// WriteString(os, "License \"or any later version\" applies to it, you have the option of");
+// WriteString(os, "following the terms and conditions either of that specified version or");
+// WriteString(os, "of any later version that has been published (not as a draft) by the");
+// WriteString(os, "Free Software Foundation. If the Document does not specify a version");
+// WriteString(os, "number of this License, you may choose any version ever published (not");
+// WriteString(os, "as a draft) by the Free Software Foundation.");
+// WriteString(os, "-->");
+// }
+
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</descriptions>");
+ }
+
+ private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = TexinfoUtils.transformTags(Synopsis);
+ String[] tt = ss.split("<eol>");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ WriteString(os, spaces + tt[pp]);
+// if (tt[pp].equals("<br>")) {
+// WriteString(os, spaces + aa + "\n");
+// aa = "";
+// }
+// else {
+// if ((aa.length() + tt[pp].length()) > 64) {
+// WriteString(os, spaces + aa);
+// aa = "";
+// }
+// aa = aa + " " + tt[pp];
+// }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static String HandleInclude (String srcdir, String line, String Synopsis) {
+ Pattern p = Pattern.compile("@include\\s+(.*?)\\.texi");
+ Matcher mm = p.matcher(line);
+ if (mm.find()) {
+ String il;
+ try {
+ String fileName = (srcdir.endsWith("/") ? srcdir : srcdir + "/") + mm.replaceAll("examples/$1");
+ BufferedReader is = new BufferedReader(new FileReader(fileName));
+ while (null != (il = is.readLine())) {
+ // C Help does not ignore "<" or ">" inside a <pre> or <samp> tag
+ // so we have to prepare for two levels of indirection. The
+ // first is for xml to interpret and the second is for the
+ // C Help processor to interpret. So, we put &lt; and &gt; which
+ // will be transformed into &amp;lt; by the tag transformer.
+ Pattern p1 = Pattern.compile("<");
+ Pattern p2 = Pattern.compile(">");
+ Matcher mm1 = p1.matcher(il);
+ il = mm1.replaceAll("&lt;");
+ Matcher mm2 = p2.matcher(il);
+ il = mm2.replaceAll("&gt;");
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+ } catch (IOException e) {
+ System.out.println("IOException reading example file");
+ }
+ }
+ return Synopsis;
+ }
+ private static void HandleDeftypefun(BufferedWriter os, BufferedReader is, String s, String srcdir) throws IOException {
+ String il;
+ FunctionDef fd;
+ List FDefs = new ArrayList();
+ String Synopsis = null;
+
+ if (null != (fd = HandleFunctionDef(is, s))) FDefs.add(fd);
+
+ while (null != (il = is.readLine())) {
+ Matcher mm = IncludePattern.matcher(il);
+ if (il.startsWith("@deftypefunx")) {
+ if (null != (fd = HandleFunctionDef(is, il))) FDefs.add(fd);
+ }
+ else if (mm.matches()) {
+ if (!IncludeList.contains(mm.group(1)))
+ IncludeList.add(mm.group(1));
+ }
+ else if (il.startsWith("@comment") ||
+ il.startsWith("@c ") ||
+ il.startsWith("@pindex")) { // ignore
+ }
+ else if (il.startsWith("@include") && fd != null) {
+ Synopsis = HandleInclude(srcdir, il, Synopsis);
+ }
+ else if (il.startsWith("@end deftypefun")) {
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ fd = (FunctionDef)FDefs.get(kk);
+
+ WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
+
+ WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
+
+ WriteString(os, " <prototype>");
+ String[] parms = fd.Parameters;
+ for (int i = 0; i < parms.length; i++) {
+ String parm = TexinfoUtils.stripProtoTags(parms[i]);
+ WriteString(os, " <parameter content=\"" + parm + "\"/>");
+ }
+ WriteString(os, " </prototype>");
+
+ if (fd.IncludeList != null) {
+ WriteString(os, " <headers>");
+ Object[] incs = fd.IncludeList;
+ for (int j = 0; j < incs.length; j++) {
+ String inc = (String)incs[j];
+ WriteString(os, " <header filename = \"" + inc + "\"/>");
+ }
+ WriteString(os, " </headers>");
+ }
+
+ if (null != Synopsis) WriteSynopsis(os, Synopsis, false);
+
+ WriteString(os, " </function>");
+ WriteString(os, " </construct>");
+ }
+ return;
+ }
+ else {
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+ }
+ FDefs.clear();
+
+ }
+
+ private static class OnlyTexi implements FilenameFilter {
+ public boolean accept(File dir, String s) {
+ return (s.endsWith(".texi")) ? true : false;
+ }
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
+ try {
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<descriptions>");
+
+ try {
+ String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
+ for (int i = 0; i < dir.length; i++) {
+ String qFile = srcdir.endsWith("/")
+ ? srcdir + dir[i]
+ : srcdir + "/" + dir[i];
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+
+ while (null != (il = is.readLine())) {
+ Matcher mm = IncludePattern.matcher(il);
+ if (il.startsWith("@deftypefun")) { // handle @deftypefun[x]
+ HandleDeftypefun(os, is, il, srcdir);
+ }
+ else if (il.startsWith("@deftp")) { // handle @deftp
+ HandleDeftp(os, is, il);
+ }
+ else if (mm.matches()) { // handle @comment <include_file>
+ if (!IncludeList.contains(mm.group(1)))
+ IncludeList.add(mm.group(1));
+ }
+ else if (il.startsWith("@end deftypefn"))
+ // Handle accumulated header file comments that are in
+ // constructs we aren't parsing.
+ IncludeList.clear();
+ }
+ is.close();
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ }
+ }
+ catch (NullPointerException e) {
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ BuildXMLFromTexinfo(args[0], args[1]);
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java
new file mode 100644
index 0000000000..eecce6431a
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java
@@ -0,0 +1,564 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover.texinfoparsers;
+import java.io.*;
+import java.util.regex.*;
+import java.util.*;
+
+//This file contains a texinfo parser that can be
+//run to create the Autotools glibc.xml file.
+//Usage is as follows:
+//1. compile this file using javac
+//2. run this file using java, passing the
+//arguments: ${glibc_source_path}/manual glibc.xml
+
+public class ParseNewlibTexinfo {
+ static final boolean DEBUG = false;
+
+ // 1, 2, 3
+ static final String RtnType = "(\\w+\\s+(\\w+\\s+)?(\\w+\\s+)?\\**)";
+ static final int RtnTypeSIndex = 1;
+
+ // 4
+ static final String FunctionName = "(\\w+)\\s*\\(";
+ static final int FunctionNameIndex = 4;
+
+ // 5 and 6
+ static final String Parms = "((.*)\\))";
+ static final int ParmsIndex = 6;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern DeftypefunPattern
+ = Pattern.compile("^" + WhiteSpace +
+ RtnType + WhiteSpace +
+ FunctionName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ // 1, 2, 3
+ static final String RtnType2 = "(\\w*\\s*(\\w*\\*?\\s+)?(\\w*\\*?\\s+)?\\**\\s*)\\(\\*";
+ static final int RtnType2Index = 1;
+
+ // 4
+ static final String FunctionName2 = "(\\w+)\\s*\\(";
+ static final int FunctionName2Index = 4;
+
+ // 5 and 6
+ static final String Parms2 = "((.*)\\)\\)\\s*)";
+ static final int Parms2Index = 6;
+
+ // 7
+ static final String RtnTypeParms = "(\\(.*\\))";
+ static final int RtnTypeParmsIndex = 7;
+
+ static final Pattern DeftypefunPattern2
+ = Pattern.compile("^" + WhiteSpace +
+ RtnType2 + WhiteSpace +
+ FunctionName2 + WhiteSpace +
+ Parms2 + RtnTypeParms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ // For va_arg, the prototype is @var{type} so we create a third type of function definition
+ // and we make it so the return type ends up taking as many groups as the normal RtnType so
+ // the BuildFunctionDef routine can be used without modification.
+ // 1, 2, 3
+ static final String RtnTypeVar = "@var\\{(\\w+)(\\})(\\s)";
+
+ static final Pattern DeftypefunPattern3
+ = Pattern.compile("^" + WhiteSpace +
+ RtnTypeVar + WhiteSpace +
+ FunctionName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern IncludePattern = Pattern.compile("^#include\\s*<((\\w*/)*\\w*\\.h)>\\s*$");
+ static final Pattern PindexPattern = Pattern.compile("^@pindex\\s*\\w*\\s*$");
+ static final Pattern FindexPattern = Pattern.compile("^@findex\\s*(\\w*)\\s*$");
+ static final Pattern SynopsisPattern = Pattern.compile("^\\s*@strong\\{Synopsis\\}\\s*");
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+ static List IncludeList = new ArrayList();
+ static Stack readers = new Stack();
+
+ static class FunctionDef {
+ String ReturnType;
+ String FunctionName;
+ String[] Parameters;
+ Object[] IncludeList;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static FunctionDef FindFunctionDef(String name, List FDefs) {
+ for (Iterator iterator = FDefs.iterator(); iterator.hasNext();) {
+ FunctionDef k = (FunctionDef) iterator.next();
+ if (k.FunctionName.equals(name))
+ return k;
+ }
+ return null;
+ }
+
+ private static FunctionDef BuildFunctionDef(Matcher m, FunctionDef fd) {
+ fd.ReturnType = m.group(RtnTypeSIndex);
+ fd.FunctionName = m.group(FunctionNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = TexinfoUtils.stripProtoTags(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ fd.Parameters = parms;
+ }
+
+ if (IncludeList.size() > 0) {
+ fd.IncludeList = IncludeList.toArray();
+ }
+ return fd;
+ }
+
+ private static FunctionDef BuildFunctionDef2(Matcher m, FunctionDef fd) {
+ fd.ReturnType = m.group(RtnType2Index) + "(*)" + m.group(RtnTypeParmsIndex);
+ fd.FunctionName = m.group(FunctionName2Index);
+
+ if (null != m.group(Parms2Index)) {
+ String tt = TexinfoUtils.stripProtoTags(m.group(Parms2Index));
+ String[] parms = tt.split(",\\s");
+ fd.Parameters = parms;
+ }
+
+ if (IncludeList.size() > 0) {
+ fd.IncludeList = IncludeList.toArray();
+ }
+ return fd;
+ }
+
+ private static void HandleFunctionDefs(BufferedReader is, List FDefs) throws IOException {
+ FunctionDef fd;
+ String il = null;
+ boolean preRead = false;
+
+ while (preRead || (il = is.readLine()) != null) {
+ preRead = false;
+ if (il.startsWith("@end example"))
+ return;
+
+ Matcher m = DeftypefunPattern.matcher(il);
+ Matcher m2 = DeftypefunPattern2.matcher(il);
+ Matcher m3 = DeftypefunPattern3.matcher(il);
+ Matcher mm = IncludePattern.matcher(il);
+
+ if (mm.matches()) {
+ if (!IncludeList.contains(mm.group(1)))
+ IncludeList.add(mm.group(1));
+ }
+ else if (m.matches()) {
+ fd = FindFunctionDef(m.group(FunctionNameIndex), FDefs);
+ if (fd != null)
+ BuildFunctionDef(m, fd);
+ else
+ System.out.println("Missing findex for " + m.group(FunctionNameIndex));
+ }
+ else if (m2.matches()) {
+ fd = FindFunctionDef(m2.group(FunctionName2Index), FDefs);
+ if (fd != null)
+ BuildFunctionDef2(m2, fd);
+ else
+ System.out.println("Missing findex for " + m2.group(FunctionName2Index));
+ }
+ else if (m3.matches()) {
+ fd = FindFunctionDef(m3.group(FunctionNameIndex), FDefs);
+ if (fd != null)
+ BuildFunctionDef(m3, fd);
+ else
+ System.out.println("Missing findex for " + m3.group(FunctionName2Index));
+ }
+ else if (il.trim().length() > 0) {
+ il = il.trim();
+ while (il.endsWith(",")) { // assume prototype extends more than one line
+ preRead = true;
+ String il2 = is.readLine().trim();
+ if (il2 != null && il2.startsWith("@")) { // something wrong, just look at new line fetched
+ il = il2;
+ continue;
+ }
+ il = il + il2; // concatenate
+ }
+ }
+ }
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
+ private static void CreateHeader(BufferedWriter os) throws IOException {
+ WriteString(os, "<!-- This file automatically generated by an Eclipse utility -->");
+ WriteString(os, "<!DOCTYPE descriptions [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT descriptions (construct)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT construct (structure|function|synopsis)*>");
+ WriteString(os, " <!ATTLIST construct");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " type CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT structure (synopsis?, elements?)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT elements (element*)>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT element (synopsis*)>");
+ WriteString(os, " <!ATTLIST element");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT function (prototype,headers?,groupsynopsis?,synopsis)>");
+ WriteString(os, " <!ATTLIST function");
+ WriteString(os, " returntype CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT headers (header+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT header (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST header");
+ WriteString(os, " filename CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT groupsynopsis (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST groupsynopsis");
+ WriteString(os, " id CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
+ }
+
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</descriptions>");
+ }
+
+ private static void WriteDescription(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = TexinfoUtils.transformTags(Synopsis);
+ String[] tt = ss.split("<eol>");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ WriteString(os, spaces + tt[pp]);
+// if (tt[pp].equals("<br>")) {
+// WriteString(os, spaces + aa + "\n");
+// aa = "";
+// }
+// else {
+// if ((aa.length() + tt[pp].length()) > 64) {
+// WriteString(os, spaces + aa);
+// aa = "";
+// }
+// aa = aa + " " + tt[pp];
+// }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static BufferedReader HandleInclude (BufferedReader is, String srcdir, String line) {
+ Pattern p = Pattern.compile("@include\\s+(.*?)");
+ Matcher mm = p.matcher(line.trim());
+ BufferedReader is2 = null;
+ if (mm.find()) {
+ String fileName = (srcdir.endsWith("/") ? srcdir : srcdir + "/") + mm.replaceAll("$1");
+ try {
+ is2 = new BufferedReader(new FileReader(fileName));
+ readers.push(is);
+ } catch (FileNotFoundException e) {
+ System.out.println("include " + fileName + " not found");
+ // do nothing and return null
+ }
+ }
+ return is2 == null ? is : is2;
+ }
+
+ private static String HandleDescription(BufferedReader is) throws IOException {
+ String Description = null;
+ String il;
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@page") ||
+ il.startsWith("@section") ||
+ il.startsWith("@node"))
+ break;
+ Description = ((Description == null) ? "" : Description + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+
+ return Description;
+ }
+
+ private static void HandleFunction(BufferedWriter os, BufferedReader is, String s, String builddir) throws IOException {
+ String il;
+ FunctionDef fd;
+ List FDefs = new ArrayList();
+ String Description = null;
+ boolean synopsisMarker = false;
+
+ IncludeList.clear();
+ Matcher mmf = FindexPattern.matcher(s);
+ fd = new FunctionDef();
+ if (mmf.matches())
+ fd.FunctionName = mmf.group(1);
+ else
+ return;
+ FDefs.add(fd);
+
+ while (null != (il = is.readLine())) {
+ Matcher syn = SynopsisPattern.matcher(il);
+ if (il.startsWith("@findex")) {
+ synopsisMarker = false;
+ Matcher mm2 = FindexPattern.matcher(il);
+ FunctionDef fd2 = new FunctionDef();
+ if (mm2.matches()) {
+ fd2.FunctionName = mm2.group(1);
+ FDefs.add(fd2);
+ }
+ }
+ else if (il.startsWith("@example") && synopsisMarker) {
+ HandleFunctionDefs(is, FDefs);
+ synopsisMarker = false;
+ }
+ else if (il.startsWith("@include") && fd != null) {
+ is = HandleInclude(is, builddir, il);
+ }
+ else if (syn.matches()) {
+ synopsisMarker = true;
+ }
+ else if (il.startsWith("@strong{Description}")) {
+ synopsisMarker = false;
+ Description = HandleDescription(is);
+ break; // we are done after description has been fetched
+ }
+ // otherwise ignore line
+ }
+
+ String name = ((FunctionDef)FDefs.get(0)).FunctionName;
+
+ if (FDefs.size() > 1) {
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ fd = (FunctionDef)FDefs.get(kk);
+
+ WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
+
+ WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
+
+ WriteString(os, " <prototype>");
+ String[] parms = fd.Parameters;
+ if (parms == null)
+ System.out.println("null parms for findex " + fd.FunctionName);
+ else {
+ for (int i = 0; i < parms.length; i++) {
+ String parm = TexinfoUtils.stripProtoTags(parms[i]);
+ WriteString(os, " <parameter content=\"" + parm + "\"/>");
+ }
+ }
+ WriteString(os, " </prototype>");
+
+ if (fd.IncludeList != null) {
+ WriteString(os, " <headers>");
+ Object[] incs = fd.IncludeList;
+ for (int j = 0; j < incs.length; j++) {
+ String inc = (String)incs[j];
+ WriteString(os, " <header filename = \"" + inc + "\"/>");
+ }
+ WriteString(os, " </headers>");
+ }
+
+ if (null != Description)
+ WriteString(os, " <groupsynopsis id=\"group-" + name + "\"/>");
+
+
+ WriteString(os, " </function>");
+ WriteString(os, " </construct>");
+ }
+
+ if (null != Description) {
+ WriteString(os, " <construct id=\"group-" + name + "\" type=\"groupsynopsis\">");
+ WriteDescription(os, Description, false);
+ WriteString(os, " </construct>");
+ }
+ }
+ else {
+ fd = (FunctionDef)FDefs.get(0);
+
+ WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
+
+ WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
+
+ WriteString(os, " <prototype>");
+ String[] parms = fd.Parameters;
+ if (parms == null)
+ System.out.println("null parms for findex " + fd.FunctionName);
+ else {
+ for (int i = 0; i < parms.length; i++) {
+ String parm = TexinfoUtils.stripProtoTags(parms[i]);
+ WriteString(os, " <parameter content=\"" + parm + "\"/>");
+ }
+ }
+ WriteString(os, " </prototype>");
+
+ if (fd.IncludeList != null) {
+ WriteString(os, " <headers>");
+ Object[] incs = fd.IncludeList;
+ for (int j = 0; j < incs.length; j++) {
+ String inc = (String)incs[j];
+ WriteString(os, " <header filename = \"" + inc + "\"/>");
+ }
+ WriteString(os, " </headers>");
+ }
+
+ if (null != Description) WriteDescription(os, Description, false);
+
+ WriteString(os, " </function>");
+ WriteString(os, " </construct>");
+ }
+ FDefs.clear();
+ }
+
+ public static void BuildXMLFromTexinfo2(String srcdir, String builddir, BufferedWriter os, String lib) {
+ try {
+ srcdir = srcdir.endsWith("/") ? srcdir + lib : srcdir + "/" + lib;
+ builddir = builddir.endsWith("/") ? builddir + lib : builddir + "/" + lib;
+ String qFile = srcdir + "/" + lib + ".texinfo";
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+ boolean ignore = false;
+
+ while (is != null) {
+ while (null != (il = is.readLine())) {
+ if (!ignore && il.startsWith("@findex")) {
+ HandleFunction(os, is, il, builddir);
+ }
+ else if (!ignore && il.startsWith("@include")) {
+ is = HandleInclude(is, builddir, il);
+ }
+ else if (il.startsWith("@ignore")) {
+ ignore = true;
+ }
+ else if (il.startsWith("@end ignore"))
+ ignore = false;
+ }
+ is.close();
+ is = (BufferedReader)readers.pop();
+ }
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ catch (EmptyStackException f) {
+ // ok, we expect to get here
+ }
+ }
+ catch (NullPointerException e) {
+ e.printStackTrace();
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String builddir, String dstdir) {
+ try {
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<descriptions>");
+ BuildXMLFromTexinfo2(srcdir, builddir, os, "libc");
+ BuildXMLFromTexinfo2(srcdir, builddir, os, "libm");
+
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ BuildXMLFromTexinfo(args[0], args[1], args[2]);
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java
new file mode 100644
index 0000000000..ceb3d91d30
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java
@@ -0,0 +1,733 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover.texinfoparsers;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class TexinfoUtils {
+
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*?)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExampleItem = Pattern.compile("(@example)((.*?<br><eol>)*+.*?)(<eol>.*@end\\s+example)");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern SmallExampleItem = Pattern.compile("(@smallexample)((.*?<br><eol>)*+.*?)(<eol>.*@end\\s+smallexample)");
+ static final Pattern SmallExamplePattern = Pattern.compile("@smallexample");
+ static final Pattern StrongPattern = Pattern.compile("@strong\\{(\\w*)\\}(@\\*)?");
+ static final Pattern EndSmallExamplePattern = Pattern.compile("@end\\s+smallexample");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern RefillPattern = Pattern.compile("@refill");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern QuotationPattern = Pattern.compile("@quotation");
+ static final Pattern EndQuotation = Pattern.compile("@end\\s+quotation");
+ static final Pattern GroupPattern = Pattern.compile("@group");
+ static final Pattern TabPattern = Pattern.compile("@tab");
+ static final Pattern DeftpPattern = Pattern.compile("@deftp\\s+\\{([^\\}]*?)\\}\\s*\\{([^\\}]*?)\\}");
+ static final Pattern EndDeftpPattern = Pattern.compile("@end\\s+deftp");
+ static final Pattern CommentPattern = Pattern.compile("@c<eol>|@c\\s+.*?<eol>");
+ static final Pattern EndGroupPattern = Pattern.compile("@end\\s+group");
+ static final Pattern BracketRefPattern = Pattern.compile("\\(@.?.?ref\\{[^\\}]*\\}\\)");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*?)@item\\s+(.*?)(<eol>.*@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*?)@item\\s+(.*?)(<eol>.*@end\\+table)", Pattern.DOTALL);
+ static final Pattern TableCodeItemPattern = Pattern.compile("(@table\\s*@code.*?)@item\\s+(.*?)(<eol>.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableVarItemPattern = Pattern.compile("(@table\\s*@var.*?)@item\\s+(.*?)(<eol>.*@end\\s+table)", Pattern.DOTALL);
+ static final Pattern VtableCodeItemPattern = Pattern.compile("(@vtable\\s*@code.*?)@item\\s+(.*?)(<eol>.*@end\\s+vtable)", Pattern.DOTALL);
+ static final Pattern MultitableItemPattern = Pattern.compile("(@multitable.*)@item\\s+(.*?)<eol>(.*?@end\\s+multitable)" +
+ "|(@multitable.*)@item\\s*<eol>(.*?)<eol>(.*?@end\\s+multitable)", Pattern.DOTALL);
+ static final Pattern TableCodeMatchPattern = Pattern.compile("(@table\\s+@code)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableSampMatchPattern = Pattern.compile("(@table\\s+@samp)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableAsisMatchPattern = Pattern.compile("(@table\\s+@asis)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableVarMatchPattern = Pattern.compile("(@table\\s+@var)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern TableCodePattern = Pattern.compile("@table\\s*@code", Pattern.MULTILINE);
+ static final Pattern TableVarPattern = Pattern.compile("@table\\s*@var", Pattern.MULTILINE);
+ static final Pattern VtableCodePattern = Pattern.compile("@vtable\\s*@code", Pattern.MULTILINE);
+ static final Pattern MultitablePattern = Pattern.compile("@multitable.*?<DT>", Pattern.DOTALL);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern EndVtablePattern = Pattern.compile("@end\\s+vtable");
+ static final Pattern EndMultitablePattern = Pattern.compile("@end\\s+multitable");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*?)" + "@end\\s+itemize", Pattern.DOTALL);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*?)" + "@end\\s+itemize", Pattern.DOTALL);
+ static final Pattern InfoOnlyPattern = Pattern.compile("@ifinfo.*?@end\\s+ifinfo", Pattern.DOTALL);
+ static final Pattern TexOnlyPattern = Pattern.compile("@iftex.*?@end\\s+iftex", Pattern.DOTALL);
+ static final Pattern TexPattern = Pattern.compile("@tex.*?@end\\s+tex", Pattern.DOTALL);
+ static final Pattern IgnorePattern = Pattern.compile("@ignore.*?@end\\s+ignore", Pattern.DOTALL);
+ static final Pattern IfInfoPattern = Pattern.compile("@ifinfo");
+ static final Pattern InfinityPattern = Pattern.compile("@infinity");
+ static final Pattern EndIfInfoPattern = Pattern.compile("@end\\s+ifinfo");
+ static final Pattern NotTexPattern = Pattern.compile("@ifnottex");
+ static final Pattern EndNotTexPattern = Pattern.compile("@end\\s+ifnottex");
+ static final Pattern DeftypevrPattern = Pattern.compile("@deftypevr\\s+");
+ static final Pattern EndDeftypevr = Pattern.compile("@end\\s+deftypevr");
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern PxrefPattern = Pattern.compile("@pxref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern AtTPattern = Pattern.compile("@t\\{([^\\}]*)\\}");
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern AnyVarPattern = Pattern.compile("@[a-z]*var\\{([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w+\\{([^\\}]*)\\}");
+ static final Pattern TagCharPattern = Pattern.compile("@([\\{\\}\\:\\*\"])");
+ static final Pattern StrandedPeriod = Pattern.compile("(\\w)\\s+\\.\\s+");
+ static final Pattern LeftOverPeriod = Pattern.compile("^\\.\\s+<eol>");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+ public static String stripProtoTags(String tt) {
+ Matcher mm;
+ String ss = "";
+
+ ss = "";
+ while (ss != tt) {
+ mm = AnyVarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("...");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = AtTPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagCharPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ return tt;
+ }
+
+ public static String transformTags(String tt) {
+ Matcher mm;
+ String ss = "";
+ int endtableIndex = Integer.MAX_VALUE;
+
+ ss = "";
+ while (ss != tt) {
+ mm = BracketRefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = XrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<eol>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = PxrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DeftypevrPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = StrongPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<h3>$1</h3>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndDeftypevr.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern2.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NoIndentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = GroupPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndGroupPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = QuotationPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndQuotation.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = InfinityPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("infinity");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DeftpPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<h4>$1 - $2</h4>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndDeftpPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = RefillPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<VAR>$1</VAR>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<small>...</small>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommandPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = KbdPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<KBD>$1</KBD>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EmphPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<EM>$1</EM>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = FilePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TT>$1</TT>");
+ }
+
+
+ ss = "";
+ while (ss != tt) {
+ mm = VerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = OptionPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExampleItem.matcher(tt);
+ ss = tt;
+ // We want to add a break at the end of each example line to preserve
+ // formatting when Eclipse processes the xml (e.g. C code lines).
+ tt = mm.replaceAll("$1$2<br>$4");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre></td></tr></table>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SmallExampleItem.matcher(tt);
+ ss = tt;
+ // We want to add a break at the end of each example line to preserve
+ // formatting when Eclipse processes the xml (e.g. C code lines).
+ tt = mm.replaceAll("$1$2<br>$4");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SmallExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndSmallExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndEnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</OL>");
+ }
+
+// ss = "";
+// while (ss != tt) {
+// mm = InfoOnlyPattern.matcher(tt);
+// ss = tt;
+// tt = mm.replaceAll("");
+// }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TexOnlyPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IgnorePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NotTexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndNotTexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ // We will treat ifinfo the same as ifnottex which we pass through.
+ ss = "";
+ while (ss != tt) {
+ mm = IfInfoPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndIfInfoPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableSampItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table samp] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table samp] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableSampMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableSampMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT><SAMP>$2</SAMP>\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ //FIXME: This parser assumes that a table does not have an @itemize element
+ // inside it. It allows the opposite to be true (i.e. a table inside
+ // an @itemize element.
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableAsisItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table asis] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table asis] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableAsisMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableAsisMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT>$2\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableCodeItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table code] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table code] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableCodeMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableCodeMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT><CODE>$2</CODE>\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableVarItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table var] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table var] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableVarMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableVarMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT><VAR>$2</VAR>\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VtableCodeItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT><CODE>$2</CODE>\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = MultitableItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT><pre>$2</pre>\n<DD><br>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableVarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableCodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VtableCodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = MultitablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n<DT>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndTablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVtablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndMultitablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ //FIXME: if there ever is a @itemize @bullet within a
+ // @itemize @minus or vice-versa, the following
+ // logic will get it wrong.
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeMinusPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<UL>$1</UL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeBulletPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>$1</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<LI>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagCharPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = StrandedPeriod.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1. ");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = LeftOverPeriod.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TabPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ mm = AmpersandPattern.matcher(tt);
+ tt = mm.replaceAll("&amp;");
+
+ mm = LeftAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&lt;");
+
+ mm = RightAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&gt;");
+
+ // Put back all the eol markers
+ mm = EOLPattern.matcher(tt);
+ tt = mm.replaceAll("<eol>");
+
+ return tt;
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.classpath b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.project b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.project
new file mode 100644
index 0000000000..5207979d38
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.libhover</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.settings/org.eclipse.jdt.core.prefs b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..bbc86d093a
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Sep 19 14:24:23 EDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/ChangeLog b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/ChangeLog
new file mode 100644
index 0000000000..5dd3997ddd
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/ChangeLog
@@ -0,0 +1,196 @@
+2010-03-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #306283
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java (getMemberSummary): Remove
+ code that looks in editor text for class name and then asks the AST. Just get the class name
+ from the member we already do the lookup for. Get the fully templated name using the new
+ getClassName method.
+ (getMatchingFunctions): Remove commented out code.
+ (getClassName): New method to get class name including template parameters.
+ (getFunctionInfo): Change to specify fully qualified name and not remove
+ namespace.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java (getClassInfo): Check
+ info is not null before accessing.
+
+2010-03-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java (getMemberSummary): Change
+ DOMException catch statement to Exception since the IFunction interface getReturnType method
+ changes in CDT 7.0.
+
+2009-12-22 Andrew Overholt <overholt@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java (getMemberSummary):
+ Revert Helios-only change on trunk.
+
+2009-12-17 Andrew Overholt <overholt@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java (getMemberSummary):
+ Remove unnecessary catch block.
+
+2009-09-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Load plugin if any of its classes are used.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java (LibhoverPlugin): Set
+ plugin in constructor.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java (resolveArgs): Change
+ to resolve template parms to actual types where known.
+ (isParmMatch): Resolve the member prototype using template types so we are comparing
+ apples to apples.
+ (getMemberSummary): Change calls to isParmMatch and resolveArgs.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java (getHoverInfo): Add
+ code to try accessing a path locally within the plugin, then try the file system.
+
+2009-08-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #285867
+ * plugin.properties: Change Provider to Eclipse instead of Eclipse.org.
+
+2009-07-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump release to 1.0.3.
+
+2009-07-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Refactor to hide internal classes in new packages.
+
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverLibrary.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/CheckboxFieldEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/LibHoverPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/PreferenceConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/PreferenceInitializer.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/libhover/properties/LibHoverPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.properties: New file.
+ * plugin.xml: Changed to match new packages.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/CheckboxFieldEditor.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/properties/LibHoverPropertyPage.java: New file.
+
+
+2009-05-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java (getMemberSummary): Fix compiler warnings.
+ (getFunctionInfo): Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/CheckboxFieldEditor.java (doLoad): Ditto.
+ (doLoadDefault): Ditto.
+ (adjustForNumColumns): Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/properties/LibHoverPropertyPage.java (updateCheckboxData): Ditto.
+
+2009-05-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java (getFunctionInfo): Add logic
+ to find the qualified name of the class, even when namespaces are being used.
+
+2009-05-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java (resolveArgs): New method.
+ (isParmMatch): Ditto.
+ (getMemberSummary): Add parameter matching support and template resolution.
+ (getFunctionInfo): Add AST logic to resolve member name for C++.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverLibrary.java (resolveTemplateTypes):
+ New method.
+ (getClassInfo): Add additional parameter of template types and fill in.
+ * src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java (getReturnType): New method.
+ (setParamTypes): Ditto.
+ (getParamTypes): Ditto.
+
+2009-02-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * schema/org.eclipse.linuxtools.cdt.libhover.library.exsd: Change description for
+ location field which now points to a serialized LibHoverInfo instance rather than
+ xml.
+ * src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverLibrary.java: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/utils/BuildFunctionInfos.java: New file to
+ create serialized LibHoverInfo file from an xml file in standard function format
+ used by previous version of LibHover.
+ * META-INF/MANIFEST.MF: Add additional dependencies and bump version to 1.0.2.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java (isCPPCharacter): New method.
+ (EnclosingASTNameJob): New internal class to query the AST for IASTName
+ for a symbol in the document.
+ (ASTDeclarationFinderJob): New internal class to get the declaration of a symbol from
+ the AST.
+ (getMemberSummary): New method to get the summary of a C++ method.
+ (getLibHoverDocs): Modified to no longer parse xml documentation. It now expects
+ documentation to be in LibHoverInfo format, serialized via Java. The method leaves
+ reading of the actual serialized info to LibHoverLibrary.
+ (getFunctionSummary): Rewritten to fetch info from the new LibHoverInfo class and
+ to handle C++.
+ (getMatchingFunctions): Ditto.
+ (FunctionSummary): Added a boolean to mark whether the prototype already has
+ brackets in it.
+ (FunctionSummary.FunctionPrototypeSummary.getPrototypeString): Use new boolean
+ to determine whether to add brackets or not.
+ (getFunctionInfo): Add C++ support.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add .qualifier to version and bump to 1.0.1.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Use bundleName and provider from plugin.properties. Add
+ "(Incubation)".
+ * plugin.properties: Initial import.
+
+2008-10-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Remove libhover property and preferences pages which are not needed since
+ C/C++ Documentation properties page does the job.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java:
+ (getMatchingFunctions): Pass document to getFunctionSummaryFromNode.
+ (constructTypes): Add groupsynopsis.
+ (getFunctionInfo): Pass document to getFunctionSummaryFromNode.
+ (getFunctionSummaryFromNode): Add groupsynopsis support.
+
+2008-10-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.properties: New file.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/CheckboxFieldEditor.java: New file.
+ * build.properties: Add plugin.properties to list of binary files.
+ * META-INF/MANIFEST.MF: Add Bundle-Localization statement.
+ * plugin.xml: Use translatable names for preference and property pages.
+ * schema/org.eclipse.linuxtools.cdt.libhover.library.exsd: Make id and name required.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java:
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverMessages.java: Fix bundle name.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverMessages.properties: New messages.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java (getID): New method.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/LibHoverPreferencePage.java (createFieldEditors):
+ Rewrite to use new CheckboxFieldEditor.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/PreferenceConstants.java: Add P_LIBHOVER.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/PreferenceInitializer.java (initializeDefaultPreferences):
+ Set up an unused default string.
+ * src/org/eclipse/linuxtools/cdt/libhover/properties/LibHoverPropertyPage.java: Rewritten to use the
+ CheckboxFieldEditor widgets on a property page.
+
+2008-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Specify javacSource and javacTarget to be 1.5.
+
+2008-09-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHover.java: Initial implementation moved
+ org.eclipse.cdt.linuxtools.autotools.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverMessages.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverMessages.properties: Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/LibHoverPlugin.java: New file.
+ * META-INF/MANIFEST.MF: Ditto.
+ * schema/org.eclipse.linuxtools.cdt.libhover.library.exsd: Ditto.
+ * about.html, build.properties, plugin.xml, plugin.properties: Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/LibHoverPreferencesPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/PreferenceConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/preferences/PreferenceInitializer.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/libhover/properties/LibHoverPropertyPage.java: Ditto.
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..fc024ea3be
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.libhover; singleton:=true
+Bundle-Version: 1.0.3.qualifier
+Bundle-Activator: org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin
+Bundle-Vendor: %provider
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.help;bundle-version="3.3.100",
+ org.eclipse.cdt.ui;bundle-version="5.0.0",
+ org.eclipse.core.filesystem;bundle-version="1.2.0",
+ org.eclipse.cdt.core;bundle-version="5.0.0",
+ org.eclipse.cdt;bundle-version="5.0.0",
+ org.eclipse.ui.editors;bundle-version="3.4.0",
+ org.eclipse.jface.text;bundle-version="3.4.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.linuxtools.cdt.libhover
+Bundle-ActivationPolicy: lazy
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/build.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/build.properties
new file mode 100644
index 0000000000..50e2a58ba8
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ plugin.properties
+
+javacSource=1.5
+javacTarget=1.5
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.properties
new file mode 100644
index 0000000000..2f48939173
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.properties
@@ -0,0 +1,14 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+LibhoverPreference.name=Library Hover
+LibhoverProperty.name=Library Hover
+bundleName=C/C++ Libhover Plug-in (Incubation)
+provider=Eclipse \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.xml b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.xml
new file mode 100644
index 0000000000..7ece4f49be
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/plugin.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="org.eclipse.linuxtools.cdt.libhover.library" name="C/C++ Library Hover Specifier" schema="schema/org.eclipse.linuxtools.cdt.libhover.library.exsd"/>
+
+ <extension
+ point="org.eclipse.cdt.ui.CHelpProvider">
+ <provider
+ class="org.eclipse.linuxtools.internal.cdt.libhover.LibHover"
+ id="org.eclipse.linuxtools.cdt.libhover.provider"/>
+ </extension>
+</plugin>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/schema/org.eclipse.linuxtools.cdt.libhover.library.exsd b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/schema/org.eclipse.linuxtools.cdt.libhover.library.exsd
new file mode 100644
index 0000000000..749ba37b99
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/schema/org.eclipse.linuxtools.cdt.libhover.library.exsd
@@ -0,0 +1,216 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="library" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="library" id="org.eclipse.linuxtools.cdt.libhover.library" name="C/C++ Library Hover Specifier"/>
+ </appinfo>
+ <documentation>
+ This extension allows specification of a library hover file to use when editing C or C++ files under the CDT.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="library" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique simple id for this extension (e.g. library).
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of this library to hover. This name will be shown in the preference and property dialogs.
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="library">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of the library that the hover info is providing
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="location" type="string" use="required">
+ <annotation>
+ <documentation>
+ Location of the binary file containing the serialized LibHoverInfo for the documentation: either an absolute file name or a URL
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="docs" type="string">
+ <annotation>
+ <documentation>
+ URL of help documentation or empty.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" use="required">
+ <annotation>
+ <documentation>
+ Type of library that help is for. One of C, C++, or ASM
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="C">
+ </enumeration>
+ <enumeration value="C++">
+ </enumeration>
+ <enumeration value="ASM">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 1.0.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ &lt;extension
+ point=&quot;org.eclipse.linuxtools.cdt.libhover.library&quot;&gt;
+ &lt;library
+ name=&quot;GTK&quot;
+ location=&quot;http://mywebsite/libhover/xml/gtk.xml&quot;
+ docs=&quot;http;//gtk.org/docs/gtk.html&quot;/&gt;
+ &lt;/extension&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ XML files referenced must adhere to the following xml structure:
+&lt;pre&gt;
+
+&lt;!DOCTYPE descriptions [
+
+ &lt;!ELEMENT descriptions (construct)*&gt;
+
+ &lt;!ELEMENT construct (structure|function)*&gt;
+ &lt;!ATTLIST construct
+ id ID #REQUIRED
+ type CDATA #REQUIRED
+ &gt;
+
+ &lt;!ELEMENT structure (synopsis?, elements?)?&gt;
+
+ &lt;!ELEMENT elements (element*)&gt;
+
+ &lt;!ELEMENT element (synopsis*)&gt;
+ &lt;!ATTLIST element
+ content CDATA #REQUIRED
+ &gt;
+
+ &lt;!ELEMENT synopsis (#PCDATA)*&gt;
+
+ &lt;!ELEMENT function (prototype,headers?,synopsis)&gt;
+ &lt;!ATTLIST function
+ returntype CDATA #REQUIRED
+ &gt;
+
+ &lt;!ELEMENT prototype (parameter+)?&gt;
+
+ &lt;!ELEMENT parameter (#PCDATA)*&gt;
+ &lt;!ATTLIST parameter
+ content CDATA #REQUIRED
+ &gt;
+
+ &lt;!ELEMENT headers (header+)?&gt;
+
+ &lt;!ELEMENT header (#PCDATA)*&gt;
+ &lt;!ATTLIST header
+ filename CDATA #REQUIRED
+ &gt;
+
+]&gt;
+&lt;/pre&gt;
+Note that function names need to be prefixed by &quot;function-&quot;. For example:
+&lt;pre&gt;
+&lt;descriptions&gt;
+ &lt;construct id=&quot;function-atexit&quot; type=&quot;function&quot;&gt;
+ &lt;function returntype=&quot;int&quot;&gt;
+ &lt;prototype&gt;
+ &lt;parameter content=&quot;void (*function) (void)&quot;/&gt;
+ &lt;/prototype&gt;
+ &lt;headers&gt;
+ &lt;header filename = &quot;stdlib.h&quot;/&gt;
+ &lt;/headers&gt;
+ &lt;synopsis&gt;
+ The &amp;lt;CODE&amp;gt;atexit&amp;lt;/CODE&amp;gt; function registers the function &amp;lt;VAR&amp;gt;function&amp;lt;/VAR&amp;gt; to be
+ called at normal program termination. The &amp;lt;VAR&amp;gt;function&amp;lt;/VAR&amp;gt; is called with
+ no arguments.
+ &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; The return value from &amp;lt;CODE&amp;gt;atexit&amp;lt;/CODE&amp;gt; is zero on success and nonzero if
+ the function cannot be registered.
+ &lt;/synopsis&gt;
+ &lt;/function&gt;
+ &lt;/construct&gt;
+&lt;/descriptions&gt;
+&lt;/pre&gt;
+
+Also note that the synopsis is output as html. To specify html tags, one needs to use &amp;amp;lt; and &amp;amp;gt; as delimeters in place of &quot;&amp;lt&quot; and &quot;&amp;gt&quot;. In the previous example, VAR tags are used for variable references, CODE tags for the function name, and br tags for forcing paragraph breaks. All of these make the hover look more interesting when displayed.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ /*******************************************************************************
+ * Copyright (c) 2008 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java
new file mode 100644
index 0000000000..fe826df00d
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+
+public class ClassInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private String templateParms[] = new String[0];
+ private boolean templateParmsFilled = false;
+ private String className;
+ private String id;
+ private String include;
+ private ArrayList<ClassInfo> baseClasses = new ArrayList<ClassInfo>();
+ private HashMap<String, MemberInfo> members = new HashMap<String, MemberInfo>();
+ private transient Document document;
+ public transient Node classNode;
+ private ArrayList<ClassInfo> children = null;
+ public ClassInfo(String className, String id, Node classNode) {
+ this.className = className;
+ this.id = id;
+ this.classNode = classNode;
+ }
+ public String getClassName() {
+ return className;
+ }
+ public Node getClassNode() {
+ if (classNode == null)
+ classNode = document.getElementById(id);
+ return classNode;
+ }
+ public void setDocument (Document d) {
+ document = d;
+ }
+ public void setClassName(String newName) {
+ className = newName;
+ }
+ public void addTemplate(ClassInfo child) {
+ if (children == null)
+ children = new ArrayList<ClassInfo>();
+ children.add(child);
+ }
+ public boolean areTemplateParmsFilled() {
+ return templateParmsFilled;
+ }
+
+ public String[] getTemplateParms() {
+ return templateParms;
+ }
+
+ public void setTemplateParms(String[] templateParms) {
+ templateParmsFilled = true;
+ this.templateParms = templateParms;
+ }
+
+ public String getInclude() {
+ return include;
+ }
+
+ public void setInclude(String include) {
+ this.include = include;
+ }
+
+ public ArrayList<ClassInfo> getChildren() {
+ return children;
+ }
+
+ public MemberInfo getMember(String name) {
+ return members.get(name);
+ }
+
+ public void addMember(MemberInfo info) {
+ String name = info.getName();
+ MemberInfo member = members.get(name);
+ if (member != null)
+ member.addChild(info);
+ else
+ members.put(name, info);
+ }
+
+ public MemberInfo[] getMembers(String nameStart) {
+ ArrayList<MemberInfo> matchList = new ArrayList<MemberInfo>();
+ Collection<MemberInfo> values = members.values();
+ for (Iterator<MemberInfo> i = values.iterator(); i.hasNext();) {
+ MemberInfo k = i.next();
+ if (k.getName().startsWith(nameStart)) {
+ matchList.add(k);
+ ArrayList<MemberInfo> children = k.getChildren();
+ if (children != null) {
+ for (Iterator<MemberInfo> j = children.iterator(); j.hasNext();) {
+ MemberInfo child = (MemberInfo)i.next();
+ matchList.add(child);
+ }
+ }
+ }
+ }
+ MemberInfo[] matches = new MemberInfo[matchList.size()];
+ return matchList.toArray(matches);
+ }
+
+ public ArrayList<ClassInfo> getBaseClasses() {
+ return baseClasses;
+ }
+
+ public void addBaseClass(ClassInfo info) {
+ baseClasses.add(info);
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java
new file mode 100644
index 0000000000..b9fef1bd7d
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class FunctionInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private String name;
+ private String prototype;
+ private String desc;
+ private String returnType;
+ private ArrayList<String> headers = new ArrayList<String>();
+ private ArrayList<FunctionInfo> children = null;
+
+ /**
+ * Constructor for function.
+ *
+ * @param name
+ */
+ public FunctionInfo(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get function name.
+ *
+ * @return function name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get prototype for function.
+ *
+ * @return prototype string or null
+ */
+ public String getPrototype() {
+ return prototype;
+ }
+
+ /**
+ * Set prototype string.
+ *
+ * @param prototype
+ */
+ public void setPrototype(String prototype) {
+ this.prototype = prototype;
+ }
+
+ /**
+ * Get description for function.
+ *
+ * @return description string or null
+ */
+ public String getDescription() {
+ return desc;
+ }
+
+ /**
+ * Set description string for function.
+ *
+ * @param desc
+ */
+ public void setDescription(String desc) {
+ this.desc = desc;
+ }
+
+ /**
+ * Get return type for function.
+ *
+ * @return return type as string or null
+ */
+ public String getReturnType() {
+ return returnType;
+ }
+
+ /**
+ * Set return type for function.
+ *
+ * @param returnType
+ */
+ public void setReturnType(String returnType) {
+ this.returnType = returnType;
+ }
+
+ /**
+ * Get the headers that need including for this function.
+ *
+ * @return list of header strings
+ */
+ public ArrayList<String> getHeaders() {
+ return headers;
+ }
+
+ /**
+ * Add a header to the list of headers needed for this function.
+ *
+ * @param header the name of the header file to add
+ */
+ public void addHeader(String header) {
+ headers.add(header);
+ }
+
+ /**
+ * Add a function with the same name as a child of this function (C++-only).
+ *
+ * @param info a function with same name as this function.
+ */
+ public void addChild(FunctionInfo info) {
+ if (children == null)
+ children = new ArrayList<FunctionInfo>();
+ children.add(info);
+ }
+
+ /**
+ * Get the children functions with same name as this function.
+ *
+ * @return an ArrayList of functions with same name or null.
+ */
+ public ArrayList<FunctionInfo> getChildren() {
+ return children;
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java
new file mode 100644
index 0000000000..efdb2dbc42
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover;
+
+import org.eclipse.cdt.ui.ICHelpBook;
+
+public class HelpBook implements ICHelpBook {
+
+ private String title;
+ private int type;
+
+ public HelpBook (String title, String typeName) {
+ this.title = title;
+ if (typeName.equals("C")) // $NON-NLS-1$
+ type = HELP_TYPE_C;
+ else if (typeName.equals("C++")) // $NON-NLS-1$
+ type = HELP_TYPE_CPP;
+ else
+ type = HELP_TYPE_ASM;
+ }
+ public String getTitle () {
+ return title;
+ }
+
+ public int getCHelpType () {
+ return type;
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java
new file mode 100644
index 0000000000..09536d302a
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.TreeMap;
+
+public class LibHoverInfo implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ public HashMap<String, ClassInfo> classes = new HashMap<String, ClassInfo>();
+ public HashMap<String, TypedefInfo> typedefs = new HashMap<String, TypedefInfo>();
+ public TreeMap<String, FunctionInfo> functions = new TreeMap<String, FunctionInfo>();
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java
new file mode 100644
index 0000000000..39e2b2b0c5
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class LibhoverPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.libhover";
+
+ // The shared instance
+ private static LibhoverPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public LibhoverPlugin() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static LibhoverPlugin getDefault() {
+ return plugin;
+ }
+
+ /*
+ * Returns the id of the plugin
+ */
+ public static String getID() {
+ return PLUGIN_ID;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java
new file mode 100644
index 0000000000..ac92c65375
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class MemberInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private String name;
+ private String prototype;
+ private String desc;
+ private String returnType;
+ private String[] paramTypes = new String[0];
+ private ArrayList<MemberInfo> children = null;
+
+ /**
+ * Constructor for member.
+ *
+ * @param name
+ */
+ public MemberInfo(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get member name.
+ *
+ * @return member name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get prototype for member.
+ *
+ * @return prototype string or null
+ */
+ public String getPrototype() {
+ return prototype;
+ }
+
+ /**
+ * Set prototype string.
+ *
+ * @param prototype
+ */
+ public void setPrototype(String prototype) {
+ this.prototype = prototype;
+ }
+
+ /**
+ * Get description for member.
+ *
+ * @return description string or null
+ */
+ public String getDescription() {
+ return desc;
+ }
+
+ /**
+ * Set description string for member.
+ *
+ * @param desc
+ */
+ public void setDescription(String desc) {
+ this.desc = desc;
+ }
+
+ /**
+ * Get param types for member.
+ *
+ * @return return array of param types
+ */
+ public String[] getParamTypes() {
+ return paramTypes;
+ }
+
+ /**
+ * Set param types for member.
+ *
+ * @param array of param types
+ */
+ public void setParamTypes(String[] paramTypes) {
+ this.paramTypes = paramTypes;
+ }
+ /**
+ * Get return type for member.
+ *
+ * @return return type as string or null
+ */
+ public String getReturnType() {
+ return returnType;
+ }
+
+ /**
+ * Set return type for member.
+ *
+ * @param returnType
+ */
+ public void setReturnType(String returnType) {
+ this.returnType = returnType;
+ }
+
+ /**
+ * Add a member with the same name as a child of this member.
+ *
+ * @param info a member with same name as this member.
+ */
+ public void addChild(MemberInfo info) {
+ if (children == null)
+ children = new ArrayList<MemberInfo>();
+ children.add(info);
+ }
+
+ /**
+ * Get the children members with same name as this member.
+ *
+ * @return an ArrayList of members with same name or null.
+ */
+ public ArrayList<MemberInfo> getChildren() {
+ return children;
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java
new file mode 100644
index 0000000000..d861558e94
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+public class TypedefInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private String[] templates = new String[0];
+ private String typedefName;
+ private String transformedType;
+ private ArrayList<TypedefInfo> children = null;
+ public TypedefInfo(String typedefName, String transformedType) {
+ this.typedefName = typedefName;
+ this.transformedType = transformedType;
+ }
+ public String getTypedefName() {
+ return typedefName;
+ }
+ public void setTypedefName(String name) {
+ typedefName = name;
+ }
+
+ private String[] getTemplateArgs(String str) {
+ ArrayList<String> list = new ArrayList<String>();
+ int index = 0;
+ int lastIndex = 0;
+ int templateCounter = 0;
+ while (index < str.length()) {
+ char ch = str.charAt(index);
+ if (ch == '<') {
+ if (templateCounter == 0)
+ lastIndex = index + 1;
+ templateCounter++;
+ } else if (ch == '>') {
+ templateCounter--;
+ } else if (ch == ',' && templateCounter == 1) {
+ // FIXME: do we have to strip out all blanks here?
+ list.add(str.substring(lastIndex, index).trim());
+ lastIndex = index + 1;
+ }
+ ++index;
+ }
+ String[] args = new String[list.size()];
+ return list.toArray(args);
+ }
+
+ public String getTransformedType(String className) {
+ int index = className.indexOf('<');
+ if (index > 0) {
+ TypedefInfo e = this;
+ // Search the children list in case the given class name
+ // matches a specific template case.
+ ArrayList<TypedefInfo> children = getChildren();
+ for (int x = 0; x < children.size(); ++x) {
+ TypedefInfo child = children.get(x);
+ if (className.matches(child.getTypedefName())) {
+ e = child;
+ break;
+ }
+ }
+ String[] templates = e.getTemplates();
+ String transformedName = e.transformedType;
+ // Check if there are any template arguments to replace. If not,
+ // we can just return the transformed type we have.
+ if (templates.length <= 0)
+ return transformedName;
+ String[] args = getTemplateArgs(className);
+ String[] templateArgs = getTemplateArgs(e.getTypedefName());
+ int j = 0;
+ // For every argument that doesn't match up, it must be a template
+ // parameter so we'll replace the template parameter name with the
+ // supplied parameter. We have to query the template parameter list
+ // for the names to replace because for partial specific templates
+ // those names will have been replaced with regex sequences designed to
+ // help us identify when the specific template has matched. For example,
+ // <char, _Tp> will be stored as <char,[a-zA-Z0-9_]*> and if we have
+ // <char,char> we will replace _Tp with char in the transformed type.
+ for (int i = 0; i < args.length; ++i) {
+ if (!args[i].equals(templateArgs[i])) {
+ transformedName.replaceAll(templates[j], args[i]);
+ ++j;
+ }
+ }
+ return transformedName;
+ } else {
+ // There is no template specified.
+ return transformedType;
+ }
+ }
+
+ public void addTypedef(TypedefInfo typedef) {
+ if (children == null)
+ children = new ArrayList<TypedefInfo>();
+ children.add(typedef);
+ }
+ public ArrayList<TypedefInfo> getChildren() {
+ return children;
+ }
+ public void copyTemplates(String[] newTemplates) {
+ templates = new String[newTemplates.length];
+ for (int i = 0; i < templates.length; ++i)
+ templates[i] = newTemplates[i];
+ }
+ public String[] getTemplates() {
+ return templates;
+ }
+}
+
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/utils/BuildFunctionInfos.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/utils/BuildFunctionInfos.java
new file mode 100644
index 0000000000..e0daac3512
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/utils/BuildFunctionInfos.java
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.libhover.utils;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectOutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.linuxtools.cdt.libhover.LibHoverInfo;
+import org.eclipse.linuxtools.cdt.libhover.FunctionInfo;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class BuildFunctionInfos {
+
+ private Document document;
+ private LibHoverInfo hoverInfo = new LibHoverInfo();
+
+ public BuildFunctionInfos(Document document) {
+ this.document = document;
+ }
+
+ public Document getDocument() {
+ return document;
+ }
+
+ protected FunctionInfo getFunctionInfoFromNode(String name, Node function_node, Document document) {
+ FunctionInfo f = new FunctionInfo(name);
+ NamedNodeMap function_node_map = function_node.getAttributes();
+ Node function_node_returntype_node = function_node_map.item(0);
+ String function_node_rt_name = function_node_returntype_node.getNodeName();
+
+ if (function_node_rt_name.equals("returntype")) { // $NON-NLS-1$
+
+ // return type
+
+ String function_node_rt_value = function_node_returntype_node.getNodeValue();
+ f.setReturnType(function_node_rt_value);
+ } // returntype
+
+ NodeList function_node_kids = function_node.getChildNodes();
+ for (int fnk = 0; fnk < function_node_kids.getLength(); fnk++) {
+ Node function_node_kid = function_node_kids.item(fnk);
+ String function_node_kid_name = function_node_kid.getNodeName();
+ if (function_node_kid_name.equals("prototype")) { // $NON-NLS-1$
+
+ // prototype
+
+ String prototype = null;
+
+ NodeList function_node_parms = function_node_kid.getChildNodes();
+ for (int fnp = 0; fnp < function_node_parms.getLength(); fnp++) {
+ Node function_node_parm = function_node_parms.item(fnp);
+ String function_node_parm_name = function_node_parm.getNodeName();
+ if (function_node_parm_name.equals("parameter")) { // $NON-NLS-1$
+ NamedNodeMap function_node_parm_map = function_node_parm.getAttributes();
+ Node function_node_parm_node = function_node_parm_map.item(0);
+ String parameter = function_node_parm_node.getNodeValue();
+ prototype = (null == prototype)
+ ? parameter
+ : prototype + ", " + parameter;
+ }
+ }
+ f.setPrototype(prototype);
+ } // prototype
+
+ else if (function_node_kid_name.equals("headers")) { // $NON-NLS-1$
+
+ // headers
+
+ NodeList function_node_headers = function_node_kid.getChildNodes();
+ for (int fnh = 0; fnh < function_node_headers.getLength(); fnh++) {
+ Node function_node_header = function_node_headers.item(fnh);
+ String function_node_header_name = function_node_header.getNodeName();
+ if (function_node_header_name.equals("header")) { // $NON-NLS-1$
+ NamedNodeMap function_node_header_map = function_node_header.getAttributes();
+ Node function_node_header_node = function_node_header_map.item(0);
+ f.addHeader(function_node_header_node.getNodeValue());
+ }
+ }
+ } // headers
+
+
+ else if (function_node_kid_name.equals("groupsynopsis")) { // $NON-NLS-1$
+
+ // group synopsis
+
+ NamedNodeMap attr = function_node_kid.getAttributes();
+ Node idnode = attr.getNamedItem("id"); // $NON-NLS-1$
+ String id = idnode.getNodeValue();
+ if (id != null) {
+ Element elem2 = document.getElementById(id);
+ if (null != elem2) {
+ NodeList synopsisNode = elem2.getElementsByTagName("synopsis"); // $NON-NLS-1$
+ if (null != synopsisNode && synopsisNode.getLength() > 0) {
+ Node synopsis = synopsisNode.item(0);
+ Node textNode = synopsis.getLastChild();
+ f.setDescription(textNode.getNodeValue());
+ }
+ }
+ }
+ }
+
+ else if (function_node_kid_name.equals("synopsis")) { // $NON-NLS-1$
+
+ // synopsis
+
+ Node textNode = function_node_kid.getLastChild();
+ f.setDescription(textNode.getNodeValue());
+ }
+ }
+ return f;
+ }
+
+ public void buildCPPInfo(String fileName) {
+ Document document = getDocument();
+ NodeList nl = document.getElementsByTagName("construct"); // $NON-NLS-1$
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node n = nl.item(i);
+ NamedNodeMap m = n.getAttributes();
+ Node id = m.getNamedItem("id"); // $NON-NLS-1$
+ if (id != null && id.getNodeValue().startsWith("function-")) { // $NON-NLS-1$
+ String name = id.getNodeValue().substring(9);
+ NodeList nl2 = n.getChildNodes();
+ for (int j = 0; j < nl2.getLength(); ++j) {
+ Node n2 = nl2.item(j);
+ if (n2.getNodeName().equals("function")) { // $NON-NLS-1$
+ FunctionInfo f = getFunctionInfoFromNode(name, n2, document);
+ hoverInfo.functions.put(name, f);
+ }
+ }
+ }
+ }
+ try {
+ // Now, output the LibHoverInfo for caching later
+ FileOutputStream f = new FileOutputStream(fileName);
+ ObjectOutputStream out = new ObjectOutputStream(f);
+ out.writeObject(hoverInfo);
+ out.close();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param args[0] - URL or file name of xml document to parse
+ * args[1] - file name to place resultant serialized LibHoverInfo
+ */
+ public static void main(String[] args) {
+ URI acDoc;
+ try {
+ acDoc = new URI(args[0]);
+ IPath p = URIUtil.toPath(acDoc);
+ InputStream docStream = null;
+ if (p == null) {
+ URL url = acDoc.toURL();
+ docStream = url.openStream();
+ } else {
+ docStream = new FileInputStream(p.toFile());
+ }
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(false);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(docStream);
+ if (doc != null) {
+ BuildFunctionInfos d = new BuildFunctionInfos(doc);
+ d.buildCPPInfo(args[1]);
+ }
+ System.out.println("Built " + args[1] + " from " + args[0]);
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ParserConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
new file mode 100644
index 0000000000..9585485768
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
@@ -0,0 +1,575 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006, 2007, 2008 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+/*
+ * Initially created on Jul 8, 2004
+ */
+
+/**
+ * @author Chris Moller, Red Hat, Inc.
+ * @author Jeff Johnston, Red Hat, Inc. (rewrite to use ICHelpProvider)
+ * Modified to be org.eclipse.linuxtools.cdt.libhover package.
+ */
+
+package org.eclipse.linuxtools.internal.cdt.libhover;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.Map.Entry;
+
+import org.eclipse.cdt.core.dom.ast.DOMException;
+import org.eclipse.cdt.core.dom.ast.IASTName;
+import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
+import org.eclipse.cdt.core.dom.ast.IBinding;
+import org.eclipse.cdt.core.dom.ast.IType;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
+import org.eclipse.cdt.core.model.ILanguage;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.ui.ICHelpBook;
+import org.eclipse.cdt.ui.ICHelpProvider;
+import org.eclipse.cdt.ui.ICHelpResourceDescriptor;
+import org.eclipse.cdt.ui.IFunctionSummary;
+import org.eclipse.cdt.ui.IRequiredInclude;
+import org.eclipse.cdt.ui.text.ICHelpInvocationContext;
+import org.eclipse.cdt.ui.text.IHoverHelpInvocationContext;
+import org.eclipse.cdt.ui.text.SharedASTJob;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.help.IHelpResource;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.linuxtools.cdt.libhover.ClassInfo;
+import org.eclipse.linuxtools.cdt.libhover.FunctionInfo;
+import org.eclipse.linuxtools.cdt.libhover.HelpBook;
+import org.eclipse.linuxtools.cdt.libhover.LibHoverInfo;
+import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin;
+import org.eclipse.linuxtools.cdt.libhover.MemberInfo;
+
+
+public class LibHover implements ICHelpProvider {
+
+ public static String LIBHOVER_DOC_EXTENSION = LibhoverPlugin.PLUGIN_ID + ".library"; //$NON-NLS-1$
+
+ // see comment in initialize()
+ // private static String defaultSearchPath = null;
+
+ private static HashMap<ICHelpBook, LibHoverLibrary> libraries = new HashMap<ICHelpBook, LibHoverLibrary>();
+
+ static final String constructTypes[] ={
+ "dtype", // $NON-NLS-1$
+ "enum", // $NON-NLS-1$
+ "function", // $NON-NLS-1$
+ "groupsynopsis", // $NON-NLS-1$
+ "struct", // $NON-NLS-1$
+ "type", // $NON-NLS-1$
+ "union" // $NON-NLS-1$
+ };
+
+ static final int dtypeIndex = 0;
+ static final int enumIndex = 1;
+ static final int functionIndex = 2;
+ static final int groupsynopsisIndex = 3;
+ static final int structIndex = 4;
+ static final int typeIndex = 5;
+ static final int unionIndex = 6;
+
+ private static ArrayList<ICHelpBook> helpBooks = new ArrayList<ICHelpBook>();
+ public static boolean docsFetched = false;
+
+ public static synchronized void getLibHoverDocs() {
+ if (docsFetched)
+ return;
+// System.out.println("getlibhoverdocs");
+ libraries.clear();
+ helpBooks.clear();
+ IExtensionRegistry x = RegistryFactory.getRegistry();
+ IConfigurationElement[] ces = x.getConfigurationElementsFor(LIBHOVER_DOC_EXTENSION);
+ for (int i = 0; i < ces.length; ++i) {
+ IConfigurationElement ce = ces[i];
+ if (ce.getName().equals("library")) { //$NON-NLS-1$
+ // see comment in initialize()
+ // Use the FileLocator class to open the magic hover doc file
+ // in the plugin's jar.
+ // Either open the html file or file system file depending
+ // on what has been specified.
+ String location = ce.getAttribute("location"); //$NON-NLS-1$
+ String name = ce.getAttribute("name"); //$NON-NLS-1$
+ String helpdocs = ce.getAttribute("docs"); //$NON-NLS-1$
+ String type = ce.getAttribute("type"); //$NON-NLS-1$
+ HelpBook h = new HelpBook(name, type);
+ helpBooks.add(h);
+ LibHoverLibrary l = new LibHoverLibrary(name, location, helpdocs,
+ true);
+ libraries.put(h, l);
+ docsFetched = true;
+ }
+ }
+ }
+
+ public void initialize() {
+ getLibHoverDocs();
+ }
+
+ public ICHelpBook[] getCHelpBooks () {
+ ICHelpBook[] chelpbooks = new ICHelpBook[helpBooks.size()];
+ return helpBooks.toArray(chelpbooks);
+ }
+
+ private class FunctionSummary implements IFunctionSummary, Comparable<FunctionSummary> {
+
+ private String Name;
+ private String NameSpace;
+ private String ReturnType;
+ private String Prototype;
+ private String Summary;
+ private boolean prototypeHasBrackets;
+
+// private String Synopsis;
+ private class RequiredInclude implements IRequiredInclude {
+ private String include;
+
+ public RequiredInclude (String file) {
+ include = file;
+ }
+
+ public String getIncludeName() {
+ return include;
+ }
+
+ public boolean isStandard() {
+ return true;
+ }
+ }
+
+ public int compareTo (FunctionSummary x) {
+ FunctionSummary y = (FunctionSummary)x;
+ return getName().compareTo(y.getName());
+ }
+
+// private RequiredInclude Includes[];
+ private ArrayList<RequiredInclude> Includes = new ArrayList<RequiredInclude>();
+
+ private void setIncludeName (String iname) {
+ RequiredInclude nri = new RequiredInclude(iname);
+ Includes.add(nri);
+ }
+
+ public class FunctionPrototypeSummary implements IFunctionPrototypeSummary {
+ public String getName() { return Name; }
+ public String getReturnType() { return ReturnType; }
+ public String getArguments() { return Prototype; }
+ public String getPrototypeString(boolean namefirst) {
+ if (true == namefirst) {
+ if (prototypeHasBrackets())
+ return Name + " " + Prototype + " " + ReturnType; // $NON-NLS-1$ // $NON-NLS-2$
+ return Name + " (" + Prototype + ") " + ReturnType; // $NON-NLS-1$ // $NON-NLS-2$
+ }
+ else {
+ if (prototypeHasBrackets())
+ return ReturnType + " " + Name + " " + Prototype; // $NON-NLS-1$ // $NON-NLS-2$
+ return ReturnType + " " + Name + " (" + Prototype + ")"; // $NON-NLS-1$ // $NON-NLS-2$ // $NON-NLS-3$
+ }
+ }
+ }
+
+ public String getName() { return Name; }
+ public String getNamespace() { return NameSpace; }
+ public String getDescription() { return Summary; }
+ public boolean prototypeHasBrackets() { return prototypeHasBrackets; }
+ public void setPrototypeHasBrackets(boolean value) { prototypeHasBrackets = value; }
+ public IFunctionPrototypeSummary getPrototype() { return new FunctionPrototypeSummary(); }
+
+ public IRequiredInclude[] getIncludes() {
+ IRequiredInclude[] includes = new IRequiredInclude[Includes.size()];
+ for (int i = 0; i < Includes.size(); ++i) {
+ includes[i] = (IRequiredInclude)Includes.get(i);
+ }
+ return includes;
+ }
+
+ }
+
+ public boolean isCPPCharacter(int ch) {
+ return Character.isLetterOrDigit(ch) || ch == '_' || ch == ':';
+ }
+
+ private class EnclosingASTNameJob extends SharedASTJob {
+ private int tlength;
+ private int toffset;
+ private IASTName result = null;
+ public EnclosingASTNameJob (ITranslationUnit t,
+ int toffset, int tlength) {
+ super("EnclosingASTNameJob", t); // $NON-NLS-1$
+ this.toffset = toffset;
+ this.tlength = tlength;
+ }
+ public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
+ if (ast != null) {
+ result = ast.getNodeSelector(null).findEnclosingName(toffset, tlength);
+ }
+ return Status.OK_STATUS;
+ }
+ public IASTName getASTName() {
+ return result;
+ }
+ }
+
+ public class ASTDeclarationFinderJob extends SharedASTJob {
+ private IBinding binding;
+ private IASTName[] decls = null;
+ public ASTDeclarationFinderJob (ITranslationUnit t, IBinding binding) {
+ super("ASTDeclarationFinderJob", t); // $NON-NLS-1$
+ this.binding = binding;
+ }
+ public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
+ if (ast != null) {
+ decls = ast.getDeclarationsInAST(binding);
+ }
+ return Status.OK_STATUS;
+ }
+ public IASTName[] getDeclarations() {
+ return decls;
+ }
+ }
+
+ public IFunctionSummary getFunctionInfo(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String name) {
+ IFunctionSummary f;
+
+ f = null;
+ ITranslationUnit t = context.getTranslationUnit();
+
+ String className = null;
+ ICPPFunctionType methodType = null;
+
+ if (t.isCXXLanguage()) {
+ try {
+ if (context instanceof IHoverHelpInvocationContext) {
+ // We know the file offset of the member reference.
+ IRegion region = (IRegion)((IHoverHelpInvocationContext)context).getHoverRegion();
+
+ // Now, let's find the declaration of the method. We need to do this because we want the specific
+ // member prototype to go searching for. There could be many members called "x" which have different
+ // documentation.
+ final IASTName[] result= {null};
+ EnclosingASTNameJob job = new EnclosingASTNameJob(t, region.getOffset(), region.getLength());
+ job.schedule();
+ try {
+ job.join();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (job.getResult() == Status.OK_STATUS)
+ result[0] = job.getASTName();
+ if (result[0] != null) {
+ final IBinding binding = result[0].getBinding();
+ // Check to see we have a member function.
+ if (binding instanceof ICPPFunction) {
+ methodType = ((ICPPFunction)binding).getType();
+ // We have a member function, find the class name.
+ IBinding owner = ((ICPPFunction)binding).getOwner();
+ if (owner instanceof ICPPClassType) {
+ className = getClassName((ICPPClassType)owner);
+ }
+ }
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (DOMException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ // Loop through all the documents we have and report first match.
+ for (int i = 0; i < helpBooks.length; ++i) {
+ LibHoverLibrary l = libraries.get(helpBooks[i]);
+ if (name != null) {
+ if (className != null) {
+ if (l.isCPP())
+ f = getMemberSummary(l, className, name, methodType);
+ } else {
+ f = getFunctionSummary(l, name);
+ }
+ if (f != null)
+ return f;
+ }
+ }
+
+ return null;
+ }
+
+ // Get the class name for a type, including any instance template parameters
+ // e.g. std::basic_string<char>
+ private String getClassName(ICPPClassType c) {
+ String className = null;
+ try {
+ String[] qualified = c.getQualifiedName();
+ className = qualified[0];
+ for (int k = 1; k < qualified.length; ++k) {
+ className += "::" + qualified[k];
+ }
+
+ // Check if we have an instance of a template class.
+ if (c instanceof ICPPTemplateInstance) {
+ ICPPTemplateInstance ti = (ICPPTemplateInstance)c;
+ // Get a map which tells us the values of the template
+ // arguments (e.g. _CharT maps to char in the instance).
+ ICPPTemplateParameterMap tiMap = ti.getTemplateParameterMap();
+ ICPPTemplateDefinition td = ti.getTemplateDefinition();
+ ICPPTemplateParameter[] templateArgs = td.getTemplateParameters();
+ className += "<";
+ String separator = "";
+ for (int x = 0; x < templateArgs.length; ++x) {
+ ICPPTemplateParameter tp = templateArgs[x];
+ ICPPTemplateArgument ta = tiMap.getArgument(tp);
+ IType type = null;
+ // The template may have a type specified or a value.
+ // In the case of a value, figure out its type and use
+ // that when we do a lookup.
+ if (ta.isTypeValue())
+ type = ta.getTypeValue();
+ else
+ type = ta.getTypeOfNonTypeValue();
+ if (tp.getTemplateNestingLevel() == 0) {
+ // if the parameter is a class type, use recursion to
+ // get its class name including template parameters
+ if (type instanceof ICPPClassType)
+ className += separator + getClassName((ICPPClassType)type);
+ else
+ className += separator + type.toString();
+ separator = ",";
+ }
+ }
+ className += ">";
+ }
+ } catch(DOMException e) {
+ return null;
+ }
+ return className;
+ }
+
+ private IFunctionSummary getFunctionSummary(LibHoverLibrary l, String name) {
+ FunctionInfo x = l.getFunctionInfo(name);
+ if (x != null) {
+ FunctionSummary f = new FunctionSummary();
+ f.ReturnType = x.getReturnType();
+ f.Prototype = x.getPrototype();
+ f.Summary = x.getDescription();
+ f.Name = x.getName();
+ ArrayList<String> headers = x.getHeaders();
+ for (int i = 0; i < headers.size(); ++i)
+ f.setIncludeName(headers.get(i));
+ return f;
+ }
+ return null;
+ }
+
+ private IFunctionSummary getMemberSummary(LibHoverLibrary l, String className,
+ String memberName, ICPPFunctionType methodType) {
+
+ ArrayList<String> templateTypes = new ArrayList<String>();
+ ClassInfo info = l.getClassInfo(className, templateTypes);
+ String[] args = new String[0];
+ @SuppressWarnings("unused")
+ IType returnType = null;
+ if (info == null)
+ return null;
+ if (methodType != null) {
+ try {
+ args = resolveArgs(info, methodType.getParameterTypes(), templateTypes);
+ returnType = methodType.getReturnType();
+ } catch (Exception e) {
+ return null;
+ }
+// for (int i = 0; i < args.length; ++i)
+// System.out.println("args<" + i + "> is " + args[i].toString());
+// System.out.println("return type is " + returnType.toString());
+
+ }
+ MemberInfo member = info.getMember(memberName);
+ if (member != null) {
+ MemberInfo m = null;
+ if (!isParmMatch(member, args, templateTypes, info)) {
+ ArrayList<MemberInfo> members = member.getChildren();
+ for (int i = 0; i < members.size(); ++i) {
+ MemberInfo k = members.get(i);
+ if (isParmMatch(k, args, templateTypes, info)) {
+ m = k;
+ break;
+ }
+ }
+ } else {
+ m = member;
+ }
+
+ if (m != null) {
+ // FIXME: do some work to determine parameters and return type.
+ FunctionSummary f = new FunctionSummary();
+ f.ReturnType = m.getReturnType();
+ f.Prototype = m.getPrototype();
+ f.Summary = m.getDescription();
+// String actualClassName = className.substring(className.indexOf("::")+2); // $NON-NLS-1$
+ f.Name = className + "::" + memberName; // $NON-NLS-1$
+ String[] templateParms = info.getTemplateParms();
+ for (int i = 0; i < templateTypes.size(); ++i) {
+ f.ReturnType = f.ReturnType.replaceAll(templateParms[i], templateTypes.get(i));
+ f.Prototype = f.Prototype.replaceAll(templateParms[i], templateTypes.get(i));
+ f.Name = f.Name.replaceAll(templateParms[i], templateTypes.get(i));
+ }
+ if (f.ReturnType.indexOf('<') >= 0) {
+ f.ReturnType = f.ReturnType.replaceAll("<", "&lt;");
+ f.ReturnType = f.ReturnType.replaceAll(">", "&gt;");
+ }
+ if (f.Prototype.indexOf('<') >= 0) {
+ f.Prototype = f.Prototype.replaceAll("<", "&lt;");
+ f.Prototype = f.Prototype.replaceAll(">", "&gt;");
+ }
+ if (f.Name.indexOf('<') >= 0) {
+ f.Name = f.Name.replaceAll("<", "&lt;");
+ f.Name = f.Name.replaceAll(">", "&gt;");
+ }
+ f.setPrototypeHasBrackets(true);
+ f.setIncludeName(info.getInclude());
+ return f;
+ }
+ }
+ return null;
+ }
+
+
+ private boolean isParmMatch(MemberInfo m, String[] args, ArrayList<String> templateTypes, ClassInfo info) {
+ String[] memberParms = m.getParamTypes();
+ for (int i = 0; i < memberParms.length; ++i) {
+ String[] templateParms = info.getTemplateParms();
+ for (int j = 0; j < templateTypes.size(); ++j) {
+ memberParms[i] = memberParms[i].replaceAll(templateParms[j], templateTypes.get(j));
+ }
+ }
+ return Arrays.equals(memberParms, args);
+ }
+
+ private String[] resolveArgs(ClassInfo info, IType[] parameterTypes, ArrayList<String> templateTypes) {
+ String[] templateParms = info.getTemplateParms();
+ String[] result = new String[parameterTypes.length];
+ for (int i = 0; i < parameterTypes.length; ++i) {
+ String param = parameterTypes[i].toString();
+ param = param.replaceAll("\\{.*\\}", "");
+ param = param.trim();
+ int index = param.indexOf("#");
+ while (index >= 0) {
+ // We assume no class has more than 9 template parms.
+ int digit = param.charAt(index + 1) - '0';
+ // where possible, replace template parms with real values
+ if (digit < templateTypes.size())
+ param = param.replaceFirst(param.substring(index, index + 2), templateTypes.get(digit));
+ else
+ param = param.replaceFirst(param.substring(index, index + 2), templateParms[digit]);
+ index = param.indexOf("#");
+ }
+ result[i] = param;
+ }
+ return result;
+ }
+
+ public IFunctionSummary[] getMatchingFunctions(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String prefix) {
+ ArrayList<IFunctionSummary> fList = new ArrayList<IFunctionSummary>();
+
+ for (int di = 0; di < helpBooks.length; ++di) {
+ LibHoverLibrary l = libraries.get(helpBooks[di]);
+ LibHoverInfo cppInfo = l.getHoverInfo();
+ SortedMap<String, FunctionInfo> map = cppInfo.functions.tailMap(prefix);
+ Set<Map.Entry<String, FunctionInfo>> c = map.entrySet();
+ for (Iterator<Entry<String, FunctionInfo>> i = c.iterator(); i.hasNext();) {
+ Map.Entry<String, FunctionInfo> e = (Map.Entry<String, FunctionInfo>)i.next();
+ FunctionInfo x = e.getValue();
+ if (x.getName().startsWith(prefix)) {
+ FunctionSummary f = new FunctionSummary();
+ f.ReturnType = x.getReturnType();
+ f.Prototype = x.getPrototype();
+ f.Summary = x.getDescription();
+ f.Name = x.getName();
+ ArrayList<String> headers = x.getHeaders();
+ for (int i1 = 0; i1 < headers.size(); ++i1)
+ f.setIncludeName(headers.get(i1));
+ fList.add(f);
+ }
+ }
+ }
+ IFunctionSummary[] summaries = new IFunctionSummary[fList.size()];
+ for (int k = 0; k < summaries.length; k++) {
+ summaries[k] = (IFunctionSummary)fList.get(k);
+ }
+ return summaries;
+ }
+
+ private class HelpResource implements IHelpResource {
+ private String href;
+ private String label;
+ public HelpResource(String href, String label) {
+ this.href = href;
+ this.label = label;
+ }
+ public String getHref() {
+ return href;
+ }
+ public String getLabel() {
+ return label;
+ }
+ }
+
+ private class HelpResourceDescriptor implements ICHelpResourceDescriptor {
+ private ICHelpBook helpbook;
+
+ public HelpResourceDescriptor(ICHelpBook helpbook) {
+ this.helpbook = helpbook;
+ }
+
+ public ICHelpBook getCHelpBook() {
+ return helpbook;
+ }
+
+ public IHelpResource[] getHelpResources() {
+ LibHoverLibrary l = libraries.get(helpbook);
+ if (l != null) {
+ IHelpResource[] hr = new IHelpResource[1];
+ hr[0] = new HelpResource(l.getLocation(), l.getName());
+ return hr;
+ }
+ return null;
+ }
+ }
+
+ public ICHelpResourceDescriptor[] getHelpResources(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String name) {
+ for (int i = 0; i < helpBooks.length; ++i) {
+ IFunctionSummary fs = getFunctionInfo(context, new ICHelpBook[]{helpBooks[i]}, name);
+ if (fs != null) {
+ return new HelpResourceDescriptor[]{new HelpResourceDescriptor(helpBooks[i])};
+ }
+ }
+ return null;
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
new file mode 100644
index 0000000000..d1310580e0
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.libhover;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.linuxtools.cdt.libhover.ClassInfo;
+import org.eclipse.linuxtools.cdt.libhover.FunctionInfo;
+import org.eclipse.linuxtools.cdt.libhover.LibHoverInfo;
+import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin;
+import org.eclipse.linuxtools.cdt.libhover.TypedefInfo;
+
+public class LibHoverLibrary {
+ private String name;
+ private String location;
+ private String docs;
+ private boolean isCPP;
+ private LibHoverInfo hoverInfo = new LibHoverInfo();
+ private boolean haveReadHoverInfo = false;
+
+ public LibHoverLibrary(String name, String location, String docs,
+ boolean isCPP) {
+ this.name = name;
+ this.location = location;
+ this.docs = docs;
+ this.isCPP = isCPP;
+ }
+
+ /**
+ * Get the name of the library
+ *
+ * @return the name of the library
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get the location of the library hover info (URL or file name)
+ *
+ * @return the URL or file name string for the library hover info location
+ */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * Get the browser help documentation URL for this library
+ *
+ * @return the name of the help documentation URL
+ */
+ public String getDocs() {
+ return docs;
+ }
+
+ /**
+ * Is this library a C++ library?
+ *
+ * @return true if C++ library, false otherwise
+ */
+ public boolean isCPP() {
+ return isCPP;
+ }
+
+ /**
+ * Get the library hover info for this library
+ *
+ * @return the library hover info for this library
+ */
+ public LibHoverInfo getHoverInfo() {
+ // We lazily get the hover info for this library since it is possible
+ // the user will never access or ultimately need it if another library
+ // supplies the information first.
+ if (!haveReadHoverInfo) {
+ URI acDoc;
+ try {
+ acDoc = new URI(location);
+ IPath p = URIUtil.toPath(acDoc);
+ InputStream docStream = null;
+ if (p == null) {
+ URL url = acDoc.toURL();
+ docStream = url.openStream();
+ } else {
+ try {
+ // Try to open the file as local to this plug-in.
+ docStream = FileLocator.openStream(LibhoverPlugin.getDefault().getBundle(), p, false);
+ } catch (IOException e) {
+ // File is not local to plug-in, try file system.
+ docStream = new FileInputStream(p.toFile());
+ }
+ }
+ ObjectInputStream input = new ObjectInputStream(docStream);
+ hoverInfo = (LibHoverInfo)input.readObject();
+ haveReadHoverInfo = true;
+ input.close();
+ docStream.close();
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return hoverInfo;
+ }
+
+ /**
+ * Set the library hover info.
+ *
+ * @param hoverInfo the library hover info to set
+ */
+ public void setHoverinfo(LibHoverInfo hoverInfo) {
+ this.hoverInfo = hoverInfo;
+ }
+
+ /**
+ * Fetch the class info for a given class.
+ *
+ * @param className the name of the class to fetch info for
+ * @return ClassInfo or null if no class info can be found
+ */
+ public ClassInfo getClassInfo(String className, ArrayList<String> templateTypes) {
+ String typedefName = className.replaceAll("<.*>", "<>"); // $NON-NLS-1$ // $NON-NLS-2$
+ TypedefInfo typedef = getHoverInfo().typedefs.get(typedefName);
+ if (typedef != null) {
+ className = typedef.getTransformedType(className); // Reset class name to typedef transformation
+ }
+ int index = className.indexOf('<');
+ // Check if it is a template reference.
+ if (index != -1) {
+ resolveTemplateTypes(className, templateTypes, index);
+ // It is. We want to see if there are partial specific templates
+ // and we choose the first match. If nothing matches our particular
+ // case, we fall back on the initial generic template.
+ ClassInfo info = getHoverInfo().classes.get(className.substring(0, index));
+ if (info != null) {
+ ArrayList<ClassInfo> children = info.getChildren();
+ if (children != null && children.size() > 0) {
+ for (int x = 0; x < children.size(); ++x) {
+ ClassInfo child = children.get(x);
+ if (className.matches(child.getClassName())) {
+ info = child;
+ break;
+ }
+ }
+ }
+ }
+ return info;
+ }
+ // Otherwise no template, just fetch the class info directly.
+ return getHoverInfo().classes.get(className);
+ }
+
+ private void resolveTemplateTypes(String className,
+ ArrayList<String> templateTypes, int index) {
+ int startIndex = index + 1;
+ int i = startIndex;
+ int count = 1;
+ while (count > 0 && i < className.length()) {
+ char x = className.charAt(i);
+ switch (x) {
+ case ('<'):
+ ++count;
+ break;
+ case ('>'):
+ --count;
+ if (count == 0)
+ templateTypes.add(className.substring(startIndex, i).trim());
+ break;
+ case (','): {
+ if (count == 1) {
+ templateTypes.add(className.substring(startIndex, i).trim());
+ startIndex = i + 1;
+ }
+ }
+ break;
+ }
+ ++i;
+ }
+ }
+
+ /**
+ * Fetch the function info for a given function.
+ *
+ * @param name of function to find info for
+ * @return FunctionInfo or null if no function info exists
+ */
+ public FunctionInfo getFunctionInfo(String name) {
+ return getHoverInfo().functions.get(name);
+ }
+}
+
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java
new file mode 100644
index 0000000000..8a4724727b
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modification to use with LibHover
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.libhover;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * MakefilePreferencesMessages
+ */
+public class LibHoverMessages {
+
+ /**
+ *
+ */
+ private LibHoverMessages() {
+ }
+
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.cdt.libhover.LibHoverMessages"; //$NON-NLS-1$
+
+ public static String getString(String key) {
+ try {
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.properties b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.properties
new file mode 100644
index 0000000000..c187c96126
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.properties
@@ -0,0 +1,16 @@
+#################################################################################
+# Copyright (c) 2007 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+LibcHelpResource.label=C Library Help
+LibcHelpBook.title=C Library Functions
+FileListControl.moveup=Move Up
+FileListControl.movedown=Move Down
+LibhoverPreferences.title=C/C++ Library Hover Enablement
+Libhover.projectSpecific.msg=Use project specific settings \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/CheckboxFieldEditor.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/CheckboxFieldEditor.java
new file mode 100644
index 0000000000..546b4f5f90
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/CheckboxFieldEditor.java
@@ -0,0 +1,394 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.libhover.preferences;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.eclipse.cdt.ui.newui.UIMessages;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.internal.cdt.libhover.LibHoverMessages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+
+public class CheckboxFieldEditor extends FieldEditor {
+
+ private String extensionID;
+ private String preferenceName;
+ private HashMap<String, String> mapItems = new HashMap<String, String>();
+ private Table table;
+ private CheckboxTableViewer tv;
+ private Button[] buttons;
+ private Composite usercomp; // space where user can create widgets
+ private Composite buttoncomp; // space for buttons on the right
+
+
+ public static final String EMPTY_STR = ""; //$NON-NLS-1$
+ public static final String MOVEUP_STR = LibHoverMessages.getString("FileListControl.moveup"); //$NON-NLS-1$
+ public static final String MOVEDOWN_STR = LibHoverMessages.getString("FileListControl.movedown"); //$NON-NLS-1$
+
+ public CheckboxFieldEditor(String extensionID, String preferenceName, String label, Composite parent) {
+ this.extensionID = extensionID;
+ this.preferenceName = preferenceName;
+ init(preferenceName, label);
+ createControl(parent);
+ }
+
+
+ @Override
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
+ */
+ protected void adjustForNumColumns(int numColumns) {
+ if (numColumns > 1) {
+ Control control = getLabelControl();
+ if (control != null) {
+ ((GridData)control.getLayoutData()).horizontalSpan = numColumns;
+ }
+ ((GridData)table.getLayoutData()).horizontalSpan = numColumns - 1;
+ ((GridData)buttoncomp.getLayoutData()).horizontalSpan = 1;
+ } else {
+ Control control = getLabelControl();
+ if (control != null) {
+ ((GridData)control.getLayoutData()).horizontalSpan = 1;
+ }
+ ((GridData)usercomp.getLayoutData()).horizontalSpan = 1;
+ ((GridData)buttoncomp.getLayoutData()).horizontalSpan = 1;
+ }
+ }
+
+
+ @Override
+ // TODO Auto-generated method stub
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
+ */
+ protected void doFillIntoGrid(Composite parent, int numColumns) {
+ int checkC = 1;
+ if (numColumns > 1) {
+ checkC = numColumns - 1;
+ }
+ Control control = getLabelControl(parent);
+ GridData gd = new GridData();
+ gd.horizontalSpan = numColumns;
+ control.setLayoutData(gd);
+ control = getCheckboxControl(parent);
+ gd = new GridData();
+ gd.horizontalSpan = checkC;
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ control.setLayoutData(gd);
+ control.setFont(parent.getFont());
+ control = getButtonControl(parent);
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ gd.horizontalAlignment = GridData.FILL;
+ control.setLayoutData(gd);
+ control.setFont(parent.getFont());
+ }
+
+ private void getExtensions() {
+ mapItems.clear();
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(
+ extensionID);
+ if (point != null) {
+ IExtension[] exts = point.getExtensions();
+ for (IExtension ext : exts) {
+ if (ext.getConfigurationElements().length > 0) {
+ mapItems.put(ext.getUniqueIdentifier(), ext.getLabel());
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doLoad() {
+ // Combine user preference string with existing libhover extensions.
+ getExtensions();
+ HashMap<String,String> copyMap = (HashMap<String,String>)mapItems.clone();
+ ArrayList<TableData> data = new ArrayList<TableData>();
+ ArrayList<TableData> checkedData = new ArrayList<TableData>();
+ // See what the user has set in preferences and make sure that
+ // any libhover referred to is a valid current extension.
+ // Drop any preference for a non-existent extension.
+ String pref = getPreferenceStore().getString(preferenceName);
+ String[] tokens = pref.split(":");
+ if (tokens.length > 1) {
+ for (int i = 0; i < tokens.length; i+=2) {
+ String id = tokens[i];
+ Boolean checked = Boolean.valueOf(tokens[i+1]);
+ String value = copyMap.get(id);
+ if (value != null) {
+ TableData d = new TableData(id, value);
+ data.add(d);
+ if (checked)
+ checkedData.add(d);
+ copyMap.remove(id);
+ }
+ }
+ }
+ // Add remaining libhover extensions to end of list as checked by default
+ String[] leftovers = new String[copyMap.size()];
+ leftovers = copyMap.keySet().toArray(leftovers);
+ for (int i = 0; i < leftovers.length; ++i) {
+ TableData d = new TableData(leftovers[i], copyMap.get(leftovers[i]));
+ data.add(d);
+ checkedData.add(d);
+ }
+ tv.setInput(data.toArray());
+ tv.setCheckedElements(checkedData.toArray());
+ updateButtons();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doLoadDefault() {
+ // Default is to find all current extensions and turn them on by default.
+ getExtensions();
+ HashMap<String,String> copyMap = (HashMap<String,String>)mapItems.clone();
+ ArrayList<TableData> data = new ArrayList<TableData>();
+ ArrayList<TableData> checkedData = new ArrayList<TableData>();
+ String[] ids = new String[copyMap.size()];
+ ids = copyMap.keySet().toArray(ids);
+ for (int i = 0; i < ids.length; ++i) {
+ TableData d = new TableData(ids[i], copyMap.get(ids[i]));
+ data.add(d);
+ checkedData.add(d);
+ }
+ tv.setInput(data.toArray());
+ tv.setCheckedElements(checkedData.toArray());
+ updateButtons();
+ }
+
+ @Override
+ protected void doStore() {
+ save();
+ }
+
+ @Override
+ public int getNumberOfControls() {
+ return 3;
+ }
+
+ public Control getButtonControl(Composite parent) {
+ if (buttoncomp == null) {
+ buttoncomp = new Composite(parent, SWT.NONE);
+ GridData d = new GridData(GridData.END);
+ d.widthHint = 1;
+ buttoncomp.setLayoutData(d);
+ buttoncomp.setFont(parent.getFont());
+ initButtons(buttoncomp, new String[] {
+ MOVEUP_STR, MOVEDOWN_STR, null,
+ UIMessages.getString("ErrorParsTab.0"), //$NON-NLS-1$
+ UIMessages.getString("ErrorParsTab.1") //$NON-NLS-1$
+ });
+ }
+ return buttoncomp;
+ }
+
+ public Control getCheckboxControl(Composite parent) {
+ if (table == null) {
+// parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ table = new Table(parent, SWT.BORDER | SWT.CHECK | SWT.SINGLE);
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ table.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateButtons();
+ }});
+ tv = new CheckboxTableViewer(table);
+ tv.setContentProvider(new IStructuredContentProvider() {
+ public Object[] getElements(Object inputElement) {
+ return (Object[])inputElement;
+ }
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ });
+
+ tv.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent e) {
+ }
+ });
+
+ }
+ return table;
+ }
+ /**
+ * Ability to create standard button on any composite.
+ * @param c
+ * @param names
+ */
+ protected void initButtons(Composite c, String[] names) {
+ initButtons(c, names, 80);
+ }
+ protected void initButtons(Composite c, String[] names, int width) {
+ if (names == null || names.length == 0) return;
+ c.setLayoutData(new GridData(GridData.FILL_VERTICAL));
+ c.setLayout(new GridLayout(1, false));
+ buttons = new Button[names.length];
+ for (int i=0; i<names.length; i++) {
+ buttons[i] = new Button(c, SWT.PUSH);
+ buttons[i].setFont(c.getFont());
+ GridData gdb = new GridData(GridData.VERTICAL_ALIGN_CENTER);
+ gdb.grabExcessHorizontalSpace = false;
+ gdb.horizontalAlignment = SWT.FILL;
+ gdb.minimumWidth = width;
+
+ if (names[i] != null)
+ buttons[i].setText(names[i]);
+ else { // no button, but placeholder !
+ buttons[i].setVisible(false);
+ buttons[i].setEnabled(false);
+ gdb.heightHint = 10;
+ }
+
+ buttons[i].setLayoutData(gdb);
+ buttons[i].addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ buttonPressed(event);
+ }});
+ }
+ }
+
+ /**
+ *
+ * @param e - event to be handled
+ */
+ private void buttonPressed(SelectionEvent e) {
+ for (int i=0; i<buttons.length; i++) {
+ if (buttons[i].equals(e.widget)) {
+ buttonPressed(i);
+ return;
+ }
+ }
+ }
+
+ public void buttonPressed (int n) {
+ switch (n) {
+ case 0: // up
+ moveItem(true);
+ break;
+ case 1: // down
+ moveItem(false);
+ break;
+ case 2: // do nothing - it's not a button
+ break;
+
+ case 3: // check all
+ tv.setAllChecked(true);
+ break;
+ case 4: // uncheck all
+ tv.setAllChecked(false);
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Move item up / down
+ private void moveItem(boolean up) {
+ int n = table.getSelectionIndex();
+ if (n < 0 ||
+ (up && n == 0) ||
+ (!up && n+1 == table.getItemCount()))
+ return;
+ TableData d = (TableData)tv.getElementAt(n);
+ boolean checked = tv.getChecked(d);
+ tv.remove(d);
+ n = up ? n - 1 : n + 1;
+ tv.insert(d, n);
+ tv.setChecked(d, checked);
+ table.setSelection(n);
+ }
+ /**
+ * Changes state of existing button.
+ * Does nothing if index is invalid
+ *
+ * @param i - button index
+ * @param state - required state
+ */
+ protected void buttonSetEnabled(int i, boolean state) {
+ if (buttons == null || buttons.length <= i ) return;
+ buttons[i].setEnabled(state);
+ }
+
+ public void updateButtons() {
+ int cnt = table.getItemCount();
+ int pos = table.getSelectionIndex();
+ buttonSetEnabled(0, pos > 0);
+ buttonSetEnabled(1, pos != -1 && pos < (cnt - 1));
+ buttonSetEnabled(3, cnt > 0);
+ buttonSetEnabled(4, cnt > 0);
+ }
+
+ class TableData {
+ String key;
+ String value;
+ public TableData (String _key, String _value) {
+ key = _key;
+ value = _value;
+ }
+ @Override
+ public String toString() { return value; }
+ }
+
+ private void save() {
+ boolean inRange = true;
+ int i = 0;
+ String outString = new String();
+ String del = "";
+ while (inRange) {
+ TableData t;
+ Object obj = tv.getElementAt(i);
+ if (obj == null)
+ inRange = false;
+ else {
+ ++i;
+ t = (TableData)obj;
+ outString += del + t.key + ":" + tv.getChecked(obj);
+ del = ":";
+ }
+ }
+ if (outString.length() > 1)
+ getPreferenceStore().setValue(preferenceName, outString);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#setEnabled(boolean,
+ * org.eclipse.swt.widgets.Composite)
+ */
+ public void setEnabled(boolean enabled, Composite parent) {
+ super.setEnabled(enabled, parent);
+ getCheckboxControl(parent).setEnabled(enabled);
+ getButtonControl(parent).setEnabled(enabled);
+ }
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java
new file mode 100644
index 0000000000..c86aff4faf
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.libhover.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin;
+import org.eclipse.linuxtools.internal.cdt.libhover.LibHover;
+import org.eclipse.linuxtools.internal.cdt.libhover.LibHoverMessages;
+
+/**
+ * This class represents a preference page that
+ * is contributed to the Preferences dialog. By
+ * subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows
+ * us to create a page that is small and knows how to
+ * save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They
+ * are stored in the preference store that belongs to
+ * the main plug-in class. That way, preferences can
+ * be accessed directly via the preference store.
+ */
+
+public class LibHoverPreferencePage
+ extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ public LibHoverPreferencePage() {
+ super(GRID);
+ setPreferenceStore(LibhoverPlugin.getDefault().getPreferenceStore());
+ }
+
+ /**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+ public void createFieldEditors() {
+ addField(new CheckboxFieldEditor(LibHover.LIBHOVER_DOC_EXTENSION,
+ PreferenceConstants.P_LIBHOVER,
+ LibHoverMessages.getString("LibhoverPreferences.title"),
+ getFieldEditorParent()));
+// addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH,
+// "&Directory preference:", getFieldEditorParent()));
+// addField(
+// new BooleanFieldEditor(
+// PreferenceConstants.P_BOOLEAN,
+// "&An example of a boolean preference",
+// getFieldEditorParent()));
+//
+// addField(new RadioGroupFieldEditor(
+// PreferenceConstants.P_CHOICE,
+// "An example of a multiple-choice preference",
+// 1,
+// new String[][] { { "&Choice 1", "choice1" }, {
+// "C&hoice 2", "choice2" }
+// }, getFieldEditorParent()));
+// addField(
+// new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+} \ No newline at end of file
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java
new file mode 100644
index 0000000000..709d6ca657
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.libhover.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ public static String P_LIBHOVER = "libhoverPreference"; //$NON-NLS-1$
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..4fd11a6c40
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.libhover.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = LibhoverPlugin.getDefault().getPreferenceStore();
+ store.setDefault(PreferenceConstants.P_LIBHOVER, "");
+// store.setDefault(PreferenceConstants.P_BOOLEAN, true);
+// store.setDefault(PreferenceConstants.P_CHOICE, "choice2");
+// store.setDefault(PreferenceConstants.P_STRING,
+// "Default value");
+ }
+
+}
diff --git a/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/properties/LibHoverPropertyPage.java b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/properties/LibHoverPropertyPage.java
new file mode 100644
index 0000000000..aca9cf05d4
--- /dev/null
+++ b/libhover/0.5.0/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/properties/LibHoverPropertyPage.java
@@ -0,0 +1,465 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.libhover.properties;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.eclipse.cdt.ui.newui.UIMessages;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin;
+import org.eclipse.linuxtools.internal.cdt.libhover.LibHover;
+import org.eclipse.linuxtools.internal.cdt.libhover.LibHoverMessages;
+import org.eclipse.linuxtools.internal.cdt.libhover.preferences.PreferenceConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+public class LibHoverPropertyPage extends PropertyPage {
+
+ private static final String PROJECT_SPECIFIC_MSG = "Libhover.projectSpecific.msg"; //$NON-NLS-1$
+ private static final String LIBHOVER_PROPERTY = "LIBHOVER"; //$NON-NLS-1$
+
+ private QualifiedName libhoverProperty = new QualifiedName(LibhoverPlugin.getID(), LIBHOVER_PROPERTY);
+
+ private Button projectSpecific;
+
+ private HashMap<String, String> mapItems = new HashMap<String, String>();
+
+ private Table table;
+ private CheckboxTableViewer tv;
+ private Button[] buttons;
+ private Composite buttoncomp; // space for buttons on the right
+
+ public static final String EMPTY_STR = ""; //$NON-NLS-1$
+ public static final String MOVEUP_STR = LibHoverMessages.getString("FileListControl.moveup"); //$NON-NLS-1$
+ public static final String MOVEDOWN_STR = LibHoverMessages.getString("FileListControl.movedown"); //$NON-NLS-1$
+
+ /**
+ * Constructor for LibhoverPropertyPage.
+ */
+ public LibHoverPropertyPage() {
+ super();
+ setPreferenceStore(LibhoverPlugin.getDefault().getPreferenceStore());
+ }
+
+ private IProject getProject() {
+ IResource r = (IResource)getElement().getAdapter(IResource.class);
+ return r.getProject();
+ }
+
+ private String getPropertyString() {
+ String p;
+ try {
+ p = getProject().getPersistentProperty(libhoverProperty);
+ } catch (CoreException c) {
+ p = null;
+ }
+ return p;
+ }
+
+ private void addFirstSection(Composite parent) {
+ Composite composite = createDefaultComposite(parent);
+
+ projectSpecific = new Button(composite, SWT.CHECK);
+ projectSpecific.setText(LibHoverMessages.getString(PROJECT_SPECIFIC_MSG));
+ String p = getPropertyString();
+ projectSpecific.setSelection(p != null);
+ projectSpecific.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ projectSpecificPressed(event);
+ }});
+ }
+
+ private void projectSpecificPressed(SelectionEvent event) {
+ if (projectSpecific.getSelection()) {
+ buttoncomp.setEnabled(true);
+ table.setEnabled(true);
+ updateCheckboxData(true);
+ } else {
+ buttoncomp.setEnabled(false);
+ table.setEnabled(false);
+ updateCheckboxData(false);
+ }
+ }
+
+ private void addSeparator(Composite parent) {
+ Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ separator.setLayoutData(gridData);
+ }
+
+ private void addLabel(Composite parent) {
+ Label label = new Label(parent, SWT.HORIZONTAL);
+ label.setText(LibHoverMessages.getString("LibhoverPreferences.title")); //$NON-NLS-1$
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ label.setLayoutData(gridData);
+ }
+
+ private Control getCheckboxControl(Composite parent) {
+ if (table == null) {
+// parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ table = new Table(parent, SWT.BORDER | SWT.CHECK | SWT.SINGLE);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalSpan = 2;
+ table.setLayoutData(gridData);
+ table.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateButtons();
+ }});
+ tv = new CheckboxTableViewer(table);
+ tv.setContentProvider(new IStructuredContentProvider() {
+ public Object[] getElements(Object inputElement) {
+ return (Object[])inputElement;
+ }
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ });
+
+ tv.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent e) {
+ }
+ });
+
+ }
+ return table;
+ }
+
+ private Control getButtonControl(Composite parent) {
+ if (buttoncomp == null) {
+ buttoncomp = new Composite(parent, SWT.NONE);
+ GridData d = new GridData(GridData.END);
+ d.widthHint = 1;
+ d.horizontalSpan = 1;
+ buttoncomp.setLayoutData(d);
+ buttoncomp.setFont(parent.getFont());
+ initButtons(buttoncomp, new String[] {
+ MOVEUP_STR, MOVEDOWN_STR, null,
+ UIMessages.getString("ErrorParsTab.0"), //$NON-NLS-1$
+ UIMessages.getString("ErrorParsTab.1") //$NON-NLS-1$
+ });
+ }
+ return buttoncomp;
+ }
+
+ private void addSecondSection(Composite parent) {
+ Composite composite = createDefaultComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ composite.setLayout(layout);
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ composite.setLayoutData(data);
+
+ getCheckboxControl(composite);
+ getButtonControl(composite);
+ }
+
+ /**
+ * @see PreferencePage#createContents(Composite)
+ */
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ composite.setLayout(layout);
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ composite.setLayoutData(data);
+
+ addFirstSection(composite);
+ addSeparator(composite);
+ addLabel(composite);
+ addSecondSection(composite);
+ String p = getPropertyString();
+ updateCheckboxData(p != null);
+ buttoncomp.setEnabled(p != null);
+ table.setEnabled(p != null);
+
+ return composite;
+ }
+
+ private Composite createDefaultComposite(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+
+ return composite;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ protected void performDefaults() {
+ updateCheckboxData(projectSpecific.getSelection());
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ public boolean performOk() {
+ try {
+ save();
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Ability to create standard button on any composite.
+ * @param c
+ * @param names
+ */
+ private void initButtons(Composite c, String[] names) {
+ initButtons(c, names, 80);
+ }
+
+ private void initButtons(Composite c, String[] names, int width) {
+ if (names == null || names.length == 0) return;
+ c.setLayoutData(new GridData(GridData.FILL_VERTICAL));
+ c.setLayout(new GridLayout(1, false));
+ buttons = new Button[names.length];
+ for (int i=0; i<names.length; i++) {
+ buttons[i] = new Button(c, SWT.PUSH);
+ buttons[i].setFont(c.getFont());
+ GridData gdb = new GridData(GridData.VERTICAL_ALIGN_CENTER);
+ gdb.grabExcessHorizontalSpace = false;
+ gdb.horizontalAlignment = SWT.FILL;
+ gdb.minimumWidth = width;
+
+ if (names[i] != null)
+ buttons[i].setText(names[i]);
+ else { // no button, but placeholder !
+ buttons[i].setVisible(false);
+ buttons[i].setEnabled(false);
+ gdb.heightHint = 10;
+ }
+
+ buttons[i].setLayoutData(gdb);
+ buttons[i].addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ buttonPressed(event);
+ }});
+ }
+ }
+
+ /**
+ *
+ * @param e - event to be handled
+ */
+ private void buttonPressed(SelectionEvent e) {
+ for (int i=0; i<buttons.length; i++) {
+ if (buttons[i].equals(e.widget)) {
+ buttonPressed(i);
+ return;
+ }
+ }
+ }
+
+ private void buttonPressed (int n) {
+ switch (n) {
+ case 0: // up
+ moveItem(true);
+ break;
+ case 1: // down
+ moveItem(false);
+ break;
+ case 2: // do nothing - it's not a button
+ break;
+
+ case 3: // check all
+ tv.setAllChecked(true);
+ break;
+ case 4: // uncheck all
+ tv.setAllChecked(false);
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Move item up / down
+ private void moveItem(boolean up) {
+ int n = table.getSelectionIndex();
+ if (n < 0 ||
+ (up && n == 0) ||
+ (!up && n+1 == table.getItemCount()))
+ return;
+ TableData d = (TableData)tv.getElementAt(n);
+ boolean checked = tv.getChecked(d);
+ tv.remove(d);
+ n = up ? n - 1 : n + 1;
+ tv.insert(d, n);
+ tv.setChecked(d, checked);
+ table.setSelection(n);
+ }
+ /**
+ * Changes state of existing button.
+ * Does nothing if index is invalid
+ *
+ * @param i - button index
+ * @param state - required state
+ */
+ private void buttonSetEnabled(int i, boolean state) {
+ if (buttons == null || buttons.length <= i ) return;
+ buttons[i].setEnabled(state);
+ }
+
+ private void updateButtons() {
+ int cnt = table.getItemCount();
+ int pos = table.getSelectionIndex();
+ buttonSetEnabled(0, pos > 0);
+ buttonSetEnabled(1, pos != -1 && pos < (cnt - 1));
+ buttonSetEnabled(3, cnt > 0);
+ buttonSetEnabled(4, cnt > 0);
+ }
+
+ private class TableData {
+ String key;
+ String value;
+ public TableData (String _key, String _value) {
+ key = _key;
+ value = _value;
+ }
+ @Override
+ public String toString() { return value; }
+ }
+
+ private void getExtensions() {
+ mapItems.clear();
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(
+ LibHover.LIBHOVER_DOC_EXTENSION);
+ if (point != null) {
+ IExtension[] exts = point.getExtensions();
+ for (IExtension ext : exts) {
+ if (ext.getConfigurationElements().length > 0) {
+ mapItems.put(ext.getUniqueIdentifier(), ext.getLabel());
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void updateCheckboxData(boolean useProject) {
+ // Combine user preference string with existing libhover extensions.
+ getExtensions();
+ HashMap<String,String> copyMap = (HashMap<String,String>)mapItems.clone();
+ ArrayList<TableData> data = new ArrayList<TableData>();
+ ArrayList<TableData> checkedData = new ArrayList<TableData>();
+ // See what the user has set in preferences/properties and make sure that
+ // any libhover referred to is a valid current extension.
+ // Drop any preference for a non-existent extension.
+ String prop = null;
+ String pref = null;
+ // User wants to use project settings. If they already exist, honor them.
+ if (useProject)
+ prop = getPropertyString();
+ // If no property settings exist or the user has not asked for project
+ // specific settings, then use the preferences as default.
+ if (prop == null)
+ pref = getPreferenceStore().getString(PreferenceConstants.P_LIBHOVER);
+ else // otherwise use the property settings
+ pref = prop;
+ // The property string has the same format as the preference string which is
+ // id1:boolean1:id2:boolean2:id3:boolean3 (where booleanx is checked or not)
+ String[] tokens = pref.split(":");
+ if (tokens.length > 1) {
+ for (int i = 0; i < tokens.length; i+=2) {
+ String id = tokens[i];
+ Boolean checked = Boolean.valueOf(tokens[i+1]);
+ String value = copyMap.get(id);
+ if (value != null) {
+ TableData d = new TableData(id, value);
+ data.add(d);
+ if (checked)
+ checkedData.add(d);
+ copyMap.remove(id);
+ }
+ }
+ }
+ // Add any remaining libhover extensions to end of list. If there is an
+ // existing property string, we treat them as unchecked. If we are
+ // defaulting to the preferences, then we treat them as checked.
+ String[] leftovers = new String[copyMap.size()];
+ leftovers = copyMap.keySet().toArray(leftovers);
+ for (int i = 0; i < leftovers.length; ++i) {
+ TableData d = new TableData(leftovers[i], copyMap.get(leftovers[i]));
+ data.add(d);
+ if (!useProject || prop == null)
+ checkedData.add(d);
+ }
+ tv.setInput(data.toArray());
+ tv.setCheckedElements(checkedData.toArray());
+ updateButtons();
+ }
+
+ private void save() throws CoreException {
+ // if we are not using project-specific property, then we
+ // set it to be null
+ if (!projectSpecific.getSelection())
+ getProject().setPersistentProperty(libhoverProperty, null);
+
+ // Otherwise form a string which has all of the libhovers in order
+ // with their boolean checked value. Use ":" to separate all entries
+ boolean inRange = true;
+ int i = 0;
+ String outString = new String();
+ String del = "";
+ while (inRange) {
+ TableData t;
+ Object obj = tv.getElementAt(i);
+ if (obj == null)
+ inRange = false;
+ else {
+ ++i;
+ t = (TableData)obj;
+ outString += del + t.key + ":" + tv.getChecked(obj);
+ del = ":";
+ }
+ }
+ // Save formatted string to project.
+ if (outString.length() > 1)
+ getProject().setPersistentProperty(libhoverProperty, outString);
+ }
+} \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/ChangeLog b/libhover/org.eclipse.linuxtools.cdt.libhover/ChangeLog
index 5892c90775..5dd3997ddd 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/ChangeLog
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/ChangeLog
@@ -1,3 +1,17 @@
+2010-03-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #306283
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java (getMemberSummary): Remove
+ code that looks in editor text for class name and then asks the AST. Just get the class name
+ from the member we already do the lookup for. Get the fully templated name using the new
+ getClassName method.
+ (getMatchingFunctions): Remove commented out code.
+ (getClassName): New method to get class name including template parameters.
+ (getFunctionInfo): Change to specify fully qualified name and not remove
+ namespace.
+ * src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java (getClassInfo): Check
+ info is not null before accessing.
+
2010-03-04 Jeff Johnston <jjohnstn@redhat.com>
* src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java (getMemberSummary): Change
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
index 5796463935..9585485768 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
@@ -30,17 +30,18 @@ import java.util.SortedMap;
import java.util.Map.Entry;
import org.eclipse.cdt.core.dom.ast.DOMException;
-import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTName;
-import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
-import org.eclipse.cdt.core.dom.ast.IASTNode;
-import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
-import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.ui.ICHelpBook;
@@ -256,11 +257,6 @@ public class LibHover implements ICHelpProvider {
IFunctionSummary f;
f = null;
- boolean isPTR = false;
- boolean isREF = false;
- int offset = -1;
- int length = 0;
-
ITranslationUnit t = context.getTranslationUnit();
String className = null;
@@ -271,128 +267,31 @@ public class LibHover implements ICHelpProvider {
if (context instanceof IHoverHelpInvocationContext) {
// We know the file offset of the member reference.
IRegion region = (IRegion)((IHoverHelpInvocationContext)context).getHoverRegion();
- char[] contents = t.getCodeReader().buffer;
- int i = region.getOffset();
- // Let's figure out if it is a pointer reference or a direct reference in which case we can
- // find the variable and hence it's class.
- if (i > 2 && contents[i-1] == '>' && contents[i-2] == '-') {
- // Pointer reference
- int j = i - 3;
- int pointer = 0;
- while (j > 0 && isCPPCharacter(contents[j])) {
- pointer = j;
- --j;
- }
- if (pointer != 0) {
- offset = pointer;
- length = region.getOffset() - pointer - 2;
- isPTR = true;
- // String pointerName = new String(contents, pointer, region.getOffset() - pointer - 2);
- // System.out.println("pointer reference to " + pointerName);
- }
- } else if (i > 1 && contents[i-1] == '.') {
- int j = i - 2;
- int ref = 0;
- while (j > 0 && isCPPCharacter(contents[j])) {
- ref = j;
- --j;
- }
- if (ref != 0) {
- offset = ref;
- length = region.getOffset() - ref - 1;
- isREF = true;
- // String refName = new String(contents, ref, region.getOffset() - ref - 1);
- // System.out.println("regular reference to " + refName);
- }
- }
- final IASTName[] result= {null};
- final int toffset = offset;
- final int tlength = length;
-
- // If we have a pointer or reference variable, get its ASTName.
- if (isPTR || isREF) {
- EnclosingASTNameJob job = new EnclosingASTNameJob(t, toffset, tlength);
- job.schedule();
- try {
- job.join();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- if (job.getResult() == Status.OK_STATUS)
- result[0] = job.getASTName();
- }
-
- // If we get the ASTName for the variable, let's find its declaration which will give us its class.
- final IASTName[][] decl = {null};
- if (result[0] != null) {
- final IBinding binding = result[0].resolveBinding();
- ASTDeclarationFinderJob job = new ASTDeclarationFinderJob(t, binding);
- job.schedule();
- try {
- job.join();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- if (job.getResult() == Status.OK_STATUS) {
- decl[0] = job.getDeclarations();
- }
- }
-
- // Look for a simple declaration.
- IASTNode n = null;
- if (decl[0] != null && decl[0].length > 0) {
- n = decl[0][0];
- while (n != null && !(n instanceof IASTSimpleDeclaration)) {
- n = n.getParent();
- }
- }
-
- // If we have the simple declaration, get its declaration specifier which hopefully will
- // be a named type.
- if (n != null) {
- IASTSimpleDeclaration d = (IASTSimpleDeclaration)n;
- IASTDeclSpecifier s = d.getDeclSpecifier();
- if (s instanceof IASTNamedTypeSpecifier) {
- // From the named type, we can get the binding of the type name and from that,
- // its qualified name. We need a qualified name (i.e. with namespace) because our
- // repository of classes and typedefs are hashed by fully qualified names.
- IASTName astName = ((IASTNamedTypeSpecifier)s).getName();
- if (astName != null) {
- IBinding nameBinding = astName.resolveBinding();
- if (nameBinding instanceof ICPPBinding) {
- String[] qualified = ((ICPPBinding)nameBinding).getQualifiedName();
- className = qualified[0];
- for (int k = 1; k < qualified.length; ++k)
- className += "::" + qualified[k];
- } else {
- className = nameBinding.getName();
- }
- }
- }
- }
-// System.out.println("classname is " + className);
// Now, let's find the declaration of the method. We need to do this because we want the specific
// member prototype to go searching for. There could be many members called "x" which have different
// documentation.
- if (className != null) {
- EnclosingASTNameJob job = new EnclosingASTNameJob(t, region.getOffset(), region.getLength());
- job.schedule();
- try {
- job.join();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- if (job.getResult() == Status.OK_STATUS)
- result[0] = job.getASTName();
- }
+ final IASTName[] result= {null};
+ EnclosingASTNameJob job = new EnclosingASTNameJob(t, region.getOffset(), region.getLength());
+ job.schedule();
+ try {
+ job.join();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (job.getResult() == Status.OK_STATUS)
+ result[0] = job.getASTName();
if (result[0] != null) {
final IBinding binding = result[0].getBinding();
+ // Check to see we have a member function.
if (binding instanceof ICPPFunction) {
methodType = ((ICPPFunction)binding).getType();
+ // We have a member function, find the class name.
+ IBinding owner = ((ICPPFunction)binding).getOwner();
+ if (owner instanceof ICPPClassType) {
+ className = getClassName((ICPPClassType)owner);
+ }
}
}
}
@@ -422,6 +321,56 @@ public class LibHover implements ICHelpProvider {
return null;
}
+
+ // Get the class name for a type, including any instance template parameters
+ // e.g. std::basic_string<char>
+ private String getClassName(ICPPClassType c) {
+ String className = null;
+ try {
+ String[] qualified = c.getQualifiedName();
+ className = qualified[0];
+ for (int k = 1; k < qualified.length; ++k) {
+ className += "::" + qualified[k];
+ }
+
+ // Check if we have an instance of a template class.
+ if (c instanceof ICPPTemplateInstance) {
+ ICPPTemplateInstance ti = (ICPPTemplateInstance)c;
+ // Get a map which tells us the values of the template
+ // arguments (e.g. _CharT maps to char in the instance).
+ ICPPTemplateParameterMap tiMap = ti.getTemplateParameterMap();
+ ICPPTemplateDefinition td = ti.getTemplateDefinition();
+ ICPPTemplateParameter[] templateArgs = td.getTemplateParameters();
+ className += "<";
+ String separator = "";
+ for (int x = 0; x < templateArgs.length; ++x) {
+ ICPPTemplateParameter tp = templateArgs[x];
+ ICPPTemplateArgument ta = tiMap.getArgument(tp);
+ IType type = null;
+ // The template may have a type specified or a value.
+ // In the case of a value, figure out its type and use
+ // that when we do a lookup.
+ if (ta.isTypeValue())
+ type = ta.getTypeValue();
+ else
+ type = ta.getTypeOfNonTypeValue();
+ if (tp.getTemplateNestingLevel() == 0) {
+ // if the parameter is a class type, use recursion to
+ // get its class name including template parameters
+ if (type instanceof ICPPClassType)
+ className += separator + getClassName((ICPPClassType)type);
+ else
+ className += separator + type.toString();
+ separator = ",";
+ }
+ }
+ className += ">";
+ }
+ } catch(DOMException e) {
+ return null;
+ }
+ return className;
+ }
private IFunctionSummary getFunctionSummary(LibHoverLibrary l, String name) {
FunctionInfo x = l.getFunctionInfo(name);
@@ -483,8 +432,8 @@ public class LibHover implements ICHelpProvider {
f.ReturnType = m.getReturnType();
f.Prototype = m.getPrototype();
f.Summary = m.getDescription();
- String actualClassName = className.substring(className.indexOf("::")+2); // $NON-NLS-1$
- f.Name = actualClassName + "::" + memberName; // $NON-NLS-1$
+// String actualClassName = className.substring(className.indexOf("::")+2); // $NON-NLS-1$
+ f.Name = className + "::" + memberName; // $NON-NLS-1$
String[] templateParms = info.getTemplateParms();
for (int i = 0; i < templateTypes.size(); ++i) {
f.ReturnType = f.ReturnType.replaceAll(templateParms[i], templateTypes.get(i));
@@ -569,28 +518,6 @@ public class LibHover implements ICHelpProvider {
fList.add(f);
}
}
-
-// Document document = l != null ? l.getDocument() : null;
-// if ((null != document) && (null != prefix)) {
-// NodeList elems = document.getElementsByTagName("construct"); // $NON-NLS-1$
-// for (int i = 0; i < elems.getLength(); ++i) {
-// Element elem = (Element)elems.item(i);
-// NamedNodeMap attrs = elem.getAttributes();
-// Node id_node = attrs.item(0);
-// String elemName = id_node.getNodeValue();
-// if (elemName != null && elemName.startsWith("function-")) { // $NON-NLS-1$
-// String funcName = elemName.substring(9);
-// if (funcName != null && funcName.startsWith(prefix)) {
-// NodeList functionNodes = elem.getElementsByTagName("function"); // $NON-NLS-1$
-// for (int j = 0; j < functionNodes.getLength(); ++j) {
-// Node function_node = functionNodes.item(j);
-// FunctionSummary f = getFunctionSummaryFromNode(funcName, function_node, document);
-// fList.add(f);
-// }
-// }
-// }
-// }
-// }
}
IFunctionSummary[] summaries = new IFunctionSummary[fList.size()];
for (int k = 0; k < summaries.length; k++) {
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
index 8019cf0b1f..d1310580e0 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
@@ -159,13 +159,15 @@ public class LibHoverLibrary {
// and we choose the first match. If nothing matches our particular
// case, we fall back on the initial generic template.
ClassInfo info = getHoverInfo().classes.get(className.substring(0, index));
- ArrayList<ClassInfo> children = info.getChildren();
- if (children != null && children.size() > 0) {
- for (int x = 0; x < children.size(); ++x) {
- ClassInfo child = children.get(x);
- if (className.matches(child.getClassName())) {
- info = child;
- break;
+ if (info != null) {
+ ArrayList<ClassInfo> children = info.getChildren();
+ if (children != null && children.size() > 0) {
+ for (int x = 0; x < children.size(); ++x) {
+ ClassInfo child = children.get(x);
+ if (className.matches(child.getClassName())) {
+ info = child;
+ break;
+ }
}
}
}

Back to the top