ack/util/ceg/EM_parser/common/eval.c

25 lines
397 B
C
Raw Normal View History

1987-11-20 11:12:07 +00:00
#include <ctype.h>
#include "decl.h"
eval( str)
char *str;
1987-12-18 12:17:56 +00:00
/* Output 'str' and replace in it all $i occurances by the corrresponding
* parameter-names, converted where necessary.
*/
1987-11-20 11:12:07 +00:00
{
register char c;
int i;
for ( c = *str++; c != '\0'; c= *str++)
if ( c == '$' && isdigit( *str)) {
i = *str++ - '0' - 1;
out( "%s", C_instr_info->arg_conv[i]);
}
else
out( "%c", c);
}