diff --exclude=.svn -ru /home/olly/svn/snowball/snowball/compiler/driver.c compiler/driver.c
--- /home/olly/svn/snowball/snowball/compiler/driver.c	2007-02-12 16:32:29.000000000 +0000
+++ compiler/driver.c	2007-02-13 14:23:14.000000000 +0000
@@ -17,6 +17,7 @@
 #ifndef DISABLE_JAVA
                     "             [-j[ava]]\n"
 #endif
+		    "             [-c++]\n"
                     "             [-w[idechars]]\n"
                     "             [-u[tf8]]\n"
                     "             [-n[ame] class name]\n"
@@ -24,6 +25,7 @@
                     "             [-vp[refix] string]\n"
                     "             [-i[nclude] directory]\n"
                     "             [-r[untime] path to runtime headers]\n"
+		    "             [-p[arentclassname] parent class name]\n"
            );
     exit(1);
 }
@@ -57,6 +59,7 @@
     o->externals_prefix = "";
     o->variables_prefix = 0;
     o->runtime_path = 0;
+    o->parent_class_name = 0;
     o->name = "";
     o->make_lang = LANG_C;
     o->widechars = false;
@@ -86,6 +89,10 @@
                 continue;
             }
 #endif
+            if (eq(s, "-c++")) {
+                o->make_lang = LANG_CPLUSPLUS;
+                continue;
+            }
             if (eq(s, "-w") || eq(s, "-widechars")) {
                 o->widechars = true;
                 continue;
@@ -128,6 +135,11 @@
                 o->utf8 = true;
                 continue;
             }
+            if (eq(s, "-p") || eq(s, "-parentclassname")) {
+                check_lim(i, argc);
+                o->parent_class_name = argv[i++];
+                continue;
+            }
             fprintf(stderr, "'%s' misplaced\n", s);
             print_arglist();
         }
@@ -165,12 +177,15 @@
                     print_arglist();
                     exit(1);
                 }
-                if (o->make_lang == LANG_C) {
+                if (o->make_lang == LANG_C || o->make_lang == LANG_CPLUSPLUS) {
                     symbol * b = add_s_to_b(0, s);
-                    b = add_s_to_b(b, ".c");
-                    o->output_c = get_output(b);
-                    b[SIZE(b) - 1] = 'h';
-                    o->output_h = get_output(b);
+		    b = add_s_to_b(b, ".h");
+		    o->output_h = get_output(b);
+		    b[SIZE(b) - 1] = 'c';
+		    if (o->make_lang == LANG_CPLUSPLUS) {
+			b = add_s_to_b(b, "c");
+		    }
+		    o->output_c = get_output(b);
                     lose_b(b);
 
                     g = create_generator_c(a, o);
diff --exclude=.svn -ru /home/olly/svn/snowball/snowball/compiler/header.h compiler/header.h
--- /home/olly/svn/snowball/snowball/compiler/header.h	2007-02-12 16:25:12.000000000 +0000
+++ compiler/header.h	2007-02-13 14:15:57.000000000 +0000
@@ -287,10 +287,11 @@
     FILE * output_java;
     byte syntax_tree;
     byte widechars;
-    enum { LANG_JAVA, LANG_C } make_lang;
+    enum { LANG_JAVA, LANG_C, LANG_CPLUSPLUS } make_lang;
     char * externals_prefix;
     char * variables_prefix;
     char * runtime_path;
+    char * parent_class_name;
     struct include * includes;
     struct include * includes_end;
     byte utf8;

