Merging in some Smalltalk changes from Patrick Collison

Reviewed By: mcslee

Test Plan: Rebuild Thrift compiler


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665361 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index cd727c1..5d7cfcc 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -60,6 +60,7 @@
 %token<id>     tok_identifier
 %token<id>     tok_literal
 %token<dtext>  tok_doctext
+%token<id>     tok_st_identifier
 
 /**
  * Constant values
@@ -85,6 +86,7 @@
 %token tok_xsd_namespace
 %token tok_xsd_attrs
 %token tok_ruby_namespace
+%token tok_smalltalk_category
 %token tok_cocoa_prefix
 
 /**
@@ -211,7 +213,7 @@
 CaptureDocText:
     {
       if (g_parse_mode == PROGRAM) {
-        $$ = g_doctext; 
+        $$ = g_doctext;
         g_doctext = NULL;
       } else {
         $$ = NULL;
@@ -293,6 +295,13 @@
         g_program->set_ruby_namespace($2);
       }
     }
+| tok_smalltalk_category tok_st_identifier
+    {
+      pdebug("Header -> tok_smalltalk_category tok_st_identifier");
+      if (g_parse_mode == PROGRAM) {
+        g_program->set_smalltalk_category($2);
+      }
+    }
 | tok_java_package tok_identifier
     {
       pdebug("Header -> tok_java_package tok_identifier");
@@ -346,7 +355,7 @@
       pdebug("Definition -> Const");
       if (g_parse_mode == PROGRAM) {
         g_program->add_const($1);
-      }    
+      }
       $$ = $1;
     }
 | TypeDefinition
@@ -411,7 +420,7 @@
     }
 
 Typedef:
-  tok_typedef DefinitionType tok_identifier 
+  tok_typedef DefinitionType tok_identifier
     {
       pdebug("TypeDef -> tok_typedef DefinitionType tok_identifier");
       t_typedef *td = new t_typedef(g_program, $2, $3);