aboutsummaryrefslogtreecommitdiff
path: root/tokens.c
diff options
context:
space:
mode:
Diffstat (limited to 'tokens.c')
-rw-r--r--tokens.c135
1 files changed, 135 insertions, 0 deletions
diff --git a/tokens.c b/tokens.c
new file mode 100644
index 0000000..675d220
--- /dev/null
+++ b/tokens.c
@@ -0,0 +1,135 @@
+const char *commands[] = {
+ "REM", /* $00 */
+ "DATA",
+ "INPUT",
+ "COLOR",
+ "LIST", /* $04 */
+ "ENTER",
+ "LET",
+ "IF",
+ "FOR", /* $08 */
+ "NEXT",
+ "GOTO",
+ "GO TO",
+ "GOSUB", /* $0C */
+ "TRAP",
+ "BYE",
+ "CONT",
+ "COM", /* $10 */
+ "CLOSE",
+ "CLR",
+ "DEG",
+ "DIM", /* $14 */
+ "END",
+ "NEW",
+ "OPEN",
+ "LOAD", /* $18 */
+ "SAVE",
+ "STATUS",
+ "NOTE",
+ "POINT", /* $1C */
+ "XIO",
+ "ON",
+ "POKE",
+ "PRINT", /* $20 */
+ "RAD",
+ "READ",
+ "RESTORE",
+ "RETURN", /* $24 */
+ "RUN",
+ "STOP",
+ "POP",
+ "?", /* $28 */
+ "GET",
+ "PUT",
+ "GRAPHICS",
+ "PLOT", /* $2C */
+ "POSITION",
+ "DOS",
+ "DRAWTO",
+ "SETCOLOR", /* $30 */
+ "LOCATE",
+ "SOUND",
+ "LPRINT",
+ "CSAVE", /* $34 */
+ "CLOAD",
+ "", /* $36, implied LET */
+ "ERROR- " /* $37 */
+};
+
+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,
+ ",", /* $12 */
+ "$",
+ ":", /* $14, named OP_COLON and OP_EOS in bas.h */
+ ";",
+ "", /* $16, EOL */
+ " GOTO ",
+ " GOSUB ", /* $18 */
+ " TO ",
+ " STEP ",
+ " THEN ",
+ "#", /* $1C */
+ "<=",
+ "<>",
+ ">=",
+ "<", /* $20 */
+ ">",
+ "=",
+ "^",
+ "*", /* $24 */
+ "+",
+ "-",
+ "/",
+ " NOT ", /* $28 */
+ " OR ",
+ " AND ",
+ "(",
+ ")",
+ "=",
+ "=",
+ "<=",
+ "<>", /* $30 */
+ ">=",
+ "<",
+ ">",
+ "=", /* $34 */
+ "+",
+ "-",
+ "(",
+ "", /* $38, redundant "(" for arrays */
+ "", /* $39, ditto for strings */
+ "(",
+ "(",
+ ",", /* $3C */
+ "STR$",
+ "CHR$",
+ "USR",
+ "ASC", /* $40 */
+ "VAL",
+ "LEN",
+ "ADR",
+ "ATN", /* $44 */
+ "COS",
+ "PEEK",
+ "SIN",
+ "RND", /* $48 */
+ "FRE",
+ "EXP",
+ "LOG",
+ "CLOG", /* $4C */
+ "SQR",
+ "SGN",
+ "ABS",
+ "INT", /* $50 */
+ "PADDLE",
+ "STICK",
+ "PTRIG",
+ "STRIG" /* $54 */
+};
+
+const unsigned short last_operator = (sizeof(operators) / sizeof(char *)) - 1;