42 #include <sys/types.h>
84 t_type* g_type_static_const_string;
85 t_type* g_type_sandesh_system;
86 t_type* g_type_sandesh_request;
87 t_type* g_type_sandesh_response;
88 t_type* g_type_sandesh_trace;
89 t_type* g_type_sandesh_trace_object;
90 t_type* g_type_sandesh_buffer;
91 t_type* g_type_sandesh_uve;
92 t_type* g_type_sandesh_dynamic_uve;
93 t_type* g_type_sandesh_alarm;
94 t_type* g_type_sandesh_object;
95 t_type* g_type_sandesh_flow;
96 t_type* g_type_sandesh_session;
228 return realpath(path, resolved_path);
243 "[ERROR:%s:%d] (last token was '%s')\n",
249 vfprintf(stderr, fmt, args);
252 fprintf(stderr,
"\n");
313 vfprintf(stderr, fmt, args);
323 string::size_type slash = filename.rfind(
"/");
324 if (slash != string::npos) {
325 filename = filename.substr(slash+1);
327 string::size_type dot = filename.rfind(
".");
328 if (dot != string::npos) {
329 filename = filename.substr(0, dot);
338 string::size_type slash = filename.rfind(
"/");
340 if (slash == string::npos) {
343 return filename.substr(0, slash);
351 if (filename[0] ==
'/') {
355 pwarning(0,
"Cannot open include file %s\n", filename.c_str());
356 return std::string();
361 if (stat(rp, &finfo) == 0) {
370 vector<string>::iterator it;
371 for (it = sp.begin(); it != sp.end(); it++) {
372 string sfilename = *(it) +
"/" + filename;
382 if (stat(rp, &finfo) == 0) {
389 pwarning(0,
"Could not find include file %s\n", filename.c_str());
390 return std::string();
415 pdebug(
"%s",
"program doctext set to INVALID");
424 pdebug(
"%s",
"program doctext set to ABSOLUTELY_SURE");
427 pdebug(
"%s",
"program doctext set to NO_PROGRAM_DOCTEXT");
439 string docstring = doctext;
441 remove(docstring.begin(), docstring.end(),
'\r'),
445 vector<string> lines;
446 string::size_type pos = string::npos;
447 string::size_type last;
449 last = (pos == string::npos) ? 0 : pos+1;
450 pos = docstring.find(
'\n', last);
451 if (pos == string::npos) {
453 string::size_type nonwhite = docstring.find_first_not_of(
" \t", last);
454 if (nonwhite != string::npos) {
455 lines.push_back(docstring.substr(last));
459 lines.push_back(docstring.substr(last, pos-last));
468 pos = lines.front().find_first_not_of(
" \t");
469 lines.front().erase(0, pos);
473 bool have_prefix =
true;
474 bool found_prefix =
false;
475 string::size_type prefix_len = 0;
476 vector<string>::iterator l_iter;
477 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
478 if (l_iter->empty()) {
482 pos = l_iter->find_first_not_of(
" \t");
484 if (pos != string::npos) {
485 if (l_iter->at(pos) ==
'*') {
496 }
else if (l_iter->size() > pos
497 && l_iter->at(pos) ==
'*'
498 && pos == prefix_len) {
500 }
else if (pos == string::npos) {
514 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
515 l_iter->erase(0, prefix_len);
520 prefix_len = string::npos;
521 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
522 if (l_iter->empty()) {
525 pos = l_iter->find_first_not_of(
" \t");
526 if (pos != string::npos
527 && (prefix_len == string::npos || pos < prefix_len)) {
533 if (prefix_len != string::npos) {
534 for (l_iter = lines.begin()+1; l_iter != lines.end(); ++l_iter) {
535 l_iter->erase(0, prefix_len);
540 for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
541 pos = l_iter->find_last_not_of(
" \t");
542 if (pos != string::npos && pos != l_iter->length()-1) {
543 l_iter->erase(pos+1);
549 if (lines.front().empty()) {
550 lines.erase(lines.begin());
555 for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
556 docstring += *l_iter;
560 assert(docstring.length() <= strlen(doctext));
561 strcpy(doctext, docstring.c_str());
575 string progdoc = program->
get_doc();
576 if (!progdoc.empty()) {
577 printf(
"Whole program doc:\n%s\n", progdoc.c_str());
579 const vector<t_typedef*>& typedefs = program->
get_typedefs();
580 vector<t_typedef*>::const_iterator t_iter;
581 for (t_iter = typedefs.begin(); t_iter != typedefs.end(); ++t_iter) {
584 printf(
"typedef %s:\n%s\n", td->
get_name().c_str(), td->
get_doc().c_str());
587 const vector<t_enum*>& enums = program->
get_enums();
588 vector<t_enum*>::const_iterator e_iter;
589 for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) {
592 printf(
"enum %s:\n%s\n", en->
get_name().c_str(), en->
get_doc().c_str());
595 const vector<t_const*>& consts = program->
get_consts();
596 vector<t_const*>::const_iterator c_iter;
597 for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
600 printf(
"const %s:\n%s\n", co->
get_name().c_str(), co->
get_doc().c_str());
603 const vector<t_struct*>& structs = program->
get_structs();
604 vector<t_struct*>::const_iterator s_iter;
605 for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) {
608 printf(
"struct %s:\n%s\n", st->
get_name().c_str(), st->
get_doc().c_str());
610 const vector<t_field*>& fields = st->
get_members();
611 vector<t_field*>::const_iterator f_iter;
612 for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
615 printf(
"fields %s:\n%s\n",
620 const vector<t_struct*>& xceptions = program->
get_xceptions();
621 vector<t_struct*>::const_iterator x_iter;
622 for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
625 printf(
"xception %s:\n%s\n", xn->
get_name().c_str(), xn->
get_doc().c_str());
629 const vector<t_sandesh*>& sandeshs = program->get_sandeshs();
630 vector<t_sandesh*>::const_iterator sn_iter;
631 for (sn_iter = sandeshs.begin(); sn_iter != sandeshs.end(); ++sn_iter) {
634 printf(
"sandesh %s:\n%s\n", sn->
get_name().c_str(), sn->
get_doc().c_str());
636 const vector<t_field*>& sn_fields = sn->
get_members();
637 vector<t_field*>::const_iterator snf_iter;
638 for (snf_iter = sn_fields.begin(); snf_iter != sn_fields.end(); ++snf_iter) {
641 printf(
"fields %s:\n%s\n",
647 const vector<t_service*>& services = program->
get_services();
648 vector<t_service*>::const_iterator v_iter;
649 for (v_iter = services.begin(); v_iter != services.end(); ++v_iter) {
652 printf(
"service %s:\n%s\n", sv->
get_name().c_str(), sv->
get_doc().c_str());
661 const vector<t_struct*>& structs = program->
get_structs();
662 vector<t_struct*>::const_iterator s_iter;
663 for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) {
668 const vector<t_struct*>& xceptions = program->
get_xceptions();
669 vector<t_struct*>::const_iterator x_iter;
670 for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
675 const vector<t_enum*>& enums = program->
get_enums();
676 vector<t_enum*>::const_iterator e_iter;
677 for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) {
686 const vector<t_sandesh*>& sandeshs = program->get_sandeshs();
687 vector<t_sandesh*>::const_iterator s_iter;
688 for (s_iter = sandeshs.begin(); s_iter != sandeshs.end(); ++s_iter) {
712 printf(
"Thrift version %s\n", THRIFT_VERSION);
721 fprintf(stderr,
"Usage: sandesh [options] file\n");
723 fprintf(stderr,
"Usage: thrift [options] file\n");
725 fprintf(stderr,
"Options:\n");
726 fprintf(stderr,
" -version Print the compiler version\n");
727 fprintf(stderr,
" -o dir Set the output directory for gen-* packages\n");
728 fprintf(stderr,
" (default: current directory)\n");
729 fprintf(stderr,
" -out dir Set the ouput location for generated files.\n");
730 fprintf(stderr,
" (no gen-* folder will be created)\n");
731 fprintf(stderr,
" -I dir Add a directory to the list of directories\n");
732 fprintf(stderr,
" searched for include directives\n");
733 fprintf(stderr,
" -nowarn Suppress all compiler warnings (BAD!)\n");
734 fprintf(stderr,
" -strict Strict compiler warnings on\n");
735 fprintf(stderr,
" -v[erbose] Verbose mode\n");
736 fprintf(stderr,
" -r[ecurse] Also generate included files\n");
737 fprintf(stderr,
" -debug Parse debug trace to stdout\n");
738 fprintf(stderr,
" --allow-neg-keys Allow negative field keys (Used to "
739 "preserve protocol\n");
740 fprintf(stderr,
" compatibility with older .thrift files)\n");
741 fprintf(stderr,
" --allow-64bit-consts Do not print warnings about using 64-bit constants\n");
742 fprintf(stderr,
" --gen STR Generate code with a dynamically-registered generator.\n");
743 fprintf(stderr,
" STR has the form language[:key1=val1[,key2,[key3=val3]]].\n");
744 fprintf(stderr,
" Keys and values are options passed to the generator.\n");
745 fprintf(stderr,
" Many options will not require values.\n");
746 fprintf(stderr,
"\n");
747 fprintf(stderr,
"Available generators (and options):\n");
749 t_generator_registry::gen_map_t::iterator iter;
750 for (iter = gen_map.begin(); iter != gen_map.end(); ++iter) {
751 fprintf(stderr,
" %s (%s):\n",
752 iter->second->get_short_name().c_str(),
753 iter->second->get_long_name().c_str());
754 fprintf(stderr,
"%s", iter->second->get_documentation().c_str());
769 throw "type error: cannot declare a void const: " + name;
777 throw "type error: const \"" + name +
"\" was declared as string";
781 case t_base_type::TYPE_STATIC_CONST_STRING:
783 throw "type error: const \"" + name +
"\" was declared as static const string";
786 case t_base_type::TYPE_U16:
788 throw "type error: const \"" + name +
"\" was declared as u16";
791 case t_base_type::TYPE_U32:
793 throw "type error: const \"" + name +
"\" was declared as u32";
796 case t_base_type::TYPE_U64:
798 throw "type error: const \"" + name +
"\" was declared as u64";
801 case t_base_type::TYPE_UUID:
803 throw "type error: const \"" + name +
"\" was declared as ct_uuid_t";
806 case t_base_type::TYPE_IPADDR:
808 throw "type error: const \"" + name +
"\" was declared as ipaddr";
814 throw "type error: const \"" + name +
"\" was declared as bool";
819 throw "type error: const \"" + name +
"\" was declared as byte";
824 throw "type error: const \"" + name +
"\" was declared as i16";
829 throw "type error: const \"" + name +
"\" was declared as i32";
834 throw "type error: const \"" + name +
"\" was declared as i64";
840 throw "type error: const \"" + name +
"\" was declared as double";
848 throw "type error: const \"" + name +
"\" was declared as enum";
854 const vector<t_enum_value*>& enum_values = ((
t_enum*)type)->get_constants();
855 vector<t_enum_value*>::const_iterator c_iter;
858 for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
859 if ((*c_iter)->get_name() == name_portion) {
865 throw "type error: const " + name +
" was declared as type "
866 + type->
get_name() +
" which is an enum, but "
867 + value->
get_identifier() +
" is not a valid value for that enum";
871 throw "type error: const \"" + name +
"\" was declared as struct/xception";
873 const vector<t_field*>& fields = ((
t_struct*)type)->get_members();
874 vector<t_field*>::const_iterator f_iter;
876 const map<t_const_value*, t_const_value*>& val = value->
get_map();
877 map<t_const_value*, t_const_value*>::const_iterator v_iter;
878 for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
880 throw "type error: " + name +
" struct key must be string";
882 t_type* field_type = NULL;
883 for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
884 if ((*f_iter)->get_name() == v_iter->first->get_string()) {
885 field_type = (*f_iter)->get_type();
888 if (field_type == NULL) {
889 throw "type error: " + type->
get_name() +
" has no field " + v_iter->first->get_string();
892 validate_const_rec(name +
"." + v_iter->first->get_string(), field_type, v_iter->second);
894 }
else if (type->
is_map()) {
897 const map<t_const_value*, t_const_value*>& val = value->
get_map();
898 map<t_const_value*, t_const_value*>::const_iterator v_iter;
899 for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
906 e_type = ((
t_list*)type)->get_elem_type();
908 e_type = ((
t_set*)type)->get_elem_type();
910 const vector<t_const_value*>& val = value->
get_list();
911 vector<t_const_value*>::const_iterator v_iter;
912 for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
936 const vector<t_field*>& members =
throws->get_members();
937 vector<t_field*>::const_iterator m_iter;
938 for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
958 yyin = fopen(path.c_str(),
"r");
960 failure(
"Could not open input file: \"%s\"", path.c_str());
964 pverbose(
"Scanning %s for includes\n", path.c_str());
971 failure(
"Parser error during include pass.");
980 vector<t_program*>::iterator iter;
981 for (iter = includes.begin(); iter != includes.end(); ++iter) {
982 parse(*iter, program);
995 yyin = fopen(path.c_str(),
"r");
997 failure(
"Could not open input file: \"%s\"", path.c_str());
999 pverbose(
"Parsing %s for types\n", path.c_str());
1003 failure(
"Parser error during types pass.");
1005 }
catch (
string x) {
1017 const vector<t_program*>& includes = program->
get_includes();
1018 for (
size_t i = 0; i < includes.size(); ++i) {
1022 generate(includes[i], generator_strings);
1037 vector<string>::const_iterator iter;
1038 for (iter = generator_strings.begin(); iter != generator_strings.end(); ++iter) {
1041 if (generator == NULL) {
1042 pwarning(1,
"Unable to get a generator for \"%s\".\n", iter->c_str());
1044 pverbose(
"Generating \"%s\"\n", iter->c_str());
1050 }
catch (
string s) {
1051 printf(
"Error: %s\n", s.c_str());
1053 failure(
"Error: %s\n", s.c_str());
1055 }
catch (
const char* exc) {
1056 printf(
"Error: %s\n", exc);
1067 int main(
int argc,
char** argv) {
1069 std::string out_path;
1070 bool out_path_is_absolute =
false;
1073 time_t now = time(NULL);
1082 vector<string> generator_strings;
1088 for (i = 1; i < argc-1; i++) {
1092 arg = strtok_r(argv[i],
" ", &saveptr);
1093 while (arg != NULL) {
1095 if (arg[0] ==
'-' && arg[1] ==
'-') {
1099 if (strcmp(arg,
"-version") == 0) {
1102 }
else if (strcmp(arg,
"-debug") == 0) {
1104 }
else if (strcmp(arg,
"-nowarn") == 0) {
1106 }
else if (strcmp(arg,
"-strict") == 0) {
1109 }
else if (strcmp(arg,
"-v") == 0 || strcmp(arg,
"-verbose") == 0 ) {
1111 }
else if (strcmp(arg,
"-r") == 0 || strcmp(arg,
"-recurse") == 0 ) {
1113 }
else if (strcmp(arg,
"-allow-neg-keys") == 0) {
1115 }
else if (strcmp(arg,
"-allow-64bit-consts") == 0) {
1117 }
else if (strcmp(arg,
"-gen") == 0) {
1120 fprintf(stderr,
"!!! Missing generator specification\n");
1123 generator_strings.push_back(arg);
1124 }
else if (strcmp(arg,
"-dense") == 0) {
1126 }
else if (strcmp(arg,
"-cpp") == 0) {
1128 }
else if (strcmp(arg,
"-javabean") == 0) {
1130 }
else if (strcmp(arg,
"-java") == 0) {
1132 }
else if (strcmp(arg,
"-php") == 0) {
1134 }
else if (strcmp(arg,
"-phpi") == 0) {
1136 }
else if (strcmp(arg,
"-phps") == 0) {
1139 }
else if (strcmp(arg,
"-phpl") == 0) {
1142 }
else if (strcmp(arg,
"-phpa") == 0) {
1146 }
else if (strcmp(arg,
"-phpo") == 0) {
1149 }
else if (strcmp(arg,
"-rest") == 0) {
1151 }
else if (strcmp(arg,
"-py") == 0) {
1153 }
else if (strcmp(arg,
"-pyns") == 0) {
1156 }
else if (strcmp(arg,
"-rb") == 0) {
1158 }
else if (strcmp(arg,
"-xsd") == 0) {
1160 }
else if (strcmp(arg,
"-perl") == 0) {
1162 }
else if (strcmp(arg,
"-erl") == 0) {
1164 }
else if (strcmp(arg,
"-ocaml") == 0) {
1166 }
else if (strcmp(arg,
"-hs") == 0) {
1168 }
else if (strcmp(arg,
"-cocoa") == 0) {
1170 }
else if (strcmp(arg,
"-st") == 0) {
1172 }
else if (strcmp(arg,
"-csharp") == 0) {
1174 }
else if (strcmp(arg,
"-delphi") == 0) {
1176 }
else if (strcmp(arg,
"-cpp_use_include_prefix") == 0) {
1178 }
else if (strcmp(arg,
"-I") == 0) {
1183 fprintf(stderr,
"!!! Missing Include directory\n");
1187 }
else if ((strcmp(arg,
"-o") == 0) || (strcmp(arg,
"-out") == 0)) {
1188 out_path_is_absolute = (strcmp(arg,
"-out") == 0) ?
true :
false;
1192 fprintf(stderr,
"-o: missing output directory\n");
1198 if (stat(out_path.c_str(), &sb) < 0) {
1199 fprintf(stderr,
"Output directory %s is unusable: %s\n", out_path.c_str(), strerror(errno));
1202 if (! S_ISDIR(sb.st_mode)) {
1203 fprintf(stderr,
"Output directory %s exists but is not a directory\n", out_path.c_str());
1207 fprintf(stderr,
"!!! Unrecognized option: %s\n", arg);
1212 arg = strtok_r(NULL,
" ", &saveptr);
1217 if (strcmp(argv[argc-1],
"-version") == 0) {
1224 pwarning(1,
"-cpp is deprecated. Use --gen cpp");
1225 string gen_string =
"cpp:";
1227 gen_string.append(
"dense,");
1230 gen_string.append(
"include_prefix,");
1232 generator_strings.push_back(gen_string);
1235 pwarning(1,
"-java is deprecated. Use --gen java");
1236 generator_strings.push_back(
"java");
1239 pwarning(1,
"-javabean is deprecated. Use --gen java:beans");
1240 generator_strings.push_back(
"java:beans");
1243 pwarning(1,
"-csharp is deprecated. Use --gen csharp");
1244 generator_strings.push_back(
"csharp");
1247 pwarning(1,
"-delphi is deprecated. Use --gen delphi");
1248 generator_strings.push_back(
"delphi");
1251 pwarning(1,
"-py is deprecated. Use --gen py");
1252 generator_strings.push_back(
"py");
1255 pwarning(1,
"-rb is deprecated. Use --gen rb");
1256 generator_strings.push_back(
"rb");
1259 pwarning(1,
"-perl is deprecated. Use --gen perl");
1260 generator_strings.push_back(
"perl");
1263 pwarning(1,
"-php is deprecated. Use --gen php");
1264 string gen_string =
"php:";
1266 gen_string.append(
"inlined,");
1268 gen_string.append(
"server,");
1270 gen_string.append(
"autoload,");
1272 gen_string.append(
"oop,");
1274 gen_string.append(
"rest,");
1276 generator_strings.push_back(gen_string);
1279 pwarning(1,
"-cocoa is deprecated. Use --gen cocoa");
1280 generator_strings.push_back(
"cocoa");
1283 pwarning(1,
"-erl is deprecated. Use --gen erl");
1284 generator_strings.push_back(
"erl");
1287 pwarning(1,
"-st is deprecated. Use --gen st");
1288 generator_strings.push_back(
"st");
1291 pwarning(1,
"-ocaml is deprecated. Use --gen ocaml");
1292 generator_strings.push_back(
"ocaml");
1295 pwarning(1,
"-hs is deprecated. Use --gen hs");
1296 generator_strings.push_back(
"hs");
1299 pwarning(1,
"-xsd is deprecated. Use --gen xsd");
1300 generator_strings.push_back(
"xsd");
1304 if (generator_strings.empty()) {
1305 fprintf(stderr,
"!!! No output language(s) specified\n\n");
1311 if (argv[i] == NULL) {
1312 fprintf(stderr,
"!!! Missing file name\n");
1316 failure(
"Could not open input file with realpath: %s", argv[i]);
1318 string input_file(rp);
1322 if (out_path.size()) {
1328 string input_filename = argv[i];
1329 string include_prefix;
1331 string::size_type last_slash = string::npos;
1332 if ((last_slash = input_filename.rfind(
"/")) != string::npos) {
1333 include_prefix = input_filename.substr(0, last_slash);
1352 g_type_u16 =
new t_base_type(
"u16", t_base_type::TYPE_U16);
1353 g_type_u32 =
new t_base_type(
"u32", t_base_type::TYPE_U32);
1354 g_type_u64 =
new t_base_type(
"u64", t_base_type::TYPE_U64);
1355 g_type_ipv4 =
new t_base_type(
"ipv4", t_base_type::TYPE_IPV4);
1356 g_type_ipaddr =
new t_base_type(
"ipaddr", t_base_type::TYPE_IPADDR);
1357 g_type_xml =
new t_base_type(
"xml", t_base_type::TYPE_XML);
1358 g_type_uuid_t =
new t_base_type(
"ct_uuid_t", t_base_type::TYPE_UUID);
1359 g_type_static_const_string =
new t_base_type(
"static const string", t_base_type::TYPE_STATIC_CONST_STRING);
1360 g_type_sandesh_system =
new t_base_type(
"system", t_base_type::TYPE_SANDESH_SYSTEM);
1361 g_type_sandesh_request =
new t_base_type(
"request", t_base_type::TYPE_SANDESH_REQUEST);
1362 g_type_sandesh_response =
new t_base_type(
"response", t_base_type::TYPE_SANDESH_RESPONSE);
1363 g_type_sandesh_trace =
new t_base_type(
"trace", t_base_type::TYPE_SANDESH_TRACE);
1364 g_type_sandesh_trace_object =
new t_base_type(
"traceobject", t_base_type::TYPE_SANDESH_TRACE_OBJECT);
1365 g_type_sandesh_buffer =
new t_base_type(
"buffer", t_base_type::TYPE_SANDESH_BUFFER);
1366 g_type_sandesh_uve =
new t_base_type(
"uve", t_base_type::TYPE_SANDESH_UVE);
1367 g_type_sandesh_dynamic_uve =
new t_base_type(
"dynamicuve", t_base_type::TYPE_SANDESH_DYNAMIC_UVE);
1368 g_type_sandesh_alarm =
new t_base_type(
"alarm", t_base_type::TYPE_SANDESH_ALARM);
1369 g_type_sandesh_object =
new t_base_type(
"object", t_base_type::TYPE_SANDESH_OBJECT);
1370 g_type_sandesh_flow =
new t_base_type(
"flow", t_base_type::TYPE_SANDESH_FLOW);
1371 g_type_sandesh_session =
new t_base_type(
"session", t_base_type::TYPE_SANDESH_SESSION);
1375 parse(program, NULL);
1384 generate(program, generator_strings);
1404 delete g_type_ipaddr;
1405 delete g_type_static_const_string;
1406 delete g_type_sandesh_system;
1407 delete g_type_sandesh_request;
1408 delete g_type_sandesh_response;
1409 delete g_type_sandesh_trace;
1410 delete g_type_sandesh_trace_object;
1411 delete g_type_sandesh_buffer;
1412 delete g_type_sandesh_uve;
1413 delete g_type_sandesh_dynamic_uve;
1414 delete g_type_sandesh_alarm;
1415 delete g_type_sandesh_object;
1416 delete g_type_sandesh_flow;
1417 delete g_type_sandesh_session;
1419 delete g_type_uuid_t;
void validate_field_value(t_field *field, t_const_value *cv)
char * saferealpath(const char *path, char *resolved_path)
virtual bool is_xception() const
const std::string & get_name() const
void dump_docstrings(t_program *program)
void pverbose(const char *fmt,...)
virtual void generate_program()
std::string get_identifier_name() const
void generate_all_fingerprints(t_program *program)
void failure(const char *fmt,...)
const std::string & get_path() const
char * g_program_doctext_candidate
void pdebug(const char *fmt,...)
const std::vector< t_program * > & get_includes() const
string program_name(string filename)
vector< string > g_incl_searchpath
static std::string t_base_name(t_base tbase)
const std::vector< t_typedef * > & get_typedefs() const
virtual bool is_map() const
std::string g_parent_prefix
const std::string & get_name() const
void yyerror(const char *fmt,...)
virtual bool is_enum() const
t_type * get_type() const
virtual bool is_base_type() const
void parse(t_program *program, t_program *parent_program)
const std::map< t_const_value *, t_const_value * > & get_map() const
const members_type & get_members()
void pwarning(int level, const char *fmt,...)
virtual void generate_fingerprint()
t_const_value_type get_type() const
void set_include_prefix(std::string include_prefix)
t_type * get_type() const
string include_file(string filename)
const std::vector< t_const * > & get_consts() const
bool g_cpp_use_include_prefix
bool is_out_path_absolute()
char * clean_up_doctext(char *doctext)
int g_allow_neg_field_keys
PROGDOCTEXT_STATUS g_program_doctext_status
virtual bool is_set() const
const std::vector< t_enum * > & get_enums() const
const std::vector< t_struct * > & get_xceptions() const
std::string get_name() const
void set_out_path(std::string out_path, bool out_path_is_absolute)
virtual bool is_void() const
virtual void generate_fingerprint()
void declare_valid_program_doctext()
t_const_value * get_value() const
std::map< std::string, t_generator_factory * > gen_map_t
static gen_map_t & get_generator_map()
void validate_const_rec(std::string name, t_type *type, t_const_value *value)
std::string get_identifier() const
virtual const std::string & get_name() const
virtual bool is_list() const
bool validate_throws(t_struct *throws)
string directory_name(string filename)
const std::string & get_out_path() const
static t_type * get_true_type(t_type *type)
virtual bool is_struct() const
const std::string & get_doc() const
const std::vector< t_struct * > & get_structs() const
static t_generator * get_generator(t_program *program, const std::string &options)
void validate_const_type(t_const *c)
const std::vector< t_service * > & get_services() const
void reset_program_doctext_info()
void generate(t_program *program, const vector< string > &generator_strings)
int g_program_doctext_lineno
const std::vector< t_const_value * > & get_list() const