From fba189882a394e9d85975ad5ad43ea688f8481c8 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 25 Jun 2024 04:09:46 -0400 Subject: listbas: added (list basic programs, very barebones for now). --- tokens.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 tokens.c (limited to 'tokens.c') diff --git a/tokens.c b/tokens.c new file mode 100644 index 0000000..08cf48a --- /dev/null +++ b/tokens.c @@ -0,0 +1,135 @@ +const char *commands[] = { + "REM", + "DATA", + "INPUT", + "COLOR", + "LIST", + "ENTER", + "LET", + "IF", + "FOR", + "NEXT", + "GOTO", + "GO TO", + "GOSUB", + "TRAP", + "BYE", + "CONT", + "COM", + "CLOSE", + "CLR", + "DEG", + "DIM", + "END", + "NEW", + "OPEN", + "LOAD", + "SAVE", + "STATUS", + "NOTE", + "POINT", + "XIO", + "ON", + "POKE", + "PRINT", + "RAD", + "READ", + "RESTORE", + "RETURN", + "RUN", + "STOP", + "POP", + "?", + "GET", + "PUT", + "GRAPHICS", + "PLOT", + "POSITION", + "DOS", + "DRAWTO", + "SETCOLOR", + "LOCATE", + "SOUND", + "LPRINT", + "CSAVE", + "CLOAD", + "", /* implied LET */ + "ERROR -" +}; + +const unsigned short last_command = (sizeof(commands) / sizeof(char *)) - 1; + +const char *operators[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ",", + "$", + ":", + ";", + "", /* $16, EOL */ + " GOTO ", + " GOSUB ", /* $18 */ + " TO ", + " STEP ", + " THEN ", + "#", + "<=", + "<>", + ">=", + "<", /* $20 */ + ">", + "=", + "^", + "*", + "+", + "-", + "/", + " NOT ", /* $28 */ + " OR ", + " AND ", + "(", + ")", + "=", + "=", + "<=", + "<>", /* $30 */ + ">=", + "<", + ">", + "=", + "+", + "-", + "(", + "", /* $38, redunant for arrays */ + "", /* $39, ditto */ + "(", + "(", + ",", + "STR$", + "CHR$", + "USR", + "ASC", /* $40 */ + "VAL", + "LEN", + "ADR", + "ATN", + "COS", + "PEEK", + "SIN", + "RND", /* $48 */ + "FRE", + "EXP", + "LOG", + "CLOG", + "SQR", + "SGN", + "ABS", + "INT", /* $50 */ + "PADDLE", + "STICK", + "PTRIG", + "STRIG" /* $54 */ +}; + +const unsigned short last_operator = (sizeof(operators) / sizeof(char *)) - 1; -- cgit v1.2.3