/*
 Copyright (c) 2014-2021, Alessandro Gatti - frob.it
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

 1. Redistributions of source code must retain the above copyright notice, this
 list of conditions and the following disclaimer.

 2. Redistributions in binary form must reproduce the above copyright notice,
 this list of conditions and the following disclaimer in the documentation
 and/or other materials provided with the distribution.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * BASIC 1.0 tokens lookup table.
 */
static const char *const Basic10Tokens[256] = {
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    "END",    "FOR",    "NEXT", "DATA", "INPUT#",  "INPUT",  "DIM",    "READ",
    "LET",    "GOTO",   "RUN",  "IF",   "RESTORE", "GOSUB",  "RETURN", "REM",
    "STOP",   "ON",     "WAIT", "LOAD", "SAVE",    "VERIFY", "DEF",    "POKE",
    "PRINT#", "PRINT",  "CONT", "LIST", "CLR",     "CMD",    "SYS",    "OPEN",
    "CLOSE",  "GET",    "NEW",  "TAB(", "TO",      "FN",     "SPC(",   "THEN",
    "NOT",    "STEP",   "+",    "-",    "*",       "/",      "^",      "AND",
    "OR",     ">",      "=",    "<",    "SGN",     "INT",    "ABS",    "USR",
    "FRE",    "POS",    "SQR",  "RND",  "LOG",     "EXP",    "COS",    "SIN",
    "TAN",    "ATN",    "PEEK", "LEN",  "STR$",    "VAL",    "ASC",    "CHR$",
    "LEFT$",  "RIGHT$", "MID$", NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     "PI"};

/**
 * BASIC 2.0 tokens lookup table.
 */
static const char *const Basic20Tokens[256] = {
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    "END",    "FOR",    "NEXT", "DATA", "INPUT#",  "INPUT",  "DIM",    "READ",
    "LET",    "GOTO",   "RUN",  "IF",   "RESTORE", "GOSUB",  "RETURN", "REM",
    "STOP",   "ON",     "WAIT", "LOAD", "SAVE",    "VERIFY", "DEF",    "POKE",
    "PRINT#", "PRINT",  "CONT", "LIST", "CLR",     "CMD",    "SYS",    "OPEN",
    "CLOSE",  "GET",    "NEW",  "TAB(", "TO",      "FN",     "SPC(",   "THEN",
    "NOT",    "STEP",   "+",    "-",    "*",       "/",      "^",      "AND",
    "OR",     ">",      "=",    "<",    "SGN",     "INT",    "ABS",    "USR",
    "FRE",    "POS",    "SQR",  "RND",  "LOG",     "EXP",    "COS",    "SIN",
    "TAN",    "ATN",    "PEEK", "LEN",  "STR$",    "VAL",    "ASC",    "CHR$",
    "LEFT$",  "RIGHT$", "MID$", "GO",   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     "PI"};

/**
 * BASIC 2.0 with Turtle Basic 1.0 extension tokens lookup table.
 */
static const char *const Basic20TurtleBasic10Tokens[256] = {
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      "END",    "FOR",    "NEXT",   "DATA",   "INPUT#",
    "INPUT",   "DIM",     "READ",   "LET",    "GOTO",   "RUN",    "IF",
    "RESTORE", "GOSUB",   "RETURN", "REM",    "STOP",   "ON",     "WAIT",
    "LOAD",    "SAVE",    "VERIFY", "DEF",    "POKE",   "PRINT#", "PRINT",
    "CONT",    "LIST",    "CLR",    "CMD",    "SYS",    "OPEN",   "CLOSE",
    "GET",     "NEW",     "TAB(",   "TO",     "FN",     "SPC(",   "THEN",
    "NOT",     "STEP",    "+",      "-",      "*",      "/",      "^",
    "AND",     "OR",      ">",      "=",      "<",      "SGN",    "INT",
    "ABS",     "USR",     "FRE",    "POS",    "SQR",    "RND",    "LOG",
    "EXP",     "COS",     "SIN",    "TAN",    "ATN",    "PEEK",   "LEN",
    "STR$",    "VAL",     "ASC",    "CHR$",   "LEFT$",  "RIGHT$", "MID$",
    "GO",      "GRAPHIC", "OLD",    "TURN",   "PEN",    "DRAW",   "MOVE",
    "POINT",   "KILL",    "WRITE",  "REPEAT", "SCREEN", "DOKE",   "RELOC",
    "FILL",    "RTIME",   "BASE",   "PAUSE",  "POP",    "COLOR",  "MERGE",
    "CHAR",    "TAKE",    "SOUND",  "VOL",    "PUT",    "PLACE",  "CLS",
    "ACCEPT",  "RESET",   "GRAB",   "RDOT",   "PLR$",   "DEEK",   "JOY",
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,     "PI"};

/**
 * BASIC 2.0 with BASIC 4.0 expansion tokens lookup table (C64).
 */
static const char *const Basic20Basic40C64ExpansionTokens[256] = {
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        "END",    "FOR",     "NEXT",   "DATA",    "INPUT#",
    "INPUT",   "DIM",       "READ",   "LET",     "GOTO",   "RUN",     "IF",
    "RESTORE", "GOSUB",     "RETURN", "REM",     "STOP",   "ON",      "WAIT",
    "LOAD",    "SAVE",      "VERIFY", "DEF",     "POKE",   "PRINT#",  "PRINT",
    "CONT",    "LIST",      "CLR",    "CMD",     "SYS",    "OPEN",    "CLOSE",
    "GET",     "NEW",       "TAB(",   "TO",      "FN",     "SPC(",    "THEN",
    "NOT",     "STEP",      "+",      "-",       "*",      "/",       "^",
    "AND",     "OR",        ">",      "=",       "<",      "SGN",     "INT",
    "ABS",     "USR",       "FRE",    "POS",     "SQR",    "RND",     "LOG",
    "EXP",     "COS",       "SIN",    "TAN",     "ATN",    "PEEK",    "LEN",
    "STR$",    "VAL",       "ASC",    "CHR$",    "LEFT$",  "RIGHT$",  "MID$",
    "GO",      "CONCAT",    "DOPEN",  "DCLOSE",  "RECORD", "HEADER",  "COLLECT",
    "BACKUP",  "COPY",      "APPEND", "DSAVE",   "DLOAD",  "CATALOG", "RENAME",
    "SCRATCH", "DIRECTORY", "COLOR",  "COLD",    "KEY",    "DVERIFY", "DELETE",
    "AUTO",    "MERGE",     "OLD",    "MONITOR", NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     "PI"};

/**
 * BASIC 2.0 with BASIC 4.0 expansion tokens lookup table (VIC-20).
 */
static const char *const Basic20Basic40VIC20ExpansionTokens[256] = {
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      "END",       "FOR",    "NEXT",   "DATA",
    "INPUT#",  "INPUT",   "DIM",       "READ",   "LET",    "GOTO",
    "RUN",     "IF",      "RESTORE",   "GOSUB",  "RETURN", "REM",
    "STOP",    "ON",      "WAIT",      "LOAD",   "SAVE",   "VERIFY",
    "DEF",     "POKE",    "PRINT#",    "PRINT",  "CONT",   "LIST",
    "CLR",     "CMD",     "SYS",       "OPEN",   "CLOSE",  "GET",
    "NEW",     "TAB(",    "TO",        "FN",     "SPC(",   "THEN",
    "NOT",     "STEP",    "+",         "-",      "*",      "/",
    "^",       "AND",     "OR",        ">",      "=",      "<",
    "SGN",     "INT",     "ABS",       "USR",    "FRE",    "POS",
    "SQR",     "RND",     "LOG",       "EXP",    "COS",    "SIN",
    "TAN",     "ATN",     "PEEK",      "LEN",    "STR$",   "VAL",
    "ASC",     "CHR$",    "LEFT$",     "RIGHT$", "MID$",   "GO",
    "CONCAT",  "DOPEN",   "DCLOSE",    "RECORD", "HEADER", "COLLECT",
    "BACKUP",  "COPY",    "APPEND",    "DSAVE",  "DLOAD",  "CATALOG",
    "RENAME",  "SCRATCH", "DIRECTORY", "IEEE",   "SERIAL", "PARALLEL",
    "MONITOR", "MODEM",   NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        "PI"};

/**
 * BASIC 2.0 with BASIC 5.0 expansion tokens lookup table (VIC-20).
 */
static const char *const Basic20Basic50ExpansionTokens[256] = {
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       "END",       "FOR",     "NEXT",    "DATA",
    "INPUT#", "INPUT",    "DIM",       "READ",    "LET",     "GOTO",
    "RUN",    "IF",       "RESTORE",   "GOSUB",   "RETURN",  "REM",
    "STOP",   "ON",       "WAIT",      "LOAD",    "SAVE",    "VERIFY",
    "DEF",    "POKE",     "PRINT#",    "PRINT",   "CONT",    "LIST",
    "CLR",    "CMD",      "SYS",       "OPEN",    "CLOSE",   "GET",
    "NEW",    "TAB(",     "TO",        "FN",      "SPC(",    "THEN",
    "NOT",    "STEP",     "+",         "-",       "*",       "/",
    "^",      "AND",      "OR",        ">",       "=",       "<",
    "SGN",    "INT",      "ABS",       "USR",     "FRE",     "POS",
    "SQR",    "RND",      "LOG",       "EXP",     "COS",     "SIN",
    "TAN",    "ATN",      "PEEK",      "LEN",     "STR$",    "VAL",
    "ASC",    "CHR$",     "LEFT$",     "RIGHT$",  "MID$",    "GO",
    "CONCAT", "DOPEN",    "DCLOSE",    "RECORD",  "HEADER",  "COLLECT",
    "BACKUP", "COPY",     "APPEND",    "DSAVE",   "DLOAD",   "CATALOG",
    "RENAME", "SCRATCH",  "DIRECTORY", "DVERIFY", "MONITOR", "REPEAT",
    "BELL",   "COMMANDS", "RENEW",     "`",       "KEY",     "AUTO",
    "OFF",    NULL,       "MERGE",     "COLOR",   "MEM",     "ENTER",
    "DELETE", "FIND",     "NUMBER",    "ELSE",    "CALL",    "GRAPHIC",
    "ALPHA",  "DMERGE",   NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        NULL,      NULL,      NULL,
    NULL,     NULL,       NULL,        "PI"};

/**
 * BASIC 2.0 with Speech Basic 2.7 extension tokens lookup table.
 */
static const char *const Basic20SpeechBasic27Tokens[256] = {
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     "END",    "FOR",    "NEXT",   "DATA",   "INPUT#",
    "INPUT",   "DIM",    "READ",   "LET",    "GOTO",   "RUN",    "IF",
    "RESTORE", "GOSUB",  "RETURN", "REM",    "STOP",   "ON",     "WAIT",
    "LOAD",    "SAVE",   "VERIFY", "DEF",    "POKE",   "PRINT#", "PRINT",
    "CONT",    "LIST",   "CLR",    "CMD",    "SYS",    "OPEN",   "CLOSE",
    "GET",     "NEW",    "TAB(",   "TO",     "FN",     "SPC(",   "THEN",
    "NOT",     "STEP",   "+",      "-",      "*",      "/",      "^",
    "AND",     "OR",     ">",      "=",      "<",      "SGN",    "INT",
    "ABS",     "USR",    "FRE",    "POS",    "SQR",    "RND",    "LOG",
    "EXP",     "COS",    "SIN",    "TAN",    "ATN",    "PEEK",   "LEN",
    "STR$",    "VAL",    "ASC",    "CHR$",   "LEFT$",  "RIGHT$", "MID$",
    "GO",      "RESET",  "BASIC",  "HELP",   "KEY",    "HIMEM",  "DISK",
    "DIR",     "BLOAD",  "BSAVE",  "MAP",    "MEM",    "PAUSE",  "BLOCK",
    "HEAR",    "RECORD", "PLAY",   "VOLDEF", "COLDEF", "HEX",    "DEZ",
    "SCREEN",  "EXEC",   "MON",    "←",      "FROM",   "SPEED",  "OFF",
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     "PI"};

/**
 * BASIC 2.0 with @Basic extension tokens lookup table.
 */
static const char *const Basic20AtbasicTokens[256] = {
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      "END",     "FOR",     "NEXT",      "DATA",
    "INPUT#",   "INPUT",   "DIM",     "READ",    "LET",       "GOTO",
    "RUN",      "IF",      "RESTORE", "GOSUB",   "RETURN",    "REM",
    "STOP",     "ON",      "WAIT",    "LOAD",    "SAVE",      "VERIFY",
    "DEF",      "POKE",    "PRINT#",  "PRINT",   "CONT",      "LIST",
    "CLR",      "CMD",     "SYS",     "OPEN",    "CLOSE",     "GET",
    "NEW",      "TAB(",    "TO",      "FN",      "SPC(",      "THEN",
    "NOT",      "STEP",    "+",       "-",       "*",         "/",
    "^",        "AND",     "OR",      ">",       "=",         "<",
    "SGN",      "INT",     "ABS",     "USR",     "FRE",       "POS",
    "SQR",      "RND",     "LOG",     "EXP",     "COS",       "SIN",
    "TAN",      "ATN",     "PEEK",    "LEN",     "STR$",      "VAL",
    "ASC",      "CHR$",    "LEFT$",   "RIGHT$",  "MID$",      "GO",
    "TRACE",    "DELETE",  "AUTO",    "OLD",     "DUMP",      "FIND",
    "RENUMBER", "DLOAD",   "DSAVE",   "DVERIFY", "DIRECTORY", "CATALOG",
    "SCRATCH",  "COLLECT", "RENAME",  "COPY",    "BACKUP",    "DISK",
    "HEADER",   "APPEND",  "MERGE",   "MLOAD",   "MVERIFY",   "MSAVE",
    "KEY",      "BASIC",   "RESET",   "EXIT",    "ENTER",     "DOKE",
    "SET",      "HELP",    "SCREEN",  "LOMEM",   "HIMEM",     "COLOUR",
    "TYPE",     "TIME",    "DEEK",    "HEX$",    "BIN$",      "OFF",
    "ALARM",    NULL,      NULL,      NULL,      NULL,        NULL,
    NULL,       NULL,      NULL,      "PI"};

/**
 * BASIC 2.0 with Final Cartdrige 3 extension tokens lookup table.
 */
static const char *const Basic20FC3Tokens[256] = {
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     "END",     "FOR",     "NEXT",   "DATA",    "INPUT#",
    "INPUT",   "DIM",    "READ",    "LET",     "GOTO",   "RUN",     "IF",
    "RESTORE", "GOSUB",  "RETURN",  "REM",     "STOP",   "ON",      "WAIT",
    "LOAD",    "SAVE",   "VERIFY",  "DEF",     "POKE",   "PRINT#",  "PRINT",
    "CONT",    "LIST",   "CLR",     "CMD",     "SYS",    "OPEN",    "CLOSE",
    "GET",     "NEW",    "TAB(",    "TO",      "FN",     "SPC(",    "THEN",
    "NOT",     "STEP",   "+",       "-",       "*",      "/",       "^",
    "AND",     "OR",     ">",       "=",       "<",      "SGN",     "INT",
    "ABS",     "USR",    "FRE",     "POS",     "SQR",    "RND",     "LOG",
    "EXP",     "COS",    "SIN",     "TAN",     "ATN",    "PEEK",    "LEN",
    "STR$",    "VAL",    "ASC",     "CHR$",    "LEFT$",  "RIGHT$",  "MID$",
    "GO",      "OFF",    "AUTO",    "DEL",     "RENUM",  "?ERROR?", "FIND",
    "OLD",     "DLOAD",  "DVERIFY", "DSAVE",   "APPEND", "DAPPEND", "DOS",
    "KILL",    "MON",    "PDIR",    "PLIST",   "BAR",    "DESKTOP", "DUMP",
    "ARRAY",   "MEM",    "TRACE",   "REPLACE", "ORDER",  "PACK",    "UNPACK",
    "MREAD",   "MWRITE", NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,     NULL,      NULL,
    NULL,      NULL,     NULL,      "PI"};

/**
 * BASIC 2.0 with Ultrabasic-64 extension tokens lookup table.
 */
static const char *const Basic20Ultrabasic64Tokens[256] = {
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     "END",    "FOR",   "NEXT",  "DATA",   "INPUT#",
    "INPUT",   "DIM",    "READ",   "LET",   "GOTO",  "RUN",    "IF",
    "RESTORE", "GOSUB",  "RETURN", "REM",   "STOP",  "ON",     "WAIT",
    "LOAD",    "SAVE",   "VERIFY", "DEF",   "POKE",  "PRINT#", "PRINT",
    "CONT",    "LIST",   "CLR",    "CMD",   "SYS",   "OPEN",   "CLOSE",
    "GET",     "NEW",    "TAB(",   "TO",    "FN",    "SPC(",   "THEN",
    "NOT",     "STEP",   "+",      "-",     "*",     "/",      "^",
    "AND",     "OR",     ">",      "=",     "<",     "SGN",    "INT",
    "ABS",     "USR",    "FRE",    "POS",   "SQR",   "RND",    "LOG",
    "EXP",     "COS",    "SIN",    "TAN",   "ATN",   "PEEK",   "LEN",
    "STR$",    "VAL",    "ASC",    "CHR$",  "LEFT$", "RIGHT$", "MID$",
    "GO",      "DOT",    "DRAW",   "BOX",   "TIC",   "COPY",   "SPRITE",
    "OFF",     "MODE",   "NORM",   "GRAPH", "DUMP",  "GREAD",  "CHAR",
    "PLACE",   "MULTI",  "HIRES",  "HEX",   "BIT",   "COLORS", "PIXEL",
    "FILL",    "CIRCLE", "BLOCK",  "SDATA", "VOL",   "GEN",    "SCOLL",
    "BCOLL",   "JOY",    "PADDLE", "PEN",   "SOUND", "TUNE",   "TDATA",
    "SET",     "TURNTO", "TURN",   "TUP",   "TDOWN", "TCOLOR", "TURTLE",
    "MOVE",    "BYE",    "ROTATE", "TPOS",  "CTR",   "SCTR",   "[",
    "]",       "HARD",   "EXIT",   "PI"};

/**
 * BASIC 2.0 with GraphicsBasic extension tokens lookup table.
 */
static const char *const Basic20GraphicsBasicTokens[256] = {
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        NULL,        NULL,      NULL,     NULL,
    NULL,         NULL,        "END",       "FOR",     "NEXT",   "DATA",
    "INPUT#",     "INPUT",     "DIM",       "READ",    "LET",    "GOTO",
    "RUN",        "IF",        "RESTORE",   "GOSUB",   "RETURN", "REM",
    "STOP",       "ON",        "WAIT",      "LOAD",    "SAVE",   "VERIFY",
    "DEF",        "POKE",      "PRINT#",    "PRINT",   "CONT",   "LIST",
    "CLR",        "CMD",       "SYS",       "OPEN",    "CLOSE",  "GET",
    "NEW",        "TAB(",      "TO",        "FN",      "SPC(",   "THEN",
    "NOT",        "STEP",      "+",         "-",       "*",      "/",
    "^",          "AND",       "OR",        ">",       "=",      "<",
    "SGN",        "INT",       "ABS",       "USR",     "FRE",    "POS",
    "SQR",        "RND",       "LOG",       "EXP",     "COS",    "SIN",
    "TAN",        "ATN",       "PEEK",      "LEN",     "STR$",   "VAL",
    "ASC",        "CHR$",      "LEFT$",     "RIGHT$",  "MID$",   "GO",
    "BACKGROUND", "BORDER",    "DIR",       "DISK",    "FILL",   "KEY",
    "CIRCLE",     "PROCEDURE", "DOT",       "FIND",    "CHANGE", "REN",
    "ELSE",       "COPY",      "SCROLL",    "ROLL",    "BOX",    "SCALE",
    "DO",         "LINE",      "SPRITE",    "COLOR",   "HIRES",  "CLEAR",
    "TEXT",       "WINDOW",    "OFF",       "AT",      "SHAPE",  "XYSIZE",
    "SPEED",      "FROM",      "SETORIGIN", "ANIMATE", "MULTI",  "EZE",
    "MOVE",       "UNDER",     "EDIT",      "RESET",   "XPOS",   "GPRINT",
    "VOICE",      "ADSR",      "WAVE",      "NE",      "VOLUME", "PLAY",
    "YPOS",       "SOUND",     "JOY",       "PI"};

/**
 * BASIC 2.0 with WS Basic extension tokens lookup table.
 */
static const char *const Basic20WSBasicTokens[256] = {
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     "END",    "FOR",   "NEXT",  "DATA",   "INPUT#",
    "INPUT",   "DIM",    "READ",   "LET",   "GOTO",  "RUN",    "IF",
    "RESTORE", "GOSUB",  "RETURN", "REM",   "STOP",  "ON",     "WAIT",
    "LOAD",    "SAVE",   "VERIFY", "DEF",   "POKE",  "PRINT#", "PRINT",
    "CONT",    "LIST",   "CLR",    "CMD",   "SYS",   "OPEN",   "CLOSE",
    "GET",     "NEW",    "TAB(",   "TO",    "FN",    "SPC(",   "THEN",
    "NOT",     "STEP",   "+",      "-",     "*",     "/",      "^",
    "AND",     "OR",     ">",      "=",     "<",     "SGN",    "INT",
    "ABS",     "USR",    "FRE",    "POS",   "SQR",   "RND",    "LOG",
    "EXP",     "COS",    "SIN",    "TAN",   "ATN",   "PEEK",   "LEN",
    "STR$",    "VAL",    "ASC",    "CHR$",  "LEFT$", "RIGHT$", "MID$",
    "GO",      "COPY",   "OLD",    "PORT",  "DOKE",  "VPOKE",  "FILL",
    "ERROR",   "SEND",   "CALL",   "BIT",   "DIR",   "BLOAD",  "BSAVE",
    "FIND",    "SPEED",  "PITCH",  "SAY",   "FAST",  "SLOW",   "TALK",
    "SHUTUP",  "STASH",  "FETCH",  "SWAP",  "OFF",   "SCREEN", "DEVICE",
    "OBJECT",  "VSTASH", "VFETCH", "QUIET", "COLOR", "CLS",    "CURPOS",
    "MONITOR", "SUBEND", "DO",     "LOOP",  "EXIT",  "DEEK",   "RSC",
    "RSM",     "DEC",    "HEX$",   "HI",    "LO",    "DS$",    "LINE",
    "VPEEK",   "ROW",    "JOY",    "PI"};

/**
 * BASIC 2.0 with WS Basic Final extension tokens lookup table.
 */
static const char *const Basic20WSBasicFinalTokens[256] = {
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,      NULL,
    NULL,      NULL,     "END",    "FOR",   "NEXT",  "DATA",    "INPUT#",
    "INPUT",   "DIM",    "READ",   "LET",   "GOTO",  "RUN",     "IF",
    "RESTORE", "GOSUB",  "RETURN", "REM",   "STOP",  "ON",      "WAIT",
    "LOAD",    "SAVE",   "VERIFY", "DEF",   "POKE",  "PRINT#",  "PRINT",
    "CONT",    "LIST",   "CLR",    "CMD",   "SYS",   "OPEN",    "CLOSE",
    "GET",     "NEW",    "TAB(",   "TO",    "FN",    "SPC(",    "THEN",
    "NOT",     "STEP",   "+",      "-",     "*",     "/",       "^",
    "AND",     "OR",     ">",      "=",     "<",     "SGN",     "INT",
    "ABS",     "USR",    "FRE",    "POS",   "SQR",   "RND",     "LOG",
    "EXP",     "COS",    "SIN",    "TAN",   "ATN",   "PEEK",    "LEN",
    "STR$",    "VAL",    "ASC",    "CHR$",  "LEFT$", "RIGHT$",  "MID$",
    "GO",      "COPY",   "BANK",   "OLD",   "DOKE",  "DISPLAY", "FILL",
    "ERROR",   "SEND",   "CALL",   "BIT",   "DIR",   "BLOAD",   "BSAVE",
    "FIND",    "SPEED",  "PITCH",  "SAY",   "FAST",  "SLOW",    "TALK",
    "SHUTUP",  "STASH",  "FETCH",  "SWAP",  "OFF",   "MODE",    "DEVICE",
    "OBJECT",  "VSTASH", "VFETCH", "LATCH", "COLOR", "CLS",     "CURPOS",
    "MONITOR", "SUBEND", "DO",     "LOOP",  "EXIT",  "DEEK",    "COL",
    "RSM",     "DEC",    "HEX$",   "HI",    "LO",    "DS$",     "LINE",
    "BNK",     "YPOS",   "JOY",    "PI"};

/**
 * BASIC 2.0 with Pegasus Basic 4.0 extension tokens lookup table.
 */
static const char *const Basic20Pegasus40Tokens[256] = {
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       "END",      "FOR",      "NEXT",       "DATA",
    "INPUT#",   "INPUT",    "DIM",      "READ",     "LET",        "GOTO",
    "RUN",      "IF",       "RESTORE",  "GOSUB",    "RETURN",     "REM",
    "STOP",     "ON",       "WAIT",     "LOAD",     "SAVE",       "VERIFY",
    "DEF",      "POKE",     "PRINT#",   "PRINT",    "CONT",       "LIST",
    "CLR",      "CMD",      "SYS",      "OPEN",     "CLOSE",      "GET",
    "NEW",      "TAB(",     "TO",       "FN",       "SPC(",       "THEN",
    "NOT",      "STEP",     "+",        "-",        "*",          "/",
    "^",        "AND",      "OR",       ">",        "=",          "<",
    "SGN",      "INT",      "ABS",      "USR",      "FRE",        "POS",
    "SQR",      "RND",      "LOG",      "EXP",      "COS",        "SIN",
    "TAN",      "ATN",      "PEEK",     "LEN",      "STR$",       "VAL",
    "ASC",      "CHR$",     "LEFT$",    "RIGHT$",   "MID$",       "GO",
    "OFF",      "ASC(",     "SIN(",     "COS(",     "TAN(",       "ATN(",
    "DEG(",     "RAD(",     "FRAC(",    "MOD(",     "ROUND(",     "DEC(",
    "BIN(",     "DEC(",     "BIN(",     "DEEK(",    "INSTR(",     "JOY(",
    "POT(",     "SCREEN(",  "TEST(",    "USING",    "DS$",        "HEX$(",
    "BIN$(",    "SPACE$(",  "UCASE$(",  "STRING$(", "INPUT$(",    "TIME$",
    "SPRITEX(", "SPRITEY(", "TURTLEX(", "TURTLEY(", "TURTLEANG(", NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       NULL,       NULL,         NULL,
    NULL,       NULL,       NULL,       "PI"};

/**
 * BASIC 2.0 with Xbasic extension tokens lookup table.
 */
static const char *const Basic20XBasicTokens[256] = {
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      "END",     "FOR",    "NEXT",     "DATA",    "INPUT#",
    "INPUT",   "DIM",     "READ",    "LET",    "GOTO",     "RUN",     "IF",
    "RESTORE", "GOSUB",   "RETURN",  "REM",    "STOP",     "ON",      "WAIT",
    "LOAD",    "SAVE",    "VERIFY",  "DEF",    "POKE",     "PRINT#",  "PRINT",
    "CONT",    "LIST",    "CLR",     "CMD",    "SYS",      "OPEN",    "CLOSE",
    "GET",     "NEW",     "TAB(",    "TO",     "FN",       "SPC(",    "THEN",
    "NOT",     "STEP",    "+",       "-",      "*",        "/",       "^",
    "AND",     "OR",      ">",       "=",      "<",        "SGN",     "INT",
    "ABS",     "USR",     "FRE",     "POS",    "SQR",      "RND",     "LOG",
    "EXP",     "COS",     "SIN",     "TAN",    "ATN",      "PEEK",    "LEN",
    "STR$",    "VAL",     "ASC",     "CHR$",   "LEFT$",    "RIGHT$",  "MID$",
    "GO",      "SPRAT",   "BRDR",    "SCREEN", "QUIT",     "SPRMULT", "MOVE",
    "SPRITE",  "ASPRITE", "DSPRITE", "SID",    "ENVELOPE", "GATE",    "FRQ",
    "WAVE",    "VOL",     "FCUT",    "FMODE",  "FILTER",   "FRSN",    "CSET",
    "MULTI",   "EXTND",   "LOCATE",  "CENTER", "HIRES",    "LINE",    "HPRNT",
    "PLOT",    "TEXT",    "CLEAR",   "COLR",   "STICK",    "BTN",     NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      NULL,     NULL,       NULL,      NULL,
    NULL,      NULL,      NULL,      "PI"};

/**
 * BASIC 2.0 with Drago Basic 2.2 extension tokens lookup table.
 */
static const char *const Basic20DragoBasic22Tokens[256] = {
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    "END",     "FOR",    "NEXT",  "DATA",   "INPUT#",
    "INPUT",   "DIM",   "READ",    "LET",    "GOTO",  "RUN",    "IF",
    "RESTORE", "GOSUB", "RETURN",  "REM",    "STOP",  "ON",     "WAIT",
    "LOAD",    "SAVE",  "VERIFY",  "DEF",    "POKE",  "PRINT#", "PRINT",
    "CONT",    "LIST",  "CLR",     "CMD",    "SYS",   "OPEN",   "CLOSE",
    "GET",     "NEW",   "TAB(",    "TO",     "FN",    "SPC(",   "THEN",
    "NOT",     "STEP",  "+",       "-",      "*",     "/",      "^",
    "AND",     "OR",    ">",       "=",      "<",     "SGN",    "INT",
    "ABS",     "USR",   "FRE",     "POS",    "SQR",   "RND",    "LOG",
    "EXP",     "COS",   "SIN",     "TAN",    "ATN",   "PEEK",   "LEN",
    "STR$",    "VAL",   "ASC",     "CHR$",   "LEFT$", "RIGHT$", "MID$",
    "GO",      "PUNKT", "LINIA",   "RYSUJ",  "PARAM", "KONTUR", "ANIM",
    "KOLOR",   "PUWID", "RYSELIP", "KOGUMA", "FIUT",  "FIGURA", "FIGUMA",
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,    NULL,     NULL,
    NULL,      NULL,    NULL,      "PI"};

/**
 * BASIC 2.0 with REU-Basic extension tokens lookup table.
 */
static const char *const Basic20REUBasicTokens[256] = {
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    "END",    "FOR",    "NEXT", "DATA", "INPUT#",  "INPUT",  "DIM",    "READ",
    "LET",    "GOTO",   "RUN",  "IF",   "RESTORE", "GOSUB",  "RETURN", "REM",
    "STOP",   "ON",     "WAIT", "LOAD", "SAVE",    "VERIFY", "DEF",    "POKE",
    "PRINT#", "PRINT",  "CONT", "LIST", "CLR",     "CMD",    "SYS",    "OPEN",
    "CLOSE",  "GET",    "NEW",  "TAB(", "TO",      "FN",     "SPC(",   "THEN",
    "NOT",    "STEP",   "+",    "-",    "*",       "/",      "^",      "AND",
    "OR",     ">",      "=",    "<",    "SGN",     "INT",    "ABS",    "USR",
    "FRE",    "POS",    "SQR",  "RND",  "LOG",     "EXP",    "COS",    "SIN",
    "TAN",    "ATN",    "PEEK", "LEN",  "STR$",    "VAL",    "ASC",    "CHR$",
    "LEFT$",  "RIGHT$", "MID$", "GO",   "PUSH",    "PULL",   "FLIP",   "REC",
    "STASH",  "FETCH",  "SWAP", "REU",  "SIZE",    "DIR",    "@",      "KILL",
    "ROM",    "RAM",    "MOVE", NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,   NULL,   NULL,      NULL,     NULL,     "PI"};

/**
 * BASIC 2.0 with Basic Lightning extension tokens lookup table.
 */
static const char *const Basic20BasicLightningTokens[256] = {
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,    "END",    "FOR",      "NEXT",    "DATA",    "INPUT#",
    "INPUT",   "DIM",   "READ",   "LET",      "GOTO",    "RUN",     "IF",
    "RESTORE", "GOSUB", "RETURN", "REM",      "STOP",    "ON",      "WAIT",
    "LOAD",    "SAVE",  "VERIFY", "DEF",      "POKE",    "PRINT#",  "PRINT",
    "CONT",    "LIST",  "CLR",    "CMD",      "SYS",     "OPEN",    "CLOSE",
    "GET",     "NEW",   "TAB(",   "TO",       "FN",      "SPC(",    "THEN",
    "NOT",     "STEP",  "+",      "-",        "*",       "/",       "^",
    "AND",     "OR",    ">",      "=",        "<",       "SGN",     "INT",
    "ABS",     "USR",   "FRE",    "POS",      "SQR",     "RND",     "LOG",
    "EXP",     "COS",   "SIN",    "TAN",      "ATN",     "PEEK",    "LEN",
    "STR$",    "VAL",   "ASC",    "CHR$",     "LEFT$",   "RIGHT$",  "MID$",
    "GO",      "ELSE",  "HEX$",   "DEEK",     "TRUE",    "IMPORT",  "CFN",
    "SIZE",    "FALSE", "VER$",   "LPX",      "LPY",     "COMMON%", "CROW",
    "CCOL",    "ATR",   "INC",    "NUM",      "ROW2",    "COL2",    "SPN2",
    "HGT",     "WID",   "ROW",    "COL",      "SPN",     "TASK",    "HALT",
    "REPEAT",  "UNTIL", "WHILE",  "WEND",     "CIF",     "CELSE",   "CEND",
    "LABEL",   "DOKE",  "EXIT",   "ALLOCATE", "DISABLE", "PULL",    "DLOAD",
    "DSAVE",   "VAR",   "LOCAL",  "PROCEND",  "PROC",    "CASEND",  "OF",
    "CASE",    "RPT",   "SETATR", "PI"};

/**
 * BASIC 2.0 with Magic Basic extension tokens lookup table.
 */
static const char *const Basic20MagicBasicTokens[256] = {
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        "END",    "FOR",    "NEXT",    "DATA",    "INPUT#",
    "INPUT",   "DIM",       "READ",   "LET",    "GOTO",    "RUN",     "IF",
    "RESTORE", "GOSUB",     "RETURN", "REM",    "STOP",    "ON",      "WAIT",
    "LOAD",    "SAVE",      "VERIFY", "DEF",    "POKE",    "PRINT#",  "PRINT",
    "CONT",    "LIST",      "CLR",    "CMD",    "SYS",     "OPEN",    "CLOSE",
    "GET",     "NEW",       "TAB(",   "TO",     "FN",      "SPC(",    "THEN",
    "NOT",     "STEP",      "+",      "-",      "*",       "/",       "^",
    "AND",     "OR",        ">",      "=",      "<",       "SGN",     "INT",
    "ABS",     "USR",       "FRE",    "POS",    "SQR",     "RND",     "LOG",
    "EXP",     "COS",       "SIN",    "TAN",    "ATN",     "PEEK",    "LEN",
    "STR$",    "VAL",       "ASC",    "CHR$",   "LEFT$",   "RIGHT$",  "MID$",
    "GO",      "ASSEMBLER", "AUTO",   "CDRIVE", "CAT",     "DAPPEND", "DELETE",
    "DEZ",     "DIR",       "DLOAD",  "DSAVE",  "DVERIFY", "CONFIG",  "FIND",
    NULL,      NULL,        "HELP",   "HEX",    "JUMP",    "LLIST",   "LPRINT",
    "OFF",     "OLD",       "RENUM",  "CRUN",   "SEND",    "STATUS",  "HIRES",
    "MULTI",   "CLEAR",     "PLOT",   "INVERT", "LINE",    "TEXT",    "GRAPHIK",
    "PAGE",    "BOX",       "DRAW",   "MIX",    "COPY",    "CIRCLE",  "GSAVE",
    "GLOAD",   "FRAME",     "HPRINT", "VPRINT", "BLOCK",   "FILL",    NULL,
    "REPLACE", "LRUN",      NULL,     "PI"};

/**
 * BASIC 2.0 with Blarg extension tokens lookup table.
 */
static const char *const Basic20BlargTokens[256] = {
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     "END",    "FOR",   "NEXT",  "DATA",   "INPUT#",
    "INPUT",   "DIM",    "READ",   "LET",   "GOTO",  "RUN",    "IF",
    "RESTORE", "GOSUB",  "RETURN", "REM",   "STOP",  "ON",     "WAIT",
    "LOAD",    "SAVE",   "VERIFY", "DEF",   "POKE",  "PRINT#", "PRINT",
    "CONT",    "LIST",   "CLR",    "CMD",   "SYS",   "OPEN",   "CLOSE",
    "GET",     "NEW",    "TAB(",   "TO",    "FN",    "SPC(",   "THEN",
    "NOT",     "STEP",   "+",      "-",     "*",     "/",      "^",
    "AND",     "OR",     ">",      "=",     "<",     "SGN",    "INT",
    "ABS",     "USR",    "FRE",    "POS",   "SQR",   "RND",    "LOG",
    "EXP",     "COS",    "SIN",    "TAN",   "ATN",   "PEEK",   "LEN",
    "STR$",    "VAL",    "ASC",    "CHR$",  "LEFT$", "RIGHT$", "MID$",
    "GO",      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    "PLOT",    "LINE",   "CIRCLE", "GRON",  "GROFF", "MODE",   "ORIGIN",
    "CLEAR",   "BUFFER", "SWAP",   "COLOR", NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,    NULL,     NULL,
    NULL,      NULL,     NULL,     "PI"};

/**
 * BASIC 2.0 with Game Basic extension tokens lookup table.
 */
static const char *const Basic20GameBasicTokens[256] = {
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     "END",     "FOR",     "NEXT",    "DATA",   "INPUT#",
    "INPUT",   "DIM",    "READ",    "LET",     "GOTO",    "RUN",    "IF",
    "RESTORE", "GOSUB",  "RETURN",  "REM",     "STOP",    "ON",     "WAIT",
    "LOAD",    "SAVE",   "VERIFY",  "DEF",     "POKE",    "PRINT#", "PRINT",
    "CONT",    "LIST",   "CLR",     "CMD",     "SYS",     "OPEN",   "CLOSE",
    "GET",     "NEW",    "TAB(",    "TO",      "FN",      "SPC(",   "THEN",
    "NOT",     "STEP",   "+",       "-",       "*",       "/",      "^",
    "AND",     "OR",     ">",       "=",       "<",       "SGN",    "INT",
    "ABS",     "USR",    "FRE",     "POS",     "SQR",     "RND",    "LOG",
    "EXP",     "COS",    "SIN",     "TAN",     "ATN",     "PEEK",   "LEN",
    "STR$",    "VAL",    "ASC",     "CHR$",    "LEFT$",   "RIGHT$", "MID$",
    "GO",      "WINDOW", "BFILE",   "UPPER",   "LOWER",   "CLS",    "SCREEN",
    "PARSE",   "PROC",   "ELSE",    "SCRATCH", "REPLACE", "DEVICE", "DIR",
    "REPEAT",  "UNTIL",  "DISK",    "FETCH#",  "PUT#",    "PROMPT", "POP",
    "HELP",    "EXIT",   "DISABLE", "ENTER",   "RESET",   "WARM",   "NUM",
    "TYPE",    "TEXT$",  NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      NULL,      NULL,      NULL,     NULL,
    NULL,      NULL,     NULL,      "PI"};

/**
 * BASIC 2.0 with Basex extension tokens lookup table.
 */
static const char *const Basic20BasexTokens[256] = {
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       "END",    "FOR",    "NEXT",   "DATA",     "INPUT#",
    "INPUT",   "DIM",      "READ",   "LET",    "GOTO",   "RUN",      "IF",
    "RESTORE", "GOSUB",    "RETURN", "REM",    "STOP",   "ON",       "WAIT",
    "LOAD",    "SAVE",     "VERIFY", "DEF",    "POKE",   "PRINT#",   "PRINT",
    "CONT",    "LIST",     "CLR",    "CMD",    "SYS",    "OPEN",     "CLOSE",
    "GET",     "NEW",      "TAB(",   "TO",     "FN",     "SPC(",     "THEN",
    "NOT",     "STEP",     "+",      "-",      "*",      "/",        "^",
    "AND",     "OR",       ">",      "=",      "<",      "SGN",      "INT",
    "ABS",     "USR",      "FRE",    "POS",    "SQR",    "RND",      "LOG",
    "EXP",     "COS",      "SIN",    "TAN",    "ATN",    "PEEK",     "LEN",
    "STR$",    "VAL",      "ASC",    "CHR$",   "LEFT$",  "RIGHT$",   "MID$",
    "GO",      "APPEND",   "AUTO",   "BAR",    "CIRCLE", "CLG",      "CLS",
    "CSR",     "DELETE",   "DISK",   "DRAW",   "EDGE",   "ENVELOPE", "FILL",
    "KEY",     "MOB",      "MODE",   "MOVE",   "OLD",    "PIC",      "DUMP",
    "PLOT",    "RENUMBER", "REPEAT", "SCROLL", "SOUND",  "WHILE",    "UNTIL",
    "VOICE",   "ASS",      "DIS",    "MEM",    NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     NULL,     NULL,     NULL,       NULL,
    NULL,      NULL,       NULL,     "PI"};

/**
 * BASIC 2.0 with Super Basic extension tokens lookup table.
 */
static const char *const Basic20SuperBasicTokens[256] = {
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     "END",     "FOR",     "NEXT",   "DATA",
    "INPUT#",    "INPUT",  "DIM",     "READ",    "LET",    "GOTO",
    "RUN",       "IF",     "RESTORE", "GOSUB",   "RETURN", "REM",
    "STOP",      "ON",     "WAIT",    "LOAD",    "SAVE",   "VERIFY",
    "DEF",       "POKE",   "PRINT#",  "PRINT",   "CONT",   "LIST",
    "CLR",       "CMD",    "SYS",     "OPEN",    "CLOSE",  "GET",
    "NEW",       "TAB(",   "TO",      "FN",      "SPC(",   "THEN",
    "NOT",       "STEP",   "+",       "-",       "*",      "/",
    "^",         "AND",    "OR",      ">",       "=",      "<",
    "SGN",       "INT",    "ABS",     "USR",     "FRE",    "POS",
    "SQR",       "RND",    "LOG",     "EXP",     "COS",    "SIN",
    "TAN",       "ATN",    "PEEK",    "LEN",     "STR$",   "VAL",
    "ASC",       "CHR$",   "LEFT$",   "RIGHT$",  "MID$",   "GO",
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      NULL,      NULL,     NULL,
    NULL,        NULL,     NULL,      "VOLUME",  "RESET",  "MEM",
    "TRACE",     "BASIC",  "RESUME",  "LETTER",  "HELP",   "COKE",
    "GROUND",    "MATRIX", "DISPOSE", "PRINT@",  "HIMEM",  "HARDCOPY",
    "INPUTFORM", "LOCK",   "SWAP",    "USING",   "SEC",    "ELSE",
    "ERROR",     "ROUND",  "DEEK",    "STRING$", "POINT",  "INSTR",
    "CEEK",      "MIN",    "MAX",     "VARPTR",  "FRAC",   "ODD",
    "DEC",       "HEX$",   "EVAL",    "PI"};

/**
 * BASIC 2.0 with Expanded Basic extension tokens lookup table.
 */
static const char *const Basic20ExpandedBasicC64Tokens[256] = {
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       "END",      "FOR",    "NEXT",     "DATA",
    "INPUT#",   "INPUT",    "DIM",      "READ",   "LET",      "GOTO",
    "RUN",      "IF",       "RESTORE",  "GOSUB",  "RETURN",   "REM",
    "STOP",     "ON",       "WAIT",     "LOAD",   "SAVE",     "VERIFY",
    "DEF",      "POKE",     "PRINT#",   "PRINT",  "CONT",     "LIST",
    "CLR",      "CMD",      "SYS",      "OPEN",   "CLOSE",    "GET",
    "NEW",      "TAB(",     "TO",       "FN",     "SPC(",     "THEN",
    "NOT",      "STEP",     "+",        "-",      "*",        "/",
    "^",        "AND",      "OR",       ">",      "=",        "<",
    "SGN",      "INT",      "ABS",      "USR",    "FRE",      "POS",
    "SQR",      "RND",      "LOG",      "EXP",    "COS",      "SIN",
    "TAN",      "ATN",      "PEEK",     "LEN",    "STR$",     "VAL",
    "ASC",      "CHR$",     "LEFT$",    "RIGHT$", "MID$",     "GO",
    "HIRES",    "NORM",     "GRAPH",    "SET",    "LINE",     "CIRCLE",
    "FILL",     "MODE",     "CLS",      "TEXT",   "COLOR",    "GSAVE",
    "GLOAD",    "INVERSE",  "FRAME",    "MOVE",   "USING",    "RENUMBER",
    "DELETE",   "BOX",      "MOBDEF",   "SPRITE", "MOBSET",   "MOBSIZE",
    "MOBCOLOR", "MOBMULTI", "MOBMOVE",  "DOKE",   "ALLCLOSE", "OLD",
    "AUTO",     "VOLUME",   "ENVELOPE", "WAVE",   "PLAY",     "CASE ERROR",
    "RESUME",   "NO ERROR", "FIND",     "INKEY",  "MERGE",    "HARDCOPY",
    NULL,       NULL,       NULL,       NULL,     NULL,       NULL,
    NULL,       NULL,       NULL,       "PI"};

/**
 * BASIC 2.0 with Warsaw Basic extension tokens lookup table.
 */
static const char *const Basic20WarsawBasicTokens[256] = {
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     "END",    "FOR",   "NEXT",   "DATA",   "INPUT#",
    "INPUT",   "DIM",    "READ",   "LET",   "GOTO",   "RUN",    "IF",
    "RESTORE", "GOSUB",  "RETURN", "REM",   "STOP",   "ON",     "WAIT",
    "LOAD",    "SAVE",   "VERIFY", "DEF",   "POKE",   "PRINT#", "PRINT",
    "CONT",    "LIST",   "CLR",    "CMD",   "SYS",    "OPEN",   "CLOSE",
    "GET",     "NEW",    "TAB(",   "TO",    "FN",     "SPC(",   "THEN",
    "NOT",     "STEP",   "+",      "-",     "*",      "/",      "^",
    "AND",     "OR",     ">",      "=",     "<",      "SGN",    "INT",
    "ABS",     "USR",    "FRE",    "POS",   "SQR",    "RND",    "LOG",
    "EXP",     "COS",    "SIN",    "TAN",   "ATN",    "PEEK",   "LEN",
    "STR$",    "VAL",    "ASC",    "CHR$",  "LEFT$",  "RIGHT$", "MID$",
    "GO",      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     NULL,     NULL,    NULL,     NULL,     NULL,
    NULL,      NULL,     "HISAVE", "SLINE", "MEM",    "TRACE",  "BEEP",
    "RESUME",  "LETTER", "HELP",   NULL,    "GROUND", "REVERS", "DISPOSE",
    "PRINT@",  "HIMEM",  NULL,     "LINE",  "PROC",   "AXIS",   "USING",
    "SEC",     "ELSE",   "ERROR",  "ROUND", NULL,     NULL,     NULL,
    NULL,      "POUND",  "MIN",    "MAX",   NULL,     "FRAC",   "ODD",
    NULL,      "HEEK",   "EVAL",   "PI"};

/**
 * BASIC 2.0 with VIC Super Expander extension tokens lookup table.
 */
static const char *const Basic20VicSuperExpanderTokens[256] = {
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    "END",     "FOR",    "NEXT",   "DATA",   "INPUT#",
    "INPUT",   "DIM",   "READ",    "LET",    "GOTO",   "RUN",    "IF",
    "RESTORE", "GOSUB", "RETURN",  "REM",    "STOP",   "ON",     "WAIT",
    "LOAD",    "SAVE",  "VERIFY",  "DEF",    "POKE",   "PRINT#", "PRINT",
    "CONT",    "LIST",  "CLR",     "CMD",    "SYS",    "OPEN",   "CLOSE",
    "GET",     "NEW",   "TAB(",    "TO",     "FN",     "SPC(",   "THEN",
    "NOT",     "STEP",  "+",       "-",      "*",      "/",      "^",
    "AND",     "OR",    ">",       "=",      "<",      "SGN",    "INT",
    "ABS",     "USR",   "FRE",     "POS",    "SQR",    "RND",    "LOG",
    "EXP",     "COS",   "SIN",     "TAN",    "ATN",    "PEEK",   "LEN",
    "STR$",    "VAL",   "ASC",     "CHR$",   "LEFT$",  "RIGHT$", "MID$",
    "GO",      "KEY",   "GRAPHIC", "SCNCLR", "CIRCLE", "DRAW",   "REGION",
    "COLOR",   "POINT", "SOUND",   "CHAR",   "PAINT",  "RPOT",   "RPEN",
    "RSND",    "RCOLR", "RGR",     "RJOY",   "RDOT",   NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,      NULL,    NULL,      "PI"};

/**
 * BASIC 2.0 with Mighty Basic extension tokens lookup table.
 */
static const char *const Basic20MightyBasicTokens[256] = {
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,      NULL,      "END",       "FOR",    "NEXT",   "DATA",
    "INPUT#",  "INPUT",   "DIM",       "READ",   "LET",    "GOTO",
    "RUN",     "IF",      "RESTORE",   "GOSUB",  "RETURN", "REM",
    "STOP",    "ON",      "WAIT",      "LOAD",   "SAVE",   "VERIFY",
    "DEF",     "POKE",    "PRINT#",    "PRINT",  "CONT",   "LIST",
    "CLR",     "CMD",     "SYS",       "OPEN",   "CLOSE",  "GET",
    "NEW",     "TAB(",    "TO",        "FN",     "SPC(",   "THEN",
    "NOT",     "STEP",    "+",         "-",      "*",      "/",
    "^",       "AND",     "OR",        ">",      "=",      "<",
    "SGN",     "INT",     "ABS",       "USR",    "FRE",    "POS",
    "SQR",     "RND",     "LOG",       "EXP",    "COS",    "SIN",
    "TAN",     "ATN",     "PEEK",      "LEN",    "STR$",   "VAL",
    "ASC",     "CHR$",    "LEFT$",     "RIGHT$", "MID$",   "GO",
    "DELETE",  "OLD",     "RENUMBER",  "HELP",   "HEADER", "MOVE",
    "TRACE",   "KILL",    "DUMP",      "DSAVE",  "DLOAD",  "DVERIFY",
    "DRESAVE", "SCRATCH", "DIRECTORY", "KEY",    "SEND",   "POP",
    "OFF",     "BSAVE",   "BLOAD",     "FIND",   "AUTO",   "PPRINT",
    "ACCEPT",  "RESET",   "ELSE",      "COLOR",  "TAKE",   "PAUSE",
    "BASE",    "COPYCHR", "CHAR",      "BEEP",   "CLS",    "FILL",
    "MERGE",   "SOUND",   "GIVE",      "PLIST",  "PUT",    "VOLUME",
    "RTIME",   "MSB",     "LSB",       "VECTOR", "JOY",    "DEC",
    "HEX$",    "GRAB",    "DS$",       "PI"};

/**
 * BASIC 2.0 with Easy Basic extension tokens lookup table.
 */
static const char *const Basic20EasyBasicTokens[256] = {
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      NULL,        NULL,     NULL,     NULL,
    NULL,     NULL,      "END",       "FOR",    "NEXT",   "DATA",
    "INPUT#", "INPUT",   "DIM",       "READ",   "LET",    "GOTO",
    "RUN",    "IF",      "RESTORE",   "GOSUB",  "RETURN", "REM",
    "STOP",   "ON",      "WAIT",      "LOAD",   "SAVE",   "VERIFY",
    "DEF",    "POKE",    "PRINT#",    "PRINT",  "CONT",   "LIST",
    "CLR",    "CMD",     "SYS",       "OPEN",   "CLOSE",  "GET",
    "NEW",    "TAB(",    "TO",        "FN",     "SPC(",   "THEN",
    "NOT",    "STEP",    "+",         "-",      "*",      "/",
    "^",      "AND",     "OR",        ">",      "=",      "<",
    "SGN",    "INT",     "ABS",       "USR",    "FRE",    "POS",
    "SQR",    "RND",     "LOG",       "EXP",    "COS",    "SIN",
    "TAN",    "ATN",     "PEEK",      "LEN",    "STR$",   "VAL",
    "ASC",    "CHR$",    "LEFT$",     "RIGHT$", "MID$",   "GO",
    "DELETE", "OLD",     "RENUMBER",  "DUMP",   "MERGE",  "PLOT",
    "TRACE",  "KILL",    "HELP",      "DLOAD",  "DSAVE",  "DVERIFY",
    "APPEND", "SCREEN",  "DIRECTORY", "KEY",    "SEND",   "POP",
    "OFF",    "POUT",    "HEADER",    "FIND",   "AUTO",   "PPRINT",
    "ACCEPT", "RESET",   "SCRATCH",   "COLOR",  "TAKE",   "PAUSE",
    "BASE",   "COPYCHR", "CHAR",      "CHK",    "CLS",    "FILL",
    "RETIME", "SOUND",   "POFF",      "PLIST",  "PUT",    "VOLUME",
    "JOY",    "MSB",     "LSB",       "VECTOR", "RKEY",   "DEC",
    "HEX$",   "GRAB",    "DS$",       "PI"};

/**
 * BASIC 2.0 with Expanded Basic extension tokens lookup table.
 */
static const char *const Basic20ExpandedBasicVIC20Tokens[256] = {
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    "END",    "FOR",    "NEXT",  "DATA", "INPUT#",  "INPUT",  "DIM",    "READ",
    "LET",    "GOTO",   "RUN",   "IF",   "RESTORE", "GOSUB",  "RETURN", "REM",
    "STOP",   "ON",     "WAIT",  "LOAD", "SAVE",    "VERIFY", "DEF",    "POKE",
    "PRINT#", "PRINT",  "CONT",  "LIST", "CLR",     "CMD",    "SYS",    "OPEN",
    "CLOSE",  "GET",    "NEW",   "TAB(", "TO",      "FN",     "SPC(",   "THEN",
    "NOT",    "STEP",   "+",     "-",    "*",       "/",      "^",      "AND",
    "OR",     ">",      "=",     "<",    "SGN",     "INT",    "ABS",    "USR",
    "FRE",    "POS",    "SQR",   "RND",  "LOG",     "EXP",    "COS",    "SIN",
    "TAN",    "ATN",    "PEEK",  "LEN",  "STR$",    "VAL",    "ASC",    "CHR$",
    "LEFT$",  "RIGHT$", "MID$",  "GO",   "RESET",   "SOUND",  "SLOW(",  "COM",
    "MEM",    "STAT(",  "KEY",   "OFF",  "COL(",    "PLOT(",  "POP(",   "CHOL(",
    "CUROL(", "BEEP(",  "PAUS(", "MSAV", "REG(",    "DPEK(",  "PDL",    "JOY",
    "DPOK",   "DO",     "UNTIL", "OLD",  NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,    NULL,   NULL,      NULL,     NULL,     "PI"};

/**
 * BASIC 3.5 tokens lookup table.
 */
static const char *const Basic35Tokens[256] = {
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     "END",    "FOR",      "NEXT",    "DATA",    "INPUT#",
    "INPUT",     "DIM",    "READ",   "LET",      "GOTO",    "RUN",     "IF",
    "RESTORE",   "GOSUB",  "RETURN", "REM",      "STOP",    "ON",      "WAIT",
    "LOAD",      "SAVE",   "VERIFY", "DEF",      "POKE",    "PRINT#",  "PRINT",
    "CONT",      "LIST",   "CLR",    "CMD",      "SYS",     "OPEN",    "CLOSE",
    "GET",       "NEW",    "TAB(",   "TO",       "FN",      "SPC(",    "THEN",
    "NOT",       "STEP",   "+",      "-",        "*",       "/",       "^",
    "AND",       "OR",     ">",      "=",        "<",       "SGN",     "INT",
    "ABS",       "USR",    "FRE",    "POS",      "SQR",     "RND",     "LOG",
    "EXP",       "COS",    "SIN",    "TAN",      "ATN",     "PEEK",    "LEN",
    "STR$",      "VAL",    "ASC",    "CHR$",     "LEFT$",   "RIGHT$",  "MID$",
    "GO",        "RGR",    "RCLR",   "RLUM",     "JOY",     "RDOT",    "DEC",
    "HEX$",      "ERR$",   "INSTR",  "ELSE",     "RESUME",  "TRAP",    "TRON",
    "TROFF",     "SOUND",  "VOL",    "AUTO",     "PUDEF",   "GRAPHIC", "PAINT",
    "CHAR",      "BOX",    "CIRCLE", "GSHAPE",   "SSHAPE",  "DRAW",    "LOCATE",
    "COLOR",     "SCNCLR", "SCALE",  "HELP",     "DO",      "LOOP",    "EXIT",
    "DIRECTORY", "DSAVE",  "DLOAD",  "HEADER",   "SCRATCH", "COLLECT", "COPY",
    "RENAME",    "BACKUP", "DELETE", "RENUMBER", "KEY",     "MONITOR", "USING",
    "UNTIL",     "WHILE",  NULL,     "PI"};

/**
 * BASIC 3.6 tokens lookup table.
 */
static const char *const Basic36Tokens[256] = {
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     "END",    "FOR",      "NEXT",    "DATA",    "INPUT#",
    "INPUT",     "DIM",    "READ",   "LET",      "GOTO",    "RUN",     "IF",
    "RESTORE",   "GOSUB",  "RETURN", "REM",      "STOP",    "ON",      "WAIT",
    "LOAD",      "SAVE",   "VERIFY", "DEF",      "POKE",    "PRINT#",  "PRINT",
    "CONT",      "LIST",   "CLR",    "CMD",      "SYS",     "OPEN",    "CLOSE",
    "GET",       "NEW",    "TAB(",   "TO",       "FN",      "SPC(",    "THEN",
    "NOT",       "STEP",   "+",      "-",        "*",       "/",       "^",
    "AND",       "OR",     ">",      "=",        "<",       "SGN",     "INT",
    "ABS",       "USR",    "FRE",    "POS",      "SQR",     "RND",     "LOG",
    "EXP",       "COS",    "SIN",    "TAN",      "ATN",     "PEEK",    "LEN",
    "STR$",      "VAL",    "ASC",    "CHR$",     "LEFT$",   "RIGHT$",  "MID$",
    "GO",        "RGR",    "RCLR",   NULL,       "JOY",     "RDOT",    "DEC",
    "HEX$",      "ERR$",   "INSTR",  "ELSE",     "RESUME",  "TRAP",    "TRON",
    "TROFF",     "SOUND",  "VOLUME", "AUTO",     "PUDEF",   "GRAPHIC", "PAINT",
    "CHAR",      "BOX",    "CIRCLE", "GSHAPE",   "SSHAPE",  "DRAW",    "LOCATE",
    "COLOR",     "SCNCLR", "SCALE",  "HELP",     "DO",      "LOOP",    "QUIT",
    "DIRECTORY", "DSAVE",  "DLOAD",  "HEADER",   "SCRATCH", "COLLECT", "COPY",
    "RENAME",    "BACKUP", "DELETE", "RENUMBER", "KEY",     "MONITOR", "USING",
    "UNTIL",     "WHILE",  NULL,     "PI"};

/**
 * BASIC 4.0 tokens lookup table.
 */
static const char *const Basic40Tokens[256] = {
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        "END",    "FOR",    "NEXT",   "DATA",    "INPUT#",
    "INPUT",   "DIM",       "READ",   "LET",    "GOTO",   "RUN",     "IF",
    "RESTORE", "GOSUB",     "RETURN", "REM",    "STOP",   "ON",      "WAIT",
    "LOAD",    "SAVE",      "VERIFY", "DEF",    "POKE",   "PRINT#",  "PRINT",
    "CONT",    "LIST",      "CLR",    "CMD",    "SYS",    "OPEN",    "CLOSE",
    "GET",     "NEW",       "TAB(",   "TO",     "FN",     "SPC(",    "THEN",
    "NOT",     "STEP",      "+",      "-",      "*",      "/",       "^",
    "AND",     "OR",        ">",      "=",      "<",      "SGN",     "INT",
    "ABS",     "USR",       "FRE",    "POS",    "SQR",    "RND",     "LOG",
    "EXP",     "COS",       "SIN",    "TAN",    "ATN",    "PEEK",    "LEN",
    "STR$",    "VAL",       "ASC",    "CHR$",   "LEFT$",  "RIGHT$",  "MID$",
    "GO",      "CONCAT",    "DOPEN",  "DCLOSE", "RECORD", "HEADER",  "COLLECT",
    "BACKUP",  "COPY",      "APPEND", "DSAVE",  "DLOAD",  "CATALOG", "RENAME",
    "SCRATCH", "DIRECTORY", NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,     NULL,      NULL,
    NULL,      NULL,        NULL,     "PI"};

/**
 * BASIC 4.7 tokens lookup table.
 */
static const char *const Basic47Tokens[256] = {
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        "END",    "FOR",    "NEXT",    "DATA",    "INPUT#",
    "INPUT",   "DIM",       "READ",   "LET",    "GOTO",    "RUN",     "IF",
    "RESTORE", "GOSUB",     "RETURN", "REM",    "STOP",    "ON",      "WAIT",
    "LOAD",    "SAVE",      "VERIFY", "DEF",    "POKE",    "PRINT#",  "PRINT",
    "CONT",    "LIST",      "CLR",    "CMD",    "SYS",     "OPEN",    "CLOSE",
    "GET",     "NEW",       "TAB(",   "TO",     "FN",      "SPC(",    "THEN",
    "NOT",     "STEP",      "+",      "-",      "*",       "/",       "^",
    "AND",     "OR",        ">",      "=",      "<",       "SGN",     "INT",
    "ABS",     "USR",       "FRE",    "POS",    "SQR",     "RND",     "LOG",
    "EXP",     "COS",       "SIN",    "TAN",    "ATN",     "PEEK",    "LEN",
    "STR$",    "VAL",       "ASC",    "CHR$",   "LEFT$",   "RIGHT$",  "MID$",
    "GO",      "CONCAT",    "DOPEN",  "DCLOSE", "RECORD",  "HEADER",  "COLLECT",
    "BACKUP",  "COPY",      "APPEND", "DSAVE",  "DLOAD",   "CATALOG", "RENAME",
    "SCRATCH", "DIRECTORY", "CLEAR",  "BANK",   "BLOAD",   "BSAVE",   "KEY",
    "DELETE",  "ELSE",      "TRAP",   "RESUME", "DISPOSE", "PUDEF",   "USING",
    "ERR$",    "INSTR",     NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     NULL,     NULL,      NULL,      NULL,
    NULL,      NULL,        NULL,     "PI"};

/**
 * BASIC 7.0 tokens lookup table.
 */
static const char *const Basic70Tokens[256] = {
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,        NULL,     "END",    "FOR",      "NEXT",    "DATA",    "INPUT#",
    "INPUT",     "DIM",    "READ",   "LET",      "GOTO",    "RUN",     "IF",
    "RESTORE",   "GOSUB",  "RETURN", "REM",      "STOP",    "ON",      "WAIT",
    "LOAD",      "SAVE",   "VERIFY", "DEF",      "POKE",    "PRINT#",  "PRINT",
    "CONT",      "LIST",   "CLR",    "CMD",      "SYS",     "OPEN",    "CLOSE",
    "GET",       "NEW",    "TAB(",   "TO",       "FN",      "SPC(",    "THEN",
    "NOT",       "STEP",   "+",      "-",        "*",       "/",       "^",
    "AND",       "OR",     ">",      "=",        "<",       "SGN",     "INT",
    "ABS",       "USR",    "FRE",    "POS",      "SQR",     "RND",     "LOG",
    "EXP",       "COS",    "SIN",    "TAN",      "ATN",     "PEEK",    "LEN",
    "STR$",      "VAL",    "ASC",    "CHR$",     "LEFT$",   "RIGHT$",  "MID$",
    "GO",        "RGR",    "RCLR",   NULL,       "JOY",     "RDOT",    "DEC",
    "HEX$",      "ERR$",   "INSTR",  "ELSE",     "RESUME",  "TRAP",    "TRON",
    "TROFF",     "SOUND",  "VOL",    "AUTO",     "PUDEF",   "GRAPHIC", "PAINT",
    "CHAR",      "BOX",    "CIRCLE", "GSHAPE",   "SSHAPE",  "DRAW",    "LOCATE",
    "COLOR",     "SCNCLR", "SCALE",  "HELP",     "DO",      "LOOP",    "EXIT",
    "DIRECTORY", "DSAVE",  "DLOAD",  "HEADER",   "SCRATCH", "COLLECT", "COPY",
    "RENAME",    "BACKUP", "DELETE", "RENUMBER", "KEY",     "MONITOR", "USING",
    "UNTIL",     "WHILE",  NULL,     "PI"};

/**
 * BASIC 10.0 tokens lookup table.
 */
static const char *const Basic100Tokens[256] = {
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     NULL,     NULL,       NULL,      NULL,      NULL,
    NULL,      NULL,     "END",    "FOR",      "NEXT",    "DATA",    "INPUT#",
    "INPUT",   "DIM",    "READ",   "LET",      "GOTO",    "RUN",     "IF",
    "RESTORE", "GOSUB",  "RETURN", "REM",      "STOP",    "ON",      "WAIT",
    "LOAD",    "SAVE",   "VERIFY", "DEF",      "POKE",    "PRINT#",  "PRINT",
    "CONT",    "LIST",   "CLR",    "CMD",      "SYS",     "OPEN",    "CLOSE",
    "GET",     "NEW",    "TAB(",   "TO",       "FN",      "SPC(",    "THEN",
    "NOT",     "STEP",   "+",      "-",        "*",       "/",       "^",
    "AND",     "OR",     ">",      "=",        "<",       "SGN",     "INT",
    "ABS",     "USR",    "FRE",    "POS",      "SQR",     "RND",     "LOG",
    "EXP",     "COS",    "SIN",    "TAN",      "ATN",     "PEEK",    "LEN",
    "STR$",    "VAL",    "ASC",    "CHR$",     "LEFT$",   "RIGHT$",  "MID$",
    "GO",      "RGR",    "RCLR",   NULL,       "JOY",     "RDOT",    "DEC",
    "HEX$",    "ERR$",   "INSTR",  "ELSE",     "RESUME",  "TRAP",    "TRON",
    "TROFF",   "SOUND",  "VOL",    "AUTO",     "PUDEF",   "GRAPHIC", "PAINT",
    "CHAR",    "BOX",    "CIRCLE", "PASTE",    "CUT",     "LINE",    "LOCATE",
    "COLOR",   "SCNCLR", "SCALE",  "HELP",     "DO",      "LOOP",    "EXIT",
    "DIR",     "DSAVE",  "DLOAD",  "HEADER",   "SCRATCH", "COLLECT", "COPY",
    "RENAME",  "BACKUP", "DELETE", "RENUMBER", "KEY",     "MONITOR", "USING",
    "UNTIL",   "WHILE",  NULL,     "PI"};

/**
 * Simons' Basic prefix lookup table.
 */
static const char *const SimonsBasicPrefixLookupTable[256] = {
    NULL,       "HIRES",    "PLOT",     "LINE",    "BLOCK",    "FCHR",
    "FCOL",     "FILL",     "REC",      "DOT",     "DRAW",     "CHAR",
    "HI COL",   "INV",      "FRAC",     "MOVE",    "PLACE",    "UPB",
    "UPW",      "LEFTW",    "LEFTB",    "DOWNB",   "DOWNW",    "RIGHTB",
    "RIGHTW",   "MULTI",    "COLOUR",   "MMOB",    "BFLASH",   "MOB SET",
    "MUSIC",    "FLASH",    "REPEAT",   "PLAY",    ">>",       "CENTRE",
    "ENVELOPE", "CGOTO",    "WAVE",     "FETCH",   "AT(",      "UNTIL",
    ">>",       ">>",       "USE",      ">>",      "GLOBAL",   ">>",
    "RESET",    "PROC",     "CALL",     "EXEC",    "END PROC", "EXIT",
    "END LOOP", "ON KEY",   "DISABLE",  "RESUME",  "LOOP",     "DELAY",
    ">>",       ">>",       ">>",       ">>",      "SECURE",   "DISAPA",
    "CIRCLE",   "ON ERROR", "NO ERROR", "LOCAL",   "RCOMP",    "ELSE",
    "RETRACE",  "TRACE",    "DIR",      "PAGE",    "DUMP",     "FIND",
    "OPTION",   "AUTO",     "OLD",      "JOY",     "MOD",      "DIV",
    "DIV",      "DUP",      "INKEY",    "INST",    "TEST",     "LIN",
    "EXOR",     "INSERT",   "POT",      "PENX",    ">>",       "PENY",
    "SOUND",    "GRAPHICS", "DESIGN",   "RLOCMOB", "CMOB",     "BCKGNDS",
    "PAUSE",    "NRM",      "MOB OFF",  "OFF",     "ANGL",     "ARC",
    "COLD",     "SCRSV",    "SCRLD",    "TEXT",    "CSET",     "VOL",
    "DISK",     "HRDCPY",   "KEY",      "PAINT",   "LOW COL",  "COPY",
    "MERGE",    "RENUMBER", "MEM",      "DETECT",  "CHECK",    "DISPLAY",
    "ERR",      "OUT",      NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL,      NULL,       NULL,
    NULL,       NULL,       NULL,       NULL};

/**
 * BASIC 3.6 / 7.0 / 10.0 $CE prefix lookup table.
 */
static const char *const Basic3670100CEPrefixLookupTable[256] = {
    NULL,  NULL,      "POT",     "BUMP", "PEN", "RSPPOS", "RSPRITE", "RSPCOLOR",
    "XOR", "RWINDOW", "POINTER", NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL,
    NULL,  NULL,      NULL,      NULL,   NULL,  NULL,     NULL,      NULL};

/**
 * BASIC 2.0 with Super Expander Chip $FE prefix lookup table.
 */
static const char *const Basic20SuperExpanderChipFEPrefixLookupTable[256] = {
    "KEY",    "COLOR",  "GRAPHIC", "SCNCLR", "LOCATE", "SCALE",  "BOX",
    "CIRCLE", "CHAR",   "DRAW",    "GSHAPE", "PAINT",  "SSHAPE", "TUNE",
    "FILTER", "SPRDEF", "TEMPO",   "MOVSPR", "SPRCOL", "SPRITE", "COLINT",
    "SPRSAV", "RDUMP",  "RCLR",    "RDOT",   "RGR",    "RJOY",   "RPEN",
    "RPOT",   "RSPCOL", "RSPPOS",  "RSPR",   NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL,     NULL,     NULL,     NULL,
    NULL,     NULL,     NULL,      NULL};

/**
 * BASIC 3.6 $FE prefix lookup table.
 */
static const char *const Basic36FEPrefixLookupTable[256] = {
    NULL,      NULL,     "BANK",     "FILTER", "PLAY",     "TEMPO",
    "MOVSPR",  "SPRITE", "SPRCOLOR", "RREG",   "ENVELOPE", "SLEEP",
    "CATALOG", "DOPEN",  "APPEND",   "DCLOSE", "BSAVE",    "BLOAD",
    "RECORD",  "CONCAT", "DVERIFY",  "DCLEAR", "SPRSAV",   "COLLISION",
    "BEGIN",   "BEND",   "WINDOW",   "BOOT",   "WIDTH",    "SPRDEF",
    "QUIT",    "STASH",  NULL,       "FETCH",  NULL,       "SWAP",
    "OFF",     "POPUPS", NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL};

/**
 * BASIC 7.0 $FE prefix lookup table.
 */
static const char *const Basic70FEPrefixLookupTable[256] = {
    NULL,      NULL,     "BANK",     "FILTER", "PLAY",     "TEMPO",
    "MOVSPR",  "SPRITE", "SPRCOLOR", "RREG",   "ENVELOPE", "SLEEP",
    "CATALOG", "DOPEN",  "APPEND",   "DCLOSE", "BSAVE",    "BLOAD",
    "RECORD",  "CONCAT", "DVERIFY",  "DCLEAR", "SPRSAV",   "COLLISION",
    "BEGIN",   "BEND",   "WINDOW",   "BOOT",   "WIDTH",    "SPRDEF",
    "QUIT",    "STASH",  NULL,       "FETCH",  NULL,       "SWAP",
    "OFF",     "FAST",   "SLOW",     NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL};

/**
 * BASIC 7.1 $FE prefix lookup table.
 */
static const char *const Basic71FEPrefixLookupTable[256] = {
    NULL,      NULL,     "BANK",     "FILTER", "PLAY",     "TEMPO",
    "MOVSPR",  "SPRITE", "SPRCOLOR", "RREG",   "ENVELOPE", "SLEEP",
    "CATALOG", "DOPEN",  "APPEND",   "DCLOSE", "BSAVE",    "BLOAD",
    "RECORD",  "CONCAT", "DVERIFY",  "DCLEAR", "SPRSAV",   "COLLISION",
    "BEGIN",   "BEND",   "WINDOW",   "BOOT",   "WIDTH",    "SPRDEF",
    "QUIT",    "STASH",  NULL,       "FETCH",  NULL,       "SWAP",
    "OFF",     "FAST",   "SLOW",     "CWIND",  "SSCRN",    "LSCRN",
    "HIDE",    "SHOW",   "SFONT",    "LFONT",  "VIEW",     "FCOPY",
    "ESAVE",   "SEND",   "CHECK",    "ESC",    "OLD",      "FIND",
    "DUMP",    "MERGE",  NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL,     NULL,       NULL,
    NULL,      NULL,     NULL,       NULL};

/**
 * BASIC 10.0 $FE prefix lookup table.
 */
static const char *const Basic100FEPrefixLookupTable[256] = {
    NULL,      NULL,        "BANK",     "FILTER",     "PLAY",     "TEMPO",
    "MOVSPR",  "SPRITE",    "SPRCOLOR", "RREG",       "ENVELOPE", "SLEEP",
    "CATALOG", "DOPEN",     "APPEND",   "DCLOSE",     "BSAVE",    "BLOAD",
    "RECORD",  "CONCAT",    "DVERIFY",  "DCLEAR",     "SPRSAV",   "COLLISION",
    "BEGIN",   "BEND",      "WINDOW",   "BOOT",       "WIDTH",    "SPRDEF",
    "QUIT",    "DMA",       NULL,       "DMA",        NULL,       "DMA",
    "OFF",     "FAST",      "SLOW",     "TYPE",       "BVERIFY",  "ECTORY",
    "ERASE",   "FIND",      "CHANGE",   "SET",        "SCREEN",   "POLYGON",
    "ELLIPSE", "VIEWPORT",  "GCOPY",    "PEN",        "PALETTE",  "DMODE",
    "DPAT",    "PIC",       "GENLOCK",  "FOREGROUND", NULL,       "BACKGROUND",
    "BORDER",  "HIGHLIGHT", NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL,         NULL,       NULL,
    NULL,      NULL,        NULL,       NULL};

// clang-format off

/**
 * CBM PETSCII character lookup table.
 */
static const char *const PetsciiCharacters[256] = {
    "{$00}",         "{$01}",         "{$02}",         "{$03}",
    "{$04}",         "{WHITE}",       "{$06}",         "{$07}",
    "{$08}",         "{$09}",         "{$0A}",         "{$0B}",
    "{$0C}",         "{$0D}",         "{LOWERCASE}",   "{$0F}",
    "{$10}",         "{DOWN}",        "{RVSON}",       "{HOME}",
    "{DELETE}",      "{$15}",         "{$16}",         "{$17}",
    "{$18}",         "{$19}",         "{$1A}",         "{$1B}",
    "{RED}",         "{RIGHT}",       "{GREEN}",       "{BLUE}",
    " ",             "!",             "\"",            "#",
    "$",             "%",             "&",             "'",
    "(",             ")",             "*",             "+",
    ",",             "-",             ".",             "/",
    "0",             "1",             "2",             "3",
    "4",             "5",             "6",             "7",
    "8",             "9",             ":",             ";",
    "<",             "=",             ">",             "?",
    "@",             "A",             "B",             "C",
    "D",             "E",             "F",             "G",
    "H",             "I",             "J",             "K",
    "L",             "M",             "N",             "O",
    "P",             "Q",             "R",             "S",
    "T",             "U",             "V",             "W",
    "X",             "Y",             "Z",             "[",
    "\\",            "]",             "^",             "_",
    "{$60}",         "{$61}",         "{$62}",         "{$63}",
    "{$64}",         "{$65}",         "{$66}",         "{$67}",
    "{$68}",         "{$69}",         "{$6A}",         "{$6B}",
    "{$6C}",         "{$6D}",         "{$6E}",         "{$6F}",
    "{$70}",         "{$71}",         "{$72}",         "{$73}",
    "{$74}",         "{$75}",         "{$76}",         "{$77}",
    "{$78}",         "{$79}",         "{$7A}",         "{$7B}",
    "{$7C}",         "{$7D}",         "{PI}",          "{$7F}",
    "{$80}",         "{ORANGE}",      "{$82}",         "{$83}",
    "{$84}",         "{F1}",          "{F3}",          "{F5}",
    "{F7}",          "{F2}",          "{F4}",          "{F6}",
    "{F8}",          "{SHIFT-ENTER}", "{UPPERCASE}",   "{$8F}",
    "{BLACK}",       "{UP}",          "{RVSOFF}",      "{CLR}",
    "{INS}",         "{BROWN}",       "{LRED}",        "{GREY1}",
    "{GREY2}",       "{LGREEN}",      "{LBLUE}",       "{GREY3}",
    "{PURPLE}",      "{LEFT}",        "{YELLOW}",      "{$CYAN}",
    "{SHIFT-SPACE}", "{$A1}",         "{$A2}",         "{$A3}",
    "{$A4}",         "{$A5}",         "{$A6}",         "{$A7}",
    "{$A8}",         "{$A9}",         "{$AA}",         "{$AB}",
    "{$AC}",         "{$AD}",         "{$AE}",         "{$AF}",
    "{$B0}",         "{$B1}",         "{$B2}",         "{$B3}",
    "{$B4}",         "{$B5}",         "{$B6}",         "{$B7}",
    "{$B8}",         "{$B9}",         "{$BA}",         "{$BB}",
    "{$BC}",         "{$BD}",         "{$BE}",         "{$BF}",
    "{$C0}",         "{$C1}",         "{$C2}",         "{$C3}",
    "{$C4}",         "{$C5}",         "{$C6}",         "{$C7}",
    "{$C8}",         "{$C9}",         "{$CA}",         "{$CB}",
    "{$CC}",         "{$CD}",         "{$CE}",         "{$CF}",
    "{$D0}",         "{$D1}",         "{$D2}",         "{$D3}",
    "{$D4}",         "{$D5}",         "{$D6}",         "{$D7}",
    "{$D8}",         "{$D9}",         "{$DA}",         "{$DB}",
    "{$DC}",         "{$DD}",         "{$DE}",         "{$DF}",
    "{$E0}",         "{$E1}",         "{$E2}",         "{$E3}",
    "{$E4}",         "{$E5}",         "{$E6}",         "{$E7}",
    "{$E8}",         "{$E9}",         "{$EA}",         "{$EB}",
    "{$EC}",         "{$ED}",         "{$EE}",         "{$EF}",
    "{$F0}",         "{$F1}",         "{$F2}",         "{$F3}",
    "{$F4}",         "{$F5}",         "{$F6}",         "{$F7}",
    "{$F8}",         "{$F9}",         "{$FA}",         "{$FB}",
    "{$FC}",         "{$FD}",         "{$FE}",         "{$FF}"};

// clang-format off

