Add xsd_all keyword to Thrift

Summary: Makes a struct an xsd_all instead of a sequence

Reviewed By: dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664929 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrift.y b/compiler/cpp/src/thrift.y
index 8dbe621..cfb3e44 100644
--- a/compiler/cpp/src/thrift.y
+++ b/compiler/cpp/src/thrift.y
@@ -66,6 +66,7 @@
 %token tok_cpp_type
 %token tok_php_namespace
 %token tok_java_package
+%token tok_xsd_all
 
 /**
  * Base datatype keywords
@@ -144,6 +145,7 @@
 %type<tstruct>   ThrowsOptional
 %type<tservice>  ExtendsOptional
 %type<tbool>     AsyncOptional
+%type<tbool>     XsdAllOptional
 %type<id>        CppTypeOptional
 
 %%
@@ -440,14 +442,25 @@
     }
 
 Struct:
-  tok_struct tok_identifier '{' FieldList '}'
+  tok_struct tok_identifier XsdAllOptional '{' FieldList '}'
     {
       pdebug("Struct -> tok_struct tok_identifier { FieldList }");
-      $4->set_name($2);
-      $$ = $4;
+      $5->set_name($2);
+      $5->set_xsd_all($3);
+      $$ = $5;
       y_field_val = -1;
     }
 
+XsdAllOptional:
+  tok_xsd_all
+    {
+      $$ = true;
+    }
+|
+    {
+      $$ = false;
+    }
+
 Xception:
   tok_xception tok_identifier '{' FieldList '}'
     {