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..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;