I would like to take the following Sequence of Tuples:

((A, 1)) ((B, 1)) ((C, 1)) ((D, 2)) ((E, 4))

and create a summation as follows:

((A, 0)) ((B, 1)) ((C, 2)) ((D, 3)) ((E, 5))

I've been able to produce the following summation:

((A, 1)) ((B, 2)) ((C, 3)) ((D, 5)) ((E, 9))

Which is close to correct but is shifted.  No matter what I try, I can't create the desired result.  It seems the preprocessor library just doesn't have enough power to do the job, but maybe there's a way to do this I can't see. 

For those interested, the input represents member variables and their respective sizes.  The output is member variables and their respective offsets within the struct (byte aligned in the example case).  The ultimate goal is to generate some test case code, so feel free to suggest a non-preprocessor way to do the same thing. 
 
As an aside, I get warnings in the case where there is only 1 Tuple in the Sequence ((A, 1)).  It would be nice to solve this too. 
 
Thanks
 
email: <pdx247@yahoo.com>