Modified cpp code generation to build read/write methods for each non-primitive type rather than inlining all serialization in client/server function handlers

Modified parser to assign negative numbers to autogenerated struct fields and function args.
			       


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664745 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/src/thrift.py b/compiler/src/thrift.py
new file mode 100644
index 0000000..8321bcd
--- /dev/null
+++ b/compiler/src/thrift.py
@@ -0,0 +1,28 @@
+import sys
+import generator
+import cpp_generator
+import parser
+
+if __name__ == '__main__':
+
+    args = sys.argv[1:]
+
+    generators = []
+
+    debug = False
+
+    if "--cpp" in args:
+	generators.append(cpp_generator.CPPGenerator())
+	args.remove("--cpp")
+    if "--debug" in args:
+	debug = True
+	args.remove("--debug")
+
+    filename = args[-1]
+
+    p = parser.Parser(debug=debug)
+
+    p.parse(filename, False)
+
+    [g(p.program, filename) for g in generators]
+