Skip to content

Commit

Permalink
Rename "alterl" to "erl".
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666481 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
David Reiss committed Jun 11, 2008
1 parent f2e66c1 commit 9f2a5d7
Show file tree
Hide file tree
Showing 46 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler/cpp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);

Expand Down Expand Up @@ -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) {
Expand All @@ -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" +
Expand All @@ -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);

Expand All @@ -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) {
}

/**
Expand All @@ -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;

Expand All @@ -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();
Expand All @@ -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()) {
Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}
Expand All @@ -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,
Expand Down Expand Up @@ -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);

Expand All @@ -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]);
Expand Down Expand Up @@ -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;

Expand All @@ -468,15 +468,15 @@ 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) {
}

/**
* Generates a service interface definition.
*
* @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);

Expand Down Expand Up @@ -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() + "'";
Expand Down Expand Up @@ -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) {
Expand All @@ -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() +
Expand All @@ -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 {
Expand All @@ -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(),
Expand All @@ -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 {
Expand All @@ -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(),
Expand All @@ -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();
Expand All @@ -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();

Expand All @@ -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()) {
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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";
}
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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]);
Expand Down
Loading

0 comments on commit 9f2a5d7

Please sign in to comment.