Added .proto parsing and convertion to .fbs.

Bug: 15777858
Change-Id: Iabef9b8c8044e593bb89510feebdee00d2f1840b
Tested: on Linux and Windows.
This commit is contained in:
Wouter van Oortmerssen
2014-09-26 16:46:30 -07:00
parent 18cf19f876
commit d38b9af243
15 changed files with 461 additions and 110 deletions

View File

@@ -0,0 +1,32 @@
// Generated from test.proto
namespace proto.test;
enum ProtoEnum : short {
FOO = 1,
BAR = 5,
}
table OtherMessage {
a:double;
b:float = 3.14149;
}
table ProtoMessage {
c:int = 16;
d:long;
p:uint;
e:ulong;
f:int = -1;
g:long;
h:uint;
q:ulong;
i:int;
j:long;
k:bool;
l:string (required);
m:string;
n:OtherMessage;
o:[string];
}

View File

@@ -0,0 +1,34 @@
// Sample .proto file that we can translate to the corresponding .fbs.
package proto.test;
option some_option = is_ignored;
import "some_other_schema.proto";
enum ProtoEnum {
FOO = 1;
BAR = 5;
}
message OtherMessage {
optional double a = 26;
optional float b = 32 [default = 3.14149];
}
message ProtoMessage {
optional int32 c = 12 [default = 16];
optional int64 d = 1 [default = 0];
optional uint32 p = 1;
optional uint64 e = 2;
optional sint32 f = 3 [default = -1];
optional sint64 g = 4;
optional fixed32 h = 5;
optional fixed64 q = 6;
optional sfixed32 i = 7;
optional sfixed64 j = 8;
optional bool k = 9;
required string l = 10;
optional bytes m = 11;
optional OtherMessage n = 12;
repeated string o = 14;
}