Added RPC declarations to the schema parser.

This is the first step in RPC support. Actual code generation
to follow.

Change-Id: I96c40fec3db671d100dd9eb509a71c5cbe55bfb2
Tested: on Linux.
Bug: 20122696
This commit is contained in:
Wouter van Oortmerssen
2016-03-07 18:07:10 -08:00
parent fbc8af40e3
commit 1a63eb46bb
4 changed files with 77 additions and 1 deletions

View File

@@ -306,6 +306,15 @@ struct EnumDef : public Definition {
Type underlying_type;
};
struct RPCCall {
std::string name;
StructDef *request, *response;
};
struct ServiceDef : public Definition {
SymbolTable<RPCCall> calls;
};
// Container of options that may apply to any of the source/text generators.
struct IDLOptions {
bool strict_json;
@@ -479,6 +488,7 @@ private:
FLATBUFFERS_CHECKED_ERROR StartStruct(const std::string &name,
StructDef **dest);
FLATBUFFERS_CHECKED_ERROR ParseDecl();
FLATBUFFERS_CHECKED_ERROR ParseService();
FLATBUFFERS_CHECKED_ERROR ParseProtoFields(StructDef *struct_def,
bool isextend, bool inside_oneof);
FLATBUFFERS_CHECKED_ERROR ParseProtoOption();
@@ -501,6 +511,7 @@ private:
public:
SymbolTable<StructDef> structs_;
SymbolTable<EnumDef> enums_;
SymbolTable<ServiceDef> services_;
std::vector<Namespace *> namespaces_;
std::string error_; // User readable error_ if Parse() == false