diff options
Diffstat (limited to 'kw.c')
| -rw-r--r-- | kw.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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; +} |
