summaryrefslogtreecommitdiff
path: root/kw.c
diff options
context:
space:
mode:
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..e3d6336
--- /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", "array", "prototype", "type",
+ "add", "subtract", "multiply", "divide", "xor",
+ "orbit", "andbit", "leftshift", "rightshift",
+ "address", "size",
+ "with", "returning", "by", "to", "than", "of", "etc",
+ "import", "call", "display", "set",
+ "if", "else", "end", "exit", "go",
+ "is", "not", "equal", "greater", "smaller", "and", "or",
+ "perform", "until",
+ "void", "byte", "halfword", "word", "long",
+ "ubyte", "uhalfword", "uword", "ulong",
+ "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;
+}