Rename "alterl" to "erl".
authorDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 01:15:45 +0000 (01:15 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 01:15:45 +0000 (01:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666481 13f79535-47bb-0310-9956-ffa450edef68

46 files changed:
.gitignore
compiler/cpp/Makefile.am
compiler/cpp/src/generate/t_erl_generator.cc [moved from compiler/cpp/src/generate/t_alterl_generator.cc with 90% similarity]
compiler/cpp/src/generate/t_erl_generator.h [moved from compiler/cpp/src/generate/t_alterl_generator.h with 95% similarity]
compiler/cpp/src/main.cc
lib/Makefile.am
lib/erl/COPYING [moved from lib/alterl/COPYING with 100% similarity]
lib/erl/LICENSE [moved from lib/alterl/LICENSE with 100% similarity]
lib/erl/Makefile [moved from lib/alterl/Makefile with 100% similarity]
lib/erl/README [moved from lib/alterl/README with 100% similarity]
lib/erl/build/beamver [moved from lib/alterl/build/beamver with 100% similarity]
lib/erl/build/buildtargets.mk [moved from lib/alterl/build/buildtargets.mk with 100% similarity]
lib/erl/build/colors.mk [moved from lib/alterl/build/colors.mk with 100% similarity]
lib/erl/build/docs.mk [moved from lib/alterl/build/docs.mk with 100% similarity]
lib/erl/build/mime.types [moved from lib/alterl/build/mime.types with 100% similarity]
lib/erl/build/otp.mk [moved from lib/alterl/build/otp.mk with 100% similarity]
lib/erl/build/otp_subdir.mk [moved from lib/alterl/build/otp_subdir.mk with 100% similarity]
lib/erl/build/raw_test.mk [moved from lib/alterl/build/raw_test.mk with 100% similarity]
lib/erl/include/thrift_constants.hrl [moved from lib/alterl/include/thrift_constants.hrl with 100% similarity]
lib/erl/include/thrift_protocol.hrl [moved from lib/alterl/include/thrift_protocol.hrl with 100% similarity]
lib/erl/src/Makefile [moved from lib/alterl/src/Makefile with 100% similarity]
lib/erl/src/test_handler.erl [moved from lib/alterl/src/test_handler.erl with 100% similarity]
lib/erl/src/test_service.erl [moved from lib/alterl/src/test_service.erl with 100% similarity]
lib/erl/src/thrift.app.src [moved from lib/alterl/src/thrift.app.src with 100% similarity]
lib/erl/src/thrift.appup.src [moved from lib/alterl/src/thrift.appup.src with 100% similarity]
lib/erl/src/thrift_base64_transport.erl [moved from lib/alterl/src/thrift_base64_transport.erl with 100% similarity]
lib/erl/src/thrift_binary_protocol.erl [moved from lib/alterl/src/thrift_binary_protocol.erl with 100% similarity]
lib/erl/src/thrift_buffered_transport.erl [moved from lib/alterl/src/thrift_buffered_transport.erl with 100% similarity]
lib/erl/src/thrift_client.erl [moved from lib/alterl/src/thrift_client.erl with 100% similarity]
lib/erl/src/thrift_disk_log_transport.erl [moved from lib/alterl/src/thrift_disk_log_transport.erl with 100% similarity]
lib/erl/src/thrift_file_transport.erl [moved from lib/alterl/src/thrift_file_transport.erl with 100% similarity]
lib/erl/src/thrift_framed_transport.erl [moved from lib/alterl/src/thrift_framed_transport.erl with 100% similarity]
lib/erl/src/thrift_http_transport.erl [moved from lib/alterl/src/thrift_http_transport.erl with 100% similarity]
lib/erl/src/thrift_processor.erl [moved from lib/alterl/src/thrift_processor.erl with 100% similarity]
lib/erl/src/thrift_protocol.erl [moved from lib/alterl/src/thrift_protocol.erl with 100% similarity]
lib/erl/src/thrift_server.erl [moved from lib/alterl/src/thrift_server.erl with 100% similarity]
lib/erl/src/thrift_service.erl [moved from lib/alterl/src/thrift_service.erl with 100% similarity]
lib/erl/src/thrift_socket_server.erl [moved from lib/alterl/src/thrift_socket_server.erl with 100% similarity]
lib/erl/src/thrift_socket_transport.erl [moved from lib/alterl/src/thrift_socket_transport.erl with 100% similarity]
lib/erl/src/thrift_transport.erl [moved from lib/alterl/src/thrift_transport.erl with 100% similarity]
lib/erl/vsn.mk [moved from lib/alterl/vsn.mk with 100% similarity]
test/erl/Makefile
tutorial/erl/client.erl [moved from tutorial/alterl/client.erl with 100% similarity]
tutorial/erl/client.sh [moved from tutorial/alterl/client.sh with 100% similarity]
tutorial/erl/server.erl [moved from tutorial/alterl/server.erl with 100% similarity]
tutorial/erl/server.sh [moved from tutorial/alterl/server.sh with 93% similarity]

index ae513f4..6b5f0e2 100644 (file)
@@ -21,7 +21,7 @@ if/Makefile.in
 install-sh
 lib/Makefile
 lib/Makefile.in
-lib/alterl/ebin
+lib/erl/ebin
 lib/cpp/.deps
 lib/cpp/.libs
 lib/cpp/Makefile
index 81aebd4..d7c7085 100644 (file)
@@ -11,7 +11,7 @@ thrift_SOURCES = src/thrifty.yy \
                  src/generate/t_generator.cc \
                  src/generate/t_php_generator.cc \
                  src/generate/t_xsd_generator.cc \
-                 src/generate/t_alterl_generator.cc \
+                 src/generate/t_erl_generator.cc \
                  src/globals.h \
                  src/main.h \
                  src/platform.h \
@@ -38,7 +38,7 @@ thrift_SOURCES = src/thrifty.yy \
                  src/generate/t_oop_generator.h \
                  src/generate/t_php_generator.h \
                  src/generate/t_xsd_generator.h \
-                 src/generate/t_alterl_generator.h
+                 src/generate/t_erl_generator.h
 
 if THRIFT_GEN_cpp
 thrift_SOURCES += src/generate/t_cpp_generator.cc
@@ -8,7 +8,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sstream>
-#include "t_alterl_generator.h"
+#include "t_erl_generator.h"
 
 using namespace std;
 
@@ -18,7 +18,7 @@ using namespace std;
  *
  * @param tprogram The program to generate
  */
-void t_alterl_generator::init_generator() {
+void t_erl_generator::init_generator() {
   // Make output directory
   mkdir(get_out_dir().c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
 
@@ -60,19 +60,19 @@ void t_alterl_generator::init_generator() {
 /**
  * Boilerplate at beginning and end of header files
  */
-void t_alterl_generator::hrl_header(ostream& out, string name) {
+void t_erl_generator::hrl_header(ostream& out, string name) {
   out << "-ifndef(_" << name << "_included)." << endl <<
     "-define(_" << name << "_included, yeah)." << endl;
 }
 
-void t_alterl_generator::hrl_footer(ostream& out, string name) {
+void t_erl_generator::hrl_footer(ostream& out, string name) {
   out << "-endif." << endl;
 }
 
 /**
  * Renders all the imports necessary for including another Thrift program
  */
-string t_alterl_generator::render_includes() {
+string t_erl_generator::render_includes() {
   const vector<t_program*>& includes = program_->get_includes();
   string result = "";
   for (size_t i = 0; i < includes.size(); ++i) {
@@ -87,7 +87,7 @@ string t_alterl_generator::render_includes() {
 /**
  * Autogen'd comment
  */
-string t_alterl_generator::erl_autogen_comment() {
+string t_erl_generator::erl_autogen_comment() {
   return
     std::string("%%\n") +
     "%% Autogenerated by Thrift\n" +
@@ -99,14 +99,14 @@ string t_alterl_generator::erl_autogen_comment() {
 /**
  * Prints standard thrift imports
  */
-string t_alterl_generator::erl_imports() {
+string t_erl_generator::erl_imports() {
   return "";
 }
 
 /**
  * Closes the type files
  */
-void t_alterl_generator::close_generator() {
+void t_erl_generator::close_generator() {
   // Close types file
   export_types_string("struct_info", 1);
 
@@ -126,7 +126,7 @@ void t_alterl_generator::close_generator() {
  *
  * @param ttypedef The type definition
  */
-void t_alterl_generator::generate_typedef(t_typedef* ttypedef) {
+void t_erl_generator::generate_typedef(t_typedef* ttypedef) {
 }
 
 /**
@@ -135,7 +135,7 @@ void t_alterl_generator::generate_typedef(t_typedef* ttypedef) {
  *
  * @param tenum The enumeration
  */
-void t_alterl_generator::generate_enum(t_enum* tenum) {
+void t_erl_generator::generate_enum(t_enum* tenum) {
   vector<t_enum_value*> constants = tenum->get_constants();
   vector<t_enum_value*>::iterator c_iter;
 
@@ -160,7 +160,7 @@ void t_alterl_generator::generate_enum(t_enum* tenum) {
 /**
  * Generate a constant value
  */
-void t_alterl_generator::generate_const(t_const* tconst) {
+void t_erl_generator::generate_const(t_const* tconst) {
   t_type* type = tconst->get_type();
   string name = capitalize(tconst->get_name());
   t_const_value* value = tconst->get_value();
@@ -173,7 +173,7 @@ void t_alterl_generator::generate_const(t_const* tconst) {
  * is NOT performed in this function as it is always run beforehand using the
  * validate_types method in main.cc
  */
-string t_alterl_generator::render_const_value(t_type* type, t_const_value* value) {
+string t_erl_generator::render_const_value(t_type* type, t_const_value* value) {
   std::ostringstream out;
 
   if (type->is_base_type()) {
@@ -297,7 +297,7 @@ string t_alterl_generator::render_const_value(t_type* type, t_const_value* value
 /**
  * Generates a struct
  */
-void t_alterl_generator::generate_struct(t_struct* tstruct) {
+void t_erl_generator::generate_struct(t_struct* tstruct) {
   generate_erl_struct(tstruct, false);
 }
 
@@ -307,14 +307,14 @@ void t_alterl_generator::generate_struct(t_struct* tstruct) {
  *
  * @param txception The struct definition
  */
-void t_alterl_generator::generate_xception(t_struct* txception) {
+void t_erl_generator::generate_xception(t_struct* txception) {
   generate_erl_struct(txception, true);
 }
 
 /**
  * Generates a struct
  */
-void t_alterl_generator::generate_erl_struct(t_struct* tstruct,
+void t_erl_generator::generate_erl_struct(t_struct* tstruct,
                                           bool is_exception) {
   generate_erl_struct_definition(f_types_, f_types_hrl_file_, tstruct, is_exception);
 }
@@ -324,7 +324,7 @@ void t_alterl_generator::generate_erl_struct(t_struct* tstruct,
  *
  * @param tstruct The struct definition
  */
-void t_alterl_generator::generate_erl_struct_definition(ostream& out,
+void t_erl_generator::generate_erl_struct_definition(ostream& out,
                                                      ostream& hrl_out,
                                                      t_struct* tstruct,
                                                      bool is_exception,
@@ -372,7 +372,7 @@ void t_alterl_generator::generate_erl_struct_definition(ostream& out,
 /**
  * Generates the read method for a struct
  */
-void t_alterl_generator::generate_erl_struct_info(ostream& out,
+void t_erl_generator::generate_erl_struct_info(ostream& out,
                                                   t_struct* tstruct) {
   string name = type_name(tstruct);
 
@@ -391,7 +391,7 @@ void t_alterl_generator::generate_erl_struct_info(ostream& out,
  *
  * @param tservice The service definition
  */
-void t_alterl_generator::generate_service(t_service* tservice) {
+void t_erl_generator::generate_service(t_service* tservice) {
   // somehow this point is reached before the constructor and it's not downcased yet
   // ...awesome
   service_name_[0] = tolower(service_name_[0]);
@@ -448,7 +448,7 @@ void t_alterl_generator::generate_service(t_service* tservice) {
  *
  * @param tservice The service to generate a header definition for
  */
-void t_alterl_generator::generate_service_helpers(t_service* tservice) {
+void t_erl_generator::generate_service_helpers(t_service* tservice) {
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::iterator f_iter;
 
@@ -468,7 +468,7 @@ void t_alterl_generator::generate_service_helpers(t_service* tservice) {
  *
  * @param tfunction The function
  */
-void t_alterl_generator::generate_erl_function_helpers(t_function* tfunction) {
+void t_erl_generator::generate_erl_function_helpers(t_function* tfunction) {
 }
 
 /**
@@ -476,7 +476,7 @@ void t_alterl_generator::generate_erl_function_helpers(t_function* tfunction) {
  *
  * @param tservice The service to generate a header definition for
  */
-void t_alterl_generator::generate_service_interface(t_service* tservice) {
+void t_erl_generator::generate_service_interface(t_service* tservice) {
 
   export_string("function_info", 2);
 
@@ -510,7 +510,7 @@ void t_alterl_generator::generate_service_interface(t_service* tservice) {
  * Generates a function_info(FunctionName, params_type) and
  * function_info(FunctionName, reply_type)
  */
-void t_alterl_generator::generate_function_info(t_service* tservice,
+void t_erl_generator::generate_function_info(t_service* tservice,
                                                 t_function* tfunction) {
 
   string name_atom = "'" + tfunction->get_name() + "'";
@@ -556,7 +556,7 @@ void t_alterl_generator::generate_function_info(t_service* tservice,
  *
  * @param ttype The type
  */
-string t_alterl_generator::declare_field(t_field* tfield) {  // TODO
+string t_erl_generator::declare_field(t_field* tfield) {  // TODO
   string result = "@" + tfield->get_name();
   t_type* type = get_true_type(tfield->get_type());
   if (tfield->get_value() != NULL) {
@@ -573,7 +573,7 @@ string t_alterl_generator::declare_field(t_field* tfield) {  // TODO
  * @param tfunction Function definition
  * @return String of rendered function definition
  */
-string t_alterl_generator::function_signature(t_function* tfunction,
+string t_erl_generator::function_signature(t_function* tfunction,
                                            string prefix) {
   return
     prefix + tfunction->get_name() +
@@ -583,7 +583,7 @@ string t_alterl_generator::function_signature(t_function* tfunction,
 /**
  * Add a function to the exports list
  */
-void t_alterl_generator::export_string(string name, int num) {
+void t_erl_generator::export_string(string name, int num) {
   if (export_lines_first_) {
     export_lines_first_ = false;
   } else {
@@ -592,7 +592,7 @@ void t_alterl_generator::export_string(string name, int num) {
   export_lines_ << name << "/" << num;
 }
 
-void t_alterl_generator::export_types_function(t_function* tfunction,
+void t_erl_generator::export_types_function(t_function* tfunction,
                                                string prefix) {
 
   export_types_string(prefix + tfunction->get_name(),
@@ -601,7 +601,7 @@ void t_alterl_generator::export_types_function(t_function* tfunction,
                       );
 }
 
-void t_alterl_generator::export_types_string(string name, int num) {
+void t_erl_generator::export_types_string(string name, int num) {
   if (export_types_lines_first_) {
     export_types_lines_first_ = false;
   } else {
@@ -610,7 +610,7 @@ void t_alterl_generator::export_types_string(string name, int num) {
   export_types_lines_ << name << "/" << num;
 }
 
-void t_alterl_generator::export_function(t_function* tfunction,
+void t_erl_generator::export_function(t_function* tfunction,
                                       string prefix) {
 
   export_string(prefix + tfunction->get_name(),
@@ -623,7 +623,7 @@ void t_alterl_generator::export_function(t_function* tfunction,
 /**
  * Renders a field list
  */
-string t_alterl_generator::argument_list(t_struct* tstruct) {
+string t_erl_generator::argument_list(t_struct* tstruct) {
   string result = "";
 
   const vector<t_field*>& fields = tstruct->get_members();
@@ -641,7 +641,7 @@ string t_alterl_generator::argument_list(t_struct* tstruct) {
   return result;
 }
 
-string t_alterl_generator::type_name(t_type* ttype) {
+string t_erl_generator::type_name(t_type* ttype) {
   string prefix = "";
   string name = ttype->get_name();
 
@@ -655,7 +655,7 @@ string t_alterl_generator::type_name(t_type* ttype) {
 /**
  * Converts the parse type to a Erlang "type" (macro for int constants)
  */
-string t_alterl_generator::type_to_enum(t_type* type) {
+string t_erl_generator::type_to_enum(t_type* type) {
   type = get_true_type(type);
 
   if (type->is_base_type()) {
@@ -697,7 +697,7 @@ string t_alterl_generator::type_to_enum(t_type* type) {
 /**
  * Generate an Erlang term which represents a thrift type
  */
-std::string t_alterl_generator::generate_type_term(t_type* type,
+std::string t_erl_generator::generate_type_term(t_type* type,
                                                    bool expand_structs) {
     type = get_true_type(type);
 
@@ -773,6 +773,6 @@ std::string t_alterl_generator::generate_type_term(t_type* type,
   throw "INVALID TYPE IN type_to_enum: " + type->get_name();
 }
 
-std::string t_alterl_generator::type_module(t_type* ttype) {
+std::string t_erl_generator::type_module(t_type* ttype) {
   return uncapitalize(ttype->get_program()->get_name()) + "_types";
 }
similarity index 95%
rename from compiler/cpp/src/generate/t_alterl_generator.h
rename to compiler/cpp/src/generate/t_erl_generator.h
index 6e7e12e..79ac375 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef T_ALTERL_GENERATOR_H
-#define T_ALTERL_GENERATOR_H
+#ifndef T_ERL_GENERATOR_H
+#define T_ERL_GENERATOR_H
 
 #include <string>
 #include <fstream>
@@ -13,9 +13,9 @@
  *
  * @author
  */
-class t_alterl_generator : public t_generator {
+class t_erl_generator : public t_generator {
  public:
-  t_alterl_generator(t_program* program) :
+  t_erl_generator(t_program* program) :
     t_generator(program)
   {
     program_name_[0] = tolower(program_name_[0]);
index 7fcab63..f2f3a9b 100644 (file)
@@ -38,7 +38,7 @@
 #include "parse/t_scope.h"
 #include "generate/t_php_generator.h"
 #include "generate/t_xsd_generator.h"
-#include "generate/t_alterl_generator.h"
+#include "generate/t_erl_generator.h"
 
 using namespace std;
 
@@ -151,7 +151,7 @@ bool gen_phpa = false;
 bool gen_phpo = false;
 bool gen_rest = false;
 bool gen_perl = false;
-bool gen_alterl = false;
+bool gen_erl = false;
 bool gen_ocaml = false;
 bool gen_hs = false;
 bool gen_cocoa = false;
@@ -601,7 +601,7 @@ void usage() {
   fprintf(stderr, "  -phpa       Generate PHP with autoload (with -php)\n");
   fprintf(stderr, "  -phpo       Generate PHP with object oriented subclasses (with -php)\n");
   fprintf(stderr, "  -xsd        Generate XSD output files\n");
-  fprintf(stderr, "  -alterl     Generate Alternative Erlang output files\n");
+  fprintf(stderr, "  -erl        Generate Erlang output files\n");
   fprintf(stderr, "  -o dir      Set the output directory for gen-* packages\n");
   fprintf(stderr, "               (default: current directory)\n");
   fprintf(stderr, "  -I dir      Add a directory to the list of directories\n");
@@ -871,11 +871,11 @@ void generate(t_program* program, const vector<string>& generator_strings) {
       delete xsd;
     }
 
-    if (gen_alterl) {
-      pverbose("Generating Alternative Erlang\n");
-      t_alterl_generator* alterl = new t_alterl_generator(program);
-      alterl->generate_program();
-      delete alterl;
+    if (gen_erl) {
+      pverbose("Generating Erlang\n");
+      t_erl_generator* erl = new t_erl_generator(program);
+      erl->generate_program();
+      delete erl;
     }
 
     if (dump_docs) {
@@ -992,8 +992,8 @@ int main(int argc, char** argv) {
         gen_xsd = true;
       } else if (strcmp(arg, "-perl") == 0) {
         gen_perl = true;
-      } else if (strcmp(arg, "-alterl") == 0) {
-        gen_alterl = true;
+      } else if (strcmp(arg, "-erl") == 0) {
+        gen_erl = true;
       } else if (strcmp(arg, "-ocaml") == 0) {
         gen_ocaml = true;
       } else if (strcmp(arg, "-hs") == 0) {
@@ -1105,7 +1105,7 @@ int main(int argc, char** argv) {
   }
 
   // You gotta generate something!
-  if (!gen_php && !gen_phpi && !gen_xsd && !gen_alterl && generator_strings.empty()) {
+  if (!gen_php && !gen_phpi && !gen_xsd && !gen_erl && generator_strings.empty()) {
     fprintf(stderr, "!!! No output language(s) specified\n\n");
     usage();
   }
index 8cbb80f..58ef555 100644 (file)
@@ -11,7 +11,7 @@ SUBDIRS += java
 endif
 
 if ENABLE_ERLANG
-SUBDIRS += alterl
+SUBDIRS += erl
 endif
 
 EXTRA_DIST = \
similarity index 100%
rename from lib/alterl/COPYING
rename to lib/erl/COPYING
similarity index 100%
rename from lib/alterl/LICENSE
rename to lib/erl/LICENSE
similarity index 100%
rename from lib/alterl/Makefile
rename to lib/erl/Makefile
similarity index 100%
rename from lib/alterl/README
rename to lib/erl/README
similarity index 100%
rename from lib/alterl/build/otp.mk
rename to lib/erl/build/otp.mk
similarity index 100%
rename from lib/alterl/src/Makefile
rename to lib/erl/src/Makefile
similarity index 100%
rename from lib/alterl/vsn.mk
rename to lib/erl/vsn.mk
index 890c809..8dc756a 100644 (file)
@@ -7,7 +7,7 @@ INCLUDEDIR=include
 TARGETDIR=ebin
 SRCDIR=src
 
-ALL_INCLUDEDIR=$(GEN_INCLUDEDIR) $(INCLUDEDIR) ../../lib/alterl/include
+ALL_INCLUDEDIR=$(GEN_INCLUDEDIR) $(INCLUDEDIR) ../../lib/erl/include
 INCLUDEFLAGS=$(patsubst %,-I%, ${ALL_INCLUDEDIR})
 
 MODULES = stress_server test_server test_disklog
@@ -24,8 +24,8 @@ THRIFT = ../../compiler/cpp/thrift
 
 ${GENDIR}/: ${RPCFILE}
        rm -rf ${GENDIR}
-       ${THRIFT} -alterl ${TEST_RPCFILE}
-       ${THRIFT} -alterl ${STRESS_RPCFILE}
+       ${THRIFT} -erl ${TEST_RPCFILE}
+       ${THRIFT} -erl ${STRESS_RPCFILE}
        mkdir -p ${GEN_INCLUDEDIR}
        mkdir -p ${GEN_SRCDIR}
        mkdir -p ${GEN_TARGETDIR}
similarity index 93%
rename from tutorial/alterl/server.sh
rename to tutorial/erl/server.sh
index a2d0d99..f101e7a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-ERL_THRIFT=../../lib/alterl
+ERL_THRIFT=../../lib/erl
 
 if ! [ -d ${ERL_THRIFT}/ebin ]; then
     echo "Please build the Thrift library by running \`make' in ${ERL_THRIFT}"