cfad47cfa3/tads3/vmimport.h

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
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
/* 
95
 *   the objects used to represent constant strings and lists, respectively,
96
 *   in method calls to such values 
97
 */
98
VM_NOIMPORT_OBJ(VM_IMPORT_NAME_CONSTSTR, const_str_obj)
99
VM_NOIMPORT_OBJ(VM_IMPORT_NAME_CONSTLST, const_lst_obj)
100
101
/*
102
 *   the array object that we use to keep track of the last allocated
103
 *   property ID (we keep this in an object so that property ID allocations
104
 *   can easily participate in the undo mechanism and are easily saved and
105
 *   restored) 
106
 */
107
VM_NOIMPORT_OBJ(VM_IMPORT_NAME_LASTPROPOBJ, last_prop_obj)
108
109
/* 
110
 *   the properties that the GrammarProd intrinsic class uses to indicate in
111
 *   a match tree the first and last token index of each match 
112
 */
113
VM_IMPORT_PROP("GrammarProd.firstTokenIndex", gramprod_first_tok)
114
VM_IMPORT_PROP("GrammarProd.lastTokenIndex", gramprod_last_tok)
115
VM_IMPORT_PROP("GrammarProd.tokenList", gramprod_token_list)
116
VM_IMPORT_PROP("GrammarProd.tokenMatchList", gramprod_token_match_list)
117
118
/* 
119
 *   classes that GrammarProd.getGrammarInfo() instantiates to store the
120
 *   production description 
121
 */
122
VM_IMPORT_OBJ("GrammarProd.GrammarAltInfo", gramprod_gram_alt_info)
123
VM_IMPORT_OBJ("GrammarProd.GrammarAltTokInfo", gramprod_gram_alt_tok_info)
124
125
/* 
126
 *   for the CharacterSet intrinsic class, the exception class for unknown
127
 *   local character mappings 
128
 */
129
VM_IMPORT_OBJ("CharacterSet.UnknownCharSetException", charset_unknown_exc)
130
131
/*
132
 *   exceptions for the File intrinsic class 
133
 */
134
VM_IMPORT_OBJ("File.FileNotFoundException", file_not_found_exc)
135
VM_IMPORT_OBJ("File.FileCreationException", file_creation_exc)
136
VM_IMPORT_OBJ("File.FileOpenException", file_open_exc)
137
VM_IMPORT_OBJ("File.FileIOException", file_io_exc)
138
VM_IMPORT_OBJ("File.FileSyncException", file_sync_exc)
139
VM_IMPORT_OBJ("File.FileClosedException", file_closed_exc)
140
VM_IMPORT_OBJ("File.FileModeException", file_mode_exc)
141
VM_IMPORT_OBJ("File.FileSafetyException", file_safety_exc)
142
143
/* properties for comparators */
144
VM_IMPORT_PROP("IfcComparator.calcHash", calc_hash_prop)
145
VM_IMPORT_PROP("IfcComparator.matchValues", match_values_prop)
146
147
148
/*
149
 *   now that we've built the table, undefine the macros used to build it,
150
 *   so that future includers can redefine the macros differently 
151
 */
152
#undef VM_IMPORT_OBJ
153
#undef VM_IMPORT_PROP
154
#undef VM_NOIMPORT_OBJ
155
#undef VM_NOIMPORT_PROP
156
#undef VM_IMPORT_FUNC