aboutsummaryrefslogtreecommitdiff
path: root/kw.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-05-09 02:56:07 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2026-06-21 01:15:38 +0200
commitb25ff71bb198c227b3202ee32a8067cda413bc16 (patch)
tree41d665a87d948c10b17a853220cbcdbaeebf3672 /kw.c
downloadprc-master.tar.gz
Add project skeletonHEADmaster
Diffstat (limited to 'kw.c')
-rw-r--r--kw.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/kw.c b/kw.c
new file mode 100644
index 0000000..b9b44da
--- /dev/null
+++ b/kw.c
@@ -0,0 +1,30 @@
+#include "prv.h"
+#include <stddef.h>
+#include <string.h>
+
+static const char *kws[] =
+{
+ "function", "public",
+ "types", "storage", "linkage", "procedure", "locals", "globals",
+ "union", "struct", "constant", "alias", "prototype",
+ "add", "subtract", "multiply", "divide", "xor",
+ "bitor", "bitand", "leftshift", "rightshift",
+ "address", "size",
+ "using", "returning", "by", "to", "than", "of", "etc",
+ "imports", "call", "display", "warn", "set",
+ "if", "else", "end", "exit", "go",
+ "is", "not", "equal", "greater", "smaller", "and", "or",
+ "perform", "until",
+ "void", "byte", "halfword", "word", "long",
+ "ubyte", "uhalfword", "uword", "ulong",
+ "array", "pointer"
+};
+
+int kw(const char *s)
+{
+ for (size_t i = 0; i < sizeof kws / sizeof *kws; i++)
+ if (!strcmp(s, kws[i]))
+ return 1;
+
+ return 0;
+}