Re: [protobuf] Save PB schema as a PB Message

2011-12-19 Thread Daniel Wright
This is already built in -- see
http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.compiler.parser.html
(in
particular, Parser::Parse), and
http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google.protobuf.descriptor.pb.html#
for
the schema of the output.

On Mon, Dec 19, 2011 at 5:26 PM, Steve  wrote:

> Has anyone created a new compiler "language type" that saves a PB file
> as output?  Goal is to use the PB output along actual PB messages
> files to create generic a PB message viewer/editor/creator.  Seems
> simpler then using protoc each time.
>
> An simplified PB message schema for the desired output:
>
> message MessageSchema
> {
>enum FieldType {
>INT32 = 0;
>UINT32 = 1;
>INT64 = 2;
>uiNT64 = 3;
>STRING = 4;
>ENUM = 5;
>NESTED_MESSAGE = 6;
>
>NAME_ENUM = 100;
>NAME_NESTED = 101;
>}
>
>message Field {
>required string name = 1;
>required FieldType type = 2;
>required int32 number = 3;
>}
>
>required string name = 1;  // name of message
>repeated Field fields = 2;  // list of fields in message
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Save PB schema as a PB Message

2011-12-19 Thread Steve
Has anyone created a new compiler "language type" that saves a PB file
as output?  Goal is to use the PB output along actual PB messages
files to create generic a PB message viewer/editor/creator.  Seems
simpler then using protoc each time.

An simplified PB message schema for the desired output:

message MessageSchema
{
enum FieldType {
INT32 = 0;
UINT32 = 1;
INT64 = 2;
uiNT64 = 3;
STRING = 4;
ENUM = 5;
NESTED_MESSAGE = 6;

NAME_ENUM = 100;
NAME_NESTED = 101;
}

message Field {
required string name = 1;
required FieldType type = 2;
required int32 number = 3;
}

required string name = 1;  // name of message
repeated Field fields = 2;  // list of fields in message
}

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.