From 52a6be4089e0b995694fb8a49d7de7e5e2b2dd7f Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 1 Mar 2019 17:11:16 -0500 Subject: script to generate distinct value checker and typedef checker from small input --- defs2d.awk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 defs2d.awk (limited to 'defs2d.awk') diff --git a/defs2d.awk b/defs2d.awk new file mode 100755 index 0000000..1151185 --- /dev/null +++ b/defs2d.awk @@ -0,0 +1,16 @@ +#!/usr/bin/awk -f + +/type/ { + printf("static %s a_%s;\n\n", $2, $2); +} + +/distinct/ { + printf("static int %s[] = {\n", $2); + for (i = 3; i < NF; i++) { + #printf("#ifndef %s\n", $i); + #printf("#error %s not defined\n", $i); + #printf("#endif\n"); + printf("\t%s,\n", $i); + } + printf("};\n"); +} -- cgit v1.2.1