ack/util/ncgg/cvtkeywords
2016-07-26 23:35:30 +02:00

26 lines
304 B
Bash
Executable file

#!/bin/sh
: '$Id$'
grep '^#' $2 >tokendefs
ed -s $1 > $3 <<'!Funky!Stuff!'
g/^#/d
1,$s/\([^ ]*\)[ ][ ]*\(.*\)/ sy_p=lookup("\1",symkeyw,newsymbol);sy_p->sy_value.syv_keywno=\2;/
1i
#include "lookup.h"
.
.r tokendefs
a
enterkeyw() {
register symbol *sy_p;
.
$a
}
.
,p
q
!Funky!Stuff!
rm tokendefs