Added namespaced way to refer to types in schemas.

Also made proper namespacing work for enums.

You can now say namespace.MyTable as the type when declaring
a field that refers to a type in a different namespace.

Previously, it would work just referring to MyTable, however
with the recent commit fixing namespaced types this now
is ambiguous.

Change-Id: Ieaa3f4ac1662b8c4dc1f16e1898ea3cdb02e10fd
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2015-05-08 15:04:53 -07:00
parent ecb27817ca
commit 39833d7cf0
3 changed files with 35 additions and 11 deletions

View File

@@ -329,6 +329,8 @@ class Parser {
void Next();
bool IsNext(int t);
void Expect(int t);
EnumDef *LookupEnum(const std::string &id);
void ParseNamespacing(std::string *id, std::string *last);
void ParseTypeIdent(Type &type);
void ParseType(Type &type);
FieldDef &AddField(StructDef &struct_def,