Debian Codegraph @

terps/hugo/source/htokens.h

raw symbols SCIP
1 /*
2 HTOKENS.H
3
4 contains token definitions
5 for the Hugo Compiler and Engine
6
7 Copyright (c) 1995-2009 by Kent Tessman
8
9 The enum constants of type TOKEN_T reflect the token names
10 given in the token array. Token names followed by a # are
11 for system use.
12 */
13
14
15 #define TOKENS 0x7B /* i.e., highest numbered token */
16
17 #define HASH_KEY 1023 /* arbitrary */
18
19
20 #if !defined (TOKEN_SET_DEFINED)
21 #define TOKEN_SET_DEFINED
22
23 enum TOKEN_T
24 {
25 /* 0x00 - 0x0f */
26 NULL_T, OPEN_BRACKET_T, CLOSE_BRACKET_T, DECIMAL_T,
27 COLON_T, EQUALS_T, MINUS_T, PLUS_T,
28 ASTERISK_T, FORWARD_SLASH_T, PIPE_T, SEMICOLON_T,
29 OPEN_BRACE_T, CLOSE_BRACE_T, OPEN_SQUARE_T, CLOSE_SQUARE_T,
30
31 /* 0x10 - 0x1f */
32 POUND_T, TILDE_T, GREATER_EQUAL_T, LESS_EQUAL_T,
33 NOT_EQUAL_T, AMPERSAND_T, GREATER_T, LESS_T,
34 IF_T, COMMA_T, ELSE_T, ELSEIF_T,
35 WHILE_T, DO_T, SELECT_T, CASE_T,
36
37 /* 0x20 - 0x2f */
38 FOR_T, RETURN_T, BREAK_T, AND_T,
39 OR_T, JUMP_T, RUN_T, IS_T,
40 NOT_T, TRUE_T, FALSE_T, LOCAL_T,
41 VERB_T, XVERB_T, HELD_T, MULTI_T,
42
43 /* 0x30 - 0x3f */
44 MULTIHELD_T, NEWLINE_T, ANYTHING_T, PRINT_T,
45 NUMBER_T, CAPITAL_T, TEXT_T, GRAPHICS_T,
46 COLOR_T, REMOVE_T, MOVE_T, TO_T,
47 PARENT_T, SIBLING_T, CHILD_T, YOUNGEST_T,
48
49 /* 0x40 - 0x4f */
50 ELDEST_T, YOUNGER_T, ELDER_T, PROP_T,
51 ATTR_T, VAR_T, DICTENTRY_T, TEXTDATA_T,
52 ROUTINE_T, DEBUGDATA_T, OBJECTNUM_T, VALUE_T,
53 EOL_T, SYSTEM_T, NOTHELD_T, MULTINOTHELD_T,
54
55 /* 0x50 - 0x5f */
56 WINDOW_T, RANDOM_T, WORD_T, LOCATE_T,
57 PARSE_T, CHILDREN_T, IN_T, PAUSE_T,
58 RUNEVENTS_T, ARRAYDATA_T, CALL_T, STRINGDATA_T,
59 SAVE_T, RESTORE_T, QUIT_T, INPUT_T,
60
61 /* 0x60 - 0x6f */
62 SERIAL_T, CLS_T, SCRIPTON_T, SCRIPTOFF_T,
63 RESTART_T, HEX_T, OBJECT_T, XOBJECT_T,
64 STRING_T, ARRAY_T, PRINTCHAR_T, UNDO_T,
65 DICT_T, RECORDON_T, RECORDOFF_T, WRITEFILE_T,
66
67 /* 0x70 - */
68 READFILE_T, WRITEVAL_T, READVAL_T, PLAYBACK_T,
69 COLOUR_T, PICTURE_T, LABEL_T, SOUND_T,
70 MUSIC_T, REPEAT_T, ADDCONTEXT_T, VIDEO_T
71 };
72
73 #endif /* if !defined (TOKEN_SET_DEFINED) */
74
75
76 #if defined (INIT_PASS)
77
78 char *token[] =
79 {
80 /* 0x00 - 0x0f */
81 "", "(", ")", ".", ":", "=", "-", "+",
82 "*", "/", "|", ";", "{", "}", "[", "]",
83
84 /* 0x10 - 0x1f */
85 "#", "~", ">=", "<=", "~=", "&", ">", "<",
86 "if", ",", "else", "elseif", "while", "do", "select", "case",
87
88 /* 0x20 - 0x2f */
89 "for", "return", "break", "and", "or", "jump", "run", "is",
90 "not", "true", "false", "local", "verb", "xverb", "held", "multi",
91
92 /* 0x30 - 0x3f */
93 "multiheld", "newline", "anything", "print",
94 "number", "capital", "text", "graphics",
95 "color", "remove", "move", "to",
96 "parent", "sibling", "child", "youngest",
97
98 /* 0x40 - 0x4f */
99 "eldest", "younger", "elder", "prop#",
100 "attr#", "var#", "dictentry#", "textdata#",
101 "routine#","debugdata#","objectnum#", "value#",
102 "eol#", "system", "notheld", "multinotheld",
103
104 /* 0x50 - 0x5f */
105 "window", "random", "word", "locate",
106 "parse$", "children", "in", "pause",
107 "runevents", "arraydata#", "call", "stringdata#",
108 "save", "restore", "quit", "input",
109
110 /* 0x60 - 0x6f */
111 "serial$", "cls", "scripton", "scriptoff",
112 "restart", "hex", "object", "xobject",
113 "string", "array", "printchar", "undo",
114 "dict", "recordon", "recordoff", "writefile",
115
116 /* 0x70 - */
117 "readfile", "writeval", "readval", "playback",
118 "colour", "picture", "label#", "sound",
119 "music", "repeat", "addcontext", "video"
120 };
121
122 int token_hash[TOKENS+1];
123
124 #else
125 extern char *token[];
126 extern int token_hash[];
127
128 #endif /* defined (INIT_PASS) */
129