45 #include <sys/types.h>
87 t_type* g_type_static_const_string;
88 t_type* g_type_sandesh_system;
89 t_type* g_type_sandesh_request;
90 t_type* g_type_sandesh_response;
91 t_type* g_type_sandesh_trace;
92 t_type* g_type_sandesh_trace_object;
93 t_type* g_type_sandesh_buffer;
94 t_type* g_type_sandesh_uve;
95 t_type* g_type_sandesh_dynamic_uve;
96 t_type* g_type_sandesh_alarm;
97 t_type* g_type_sandesh_object;
98 t_type* g_type_sandesh_flow;
99 t_type* g_type_sandesh_session;
231 return realpath(path, resolved_path);
246 "[ERROR:%s:%d] (last token was '%s')\n",
252 vfprintf(stderr, fmt, args);
255 fprintf(stderr,
"\n");
316 vfprintf(stderr, fmt, args);
326 string::size_type slash = filename.rfind(
"/");
327 if (slash != string::npos) {
328 filename = filename.substr(slash+1);
330 string::size_type dot = filename.rfind(
".");
331 if (dot != string::npos) {
332 filename = filename.substr(0, dot);
341 string::size_type slash = filename.rfind(
"/");
343 if (slash == string::npos) {
346 return filename.substr(0, slash);
354 if (filename[0] ==
'/') {
358 pwarning(0,
"Cannot open include file %s\n", filename.c_str());
359 return std::string();
364 if (stat(rp, &finfo) == 0) {
373 vector<string>::iterator it;
374 for (it = sp.begin(); it != sp.end(); it++) {
375 string sfilename = *(it) +
"/" + filename;
385 if (stat(rp, &finfo) == 0) {
392 pwarning(0,
"Could not find include file %s\n", filename.c_str());
393 return std::string();
418 pdebug(
"%s",
"program doctext set to INVALID");
427 pdebug(
"%s",
"program doctext set to ABSOLUTELY_SURE");
430 pdebug(
"%s",
"program doctext set to NO_PROGRAM_DOCTEXT");
442 string docstring = doctext;
444 remove(docstring.begin(), docstring.end(),
'\r'),
448 vector<string> lines;
449 string::size_type pos = string::npos;
450 string::size_type last;
452 last = (pos == string::npos) ? 0 : pos+1;
453 pos = docstring.find(
'\n', last);
454 if (pos == string::npos) {
456 string::size_type nonwhite = docstring.find_first_not_of(
" \t", last);
457 if (nonwhite != string::npos) {
458 lines.push_back(docstring.substr(last));
462 lines.push_back(docstring.substr(last, pos-last));
471 pos = lines.front().find_first_not_of(
" \t");
472 lines.front().erase(0, pos);
476 bool have_prefix =
true;
477 bool found_prefix =
false;
478 string::size_type prefix_len = 0;
479 vector<string>::iterator l_iter;
480 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
481 if (l_iter->empty()) {
485 pos = l_iter->find_first_not_of(
" \t");
487 if (pos != string::npos) {
488 if (l_iter->at(pos) ==
'*') {
499 }
else if (l_iter->size() > pos
500 && l_iter->at(pos) ==
'*'
501 && pos == prefix_len) {
503 }
else if (pos == string::npos) {
517 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
518 l_iter->erase(0, prefix_len);
523 prefix_len = string::npos;
524 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
525 if (l_iter->empty()) {
528 pos = l_iter->find_first_not_of(
" \t");
529 if (pos != string::npos
530 && (prefix_len == string::npos || pos < prefix_len)) {
536 if (prefix_len != string::npos) {
537 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
538 l_iter->erase(0, prefix_len);
543 for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
544 pos = l_iter->find_last_not_of(
" \t");
545 if (pos != string::npos && pos != l_iter->length()-1) {
546 l_iter->erase(pos+1);
552 if (lines.front().empty()) {
553 lines.erase(lines.begin());
558 for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
559 docstring += *l_iter;
563 assert(docstring.length() <= strlen(doctext));
564 strcpy(doctext, docstring.c_str());
578 string progdoc = program->
get_doc();
579 if (!progdoc.empty()) {
580 printf(
"Whole program doc:\n%s\n", progdoc.c_str());
582 const vector<t_typedef*>& typedefs = program->
get_typedefs();
583 vector<t_typedef*>::const_iterator t_iter;
584 for (t_iter = typedefs.begin(); t_iter != typedefs.end(); ++t_iter) {
587 printf(
"typedef %s:\n%s\n", td->
get_name().c_str(), td->
get_doc().c_str());
590 const vector<t_enum*>& enums = program->
get_enums();
591 vector<t_enum*>::const_iterator e_iter;
592 for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) {
595 printf(
"enum %s:\n%s\n", en->
get_name().c_str(), en->
get_doc().c_str());
598 const vector<t_const*>& consts = program->
get_consts();
599 vector<t_const*>::const_iterator c_iter;
600 for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
603 printf(
"const %s:\n%s\n", co->
get_name().c_str(), co->
get_doc().c_str());
606 const vector<t_struct*>& structs = program->
get_structs();
607 vector<t_struct*>::const_iterator s_iter;
608 for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) {
611 printf(
"struct %s:\n%s\n", st->
get_name().c_str(), st->
get_doc().c_str());
613 const vector<t_field*>& fields = st->
get_members();
614 vector<t_field*>::const_iterator f_iter;
615 for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
618 printf(
"fields %s:\n%s\n",
623 const vector<t_struct*>& xceptions = program->
get_xceptions();
624 vector<t_struct*>::const_iterator x_iter;
625 for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
628 printf(
"xception %s:\n%s\n", xn->
get_name().c_str(), xn->
get_doc().c_str());
632 const vector<t_sandesh*>& sandeshs = program->get_sandeshs();
633 vector<t_sandesh*>::const_iterator sn_iter;
634 for (sn_iter = sandeshs.begin(); sn_iter != sandeshs.end(); ++sn_iter) {
637 printf(
"sandesh %s:\n%s\n", sn->
get_name().c_str(), sn->
get_doc().c_str());
639 const vector<t_field*>& sn_fields = sn->
get_members();
640 vector<t_field*>::const_iterator snf_iter;
641 for (snf_iter = sn_fields.begin(); snf_iter != sn_fields.end(); ++snf_iter) {
644 printf(
"fields %s:\n%s\n",
650 const vector<t_service*>& services = program->
get_services();
651 vector<t_service*>::const_iterator v_iter;
652 for (v_iter = services.begin(); v_iter != services.end(); ++v_iter) {
655 printf(
"service %s:\n%s\n", sv->
get_name().c_str(), sv->
get_doc().c_str());
664 const vector<t_struct*>& structs = program->
get_structs();
665 vector<t_struct*>::const_iterator s_iter;
666 for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) {
671 const vector<t_struct*>& xceptions = program->
get_xceptions();
672 vector<t_struct*>::const_iterator x_iter;
673 for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
678 const vector<t_enum*>& enums = program->
get_enums();
679 vector<t_enum*>::const_iterator e_iter;
680 for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) {
689 const vector<t_sandesh*>& sandeshs = program->get_sandeshs();
690 vector<t_sandesh*>::const_iterator s_iter;
691 for (s_iter = sandeshs.begin(); s_iter != sandeshs.end(); ++s_iter) {
715 printf(
"Thrift version %s\n", THRIFT_VERSION);
724 fprintf(stderr,
"Usage: sandesh [options] file\n");
726 fprintf(stderr,
"Usage: thrift [options] file\n");
728 fprintf(stderr,
"Options:\n");
729 fprintf(stderr,
" -version Print the compiler version\n");
730 fprintf(stderr,
" -o dir Set the output directory for gen-* packages\n");
731 fprintf(stderr,
" (default: current directory)\n");
732 fprintf(stderr,
" -out dir Set the ouput location for generated files.\n");
733 fprintf(stderr,
" (no gen-* folder will be created)\n");
734 fprintf(stderr,
" -I dir Add a directory to the list of directories\n");
735 fprintf(stderr,
" searched for include directives\n");
736 fprintf(stderr,
" -nowarn Suppress all compiler warnings (BAD!)\n");
737 fprintf(stderr,
" -strict Strict compiler warnings on\n");
738 fprintf(stderr,
" -v[erbose] Verbose mode\n");
739 fprintf(stderr,
" -r[ecurse] Also generate included files\n");
740 fprintf(stderr,
" -debug Parse debug trace to stdout\n");
741 fprintf(stderr,
" --allow-neg-keys Allow negative field keys (Used to "
742 "preserve protocol\n");
743 fprintf(stderr,
" compatibility with older .thrift files)\n");
744 fprintf(stderr,
" --allow-64bit-consts Do not print warnings about using 64-bit constants\n");
745 fprintf(stderr,
" --gen STR Generate code with a dynamically-registered generator.\n");
746 fprintf(stderr,
" STR has the form language[:key1=val1[,key2,[key3=val3]]].\n");
747 fprintf(stderr,
" Keys and values are options passed to the generator.\n");
748 fprintf(stderr,
" Many options will not require values.\n");
749 fprintf(stderr,
"\n");
750 fprintf(stderr,
"Available generators (and options):\n");
752 t_generator_registry::gen_map_t::iterator iter;
753 for (iter = gen_map.begin(); iter != gen_map.end(); ++iter) {
754 fprintf(stderr,
" %s (%s):\n",
755 iter->second->get_short_name().c_str(),
756 iter->second->get_long_name().c_str());
757 fprintf(stderr,
"%s", iter->second->get_documentation().c_str());
771 if (
type->is_void()) {
772 throw "type error: cannot declare a void const: " + name;
775 if (
type->is_base_type()) {
780 throw "type error: const \"" + name +
"\" was declared as string";
784 case t_base_type::TYPE_STATIC_CONST_STRING:
786 throw "type error: const \"" + name +
"\" was declared as static const string";
789 case t_base_type::TYPE_U16:
791 throw "type error: const \"" + name +
"\" was declared as u16";
794 case t_base_type::TYPE_U32:
796 throw "type error: const \"" + name +
"\" was declared as u32";
799 case t_base_type::TYPE_U64:
801 throw "type error: const \"" + name +
"\" was declared as u64";
804 case t_base_type::TYPE_UUID:
806 throw "type error: const \"" + name +
"\" was declared as ct_uuid_t";
809 case t_base_type::TYPE_IPADDR:
811 throw "type error: const \"" + name +
"\" was declared as ipaddr";
817 throw "type error: const \"" + name +
"\" was declared as bool";
822 throw "type error: const \"" + name +
"\" was declared as byte";
827 throw "type error: const \"" + name +
"\" was declared as i16";
832 throw "type error: const \"" + name +
"\" was declared as i32";
837 throw "type error: const \"" + name +
"\" was declared as i64";
843 throw "type error: const \"" + name +
"\" was declared as double";
849 }
else if (
type->is_enum()) {
851 throw "type error: const \"" + name +
"\" was declared as enum";
857 const vector<t_enum_value*>& enum_values = ((
t_enum*)
type)->get_constants();
858 vector<t_enum_value*>::const_iterator c_iter;
861 for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
862 if ((*c_iter)->get_name() == name_portion) {
868 throw "type error: const " + name +
" was declared as type "
869 +
type->get_name() +
" which is an enum, but "
870 + value->
get_identifier() +
" is not a valid value for that enum";
872 }
else if (
type->is_struct() ||
type->is_xception()) {
874 throw "type error: const \"" + name +
"\" was declared as struct/xception";
876 const vector<t_field*>& fields = ((
t_struct*)
type)->get_members();
877 vector<t_field*>::const_iterator f_iter;
879 const map<t_const_value*, t_const_value*>& val = value->
get_map();
880 map<t_const_value*, t_const_value*>::const_iterator v_iter;
881 for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
883 throw "type error: " + name +
" struct key must be string";
885 t_type* field_type = NULL;
886 for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
887 if ((*f_iter)->get_name() == v_iter->first->get_string()) {
888 field_type = (*f_iter)->get_type();
891 if (field_type == NULL) {
892 throw "type error: " +
type->get_name() +
" has no field " + v_iter->first->get_string();
895 validate_const_rec(name +
"." + v_iter->first->get_string(), field_type, v_iter->second);
897 }
else if (
type->is_map()) {
900 const map<t_const_value*, t_const_value*>& val = value->
get_map();
901 map<t_const_value*, t_const_value*>::const_iterator v_iter;
902 for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
906 }
else if (
type->is_list() ||
type->is_set()) {
908 if (
type->is_list()) {
911 e_type = ((
t_set*)
type)->get_elem_type();
913 const vector<t_const_value*>& val = value->
get_list();
914 vector<t_const_value*>::const_iterator v_iter;
915 for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
939 const vector<t_field*>& members =
throws->get_members();
940 vector<t_field*>::const_iterator m_iter;
941 for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
961 yyin = fopen(path.c_str(),
"r");
963 failure(
"Could not open input file: \"%s\"", path.c_str());
967 pverbose(
"Scanning %s for includes\n", path.c_str());
974 failure(
"Parser error during include pass.");
983 vector<t_program*>::iterator iter;
984 for (iter = includes.begin(); iter != includes.end(); ++iter) {
985 parse(*iter, program);
998 yyin = fopen(path.c_str(),
"r");
1000 failure(
"Could not open input file: \"%s\"", path.c_str());
1002 pverbose(
"Parsing %s for types\n", path.c_str());
1006 failure(
"Parser error during types pass.");
1008 }
catch (
string x) {
1020 const vector<t_program*>& includes = program->
get_includes();
1021 for (
size_t i = 0; i < includes.size(); ++i) {
1025 generate(includes[i], generator_strings);
1040 vector<string>::const_iterator iter;
1041 for (iter = generator_strings.begin(); iter != generator_strings.end(); ++iter) {
1044 if (generator == NULL) {
1045 pwarning(1,
"Unable to get a generator for \"%s\".\n", iter->c_str());
1047 pverbose(
"Generating \"%s\"\n", iter->c_str());
1053 }
catch (
string s) {
1054 printf(
"Error: %s\n", s.c_str());
1056 failure(
"Error: %s\n", s.c_str());
1058 }
catch (
const char* exc) {
1059 printf(
"Error: %s\n", exc);
1070 int main(
int argc,
char** argv) {
1072 std::string out_path;
1073 bool out_path_is_absolute =
false;
1076 time_t now = time(NULL);
1085 vector<string> generator_strings;
1091 for (i = 1; i < argc-1; i++) {
1095 arg = strtok_r(argv[i],
" ", &saveptr);
1096 while (arg != NULL) {
1098 if (arg[0] ==
'-' && arg[1] ==
'-') {
1102 if (strcmp(arg,
"-version") == 0) {
1105 }
else if (strcmp(arg,
"-debug") == 0) {
1107 }
else if (strcmp(arg,
"-nowarn") == 0) {
1109 }
else if (strcmp(arg,
"-strict") == 0) {
1112 }
else if (strcmp(arg,
"-v") == 0 || strcmp(arg,
"-verbose") == 0 ) {
1114 }
else if (strcmp(arg,
"-r") == 0 || strcmp(arg,
"-recurse") == 0 ) {
1116 }
else if (strcmp(arg,
"-allow-neg-keys") == 0) {
1118 }
else if (strcmp(arg,
"-allow-64bit-consts") == 0) {
1120 }
else if (strcmp(arg,
"-gen") == 0) {
1123 fprintf(stderr,
"!!! Missing generator specification\n");
1126 generator_strings.push_back(arg);
1127 }
else if (strcmp(arg,
"-dense") == 0) {
1129 }
else if (strcmp(arg,
"-cpp") == 0) {
1131 }
else if (strcmp(arg,
"-javabean") == 0) {
1133 }
else if (strcmp(arg,
"-java") == 0) {
1135 }
else if (strcmp(arg,
"-php") == 0) {
1137 }
else if (strcmp(arg,
"-phpi") == 0) {
1139 }
else if (strcmp(arg,
"-phps") == 0) {
1142 }
else if (strcmp(arg,
"-phpl") == 0) {
1145 }
else if (strcmp(arg,
"-phpa") == 0) {
1149 }
else if (strcmp(arg,
"-phpo") == 0) {
1152 }
else if (strcmp(arg,
"-rest") == 0) {
1154 }
else if (strcmp(arg,
"-py") == 0) {
1156 }
else if (strcmp(arg,
"-pyns") == 0) {
1159 }
else if (strcmp(arg,
"-rb") == 0) {
1161 }
else if (strcmp(arg,
"-xsd") == 0) {
1163 }
else if (strcmp(arg,
"-perl") == 0) {
1165 }
else if (strcmp(arg,
"-erl") == 0) {
1167 }
else if (strcmp(arg,
"-ocaml") == 0) {
1169 }
else if (strcmp(arg,
"-hs") == 0) {
1171 }
else if (strcmp(arg,
"-cocoa") == 0) {
1173 }
else if (strcmp(arg,
"-st") == 0) {
1175 }
else if (strcmp(arg,
"-csharp") == 0) {
1177 }
else if (strcmp(arg,
"-delphi") == 0) {
1179 }
else if (strcmp(arg,
"-cpp_use_include_prefix") == 0) {
1181 }
else if (strcmp(arg,
"-I") == 0) {
1186 fprintf(stderr,
"!!! Missing Include directory\n");
1190 }
else if ((strcmp(arg,
"-o") == 0) || (strcmp(arg,
"-out") == 0)) {
1191 out_path_is_absolute = (strcmp(arg,
"-out") == 0) ?
true :
false;
1195 fprintf(stderr,
"-o: missing output directory\n");
1201 if (stat(out_path.c_str(), &sb) < 0) {
1202 fprintf(stderr,
"Output directory %s is unusable: %s\n", out_path.c_str(), strerror(errno));
1205 if (! S_ISDIR(sb.st_mode)) {
1206 fprintf(stderr,
"Output directory %s exists but is not a directory\n", out_path.c_str());
1210 fprintf(stderr,
"!!! Unrecognized option: %s\n", arg);
1215 arg = strtok_r(NULL,
" ", &saveptr);
1220 if (strcmp(argv[argc-1],
"-version") == 0) {
1227 pwarning(1,
"-cpp is deprecated. Use --gen cpp");
1228 string gen_string =
"cpp:";
1230 gen_string.append(
"dense,");
1233 gen_string.append(
"include_prefix,");
1235 generator_strings.push_back(gen_string);
1238 pwarning(1,
"-java is deprecated. Use --gen java");
1239 generator_strings.push_back(
"java");
1242 pwarning(1,
"-javabean is deprecated. Use --gen java:beans");
1243 generator_strings.push_back(
"java:beans");
1246 pwarning(1,
"-csharp is deprecated. Use --gen csharp");
1247 generator_strings.push_back(
"csharp");
1250 pwarning(1,
"-delphi is deprecated. Use --gen delphi");
1251 generator_strings.push_back(
"delphi");
1254 pwarning(1,
"-py is deprecated. Use --gen py");
1255 generator_strings.push_back(
"py");
1258 pwarning(1,
"-rb is deprecated. Use --gen rb");
1259 generator_strings.push_back(
"rb");
1262 pwarning(1,
"-perl is deprecated. Use --gen perl");
1263 generator_strings.push_back(
"perl");
1266 pwarning(1,
"-php is deprecated. Use --gen php");
1267 string gen_string =
"php:";
1269 gen_string.append(
"inlined,");
1271 gen_string.append(
"server,");
1273 gen_string.append(
"autoload,");
1275 gen_string.append(
"oop,");
1277 gen_string.append(
"rest,");
1279 generator_strings.push_back(gen_string);
1282 pwarning(1,
"-cocoa is deprecated. Use --gen cocoa");
1283 generator_strings.push_back(
"cocoa");
1286 pwarning(1,
"-erl is deprecated. Use --gen erl");
1287 generator_strings.push_back(
"erl");
1290 pwarning(1,
"-st is deprecated. Use --gen st");
1291 generator_strings.push_back(
"st");
1294 pwarning(1,
"-ocaml is deprecated. Use --gen ocaml");
1295 generator_strings.push_back(
"ocaml");
1298 pwarning(1,
"-hs is deprecated. Use --gen hs");
1299 generator_strings.push_back(
"hs");
1302 pwarning(1,
"-xsd is deprecated. Use --gen xsd");
1303 generator_strings.push_back(
"xsd");
1307 if (generator_strings.empty()) {
1308 fprintf(stderr,
"!!! No output language(s) specified\n\n");
1314 if (argv[i] == NULL) {
1315 fprintf(stderr,
"!!! Missing file name\n");
1319 failure(
"Could not open input file with realpath: %s", argv[i]);
1321 string input_file(rp);
1325 if (out_path.size()) {
1331 string input_filename = argv[i];
1332 string include_prefix;
1334 string::size_type last_slash = string::npos;
1335 if ((last_slash = input_filename.rfind(
"/")) != string::npos) {
1336 include_prefix = input_filename.substr(0, last_slash);
1355 g_type_u16 =
new t_base_type(
"u16", t_base_type::TYPE_U16);
1356 g_type_u32 =
new t_base_type(
"u32", t_base_type::TYPE_U32);
1357 g_type_u64 =
new t_base_type(
"u64", t_base_type::TYPE_U64);
1358 g_type_ipv4 =
new t_base_type(
"ipv4", t_base_type::TYPE_IPV4);
1359 g_type_ipaddr =
new t_base_type(
"ipaddr", t_base_type::TYPE_IPADDR);
1360 g_type_xml =
new t_base_type(
"xml", t_base_type::TYPE_XML);
1361 g_type_uuid_t =
new t_base_type(
"ct_uuid_t", t_base_type::TYPE_UUID);
1362 g_type_static_const_string =
new t_base_type(
"static const string", t_base_type::TYPE_STATIC_CONST_STRING);
1363 g_type_sandesh_system =
new t_base_type(
"system", t_base_type::TYPE_SANDESH_SYSTEM);
1364 g_type_sandesh_request =
new t_base_type(
"request", t_base_type::TYPE_SANDESH_REQUEST);
1365 g_type_sandesh_response =
new t_base_type(
"response", t_base_type::TYPE_SANDESH_RESPONSE);
1366 g_type_sandesh_trace =
new t_base_type(
"trace", t_base_type::TYPE_SANDESH_TRACE);
1367 g_type_sandesh_trace_object =
new t_base_type(
"traceobject", t_base_type::TYPE_SANDESH_TRACE_OBJECT);
1368 g_type_sandesh_buffer =
new t_base_type(
"buffer", t_base_type::TYPE_SANDESH_BUFFER);
1369 g_type_sandesh_uve =
new t_base_type(
"uve", t_base_type::TYPE_SANDESH_UVE);
1370 g_type_sandesh_dynamic_uve =
new t_base_type(
"dynamicuve", t_base_type::TYPE_SANDESH_DYNAMIC_UVE);
1371 g_type_sandesh_alarm =
new t_base_type(
"alarm", t_base_type::TYPE_SANDESH_ALARM);
1372 g_type_sandesh_object =
new t_base_type(
"object", t_base_type::TYPE_SANDESH_OBJECT);
1373 g_type_sandesh_flow =
new t_base_type(
"flow", t_base_type::TYPE_SANDESH_FLOW);
1374 g_type_sandesh_session =
new t_base_type(
"session", t_base_type::TYPE_SANDESH_SESSION);
1378 parse(program, NULL);
1387 generate(program, generator_strings);
1407 delete g_type_ipaddr;
1408 delete g_type_static_const_string;
1409 delete g_type_sandesh_system;
1410 delete g_type_sandesh_request;
1411 delete g_type_sandesh_response;
1412 delete g_type_sandesh_trace;
1413 delete g_type_sandesh_trace_object;
1414 delete g_type_sandesh_buffer;
1415 delete g_type_sandesh_uve;
1416 delete g_type_sandesh_dynamic_uve;
1417 delete g_type_sandesh_alarm;
1418 delete g_type_sandesh_object;
1419 delete g_type_sandesh_flow;
1420 delete g_type_sandesh_session;
1422 delete g_type_uuid_t;
static std::string t_base_name(t_base tbase)
const std::vector< t_const_value * > & get_list() const
std::string get_identifier() const
std::string get_identifier_name() const
t_const_value_type get_type() const
const std::map< t_const_value *, t_const_value * > & get_map() const
t_type * get_type() const
std::string get_name() const
t_const_value * get_value() const
const std::string & get_doc() const
const std::string & get_name() const
t_type * get_type() const
static gen_map_t & get_generator_map()
static t_generator * get_generator(t_program *program, const std::string &options)
std::map< std::string, t_generator_factory * > gen_map_t
virtual void generate_program()
static t_type * get_true_type(t_type *type)
const std::vector< t_program * > & get_includes() const
void set_include_prefix(std::string include_prefix)
const std::vector< t_service * > & get_services() const
bool is_out_path_absolute()
const std::string & get_path() const
const std::vector< t_struct * > & get_structs() const
const std::vector< t_const * > & get_consts() const
const std::string & get_out_path() const
const std::vector< t_struct * > & get_xceptions() const
const std::string & get_name() const
const std::vector< t_enum * > & get_enums() const
void set_out_path(std::string out_path, bool out_path_is_absolute)
const std::vector< t_typedef * > & get_typedefs() const
const members_type & get_members()
virtual void generate_fingerprint()
virtual void generate_fingerprint()
virtual bool is_xception() const
virtual const std::string & get_name() const
void validate_const_type(t_const *c)
char * clean_up_doctext(char *doctext)
void pwarning(int level, const char *fmt,...)
int g_allow_neg_field_keys
bool validate_throws(t_struct *throws)
void dump_docstrings(t_program *program)
char * g_program_doctext_candidate
bool g_cpp_use_include_prefix
void declare_valid_program_doctext()
void pverbose(const char *fmt,...)
void yyerror(const char *fmt,...)
void validate_const_rec(std::string name, t_type *type, t_const_value *value)
char * saferealpath(const char *path, char *resolved_path)
string directory_name(string filename)
string program_name(string filename)
void validate_field_value(t_field *field, t_const_value *cv)
void generate_all_fingerprints(t_program *program)
int g_program_doctext_lineno
void parse(t_program *program, t_program *parent_program)
PROGDOCTEXT_STATUS g_program_doctext_status
void generate(t_program *program, const vector< string > &generator_strings)
string include_file(string filename)
void reset_program_doctext_info()
vector< string > g_incl_searchpath
void failure(const char *fmt,...)
void pdebug(const char *fmt,...)