aboutsummaryrefslogtreecommitdiff
path: root/div.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-09-05 17:14:53 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2026-09-26 03:41:55 +0200
commit3c0819236e4f07c8f57aaf1ca46d0d68aa761558 (patch)
treebd8b57cf5420cabc4ec29815052df545b55026f9 /div.c
parenta3f56c76444fee090e62a59f257ed5f60b4e552b (diff)
downloadprc-3c0819236e4f07c8f57aaf1ca46d0d68aa761558.tar.gz
Move source to src/prc1
Diffstat (limited to 'div.c')
-rw-r--r--div.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/div.c b/div.c
deleted file mode 100644
index 9061ac6..0000000
--- a/div.c
+++ /dev/null
@@ -1,89 +0,0 @@
-#include "div.h"
-#include "gl.h"
-#include "im.h"
-#include "lk.h"
-#include "pr.h"
-#include "td.h"
-#include "ws.h"
-
-static const struct seq linkage =
- {(struct step[]){{ID, "linkage"}, {0}}, .fn = lk},
- types = {(struct step[]){{ID, "types"}, {0}}, .fn = td},
- imports = {(struct step[]){{ID, "imports"}, {0}}, .fn = im},
- procedure = {(struct step[]){{ID, "procedure"}, {0}}, .fn = pr};
-
-static const struct seq fnseq[] =
-{
- linkage,
- types,
- imports,
- procedure,
- {(struct step[]){{ID, "storage"}, {0}}, .fn = ws},
- {(struct step[]){{ID, "globals"}, {0}}, .fn = gl},
- {0}
-};
-
-static const struct seq imseq[] =
-{
- linkage,
- types,
- imports,
- {0}
-};
-
-static const struct seq pseq[] =
-{
- linkage,
- procedure,
- {0}
-};
-
-int div_fn(const struct lex *l, struct prv *p)
-{
- struct pos init =
- {
- .seq = fnseq,
- .stseq = fnseq,
- .step = fnseq->steps
- };
-
- if (push(&init, p))
- return -1;
-
- p->stk = p->tk;
- return 0;
-}
-
-int div_im(const struct lex *l, struct prv *p)
-{
- struct pos init =
- {
- .seq = imseq,
- .stseq = imseq,
- .step = imseq->steps
- };
-
- if (lex_eof(l, p->stk))
- return 0;
- else if (push(&init, p))
- return -1;
-
- p->stk = p->tk;
- return 1;
-}
-
-int div_p(const struct lex *l, struct prv *p)
-{
- struct pos init =
- {
- .seq = pseq,
- .stseq = pseq,
- .step = pseq->steps
- };
-
- if (push(&init, p))
- return -1;
-
- p->stk = p->tk;
- return 1;
-}