summaryrefslogtreecommitdiff
path: root/kw.c
blob: e3d63363232d6e6c758c1f89712074f275c770db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
}