mktokens (935205e2307611615ed5a7fe0a32b225ffd8c19c) mktokens (22ea47ec90b51ecbe6d2883ccee30d312c162044)
1#!/bin/sh -
2
3#-
4# Copyright (c) 1991, 1993
5# The Regents of the University of California. All rights reserved.
6#
7# This code is derived from software contributed to Berkeley by
8# Kenneth Almquist.

--- 60 unchanged lines hidden (view full) ---

69TESAC 1 "esac"
70TNOT 0 "!"
71!
72nl=`wc -l $temp`
73exec > token.h
74awk '{print "#define " $1 " " NR-1}' $temp
75echo '
76/* Array indicating which tokens mark the end of a list */
1#!/bin/sh -
2
3#-
4# Copyright (c) 1991, 1993
5# The Regents of the University of California. All rights reserved.
6#
7# This code is derived from software contributed to Berkeley by
8# Kenneth Almquist.

--- 60 unchanged lines hidden (view full) ---

69TESAC 1 "esac"
70TNOT 0 "!"
71!
72nl=`wc -l $temp`
73exec > token.h
74awk '{print "#define " $1 " " NR-1}' $temp
75echo '
76/* Array indicating which tokens mark the end of a list */
77const char tokendlist[] = {'
77static const char tokendlist[] = {'
78awk '{print "\t" $2 ","}' $temp
79echo '};
80
78awk '{print "\t" $2 ","}' $temp
79echo '};
80
81const char *const tokname[] = {'
81static const char *const tokname[] = {'
82sed -e 's/"/\\"/g' \
83 -e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \
84 $temp
85echo '};
86'
87sed 's/"//g' $temp | awk '
88/TIF/{print "#define KWDOFFSET " NR-1; print ""; print "const char *const parsekwd[] = {"}
89/TIF/,/neverfound/{print " \"" $3 "\","}'
90echo ' 0
91};'
92
93rm $temp
82sed -e 's/"/\\"/g' \
83 -e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \
84 $temp
85echo '};
86'
87sed 's/"//g' $temp | awk '
88/TIF/{print "#define KWDOFFSET " NR-1; print ""; print "const char *const parsekwd[] = {"}
89/TIF/,/neverfound/{print " \"" $3 "\","}'
90echo ' 0
91};'
92
93rm $temp