+ Addition of scripts to generate compiler include files.
authorcarl <cecodere@yahoo.ca>
Mon, 18 Feb 2019 16:40:51 +0000 (00:40 +0800)
committercarl <cecodere@yahoo.ca>
Mon, 18 Feb 2019 16:54:23 +0000 (00:54 +0800)
util/scripts/mkalloc1.sed [new file with mode: 0644]
util/scripts/mkalloc2.sed [new file with mode: 0644]
util/scripts/mknext.sed [new file with mode: 0644]
util/scripts/mkparams.sed [new file with mode: 0644]
util/scripts/mktkfile.sed [new file with mode: 0644]

diff --git a/util/scripts/mkalloc1.sed b/util/scripts/mkalloc1.sed
new file mode 100644 (file)
index 0000000..65119c7
--- /dev/null
@@ -0,0 +1,13 @@
+s/^.*[         ]ALLOCDEF[      ].*"\(.*\)"[    ]*\([0-9][0-9]*\).*$/\
+\/* allocation definitions of struct \1 *\/\
+extern char *st_alloc();\
+extern struct \1 *h_\1;\
+#ifdef DEBUG\
+extern int cnt_\1;\
+extern char *std_alloc();\
+#define        new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\
+#else\
+#define        new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\
+#endif\
+#define        free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\
+/
diff --git a/util/scripts/mkalloc2.sed b/util/scripts/mkalloc2.sed
new file mode 100644 (file)
index 0000000..8955d20
--- /dev/null
@@ -0,0 +1,12 @@
+s/^.*[         ]STATICALLOCDEF[        ].*"\(.*\)"[    ]*\([0-9][0-9]*\).*$/\
+\/* allocation definitions of struct \1 *\/\
+extern char *st_alloc();\
+struct \1 *h_\1;\
+#ifdef DEBUG\
+int cnt_\1;\
+#define        new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\
+#else\
+#define        new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\
+#endif\
+#define        free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\
+/
\ No newline at end of file
diff --git a/util/scripts/mknext.sed b/util/scripts/mknext.sed
new file mode 100644 (file)
index 0000000..b606209
--- /dev/null
@@ -0,0 +1,4 @@
+s/^.*[         ]ALLOCDEF[      ].*"\(.*\)".*$/struct \1 *h_\1 = 0;\
+#ifdef DEBUG\
+int cnt_\1 = 0;\
+#endif/p
diff --git a/util/scripts/mkparams.sed b/util/scripts/mkparams.sed
new file mode 100644 (file)
index 0000000..77826d0
--- /dev/null
@@ -0,0 +1,9 @@
+##################################################################
+# This script is used to generate a parameter header file from 
+# the Parameters files.
+#
+# The Parameters file and this script should have UNIX line endings
+# (\n) otherwise strange issues could occur.
+#
+#################################################################
+/!File: /d
\ No newline at end of file
diff --git a/util/scripts/mktkfile.sed b/util/scripts/mktkfile.sed
new file mode 100644 (file)
index 0000000..b0ebcd8
--- /dev/null
@@ -0,0 +1,4 @@
+/{[A-Z]/!d\r
+s/.*{//\r
+s/,.*//\r
+s/.*/%token    &;/\r