Allow field elements to be optional in thrift with xsd_optional keyword

Reviewed By: tbr-dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664932 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc
index 2fbf913..48552e6 100644
--- a/compiler/cpp/src/main.cc
+++ b/compiler/cpp/src/main.cc
@@ -435,6 +435,7 @@
   g_program = program;
   g_scope = program->scope();
   try {
+    yylineno = 1;
     if (yyparse() != 0) {
       failure("Parser error during include pass.");
     }
@@ -462,6 +463,7 @@
     failure("Could not open input file: \"%s\"", path.c_str());
   }
   pverbose("Parsing %s for types\n", path.c_str());
+  yylineno = 1;
   if (yyparse() != 0) {
     failure("Parser error during types pass.");
   }