From 2d94635fbe3d405969ad6d3721da8a14785b41e5 Mon Sep 17 00:00:00 2001
From: Alberto Massari <amassari@apache.org>
Date: Wed, 22 Mar 2006 13:23:44 +0000
Subject: [PATCH] Retrieve base class and static methods; added missing final
 </div>; closing brace for enum values was not indented properly

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@387852 13f79535-47bb-0310-9956-ffa450edef68
---
 scripts/createBindingsFormatFromHPP.pl | 44 +++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 5 deletions(-)

diff --git a/scripts/createBindingsFormatFromHPP.pl b/scripts/createBindingsFormatFromHPP.pl
index a583f5997..814042068 100755
--- a/scripts/createBindingsFormatFromHPP.pl
+++ b/scripts/createBindingsFormatFromHPP.pl
@@ -19,8 +19,14 @@ my $filename = $ARGV[0];
 open(IN,"< $filename") || die("Couldn't open input file: $filename");
 
 while (<IN>) {
-  if ($_=~/^\s*class\s+[A-Z0-9_]+_EXPORT\s+([^\s]+)/) {
+  if ($_=~/^\s*class\s+[A-Z0-9_]+_EXPORT\s+([^\s]+)\s*[:]\s*public\s([^\s]+)/) {
     $classname = $1;
+    $baseclass = $2;
+    last;
+  }
+  elsif ($_=~/^\s*class\s+[A-Z0-9_]+_EXPORT\s+([^\s]+)/) {
+    $classname = $1;
+    $baseclass = "";
     last;
   }
 }
@@ -32,9 +38,17 @@ print OUT <<"END1";
 <font color="#000000">$filename:</font></h3>
 
 <div id="$classname"><font face="Courier New,Courier"><font size=-1>class
-$classname</font></font>
-<table>
+$classname
 END1
+if ($baseclass ne "") { 
+print OUT <<"END2";
+: public $baseclass
+END2
+}
+print OUT <<"END3";
+</font></font>
+<table>
+END3
 
 while (<IN>) {
   if ($_=~/^\s*public\s*:/) {
@@ -83,6 +97,25 @@ while (<IN>) {
 
 <td><font face="Courier New,Courier"><font size=-1>$b</font></font></td>
 
+<td><font face="Courier New,Courier"><font size=-1>$c</font></font></td>
+</tr>
+END
+  } elsif ($_=~/^\s*(static)\s+([^\s\(][^\(]*[^\s\(])\s+([^\s\(]+\(.*)/) {
+    $a=$1;
+    $b=$2;
+    $c=$3;
+    while ($c!~/\)/) {
+      $c.=<IN>;
+    }
+    print OUT <<"END";
+
+<tr ALIGN=LEFT VALIGN=TOP>
+<td></td>
+
+<td><font face="Courier New,Courier"><font size=-1>$a</font></font></td>
+
+<td><font face="Courier New,Courier"><font size=-1>$b</font></font></td>
+
 <td><font face="Courier New,Courier"><font size=-1>$c</font></font></td>
 </tr>
 END
@@ -117,10 +150,10 @@ END3
       if ($_=~/}\s*;/) {
         print OUT <<"END4";
 <tr ALIGN=LEFT VALIGN=TOP>
-<td><font face="Courier New,Courier"><font size=-1>};</font></font></td>
-
 <td></td>
 
+<td><font face="Courier New,Courier"><font size=-1>};</font></font></td>
+
 <td></td>
 
 <td></td>
@@ -148,6 +181,7 @@ print OUT <<"END6";
 <td></td>
 </tr>
 </table>
+</div>
 END6
 
 close(OUT);
-- 
GitLab