From a221880faa57441e129d171a3cbc2d72480445e5 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 31 Jul 2023 21:35:13 -0700 Subject: [PATCH] add split-insns.sh --- .gitignore | 3 ++ split-insns.sh | 140 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100755 split-insns.sh diff --git a/.gitignore b/.gitignore index 6ce67a3b..2b65439b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ dist /crtl* /formal_test_temp /test-out/ +*~ +*.~[0-9]~ +*.~[0-9][0-9]~ diff --git a/split-insns.sh b/split-insns.sh new file mode 100755 index 00000000..1ef222ae --- /dev/null +++ b/split-insns.sh @@ -0,0 +1,140 @@ +#!/bin/bash +cd "$(dirname "$0")" +set -C + +function note() { + echo "$fname:$((lidx + 1)): note: $@" +} + +function warn() { + echo "$fname:$((lidx + 1)): warning: $@" >&2 +} + +function fatal() { + echo "$fname:$((lidx + 1)): fatal: $@" >&2 + exit 1 +} + +function next_line() { + line="${lines[++lidx]}" +} + +function skip_comments() { + while [[ "$line" =~ ^"