I have always used C macros for pretty basic things. Are C macros powerful enough to do things like :
Counting:
COUNT(a,b,c) COUNT(e,f)
-->
3 2
Taking an arbitrary number of parameters (say here up to 5) and replacing missing ones by -1:
ARRAY(a,b,c) ARRAY(e,f)
-->
const int array[5]={a,b,c,-1,-1}; const int array[5]={e,f,-1,-1,-1};
Replacing what is not a number or mathematical sign with an incrementing counter:
FORMULA(a*3+5*(b+a))
-->
array[0]*3+5*(array[1]+array[0])