Union Vector

This commit is contained in:
Bei Li
2017-01-24 11:52:36 -08:00
parent bbef92c17d
commit 68bbe983e9
12 changed files with 567 additions and 121 deletions

View File

@@ -356,10 +356,25 @@ struct IDLOptions {
bool allow_non_utf8;
// Possible options for the more general generator below.
enum Language { kJava, kCSharp, kGo, kMAX };
enum Language {
kJava = 1 << 0,
kCSharp = 1 << 1,
kGo = 1 << 2,
kCpp = 1 << 3,
kJs = 1 << 4,
kPython = 1 << 5,
kPhp = 1 << 6,
kJson = 1 << 7,
kBinary = 1 << 8,
kMAX
};
Language lang;
// The corresponding language bit will be set if a language is included
// for code generation.
unsigned long lang_to_generate;
IDLOptions()
: strict_json(false),
skip_js_exports(false),
@@ -378,7 +393,8 @@ struct IDLOptions {
cpp_object_api_pointer_type("std::unique_ptr"),
union_value_namespacing(true),
allow_non_utf8(false),
lang(IDLOptions::kJava) {}
lang(IDLOptions::kJava),
lang_to_generate(0) {}
};
// This encapsulates where the parser is in the current source file.