File: tokenstr.sed

package info (click to toggle)
mmorph 2.3.4-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 876 kB
  • ctags: 742
  • sloc: ansic: 5,009; yacc: 1,211; lex: 417; makefile: 306; sh: 60; sed: 34; csh: 26
file content (17 lines) | stat: -rwxr-xr-x 245 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sed -f
1i\
#define FIRSTTOKEN  257\
static char *token[] = {
s/[	 ][	 ]*/ /g
/^# *define /b token
b end
: token
s/^# *define \([^ ][^ ]*\) \([0-9][0-9]*\) *$/\1/
h
s/.*/    "&",/p
: end
$i\
\    ""\
\    };
$g
$s/.*/#define LASTTOKEN &/p