Probably forking TextFormat and modifying it to your needs would be easiest.
Or you could apply the C preprocessor to your input before feeding it to
TextFormat.
On Thu, Mar 18, 2010 at 11:16 PM, nicksun wrote:
> Kenton,
>
>I don't imagine this to be an option within TextFormatter. My
> question should be reworded:
>
> What is the lowest effort method to produce something similar to
> relations within a currently defined TextFormatter ingest file? Would
> it be to extend TextFormatter or create a preprocessor that would
> evaluate basic entries and tokenize before TextFormatter runs? I
> guess it's an overall design question. I realize this is not the
> intention of ProtoBuf but the simplistic file format lends itself well
> to disseminating configuration information across many processing
> nodes.
>
>
>
> On Mar 17, 10:09 am, Kenton Varda wrote:
> > If you're asking whether text format supports expression evaluation, the
> > answer is no. Implementing this would probably add more complication to
> the
> > parser than it already has, and it would never be good enough to satisfy
> > everyone. If you need computed values, you should write code in a real
> > programming language to do the computation.
> >
> > On Mon, Mar 15, 2010 at 4:40 PM, nicksun wrote:
> > > I've been using protobuf as configuration files and status messages to
> > > deliver to various compute nodes. The thought was to eventually
> > > replace our nasty #DEFINE X_PARAM 1020 with elegantly disseminated
> > > protobuf messages read from a human readable and editable file.
> >
> > > We've gotten to the point where we're trying to determine relations
> > > between two ProtoBuf values such as the following preprocessor
> > > definition:
> >
> > > #DEFINE Y_PARAM X_PARAM*Z_PARAM
> >
> > > Is there a solution within protobuf that would allow the TextFormatter
> > > to parse the explicit message and produce the appropriate message for
> > > serialization? Thanks in advance.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Protocol Buffers" group.
> > > To post to this group, send email to proto...@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 proto...@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 proto...@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.