On Wed, Mar 9, 2011 at 1:49 PM, mdonohue <michael.dono...@gmail.com> wrote:

> My goal is to port Google's libphonenumber to java-me, so I can use it
> on a BlackBerry.   The current subgoal is to get a Protocol Buffer
> compiler for java-me that is suitable for porting libphonenumber.
> There are four existing libraries mentioned on the wiki.  I've tried
> two of them that appeared to have recent development, but ran into
> trouble.
>
> protobuf-j2me on Google Code required a significant number of extra
> tools to be installed just to build it.  Since I am willing to use
> java to target java-me, I was a little put off by the requirement to
> use python, and install a whole tool management system in the form of
> 'gyp'
> I wasn't able to successfully build this project on my windows box.
>
> protobuf-j2me on github.   It appears this is the same as the other
> protobuf-j2me listed above.   Why are both listed on the wiki?
>
> protobuf-javame on Google Code appears to be a pure java
> implementation.   I was able to run the compiler on my windows box,
> but it doesn't support comments or default values in the .proto file,
> I get the impression that those are more recent additions to the
> protocol buffers spec.   After pruning those parts out of the
> libphonenumber proto files, I also found that this compiler doesn't
> offer a way to copy protocol buffer message objects, and all the
> fields are immutable.  Both of those conflict with libphonenumber's
> use of protocolbuffer messages.  I looked at fixing the parser to
> support more recent versions of protocol buffers, but discovered it
> was primarily driven by inscrutable regex patterns.
>
> swingme on Sourceforge appeared a little too generic to me.  It says
> "This is a 'bastardized' version of Google Protocol Buffers that
> allows for Anonymous Objects."   so I didn't even try it, since I want
> to use the real thing.
>
> It looks like I need to write my own java-me target for Protocol
> Buffers.   I would like it to be a self contained java codebase, so it
> seems antlr + stringtemplate are the right tools here.

Those are the exact tools used by protostuff.
It has an existing "java bean" output (simple mutable pojos w/ support for
cyclic references).
If that doesn't fit your bill, you can make a customized generator output
(or extend existing ones) using stringtemplate.
See http://code.google.com/p/protostuff/wiki/WritingCustomCodeGenerators


> I am looking
> for a EBNF style specification of the .proto file, but I can't seem to
> find one.  I see the documentation, which covers many examples, but I
> want an actual spec for the file.
>
> I found some pretty detailed information on this prolog page --
> http://www.swi-prolog.org/pldoc/package/protobufs.html -- a lot of the
> text appears to have been written by Google in fact.  There are
> referenced to the protocol buffers spec, too.   But I am having
> trouble finding something similar on the protocol buffers site.    So
> where do I find the spec?
>
>
> --
> 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.
>
>


-- 
When the cat is away, the mouse is alone.
- David Yu

-- 
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.

Reply via email to