Extended symbolic enum parsing in JSON for integers and OR-ing.

Change-Id: Iedbd9914a1ca3897776fb92aa9a1fdfc4603da3c
Tested: on Windows and Linux
This commit is contained in:
Wouter van Oortmerssen
2014-07-25 15:04:35 -07:00
parent bba042d723
commit 9c3de1e2a0
9 changed files with 98 additions and 23 deletions

View File

@@ -210,12 +210,12 @@ inline size_t InlineAlignment(const Type &type) {
}
struct EnumVal {
EnumVal(const std::string &_name, int _val)
EnumVal(const std::string &_name, int64_t _val)
: name(_name), value(_val), struct_def(nullptr) {}
std::string name;
std::string doc_comment;
int value;
int64_t value;
StructDef *struct_def; // only set if this is a union
};
@@ -268,6 +268,7 @@ class Parser {
void ParseMetaData(Definition &def);
bool TryTypedValue(int dtoken, bool check, Value &e, BaseType req);
void ParseSingleValue(Value &e);
int64_t ParseIntegerFromString(Type &type);
StructDef *LookupCreateStruct(const std::string &name);
void ParseEnum(bool is_union);
void ParseDecl();