You might want to consider something like GNU m4 as a preprocessor to your
config files.  I've never used it for proto files, but used it successfully
for other things -- it lets you define macros and evaluate expressions.
 See http://en.wikipedia.org/wiki/M4_(computer_language)

On Wed, Mar 17, 2010 at 10:09 AM, Kenton Varda <ken...@google.com> 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 <nick...@gmail.com> 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<protobuf%2bunsubscr...@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<protobuf%2bunsubscr...@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.

Reply via email to