diff options
Diffstat (limited to 'src/mktokens')
-rw-r--r-- | src/mktokens | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mktokens b/src/mktokens index 7c873af..cd52241 100644 --- a/src/mktokens +++ b/src/mktokens @@ -71,13 +71,16 @@ TEND 1 "}" nl=`wc -l /tmp/ka$$` exec > token.h awk '{print "#define " $1 " " NR-1}' /tmp/ka$$ + +exec > token_vars.h + echo ' /* Array indicating which tokens mark the end of a list */ -const char tokendlist[] = {' +static const char tokendlist[] = {' awk '{print "\t" $2 ","}' /tmp/ka$$ echo '}; -const char *const tokname[] = {' +static const char *const tokname[] = {' sed -e 's/"/\\"/g' \ -e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \ /tmp/ka$$ @@ -85,7 +88,7 @@ echo '}; ' sed 's/"//g' /tmp/ka$$ | awk ' /TNOT/{print "#define KWDOFFSET " NR-1; print ""; - print "STATIC const char *const parsekwd[] = {"} + print "static const char *const parsekwd[] = {"} /TNOT/,/neverfound/{if (last) print " \"" last "\","; last = $3} END{print " \"" last "\"\n};"}' |