From 90f1642d95b3d5a6e992257b6132a0586ed8ce4b Mon Sep 17 00:00:00 2001 From: Wodan58 Date: Mon, 11 Sep 2023 17:37:31 +0200 Subject: [PATCH] Remove files --- src/_genrec.c | 88 ----------------------------------------------- src/_treegenrec.c | 48 -------------------------- src/_treerec.c | 42 ---------------------- 3 files changed, 178 deletions(-) delete mode 100644 src/_genrec.c delete mode 100644 src/_treegenrec.c delete mode 100644 src/_treerec.c diff --git a/src/_genrec.c b/src/_genrec.c deleted file mode 100644 index 48259f64..00000000 --- a/src/_genrec.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - module : _genrec.c - version : 1.3 - date : 09/04/23 -*/ -#ifndef _GENREC_C -#define _GENREC_C - -/** -OK 3140 (_genrec) : DDDDU [B] [T] [R1] [R2] -> ... -Executes B, if that yields true, executes T. -Else executes R1 and then [[[B] [T] [R1] R2] genrec] R2. -*/ -void _genrec_(pEnv env) -{ - int i, j, size; - unsigned size1, size2; - Node first, second, third, aggr, node; - - PARM(1, DIP); - aggr = lst_pop(env->stck); /* item on top of the stack */ - first = lst_back(aggr.u.lis); - size = lst_size(aggr.u.lis); - second = lst_at(aggr.u.lis, size - 2); - third = lst_at(aggr.u.lis, size - 3); - /* - record the jump location after the false branch - */ - size2 = lst_size(env->prog); - /* - push R2, excluding [B], [T], [R1] - */ - for (i = 0, j = lst_size(aggr.u.lis) - 3; i < j; i++) - lst_push(env->prog, lst_at(aggr.u.lis, i)); - - code(env, cons_); - code(env, cons_); - - node.u.lis = 0; - node.op = LIST_; - lst_push(env->prog, node); - - node.u.proc = _genrec_; - node.op = ANON_PRIME_; - lst_push(env->prog, node); - - node.u.lis = aggr.u.lis; - node.op = LIST_; - lst_push(env->prog, node); - /* - push R1 - */ - prog(env, third.u.lis); - /* - record the jump location before the false branch - */ - size1 = lst_size(env->prog); - /* - push the jump address onto the program stack - */ - push(env, size2); - /* - jump after the false branch of genrec - */ - code(env, jump_); - /* - push the true branch of genrec - */ - prog(env, second.u.lis); - /* - push the jump address onto the program stack - */ - push(env, size1); - /* - jump on false before the false branch - */ - code(env, fjump_); - /* - save the stack before the condition and restore it afterwards with - the condition code included. - */ - save(env, first.u.lis, 0); - /* - push the test of genrec - */ - prog(env, first.u.lis); -} -#endif diff --git a/src/_treegenrec.c b/src/_treegenrec.c deleted file mode 100644 index f99cbb9a..00000000 --- a/src/_treegenrec.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - module : _treegenrec.c - version : 1.4 - date : 09/04/23 -*/ -#ifndef _TREEGENREC_C -#define _TREEGENREC_C - -/** -OK 3150 (_treegenrec) : DDDDU T [O1] [O2] [C] -> ... -T is a tree. If T is a leaf, executes O1. -Else executes O2 and then [[[O1] [O2] C] treegenrec] C. -*/ -void _treegenrec_(pEnv env) -{ - unsigned size; - Node list, node; - - PARM(1, DIP); - list = lst_pop(env->stck); /* item on top of the stack */ - node = lst_back(env->stck); /* 2nd item on the stack */ - if (node.op == LIST_) { /* list = [[O1] [O2] C] */ - prog(env, list.u.lis); /* C */ - (void)pop(env); - (void)pop(env); - - code(env, cons_); - code(env, cons_); - - node.u.lis = 0; - node.op = LIST_; - lst_push(env->prog, node); - - node.u.proc = _treegenrec_; - node.op = ANON_PRIME_; - lst_push(env->prog, node); - - lst_push(env->prog, list); /* list = [[O1] [O2] C] */ - - size = lst_size(list.u.lis); /* list = [[O1] [O2] C] */ - list = lst_at(list.u.lis, size - 2); /* list = [O2] */ - prog(env, list.u.lis); - } else { /* list = [[O1] [O2] C] */ - list = lst_back(list.u.lis); /* list = [O1] */ - prog(env, list.u.lis); - } -} -#endif diff --git a/src/_treerec.c b/src/_treerec.c deleted file mode 100644 index 9f13063e..00000000 --- a/src/_treerec.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - module : _treerec.c - version : 1.4 - date : 09/04/23 -*/ -#ifndef _TREEREC_C -#define _TREEREC_C - -/** -OK 3160 (_treerec) : DDDU T [O] [C] -> ... -T is a tree. If T is a leaf, executes O. Else executes [[[O] C] treerec] C. -*/ -void _treerec_(pEnv env) -{ - Node list, node; - - PARM(2, DIP); - list = lst_pop(env->stck); /* item on top of the stack */ - node = lst_back(env->stck); /* 2nd item on the stack */ - if (node.op == LIST_) { /* list = [[O] C] */ - - prog(env, list.u.lis); /* C */ - (void)pop(env); - - code(env, cons_); - code(env, cons_); - - node.u.lis = 0; - node.op = LIST_; - lst_push(env->prog, node); - - node.u.proc = _treerec_; - node.op = ANON_PRIME_; - lst_push(env->prog, node); - - lst_push(env->prog, list); /* list = [[O] C] */ - } else { - list = lst_back(list.u.lis); /* list = [O] */ - prog(env, list.u.lis); - } -} -#endif