Pristine Ack-5.5
[Ack-5.5.git] / util / ceg / EM_parser / common / eval.c
1 #include <ctype.h>
2 #include "decl.h"
3
4
5 eval( str)
6 char *str;
7
8 /* Output 'str' and replace in it all $i occurances by the corrresponding
9  * parameter-names, converted where necessary.
10  */
11 {
12         register char c;
13         int i;
14
15         for ( c = *str++; c != '\0'; c= *str++)
16                 if ( c == '$' && isdigit( *str)) {
17
18                         i = *str++ - '0' - 1;
19                         
20                         out( "%s", C_instr_info->arg_conv[i]);
21                 }
22                 else
23                         out( "%c", c);
24 }