Debian Codegraph @

terps/tads/tads3/vmimport.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2001, 2002 Michael J. Roberts. All Rights Reserved.
3 *
4 * Please see the accompanying license file, LICENSE.TXT, for information
5 * on using and copying this software.
6 */
7 /*
8 Name
9 vmimport.h - T3 VM imported symbol list
10 Function
11 Defines the list of symbols to import from the image file. Each
12 imported symbol must have an entry in this file.
13 Notes
14 Note that this file is NOT protected against multiple inclusion,
15 because it is included in several different ways to generate different
16 tables.
17
18 Each includer must define the generator macros (VM_IMPORT, VM_IMP_xxx,
19 etc) just before including this file. The macros are to be defined as
20 needed by the includer to generate the appropriate table entries for that
21 inclusion.
22 Modified
23 02/23/01 MJRoberts - Creation
24 */
25
26
27 /* if any of our macros are undefined, provide empty definitions now */
28 #ifndef VM_IMPORT_OBJ
29 #define VM_IMPORT_OBJ(sym, member_name)
30 #endif
31 #ifndef VM_IMPORT_PROP
32 #define VM_IMPORT_PROP(sym, member_name)
33 #endif
34 #ifndef VM_NOIMPORT_OBJ
35 #define VM_NOIMPORT_OBJ(sym, member_name)
36 #endif
37 #ifndef VM_NOIMPORT_PROP
38 #define VM_NOIMPORT_PROP(sym, member_name)
39 #endif
40 #ifndef VM_IMPORT_FUNC
41 #define VM_IMPORT_FUNC(symm, member_name)
42 #endif
43
44
45 /* ------------------------------------------------------------------------ */
46 /*
47 * This is the imported symbol table. Add symbols here as needed. Define
48 * each imported symbol as follows:
49 *
50 * VM_IMPORT_OBJ("object_symbol_name", predef_member_name) - import an
51 * object
52 *
53 * VM_IMPORT_PROP("prop_symbol_name", predef_member_name) - import a
54 * property
55 *
56 * VM_NOIMPORT_OBJ("object_symbol_name", predef_member_name) - define a
57 * named object, but do not generate an import for it; objects defined in
58 * this way are created after load. Any object that the VM creates on its
59 * own after load must be defined in this manner, so that the object can
60 * be identified in saved state files and restored properly.
61 *
62 * VM_NOIMPORT_PROP("prop_symbol_name", predef_member_name) - define a
63 * named property, but do not generate an import for it.
64 */
65
66 /* the base class for VM run-time exceptions */
67 VM_IMPORT_OBJ("RuntimeError", rterr)
68
69 /*
70 * the property in which we store the exception message text for VM
71 * run-time exceptions
72 */
73 VM_IMPORT_PROP(VM_IMPORT_NAME_RTERRMSG, rterrmsg_prop)
74
75 /* the constructor and destructor (finalizer) properties */
76 VM_IMPORT_PROP("Constructor", obj_construct)
77 VM_IMPORT_PROP("Destructor", obj_destruct)
78
79 /* the last property ID allocated by the compiler */
80 VM_IMPORT_PROP("LastProp", last_prop)
81
82 /* the property used to invoke the function in an anonymous function object */
83 VM_IMPORT_PROP("ObjectCallProp", obj_call_prop)
84
85 /* property invoked when an undefined property is invoked */
86 VM_IMPORT_PROP("propNotDefined", prop_not_defined_prop)
87
88 /* object representing a frame in a stack trace (t3GetStackTrace) */
89 VM_IMPORT_OBJ("T3StackInfo", stack_info_cls)
90
91 /* entrypoint function for restoring a saved state on startup */
92 VM_IMPORT_FUNC("mainRestore", main_restore_func)
93
94 /* "length" method property */
95 VM_IMPORT_PROP("length", length_prop)
96
97 /*
98 * the objects used to represent constant strings and lists, respectively,
99 * in method calls to such values
100 */
101 VM_NOIMPORT_OBJ(VM_IMPORT_NAME_CONSTSTR, const_str_obj)
102 VM_NOIMPORT_OBJ(VM_IMPORT_NAME_CONSTLST, const_lst_obj)
103
104 /*
105 * the array object that we use to keep track of the last allocated
106 * property ID (we keep this in an object so that property ID allocations
107 * can easily participate in the undo mechanism and are easily saved and
108 * restored)
109 */
110 VM_NOIMPORT_OBJ(VM_IMPORT_NAME_LASTPROPOBJ, last_prop_obj)
111
112 /* storage server error */
113 VM_IMPORT_OBJ("StorageServerError", storage_server_error)
114
115 /* String class imports */
116 VM_IMPORT_PROP("String.specialsToHtml.flags", string_sth_flags)
117 VM_IMPORT_PROP("String.specialsToHtml.tag", string_sth_tag)
118
119 /*
120 * the properties that the GrammarProd intrinsic class uses to indicate in
121 * a match tree the first and last token index of each match
122 */
123 VM_IMPORT_PROP("GrammarProd.firstTokenIndex", gramprod_first_tok)
124 VM_IMPORT_PROP("GrammarProd.lastTokenIndex", gramprod_last_tok)
125 VM_IMPORT_PROP("GrammarProd.tokenList", gramprod_token_list)
126 VM_IMPORT_PROP("GrammarProd.tokenMatchList", gramprod_token_match_list)
127 VM_IMPORT_PROP("GrammarProd.grammarTag", gramprod_tag)
128 VM_IMPORT_PROP("GrammarProd.miscVocab", misc_vocab)
129 VM_IMPORT_PROP("GrammarProd.altProps", gramprod_alt_props)
130
131 /*
132 * classes that GrammarProd.getGrammarInfo() instantiates to store the
133 * production description
134 */
135 VM_IMPORT_OBJ("GrammarProd.GrammarAltInfo", gramprod_gram_alt_info)
136 VM_IMPORT_OBJ("GrammarProd.GrammarAltTokInfo", gramprod_gram_alt_tok_info)
137
138 /*
139 * for the CharacterSet intrinsic class, the exception class for unknown
140 * local character mappings
141 */
142 VM_IMPORT_OBJ("CharacterSet.UnknownCharSetException", charset_unknown_exc)
143
144 /*
145 * exceptions for the File intrinsic class
146 */
147 VM_IMPORT_OBJ("File.FileNotFoundException", file_not_found_exc)
148 VM_IMPORT_OBJ("File.FileCreationException", file_creation_exc)
149 VM_IMPORT_OBJ("File.FileOpenException", file_open_exc)
150 VM_IMPORT_OBJ("File.FileIOException", file_io_exc)
151 VM_IMPORT_OBJ("File.FileSyncException", file_sync_exc)
152 VM_IMPORT_OBJ("File.FileClosedException", file_closed_exc)
153 VM_IMPORT_OBJ("File.FileModeException", file_mode_exc)
154 VM_IMPORT_OBJ("File.FileSafetyException", file_safety_exc)
155 VM_IMPORT_PROP("FileSpec.getFilename", filespec_getFilename)
156 VM_IMPORT_PROP("FileSpec.closeFile", filespec_closeFile)
157 VM_IMPORT_OBJ("File.FileInfo", file_info)
158
159 /* exceptions for the DynamicFunc intrinsic class */
160 VM_IMPORT_OBJ("DynamicFunc.CompilerException", compiler_exc)
161
162 /* properties for comparators */
163 VM_IMPORT_PROP("IfcComparator.calcHash", calc_hash_prop)
164 VM_IMPORT_PROP("IfcComparator.matchValues", match_values_prop)
165
166 /* properties for overloaded operators */
167 VM_IMPORT_PROP("operator +", operator_add)
168 VM_IMPORT_PROP("operator -", operator_sub)
169 VM_IMPORT_PROP("operator *", operator_mul)
170 VM_IMPORT_PROP("operator /", operator_div)
171 VM_IMPORT_PROP("operator %", operator_mod)
172 VM_IMPORT_PROP("operator ^", operator_xor)
173 VM_IMPORT_PROP("operator <<", operator_shl)
174 VM_IMPORT_PROP("operator >>", operator_ashr)
175 VM_IMPORT_PROP("operator >>>", operator_lshr)
176 VM_IMPORT_PROP("operator ~", operator_bit_not)
177 VM_IMPORT_PROP("operator &", operator_bit_and)
178 VM_IMPORT_PROP("operator |", operator_bit_or)
179 VM_IMPORT_PROP("operator negate", operator_neg)
180 VM_IMPORT_PROP("operator []", operator_idx)
181 VM_IMPORT_PROP("operator []=", operator_setidx)
182
183 /* objects and properties for the TADS Networking package */
184 VM_IMPORT_OBJ("TadsNet.NetException", net_exception)
185 VM_IMPORT_OBJ("TadsNet.SocketDisconnectException", net_reset_exception)
186 VM_IMPORT_OBJ("TadsNet.NetSafetyException", net_safety_exception)
187 VM_IMPORT_OBJ("TadsNet.NetEvent", net_event)
188 VM_IMPORT_OBJ("TadsNet.NetRequestEvent", net_request_event)
189 VM_IMPORT_OBJ("TadsNet.NetTimeoutEvent", net_timeout_event)
190 VM_IMPORT_OBJ("TadsNet.NetReplyEvent", net_reply_event)
191 VM_IMPORT_OBJ("TadsNet.NetReplyDoneEvent", net_reply_done_event)
192 VM_IMPORT_OBJ("TadsNet.FileUpload", file_upload_cl)
193 VM_IMPORT_PROP("TadsNet.FileUpload.file", file_upload_fileObj)
194 VM_IMPORT_PROP("TadsNet.FileUpload.contentType", file_upload_contentType)
195 VM_IMPORT_PROP("TadsNet.FileUpload.filename", file_upload_filename)
196
197 /* reflection services */
198 VM_IMPORT_OBJ("reflection.reflectionServices", reflection_services)
199 VM_IMPORT_PROP("reflection.valToSymbol", reflection_valToSymbol)
200
201 /* general-purpose object-to-string formatting */
202 VM_IMPORT_PROP("objToString", objToString)
203
204
205 /*
206 * now that we've built the table, undefine the macros used to build it,
207 * so that future includers can redefine the macros differently
208 */
209 #undef VM_IMPORT_OBJ
210 #undef VM_IMPORT_PROP
211 #undef VM_NOIMPORT_OBJ
212 #undef VM_NOIMPORT_PROP
213 #undef VM_IMPORT_FUNC