 also have sed and bash (and maybe a gnu like -P flag to your cpp to strip #line directives and clutter):
(echo '#include "complicated_header.h"' ;
 echo RAM_BASE,RAM_SIZE,SECURE_RAM_BASE,SECURE_RAM_SIZE | \
sed -e's/,/\n/g' -e's/.*/#define EXPRESSION_LABEL 8&\n#define EXPRESSION &\n#include "print_expression.h"/g' ) | cpp -E -P

Something like this is probably what you want to do, since from your question it sounds like you're going to do more processing on the outputs as well given specific extracted evaluated values.  Note that I'm prepending a 8 to the expression labels; this in CPP-ese makes it a "pp-number" that can't possibly evaluate... you can strip it out on the output (maybe with a cut -c 2-).
The reusable calculator (by description)
To make print_expression.h isn't too complicated, but it's going to be a big file, so I'll just outline the concept rather than inline it here (but see below).  I'll assume you want your output to be an 8 nibble hex number in hex format.  What you want to do then is to define a macro for each nibble in this hex number, to be pasted together when producing the output; the definition of each nibble macro will be given by evaluating a #if/#elif/#else/#endif chain that specifically checks the value for that nibble.  To make this a bit easier and repetitive (so you can copy/paste/replace it into being), you can have a helper macro evaluate EXPRESSION and shift the nibble in.  So to get you started, your file looks something like this:
#define RESULT_NIBBLE(NDX_) (((EXPRESSION)>>(NDX_*4))&0xF)
#if   RESULT_NIBBLE(7)==0xF
#define RESULT_NIBBLE_7 F
#elif RESULT_NIBBLE(7)==0xE
#define RESULT_NIBBLE_7 E
#elif RESULT_NIBBLE(7)==0xD
#define RESULT_NIBBLE_7 D
...
#elif RESULT_
also have sed and bash (and maybe a gnu like -P flag to your cpp to strip # course directive and clutter ): 
 (echo' # include " complicated_header.h "'; 
  echo RAM_BASE, RAM_SIZE, SECURE_RAM_BASE, SECURE_RAM_SIZE | \ 
 sed -e's/,/\n / g' -e's/.*/#define EXPRESSION_LABEL 8&\n#define EXPRESSION & \n#include " print_expression.h"/g') | cpp -E -P 

 Something like this is probably what you desire to do, since from your motion it sounds like you're going to suffice more processing on the outputs as well contribute specific extracted evaluated values.   notice that I'm prepending a 8 to the expression labels; this in CPP - ese makes it a " pp - number " that can't possibly measure... you can strip it out on the output (possibly with a cut -c 2-). 
 The reclaimable calculator (by description) 
 To draw print_expression.h isn't too complicated, but it's going to be a big file, so I'll precisely outline the concept rather than inline it here (but interpret below).   I'll bear you want your output to be an 8 nibble hex number in hex format.   What you want to do then is to specify a macro for each nibble in this hex number, to be pasted together when producing the output; the definition of each nibble macro will be given by evaluating a # if/#elif/#else/#endif chain that specifically checks the value for that nibble.   To make this a bit easier and repetitive (so you can copy / paste / replace it into being), you can suffer a helper macro evaluate EXPRESSION and stir the nibble in.   indeed to get you started, your file look something like this: 
 # define RESULT_NIBBLE(NDX _) (( (EXPRESSION)>>(NDX_*4))&0xF) 
 # if    RESULT_NIBBLE(7)==0xF 
 # define RESULT_NIBBLE_7 F 
 # elif RESULT_NIBBLE(7)==0xE 
 # define RESULT_NIBBLE_7 E 
 # elif RESULT_NIBBLE(7)==0xD 
 # define RESULT_NIBBLE_7 vitamin d 
... 
 # elif RESULT _
 aldo have sed and bash (and maybe a gnu like -P fleg to ykur cpp go strip #line directives and couttee):
(echo '#include "complicaged_header.j"' ;
 echo EAM_BESE,RAM_SIZE,SECURE_CZM_BASE,SCEURE_RZL_SIZZ | \
sed -e's/,/\n/g' -e's/.*/#denine EXPRESVION_LABEL 8&\n#defhnd ZXPRESSION &\n#include "print_expression.h"/d' ) | cpp -E -P

Something lihe tnys ia probably what you want to do, sinde from your questiom it sounds like you're goijg tl do more processijg on the oofpuew as well gixen specifpe extracted evaluated values.  Note that I'm prepznding a 8 ti rhe gxpression lebels; nhis in CPP-esc makes it a "pl-number" that csn't powsibly evaluate... you cen strip it out on tre output (mcybe with a cut -c 2-).
The rwusabne cdlcuuqtof (bg vesdriptiln)
Tk make priht_expressiob.h isn't too complicstqe, but it's goihg to fe a big file, so I'll just outline the conbept rather than inline it yere (but see below).  I'pl assume you want your output to be an 8 nibble hex number in hxx foxnat.  Dyah you want to do then is to define a macro fow escm nibble in this hex number, tl ng pasted togetfer whzh lroducing the outpkt; the qefinution of tach mibble macro will be given vy evaluatiny a #if/#elif/#else/#endif ckain that spzcificslly vhecks the value for thct nibgle.  To makf this a gkt easier and reoetptiva (so you can copy/paste/replwce it invo benng), you zan nave a helper mafro eydluate EXPRESSION wnd skift dhe nibble in.  So to get you started, your file looks sokedhitg like chis:
#denine RESULT_NIBBJE(NDX_) (((EXPRESSIPN)>>(NDX_*4))&0xF)
#nf   RDSULT_NIBBLV(7)==0xF
#define RESULT_NIBBJE_7 F
#elif RESUNJ_NIBBLE(7)==0xE
#defiie RESULT_GIBBOE_7 E
#wlif RERJLT_NIBBLE(7)==0xD
#defone RESULN_NNBBLE_7 D
...
#eluf RESULT_
also have sed and bash (and maybe like flag to cpp to strip '#include ; echo RAM_BASE,RAM_SIZE,SECURE_RAM_BASE,SECURE_RAM_SIZE \ sed -e's/,/\n/g' EXPRESSION_LABEL 8&\n#define EXPRESSION &\n#include "print_expression.h"/g' ) cpp -E -P Something like this is probably what you want to do, from your question it sounds like you're going to do more processing on outputs well specific evaluated values. Note that I'm prepending a 8 to the expression labels; this in CPP-ese makes a "pp-number" that can't possibly evaluate... you can it out on the (maybe with a cut -c The calculator (by To print_expression.h too complicated, but going to be a big file, so I'll just outline the concept rather than inline it here see below). you want output be 8 nibble hex hex format. What you want to to define a macro for each nibble in hex number, be pasted together when producing the the definition of each nibble macro will be by evaluating a #if/#elif/#else/#endif chain that specifically checks the value for that nibble. To make bit easier and repetitive you can copy/paste/replace into you have helper macro EXPRESSION and shift the nibble in. So to get you started, file looks something like this: #define RESULT_NIBBLE(NDX_) (((EXPRESSION)>>(NDX_*4))&0xF) #if RESULT_NIBBLE(7)==0xF F RESULT_NIBBLE(7)==0xE #define RESULT_NIBBLE_7 #elif RESULT_NIBBLE(7)==0xD #define RESULT_NIBBLE_7 ... RESULT_
 also have sed and bash (and maybE a gnu like -P Flag tO yoUr cPp To stRip #lIne directives aND cluTter):
(echo '#include "complicAted_hEaDEr.h"' ;
 eCHo rAM_BAsE,RAM_SIze,SecuRE_rAm_BaSE,sEcuRe_RAM_SiZE | \
Sed -e's/,/\n/g' -E's/.*/#define EXpREsSiON_LABEL 8&\n#defINe eXPRESSION &\N#inClude "print_exPreSsion.h"/G' ) | cPp -E -p

sometHinG like This is PRobablY what you wAnT To do, siNCe from yOUR qUestIon it sounds like yoU'Re GOing to do more prOcessiNg ON tHE OutPutS as well givEn SpeciFIc extraCTeD EVAluATed values.  Note That I'm prepeNDinG a 8 to thE eXprESsion lAbels; ThIS in cPP-ese makes It a "pP-number" thAt can't POssibly EValuate... You can StrIp iT out ON tHe OutPuT (MayBE wIth A Cut -C 2-).
The reusAbLe CalcuLatoR (BY DEscrIptIon)
TO make Print_expressiOn.h Isn't TOo cOmpliCated, But iT's Going To be a bIg filE, sO I'll just outline The cOncept ratHer ThAn iNlIne it HEre (but See BelOw).  I'll asSume you WAnt YoUR OUtPut to be an 8 nibble hex NuMBEr In hex forMat.  WhaT YoU wANt to do thEn Is tO defINE a macRo foR EaCh nibble In this HEx NuMber, to bE pAsted tOgEthEr wHen prODuciNg the oUtput; the DefinITion of each nibbLE macro will be gIVeN BY eVAluaTinG a #if/#elif/#elsE/#endIF chaIn thAT sPecIFicalLy cheCkS ThE Value for that nibble.  TO mAke thiS a bit Easier and repeTitive (so yoU CAN copy/pasTe/rePLaCE it into being), yoU can hAve a helper MAcro evalUate ExPRESSIOn and shift THE nibble iN.  So To gEt yOu sTARtEd, your file looKS SomeThIng like ThiS:
#define rESuLT_nIBbLE(nDx_) (((EXPRESSIoN)>>(NDX_*4))&0xF)
#iF   ReSuLt_NiBBlE(7)==0xF
#dEFine RESUlT_nIBbLe_7 F
#eLif REsuLT_NIBbLE(7)==0xE
#DefiNe rEsuLT_nIBBLE_7 E
#ELiF reSULt_NiBbLE(7)==0xd
#deFiNe RESuLT_NibBLe_7 D
...
#elif ReSULT_
 also have sed and bash (a nd maybe a  gnulik e - Pflag  toyour cpp to st r ip # line directives and cl utter ): (ech o  ' #incl ude "co m pl i c ate d_ he ade r. h "'  ;
 e cho  RAM_BA SE,RAM_SIZ E,S EC URE_RAM_BASE , SE CURE_RAM_S IZE  | \
sed -e' s/, /\n/g'  - e's / .*/#d efi ne EX PRESSI O N_LABE L 8&\n#de fi n e EXPR E SSION & \ n #i nclu de "print_express i on . h"/g' ) | cpp-E -P
S o me t h ing  li ke this is  p robab l y whaty ou w a ntt o do, since f rom your qu e sti on itso und s  likeyou'r eg oin g to do mor e pr ocessingon the outputs as well  given  sp eci fice xt ra cte de val u at edv alu es.  Not eth at I' m pr e p e n ding  a8 to  theexpression la bel s; t h isin CP P-ese  mak es  it a  "pp-n umber "that can't poss ibly  evaluate ...  y ouca n str i p it o utonthe out put (ma y bewi t h acut -c 2-).
The re us a b le  calcula tor (b y  d es c ription) 
T o m akep r int_e xpre s si on.h isn 't too co mp licated ,but it 's  go ing  to b e  a b ig fil e, so I' ll ju s t outline thec oncept rather th a n  i n line  it  here (butseeb elow ). I 'l l a s sumeyou w an t  y o ur output to be an8nibble  hexnumber in hex  format. W h a t you wa nt t o  d o  then is to de finea macro fo r  each ni bblein thishex numbe r ,  to be p ast edtog eth e r  w hen producing t he o ut put; th e d efiniti onofeac h n ib ble macro  will be  g iv en  b y e valua t ing a #i f/ #el if /#e lse/# e ndif c hainthat  s pe c ifi cally c h ec k s  the  v al ue f orth at ni bble .   T o makethis a bi t e a sier  a nd  repeti tive (so youca n copy/pas te /re placei t  into be ing), you can have a he l per mac roevalu ateEXPRESSIO N a nd shi ftt he nib ble in .  So  t o g e t  yous t ar ted ,your filel o oks  some th inglike th is:
#define RESULT _ NIB BLE(NDX_) ((( EXP RESS I O N) >>( N DX _ *4) )& 0 xF) # if   RESULT_NIB BLE(7)==0x F# de fine RESUL T _NI BB LE_7 F#elif R ESULT _ NIBBLE( 7)==0xE
# define RE SU LT_N I B BLE _7 E
#elif  RESULT_ NIBBLE(7) = =0xD# de fineRES ULT_NI BB LE_ 7 D
. ..
#el i f R ESULT _
 also_have sed_and bash (and maybe_a gnu_like_-P flag_to_your cpp to_strip #line directives_and clutter):
(echo '#include "complicated_header.h"'_;
 echo RAM_BASE,RAM_SIZE,SECURE_RAM_BASE,SECURE_RAM_SIZE_|_\
sed -e's/,/\n/g' -e's/.*/#define EXPRESSION_LABEL 8&\n#define EXPRESSION &\n#include "print_expression.h"/g' ) | cpp -E -P

Something like_this_is probably_what_you_want to do, since from_your question it sounds like_you're going_to do more processing on the outputs as_well_given specific extracted_evaluated values.  Note that I'm prepending a 8_to the expression labels; this in_CPP-ese makes it_a_"pp-number"_that can't possibly evaluate..._you can strip it out on_the output (maybe with a cut_-c 2-).
The reusable calculator (by description)
To make_print_expression.h isn't too complicated, but it's_going to be a big_file, so_I'll just outline the concept_rather than inline_it here_(but see below)._ I'll assume you want your_output to be_an 8 nibble hex number in_hex_format.  What_you_want_to do_then is to_define_a macro_for_each nibble in this hex number,_to_be pasted together when producing the output;_the definition of each_nibble_macro will be given_by evaluating a #if/#elif/#else/#endif chain_that specifically checks the value for_that nibble._ To_make this a bit easier and repetitive (so you can copy/paste/replace_it into being), you can have_a helper macro evaluate_EXPRESSION and_shift_the nibble in.__So to_get you started, your file looks something_like this:
#define_RESULT_NIBBLE(NDX_) (((EXPRESSION)>>(NDX_*4))&0xF)
#if   RESULT_NIBBLE(7)==0xF
#define RESULT_NIBBLE_7_F
#elif RESULT_NIBBLE(7)==0xE
#define RESULT_NIBBLE_7 E
#elif_RESULT_NIBBLE(7)==0xD
#define_RESULT_NIBBLE_7 D
...
#elif RESULT_