5 # Allows tokens to be written as `literal` and then automatically
6 # substituted with #defined tokens.
9 # yyacc file.y filetab.h file.yy
12 # file.yy yacc grammar with ` literals
16 # filetab.h array of string <-> token mappings
18 # 03-13-93 - Documented and p moved in sed command (for some reason,
19 # s/x/y/p doesn't work).
20 # 10-12-93 - Take basename as second argument.
21 # 12-31-96 - reversed order of args to be compatible with GenFile rule
22 # 03/19/02 (seiwald) - suffix symbols with _t to avoid conflicts
28 out
=`basename $in .yy`
37 s/[^`]*`\([^`]*\)`.*/\1/
44 ' $in |
sort -u |
sed '
46 y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
76 s:^\(.*\) \(.*\)$:s/`\2`/\1/g:
84 #sed 's:^\(.*\) \(.*\)$:%token \1:' $T.1
89 sed 's:^\(.*\) \(.*\)$: { "\2", \1 },:' $T.1