This repository has been archived by the owner on Mar 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gencdecs
executable file
·38 lines (32 loc) · 1.54 KB
/
gencdecs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/sh
#shell script for creating combs.h cmbnms.c
#needs to be run if list of combinators changes
hdr='/* file created by gencdecs - do not edit manually */'
echo "$hdr" > combs.h
echo "$hdr" > cmbnms.c
echo 'char *cmbnms[] = {' >> cmbnms.c
i=0
for c in S K Y C B CB I HD TL BODY LAST S_p U Uf U_ Ug COND EQ NEQ \
NEG AND OR NOT APPEND STEP STEPUNTIL GENSEQ MAP ZIP TAKE \
DROP FLATMAP FILTER FOLDL MERGE FOLDL1 LIST_LAST FOLDR MATCH \
MATCHINT TRY SUBSCRIPT ATLEAST P B_p C_p S1 B1 C1 ITERATE \
ITERATE1 SEQ FORCE MINUS PLUS TIMES INTDIV FDIV MOD GR GRE \
POWER CODE DECODE LENGTH ARCTAN_FN EXP_FN ENTIER_FN LOG_FN \
LOG10_FN SIN_FN COS_FN SQRT_FN FILEMODE FILESTAT GETENV EXEC WAIT \
INTEGER SHOWNUM SHOWHEX SHOWOCT SHOWSCALED SHOWFLOAT NUMVAL STARTREAD \
STARTREADBIN NB_STARTREAD READVALS NB_READ READ READBIN GETARGS Ush Ush1 KI \
G_ERROR G_ALT G_OPT G_STAR G_FBSTAR G_SYMB G_ANY G_SUCHTHAT \
G_END G_STATE G_SEQ G_RULE G_UNIT G_ZERO G_CLOSE G_COUNT \
LEX_RPT LEX_RPT1 LEX_TRY LEX_TRY_ LEX_TRY1 LEX_TRY1_ DESTREV \
LEX_COUNT LEX_COUNT0 LEX_FAIL LEX_STRING LEX_CLASS LEX_CHAR \
LEX_DOT LEX_SEQ LEX_OR LEX_RCONTEXT LEX_STAR LEX_OPT \
MKSTRICT BADCASE CONFERROR ERROR FAIL False True NIL NILS UNDEF
do
echo "#define $c (CMBASE+$i)" >> combs.h
i=`expr $i + 1`
echo \"$c\"\, >> cmbnms.c
done
echo "#define ATOMLIMIT (CMBASE+$i)" >> combs.h
echo '0};' >> cmbnms.c
#./.nextxversion
#changing .xversion causes old .x files to be discarded as obsolete