| 1 | /* $Header: d:/cvsroot/tads/tads3/TCPNDRV.H,v 1.4 1999/07/11 00:46:53 MJRoberts Exp $ */cxx . . $ `<file>/tads3/tcpndrv.h`/ |
| 2 | |
| 3 | /* |
| 4 | * Copyright (c) 1999, 2002 Michael J. Roberts. All Rights Reserved. |
| 5 | * |
| 6 | * Please see the accompanying license file, LICENSE.TXT, for information |
| 7 | * on using and copying this software. |
| 8 | */ |
| 9 | /* |
| 10 | Name |
| 11 | tcpndrv.h - parse node base classes derived from CTcPrsNode |
| 12 | Function |
| 13 | This file contains the intermediate classes derived from CTcPrsNode. |
| 14 | |
| 15 | CTcPrsNode is defined separately for each target code generator. |
| 16 | These classes are separated into this header file so that they can |
| 17 | be defined after the target-specific CTcPrsNode header has been |
| 18 | included, which in turn must be included after the base parse node |
| 19 | file, tcpnbase.h. Finally, after this file, the target-specific |
| 20 | derived classes header can be included. |
| 21 | |
| 22 | The sequence is thus: |
| 23 | |
| 24 | tcpnbase.h - target-independent CTcPrsNodeBase |
| 25 | ???.h - target-specific CTcPrsNode definition (file varies by target) |
| 26 | tcpnint.h - target-independent intermediate classes |
| 27 | ???.h - target-specific intermediate classes |
| 28 | tcpndrv.h - target-independent derived CTPNXxxBase classes |
| 29 | ???.h - target-specific derived CTPNXxx final classes |
| 30 | Notes |
| 31 | |
| 32 | Modified |
| 33 | 05/10/99 MJRoberts - Creation |
| 34 | */ |
| 35 | |
| 36 | #ifndef TCPNDRV_H |
| 37 | #define TCPNDRV_Hcxx . . $ `tads3/tcpndrv.h:37:9`! |
| 38 | |
| 39 | /* ------------------------------------------------------------------------ */ |
| 40 | /* |
| 41 | * "argcount" node |
| 42 | */ |
| 43 | class CTPNArgcBasecxx . . $ CTPNArgcBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 44 | { |
| 45 | public: |
| 46 | /* fold constants */ |
| 47 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNArgcBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 48 | { |
| 49 | /* simply return myself unchanged */ |
| 50 | return this; |
| 51 | } |
| 52 | |
| 53 | /* adjust for dynamic (run-time) compilation */ |
| 54 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNArgcBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 55 | { return this; } |
| 56 | }; |
| 57 | |
| 58 | /* ------------------------------------------------------------------------ */ |
| 59 | /* |
| 60 | * "self" node |
| 61 | */ |
| 62 | class CTPNSelfBasecxx . . $ CTPNSelfBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 63 | { |
| 64 | public: |
| 65 | /* fold constants */ |
| 66 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNSelfBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 67 | { |
| 68 | /* simply return myself unchanged */ |
| 69 | return this; |
| 70 | } |
| 71 | |
| 72 | /* adjust for dynamic (run-time) compilation */ |
| 73 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNSelfBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 74 | { return this; } |
| 75 | }; |
| 76 | |
| 77 | /* ------------------------------------------------------------------------ */ |
| 78 | /* |
| 79 | * "targetprop" node |
| 80 | */ |
| 81 | class CTPNTargetpropBasecxx . . $ CTPNTargetpropBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 82 | { |
| 83 | public: |
| 84 | /* fold constants */ |
| 85 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNTargetpropBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 86 | { |
| 87 | /* simply return myself unchanged */ |
| 88 | return this; |
| 89 | } |
| 90 | |
| 91 | /* adjust for dynamic (run-time) compilation */ |
| 92 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNTargetpropBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 93 | { return this; } |
| 94 | }; |
| 95 | |
| 96 | |
| 97 | /* ------------------------------------------------------------------------ */ |
| 98 | /* |
| 99 | * "targetobj" node |
| 100 | */ |
| 101 | class CTPNTargetobjBasecxx . . $ CTPNTargetobjBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 102 | { |
| 103 | public: |
| 104 | /* fold constants */ |
| 105 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNTargetobjBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 106 | { |
| 107 | /* simply return myself unchanged */ |
| 108 | return this; |
| 109 | } |
| 110 | |
| 111 | /* adjust for dynamic (run-time) compilation */ |
| 112 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNTargetobjBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 113 | { return this; } |
| 114 | }; |
| 115 | |
| 116 | |
| 117 | /* ------------------------------------------------------------------------ */ |
| 118 | /* |
| 119 | * "definingobj" node |
| 120 | */ |
| 121 | class CTPNDefiningobjBasecxx . . $ CTPNDefiningobjBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 122 | { |
| 123 | public: |
| 124 | /* fold constants */ |
| 125 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNDefiningobjBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) |
| 126 | { |
| 127 | /* simply return myself unchanged */ |
| 128 | return this; |
| 129 | } |
| 130 | |
| 131 | /* adjust for dynamic (run-time) compilation */ |
| 132 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNDefiningobjBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 133 | { return this; } |
| 134 | }; |
| 135 | |
| 136 | /* ------------------------------------------------------------------------ */ |
| 137 | /* |
| 138 | * "invokee" node |
| 139 | */ |
| 140 | class CTPNInvokeeBasecxx . . $ CTPNInvokeeBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 141 | { |
| 142 | public: |
| 143 | /* fold constants */ |
| 144 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNInvokeeBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) { return this; } |
| 145 | |
| 146 | /* adjust for dynamic (run-time) compilation */ |
| 147 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNInvokeeBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 148 | { return this; } |
| 149 | }; |
| 150 | |
| 151 | |
| 152 | /* ------------------------------------------------------------------------ */ |
| 153 | /* |
| 154 | * "inherited" node |
| 155 | */ |
| 156 | class CTPNInhBasecxx . . $ CTPNInhBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 157 | { |
| 158 | public: |
| 159 | CTPNInhBasecxx . . $ CTPNInhBase#CTPNInhBase(49f6e7a06ebc5aa8).() |
| 160 | { |
| 161 | typelist_cxx . . $ CTPNInhBase#typelist_. = 0; |
| 162 | } |
| 163 | |
| 164 | /* fold constants */ |
| 165 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNInhBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 166 | { |
| 167 | /* simply return myself unchanged */ |
| 168 | return this; |
| 169 | } |
| 170 | |
| 171 | /* adjust for dynamic (run-time) compilation */ |
| 172 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNInhBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 173 | { return this; } |
| 174 | |
| 175 | /* get/set the formal type list */ |
| 176 | class CTcFormalTypeListcxx . . $ CTcFormalTypeList# *get_typelistcxx . . $ CTPNInhBase#get_typelist(b17aee8cb4e5bafc).() const { return typelist_cxx . . $ CTPNInhBase#typelist_.; } |
| 177 | void set_typelistcxx . . $ CTPNInhBase#set_typelist(44c4056b834289f).(class CTcFormalTypeListcxx . . $ CTcFormalTypeList# *l) { typelist_cxx . . $ CTPNInhBase#typelist_. = l; } |
| 178 | |
| 179 | protected: |
| 180 | class CTcFormalTypeListcxx . . $ CTcFormalTypeList# *typelist_cxx . . $ CTPNInhBase#typelist_.; |
| 181 | }; |
| 182 | |
| 183 | /* |
| 184 | * "inherited class" node - for (inherited superclass.method) construct |
| 185 | */ |
| 186 | class CTPNInhClassBasecxx . . $ CTPNInhClassBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 187 | { |
| 188 | public: |
| 189 | CTPNInhClassBasecxx . . $ CTPNInhClassBase#CTPNInhClassBase(7cafb6e0818eff3b).(const char *sym, size_t len) |
| 190 | { |
| 191 | sym_cxx . . $ CTPNInhClassBase#sym_. = sym; |
| 192 | len_cxx . . $ CTPNInhClassBase#len_. = len; |
| 193 | } |
| 194 | |
| 195 | /* fold constants */ |
| 196 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNInhClassBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 197 | { |
| 198 | /* simply return myself unchanged */ |
| 199 | return this; |
| 200 | } |
| 201 | |
| 202 | /* adjust for dynamic (run-time) compilation */ |
| 203 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNInhClassBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 204 | { return this; } |
| 205 | |
| 206 | protected: |
| 207 | /* the superclass name symbol and its length */ |
| 208 | const char *sym_cxx . . $ CTPNInhClassBase#sym_.; |
| 209 | size_t len_cxx . . $ CTPNInhClassBase#len_.; |
| 210 | }; |
| 211 | |
| 212 | |
| 213 | /* |
| 214 | * "delegated" node - for (delegated expr.method) construct |
| 215 | */ |
| 216 | class CTPNDelegatedBasecxx . . $ CTPNDelegatedBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 217 | { |
| 218 | public: |
| 219 | CTPNDelegatedBasecxx . . $ CTPNDelegatedBase#CTPNDelegatedBase(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *delegatee) |
| 220 | { |
| 221 | delegatee_cxx . . $ CTPNDelegatedBase#delegatee_. = delegatee; |
| 222 | } |
| 223 | |
| 224 | /* fold constants */ |
| 225 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNDelegatedBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 226 | { |
| 227 | /* fold constants in the delegatee */ |
| 228 | delegatee_cxx . . $ CTPNDelegatedBase#delegatee_. = delegatee_cxx . . $ CTPNDelegatedBase#delegatee_.->fold_constantscxx . . $ CTcPrsNodeBase#fold_constants(ec2152be3a5a18d3).(symtab); |
| 229 | |
| 230 | /* return myself otherwise unchanged */ |
| 231 | return this; |
| 232 | } |
| 233 | |
| 234 | /* adjust for dynamic (run-time) compilation */ |
| 235 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNDelegatedBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 236 | { |
| 237 | /* adjust the delegatee subexpression */ |
| 238 | delegatee_cxx . . $ CTPNDelegatedBase#delegatee_. = delegatee_cxx . . $ CTPNDelegatedBase#delegatee_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 239 | |
| 240 | /* return myself otherwise unchanged */ |
| 241 | return this; |
| 242 | } |
| 243 | |
| 244 | protected: |
| 245 | /* the delegatee (the object to which we delegate the method) */ |
| 246 | CTcPrsNodecxx . . $ CTcPrsNode# *delegatee_cxx . . $ CTPNDelegatedBase#delegatee_.; |
| 247 | }; |
| 248 | |
| 249 | /* |
| 250 | * "replaced" node |
| 251 | */ |
| 252 | class CTPNReplacedBasecxx . . $ CTPNReplacedBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 253 | { |
| 254 | public: |
| 255 | /* fold constants */ |
| 256 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNReplacedBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 257 | { |
| 258 | /* simply return myself unchanged */ |
| 259 | return this; |
| 260 | } |
| 261 | |
| 262 | /* adjust for dynamic (run-time) compilation */ |
| 263 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNReplacedBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 264 | { return this; } |
| 265 | }; |
| 266 | |
| 267 | |
| 268 | /* ------------------------------------------------------------------------ */ |
| 269 | /* |
| 270 | * Parse node for constant values (numbers, strings) |
| 271 | */ |
| 272 | class CTPNConstBasecxx . . $ CTPNConstBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 273 | { |
| 274 | public: |
| 275 | CTPNConstBasecxx . . $ CTPNConstBase#CTPNConstBase(63e889a2aa8150b1).(const CTcConstValcxx . . $ CTcConstVal# *val) { val_cxx . . $ CTPNConstBase#val_. =cxx . . $ CTcConstVal#`operator=`(983ee9f1a836fa0a). *val; } |
| 276 | |
| 277 | /* get the constant value of the node */ |
| 278 | virtual class CTcConstValcxx . . $ CTcConstVal# *get_const_valcxx . . $ CTPNConstBase#get_const_val(78964007e8d3aff7).() { return &val_cxx . . $ CTPNConstBase#val_.; } |
| 279 | |
| 280 | /* fold constants */ |
| 281 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNConstBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 282 | { |
| 283 | /* simply return myself unchanged */ |
| 284 | return this; |
| 285 | } |
| 286 | |
| 287 | /* adjust for dynamic (run-time) compilation */ |
| 288 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNConstBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 289 | |
| 290 | /* check to see if this is a boolean value */ |
| 291 | virtual int is_boolcxx . . $ CTPNConstBase#is_bool(455f465bc33b4cdf).() const { return val_cxx . . $ CTPNConstBase#val_..is_boolcxx . . $ CTcConstVal#is_bool(455f465bc33b4cdf).(); } |
| 292 | |
| 293 | protected: |
| 294 | CTcConstValcxx . . $ CTcConstVal# val_cxx . . $ CTPNConstBase#val_.; |
| 295 | }; |
| 296 | |
| 297 | /* |
| 298 | * The target must define a subclass, CTPNDebugConst, for use when |
| 299 | * evaluating debugger expressions. |
| 300 | */ |
| 301 | /* class CTPNDebugConst: public CTPNConst ... */ |
| 302 | |
| 303 | /* ------------------------------------------------------------------------ */ |
| 304 | /* |
| 305 | * Address-of Operator |
| 306 | */ |
| 307 | class CTPNAddrBasecxx . . $ CTPNAddrBase#: public CTPNUnarycxx . . $ CTPNUnary# |
| 308 | { |
| 309 | public: |
| 310 | CTPNAddrBasecxx . . $ CTPNAddrBase#CTPNAddrBase(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *sub) |
| 311 | : CTPNUnarycxx . . $ CTPNUnary#(sub) { } |
| 312 | |
| 313 | /* this is an address expression */ |
| 314 | virtual int is_addrcxx . . $ CTPNAddrBase#is_addr(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 315 | |
| 316 | /* |
| 317 | * Determine if this address expression is the same as a given |
| 318 | * address expression. Returns true if so, false if not. Sets |
| 319 | * (*comparable) to true if the comparison is meaningful, false if |
| 320 | * not; if (*comparable) is set to false, the caller should not |
| 321 | * attempt to perform a compile-time comparison of the addresses, |
| 322 | * and must defer the comparison to run-time. |
| 323 | */ |
| 324 | int is_addr_eqcxx . . $ CTPNAddrBase#is_addr_eq(2b8b39ff80d57d9b).(const class CTPNAddrcxx . . $ CTPNAddr# *, int *comparable) const; |
| 325 | |
| 326 | /* adjust for dynamic (run-time) compilation */ |
| 327 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNAddrBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 328 | { return this; } |
| 329 | |
| 330 | /* fold constants */ |
| 331 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNAddrBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 332 | }; |
| 333 | |
| 334 | /* ------------------------------------------------------------------------ */ |
| 335 | /* |
| 336 | * Symbol node. This node handles symbols that are not resolved at |
| 337 | * parse time, and whose resolution must be deferred to code generation. |
| 338 | * Any symbol that doesn't resolve at parse time to something in local |
| 339 | * scope uses this type of node. |
| 340 | */ |
| 341 | class CTPNSymBasecxx . . $ CTPNSymBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 342 | { |
| 343 | public: |
| 344 | CTPNSymBasecxx . . $ CTPNSymBase#CTPNSymBase(7cafb6e0818eff3b).(const char *sym, size_t len) |
| 345 | { |
| 346 | /* remember my symbol name */ |
| 347 | sym_cxx . . $ CTPNSymBase#sym_. = sym; |
| 348 | len_cxx . . $ CTPNSymBase#len_. = len; |
| 349 | } |
| 350 | |
| 351 | /* |
| 352 | * Assume that a simple symbol primary can be used as an lvalue. |
| 353 | * Some symbols are not suitable as lvalues, but we can't know this |
| 354 | * at parse time, so assume that an lvalue is okay for now. |
| 355 | */ |
| 356 | virtual int check_lvaluecxx . . $ CTPNSymBase#check_lvalue(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 357 | |
| 358 | /* check to see if this is an lvalue, resolving in the given scope */ |
| 359 | virtual int check_lvalue_resolvedcxx . . $ CTPNSymBase#check_lvalue_resolved(4e8c269856e3e20f).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) const; |
| 360 | |
| 361 | /* |
| 362 | * At parse time, assume that we can take the address of a simple |
| 363 | * symbol primary. |
| 364 | */ |
| 365 | virtual int has_addrcxx . . $ CTPNSymBase#has_addr(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 366 | |
| 367 | /* determine if I have a return value when called */ |
| 368 | virtual int has_return_value_on_callcxx . . $ CTPNSymBase#has_return_value_on_call(455f465bc33b4cdf).() const; |
| 369 | |
| 370 | /* get my symbol information */ |
| 371 | const char *get_sym_textcxx . . $ CTPNSymBase#get_sym_text(a9f41ea0e82d88cf).() const { return sym_cxx . . $ CTPNSymBase#sym_.; } |
| 372 | size_t get_sym_text_lencxx . . $ CTPNSymBase#get_sym_text_len(fe4d2d262d4164a8).() const { return len_cxx . . $ CTPNSymBase#len_.; } |
| 373 | int sym_text_matchescxx . . $ CTPNSymBase#sym_text_matches(4278251323722c4f).(const char *sym, size_t len) const |
| 374 | { return (len_cxx . . $ CTPNSymBase#len_. == len && memcmp(sym, sym_cxx . . $ CTPNSymBase#sym_., len) == 0); } |
| 375 | |
| 376 | /* fold constants */ |
| 377 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNSymBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 378 | |
| 379 | /* generate a constant node for my address value */ |
| 380 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_addr_constcxx . . $ CTPNSymBase#fold_addr_const(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 381 | |
| 382 | /* adjust for dynamic (run-time) compilation */ |
| 383 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNSymBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *); |
| 384 | |
| 385 | protected: |
| 386 | /* my symbol */ |
| 387 | const char *sym_cxx . . $ CTPNSymBase#sym_.; |
| 388 | size_t len_cxx . . $ CTPNSymBase#len_.; |
| 389 | }; |
| 390 | |
| 391 | /* ------------------------------------------------------------------------ */ |
| 392 | /* |
| 393 | * Resolved symbol node. This node handles symbols that are resolve |
| 394 | * during parsing. All local scope symbols, by the nature of the |
| 395 | * language, are resolvable during parsing, because local scope symbols |
| 396 | * must be declared before their first use. |
| 397 | */ |
| 398 | class CTPNSymResolvedBasecxx . . $ CTPNSymResolvedBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 399 | { |
| 400 | public: |
| 401 | CTPNSymResolvedBasecxx . . $ CTPNSymResolvedBase#CTPNSymResolvedBase(3ddcefa113cb28cb).(CTcSymbolcxx . . $ CTcSymbol# *sym) |
| 402 | { |
| 403 | /* remember my symbol table entry */ |
| 404 | sym_cxx . . $ CTPNSymResolvedBase#sym_. = sym; |
| 405 | } |
| 406 | |
| 407 | /* get my symbol information */ |
| 408 | const char *get_sym_textcxx . . $ CTPNSymResolvedBase#get_sym_text(a9f41ea0e82d88cf).() const { return sym_cxx . . $ CTPNSymResolvedBase#sym_.->get_symcxx . . $ CTcSymbolBase#get_sym(a9f41ea0e82d88cf).(); } |
| 409 | size_t get_sym_text_lencxx . . $ CTPNSymResolvedBase#get_sym_text_len(fe4d2d262d4164a8).() const { return sym_cxx . . $ CTPNSymResolvedBase#sym_.->get_sym_lencxx . . $ CTcSymbolBase#get_sym_len(fe4d2d262d4164a8).(); } |
| 410 | int sym_text_matchescxx . . $ CTPNSymResolvedBase#sym_text_matches(4278251323722c4f).(const char *sym, size_t len) const |
| 411 | { |
| 412 | return (sym_cxx . . $ CTPNSymResolvedBase#sym_.->get_sym_lencxx . . $ CTcSymbolBase#get_sym_len(fe4d2d262d4164a8).() == len |
| 413 | && memcmp(sym, sym_cxx . . $ CTPNSymResolvedBase#sym_.->get_symcxx . . $ CTcSymbolBase#get_sym(a9f41ea0e82d88cf).(), len) == 0); |
| 414 | } |
| 415 | |
| 416 | /* determine if I can be an lvalue */ |
| 417 | virtual int check_lvaluecxx . . $ CTPNSymResolvedBase#check_lvalue(455f465bc33b4cdf).() const { return sym_cxx . . $ CTPNSymResolvedBase#sym_.->check_lvaluecxx . . $ CTcSymbolBase#check_lvalue(455f465bc33b4cdf).(); } |
| 418 | |
| 419 | /* |
| 420 | * check to see if this is an lvalue, resolving in the given scope - |
| 421 | * this type of symbol is pre-resolved, so we can ignore the symbol |
| 422 | * table and just ask our resoloved symbol directly |
| 423 | */ |
| 424 | virtual int check_lvalue_resolvedcxx . . $ CTPNSymResolvedBase#check_lvalue_resolved(4e8c269856e3e20f).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) const |
| 425 | { return sym_cxx . . $ CTPNSymResolvedBase#sym_.->check_lvaluecxx . . $ CTcSymbolBase#check_lvalue(455f465bc33b4cdf).(); } |
| 426 | |
| 427 | /* determine if I have an address */ |
| 428 | virtual int has_addrcxx . . $ CTPNSymResolvedBase#has_addr(455f465bc33b4cdf).() const { return sym_cxx . . $ CTPNSymResolvedBase#sym_.->has_addrcxx . . $ CTcSymbolBase#has_addr(455f465bc33b4cdf).(); } |
| 429 | |
| 430 | /* determine if I have a return value when called as a function */ |
| 431 | virtual int has_return_value_on_callcxx . . $ CTPNSymResolvedBase#has_return_value_on_call(455f465bc33b4cdf).() const |
| 432 | { return sym_cxx . . $ CTPNSymResolvedBase#sym_.->has_return_value_on_callcxx . . $ CTcSymbolBase#has_return_value_on_call(455f465bc33b4cdf).(); } |
| 433 | |
| 434 | /* fold constants */ |
| 435 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNSymResolvedBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 436 | |
| 437 | /* generate a constant node for my address value */ |
| 438 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_addr_constcxx . . $ CTPNSymResolvedBase#fold_addr_const(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 439 | |
| 440 | /* adjust for dynamic (run-time) compilation */ |
| 441 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNSymResolvedBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 442 | { return this; } |
| 443 | |
| 444 | protected: |
| 445 | /* the symbol table entry for this symbol */ |
| 446 | class CTcSymbolcxx . . $ CTcSymbol# *sym_cxx . . $ CTPNSymResolvedBase#sym_.; |
| 447 | }; |
| 448 | |
| 449 | /* ------------------------------------------------------------------------ */ |
| 450 | /* |
| 451 | * Debugger local variable resolved symbol |
| 452 | */ |
| 453 | class CTPNSymDebugLocalBasecxx . . $ CTPNSymDebugLocalBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 454 | { |
| 455 | public: |
| 456 | CTPNSymDebugLocalBasecxx . . $ CTPNSymDebugLocalBase#CTPNSymDebugLocalBase(e21b419b19a992ef).(const struct tcprsdbg_sym_infocxx . . $ tcprsdbg_sym_info# *info); |
| 457 | |
| 458 | /* locals can always be lvalues */ |
| 459 | virtual int check_lvaluecxx . . $ CTPNSymDebugLocalBase#check_lvalue(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 460 | virtual int check_lvalue_resolvedcxx . . $ CTPNSymDebugLocalBase#check_lvalue_resolved(4e8c269856e3e20f).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) const |
| 461 | { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 462 | |
| 463 | /* determine if I have an address */ |
| 464 | virtual int has_addrcxx . . $ CTPNSymDebugLocalBase#has_addr(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 465 | |
| 466 | /* |
| 467 | * Determine if I have a return value when called as a function. We |
| 468 | * have to assume that we do, since we can't know in advance what the |
| 469 | * variable will hold at run-time. If it holds a function with a |
| 470 | * return value, we'll need to return the value; if it doesn't, the |
| 471 | * function will effectively return nil, so returning the non-result |
| 472 | * will do no harm. |
| 473 | */ |
| 474 | virtual int has_return_value_on_callcxx . . $ CTPNSymDebugLocalBase#has_return_value_on_call(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 475 | |
| 476 | /* fold constants */ |
| 477 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNSymDebugLocalBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) { return this; } |
| 478 | |
| 479 | /* adjust for dynamic (run-time) compilation */ |
| 480 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNSymDebugLocalBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 481 | { return this; } |
| 482 | |
| 483 | protected: |
| 484 | /* local variable ID */ |
| 485 | uintcxx . . $ uint# var_id_cxx . . $ CTPNSymDebugLocalBase#var_id_.; |
| 486 | |
| 487 | /* context array index for this variable, if I'm in a context */ |
| 488 | int ctx_arr_idx_cxx . . $ CTPNSymDebugLocalBase#ctx_arr_idx_.; |
| 489 | |
| 490 | /* stack frame index */ |
| 491 | uintcxx . . $ uint# frame_idx_cxx . . $ CTPNSymDebugLocalBase#frame_idx_.; |
| 492 | |
| 493 | /* is this a parameter? (if not, it's a local) */ |
| 494 | uintcxx . . $ uint# is_param_cxx . . $ CTPNSymDebugLocalBase#is_param_. : 1; |
| 495 | |
| 496 | }; |
| 497 | |
| 498 | /* ------------------------------------------------------------------------ */ |
| 499 | /* |
| 500 | * Argument List |
| 501 | */ |
| 502 | class CTPNArglistBasecxx . . $ CTPNArglistBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 503 | { |
| 504 | public: |
| 505 | CTPNArglistBasecxx . . $ CTPNArglistBase#CTPNArglistBase(bdfe80eb25c4b024).(int argc, class CTPNArgcxx . . $ CTPNArg# *list_head) |
| 506 | { |
| 507 | /* remember the argument count and list head */ |
| 508 | argc_cxx . . $ CTPNArglistBase#argc_. = argc; |
| 509 | list_cxx . . $ CTPNArglistBase#list_. = list_head; |
| 510 | } |
| 511 | |
| 512 | /* get/set the argument count */ |
| 513 | int get_argccxx . . $ CTPNArglistBase#get_argc(455f465bc33b4cdf).() const { return argc_cxx . . $ CTPNArglistBase#argc_.; } |
| 514 | void set_argccxx . . $ CTPNArglistBase#set_argc(d4f767463ce0a6b3).(int argc) { argc_cxx . . $ CTPNArglistBase#argc_. = argc; } |
| 515 | |
| 516 | /* |
| 517 | * Get the head argument of the list. The other arguments can be |
| 518 | * obtained by following the linked list from this one. Note that |
| 519 | * we build some argument lists in reverse order, with the last |
| 520 | * argument at the head of the list. |
| 521 | */ |
| 522 | class CTPNArgcxx . . $ CTPNArg# *get_arg_list_headcxx . . $ CTPNArglistBase#get_arg_list_head(fbc7738340ebad35).() const { return list_cxx . . $ CTPNArglistBase#list_.; } |
| 523 | |
| 524 | /* set the argument list head */ |
| 525 | void set_arg_list_headcxx . . $ CTPNArglistBase#set_arg_list_head(459f5ba72bfb6a16).(class CTPNArgcxx . . $ CTPNArg# *head) { list_cxx . . $ CTPNArglistBase#list_. = head; } |
| 526 | |
| 527 | /* fold constants */ |
| 528 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNArglistBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 529 | |
| 530 | /* adjust for dynamic (run-time) compilation */ |
| 531 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNArglistBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 532 | |
| 533 | protected: |
| 534 | /* |
| 535 | * argument count (this is simply the number of entries in the list, |
| 536 | * but we keep it separately for easy access) |
| 537 | */ |
| 538 | int argc_cxx . . $ CTPNArglistBase#argc_.; |
| 539 | |
| 540 | /* head of the argument list */ |
| 541 | class CTPNArgcxx . . $ CTPNArg# *list_cxx . . $ CTPNArglistBase#list_.; |
| 542 | }; |
| 543 | |
| 544 | |
| 545 | /* ------------------------------------------------------------------------ */ |
| 546 | /* |
| 547 | * Argument list entry. Each list entry has the expression for the |
| 548 | * argument and a pointer to the next element of the argument list. |
| 549 | */ |
| 550 | class CTPNArgBasecxx . . $ CTPNArgBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 551 | { |
| 552 | public: |
| 553 | CTPNArgBasecxx . . $ CTPNArgBase#CTPNArgBase(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *arg_expr) |
| 554 | { |
| 555 | /* remember the expression for this argument */ |
| 556 | arg_expr_cxx . . $ CTPNArgBase#arg_expr_. = arg_expr; |
| 557 | |
| 558 | /* there's nothing else in our list yet */ |
| 559 | next_arg_cxx . . $ CTPNArgBase#next_arg_. = 0; |
| 560 | |
| 561 | /* assume it's not a list-to-varargs conversion */ |
| 562 | is_varargs_cxx . . $ CTPNArgBase#is_varargs_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 563 | |
| 564 | /* presume no argument name */ |
| 565 | name_cxx . . $ CTPNArgBase#name_..settypcxx . . $ CTcToken#settyp(b6c036861e771a25).(TOKT_INVALIDcxx . . $ TOKT_INVALID.); |
| 566 | } |
| 567 | |
| 568 | /* set the parameter name, for a "name: value" argument */ |
| 569 | void set_namecxx . . $ CTPNArgBase#set_name(cf347308e962de74).(const class CTcTokencxx . . $ CTcToken# *tok); |
| 570 | |
| 571 | /* get the name and its length */ |
| 572 | const char *get_namecxx . . $ CTPNArgBase#get_name(a9f41ea0e82d88cf).() const { return name_cxx . . $ CTPNArgBase#name_..get_textcxx . . $ CTcToken#get_text(a9f41ea0e82d88cf).(); } |
| 573 | size_t get_name_lencxx . . $ CTPNArgBase#get_name_len(fe4d2d262d4164a8).() const { return name_cxx . . $ CTPNArgBase#name_..get_text_lencxx . . $ CTcToken#get_text_len(fe4d2d262d4164a8).(); } |
| 574 | |
| 575 | /* is this a named parameter? */ |
| 576 | int is_named_paramcxx . . $ CTPNArgBase#is_named_param(b126dc7c1de90089).() { return name_cxx . . $ CTPNArgBase#name_..gettypcxx . . $ CTcToken#gettyp(3dcf269a9f63bfba).() != TOKT_INVALIDcxx . . $ TOKT_INVALID.; } |
| 577 | |
| 578 | /* get the argument expression */ |
| 579 | CTcPrsNodecxx . . $ CTcPrsNode# *get_arg_exprcxx . . $ CTPNArgBase#get_arg_expr(d201019a7d73592c).() const { return arg_expr_cxx . . $ CTPNArgBase#arg_expr_.; } |
| 580 | |
| 581 | /* get the next argument in my list */ |
| 582 | class CTPNArgcxx . . $ CTPNArg# *get_next_argcxx . . $ CTPNArgBase#get_next_arg(fbc7738340ebad35).() const { return next_arg_cxx . . $ CTPNArgBase#next_arg_.; } |
| 583 | |
| 584 | /* set the next element in my list */ |
| 585 | void set_next_argcxx . . $ CTPNArgBase#set_next_arg(459f5ba72bfb6a16).(class CTPNArgcxx . . $ CTPNArg# *prv) { next_arg_cxx . . $ CTPNArgBase#next_arg_. = prv; } |
| 586 | |
| 587 | /* fold constants */ |
| 588 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNArgBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 589 | |
| 590 | /* adjust for dynamic (run-time) compilation */ |
| 591 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNArgBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 592 | { |
| 593 | /* adjust the expression */ |
| 594 | arg_expr_cxx . . $ CTPNArgBase#arg_expr_. = arg_expr_cxx . . $ CTPNArgBase#arg_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 595 | |
| 596 | /* return myself otherwise unchanged */ |
| 597 | return this; |
| 598 | } |
| 599 | |
| 600 | /* get/set list-to-varargs conversion flag */ |
| 601 | int is_varargscxx . . $ CTPNArgBase#is_varargs(455f465bc33b4cdf).() const { return is_varargs_cxx . . $ CTPNArgBase#is_varargs_.; } |
| 602 | void set_varargscxx . . $ CTPNArgBase#set_varargs(d4f767463ce0a6b3).(int f) { is_varargs_cxx . . $ CTPNArgBase#is_varargs_. = (f != 0); } |
| 603 | |
| 604 | protected: |
| 605 | /* argument expression */ |
| 606 | CTcPrsNodecxx . . $ CTcPrsNode# *arg_expr_cxx . . $ CTPNArgBase#arg_expr_.; |
| 607 | |
| 608 | /* next argument in the list */ |
| 609 | class CTPNArgcxx . . $ CTPNArg# *next_arg_cxx . . $ CTPNArgBase#next_arg_.; |
| 610 | |
| 611 | /* the parameter name, for a "name: expression" argument */ |
| 612 | CTcTokencxx . . $ CTcToken# name_cxx . . $ CTPNArgBase#name_.; |
| 613 | |
| 614 | /* flag: this is a list-to-varargs parameter */ |
| 615 | unsigned int is_varargs_cxx . . $ CTPNArgBase#is_varargs_. : 1; |
| 616 | }; |
| 617 | |
| 618 | |
| 619 | |
| 620 | /* ------------------------------------------------------------------------ */ |
| 621 | /* |
| 622 | * Function/Method Call node |
| 623 | */ |
| 624 | class CTPNCallBasecxx . . $ CTPNCallBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 625 | { |
| 626 | public: |
| 627 | CTPNCallBasecxx . . $ CTPNCallBase#CTPNCallBase(6b1ba6291bddd291).(CTcPrsNodecxx . . $ CTcPrsNode# *func, class CTPNArglistcxx . . $ CTPNArglist# *arglist) |
| 628 | { |
| 629 | /* remember the expression giving the function or method to call */ |
| 630 | func_cxx . . $ CTPNCallBase#func_. = func; |
| 631 | |
| 632 | /* remember the argument list */ |
| 633 | arglist_cxx . . $ CTPNCallBase#arglist_. = arglist; |
| 634 | } |
| 635 | |
| 636 | /* get the function to call */ |
| 637 | CTcPrsNodecxx . . $ CTcPrsNode# *get_funccxx . . $ CTPNCallBase#get_func(d201019a7d73592c).() const { return func_cxx . . $ CTPNCallBase#func_.; } |
| 638 | |
| 639 | /* get the argument list */ |
| 640 | class CTPNArglistcxx . . $ CTPNArglist# *get_arg_listcxx . . $ CTPNCallBase#get_arg_list(b53ed4538afc7c51).() const { return arglist_cxx . . $ CTPNCallBase#arglist_.; } |
| 641 | |
| 642 | /* fold constants */ |
| 643 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNCallBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 644 | |
| 645 | /* we have a return value if our function has a return value */ |
| 646 | virtual int has_return_valuecxx . . $ CTPNCallBase#has_return_value(455f465bc33b4cdf).() const |
| 647 | { return func_cxx . . $ CTPNCallBase#func_.->has_return_value_on_callcxx . . $ CTcPrsNodeBase#has_return_value_on_call(455f465bc33b4cdf).(); } |
| 648 | |
| 649 | /* adjust for dynamic (run-time) compilation */ |
| 650 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNCallBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 651 | |
| 652 | protected: |
| 653 | /* expression giving function or method to call */ |
| 654 | CTcPrsNodecxx . . $ CTcPrsNode# *func_cxx . . $ CTPNCallBase#func_.; |
| 655 | |
| 656 | /* argument list */ |
| 657 | class CTPNArglistcxx . . $ CTPNArglist# *arglist_cxx . . $ CTPNCallBase#arglist_.; |
| 658 | }; |
| 659 | |
| 660 | |
| 661 | /* ------------------------------------------------------------------------ */ |
| 662 | /* |
| 663 | * double-quoted string node |
| 664 | */ |
| 665 | class CTPNDstrBasecxx . . $ CTPNDstrBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 666 | { |
| 667 | public: |
| 668 | CTPNDstrBasecxx . . $ CTPNDstrBase#CTPNDstrBase(7cafb6e0818eff3b).(const char *str, size_t len); |
| 669 | |
| 670 | /* get my string information */ |
| 671 | const char *get_strcxx . . $ CTPNDstrBase#get_str(a9f41ea0e82d88cf).() const { return str_cxx . . $ CTPNDstrBase#str_.; } |
| 672 | size_t get_str_lencxx . . $ CTPNDstrBase#get_str_len(fe4d2d262d4164a8).() const { return len_cxx . . $ CTPNDstrBase#len_.; } |
| 673 | |
| 674 | /* I'm a double-quoted string node */ |
| 675 | virtual int is_dstringcxx . . $ CTPNDstrBase#is_dstring(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 676 | virtual int is_dstring_exprcxx . . $ CTPNDstrBase#is_dstring_expr(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 677 | |
| 678 | /* fold constants - there's nothing extra to do here */ |
| 679 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNDstrBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 680 | { return this; } |
| 681 | |
| 682 | /* double-quoted strings have no value */ |
| 683 | virtual int has_return_valuecxx . . $ CTPNDstrBase#has_return_value(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 684 | |
| 685 | /* adjust for dynamic (run-time) compilation */ |
| 686 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNDstrBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 687 | |
| 688 | protected: |
| 689 | /* my string */ |
| 690 | const char *str_cxx . . $ CTPNDstrBase#str_.; |
| 691 | size_t len_cxx . . $ CTPNDstrBase#len_.; |
| 692 | }; |
| 693 | |
| 694 | /* |
| 695 | * The target must also define CTPNDebugDstr, a subclass of CTPNDstr. |
| 696 | * This for use in debugger expressions. |
| 697 | */ |
| 698 | /* class CTPNDebugDstr: public CTPNDstr ... */ |
| 699 | |
| 700 | /* |
| 701 | * Double-quoted string embedding. This node contains an expression |
| 702 | * embedded with the "<< >>" notation inside a double-quoted string. |
| 703 | * This type of expression requires an implicit say() call. |
| 704 | */ |
| 705 | class CTPNDstrEmbedBasecxx . . $ CTPNDstrEmbedBase#: public CTPNUnarycxx . . $ CTPNUnary# |
| 706 | { |
| 707 | public: |
| 708 | CTPNDstrEmbedBasecxx . . $ CTPNDstrEmbedBase#CTPNDstrEmbedBase(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *sub) |
| 709 | : CTPNUnarycxx . . $ CTPNUnary#(sub) { } |
| 710 | |
| 711 | /* this is part of a dstring expression */ |
| 712 | virtual int is_dstring_exprcxx . . $ CTPNDstrEmbedBase#is_dstring_expr(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 713 | |
| 714 | /* we have no return value */ |
| 715 | virtual int has_return_valuecxx . . $ CTPNDstrEmbedBase#has_return_value(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 716 | |
| 717 | /* adjust for dynamic (run-time) compilation */ |
| 718 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNDstrEmbedBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 719 | { |
| 720 | /* don't allow in speculative mode due to side effects */ |
| 721 | if (info->speculativecxx . . $ tcpn_dyncomp_info#speculative.) |
| 722 | err_throwcxx . . $ err_throw(cb2f890c2fdad230).(VMERR_BAD_SPEC_EVALcxx . . $ `tads3/vmerrnum.h:537:9`!); |
| 723 | |
| 724 | /* inherit default unary operator handling */ |
| 725 | return CTPNUnarycxx . . $ CTPNUnary#::adjust_for_dyncxx . . $ CTPNUnaryBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 726 | } |
| 727 | }; |
| 728 | |
| 729 | /* ------------------------------------------------------------------------ */ |
| 730 | /* |
| 731 | * An embedded <<one of>> list in a string. |
| 732 | */ |
| 733 | class CTPNStrOneOfBasecxx . . $ CTPNStrOneOfBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 734 | { |
| 735 | public: |
| 736 | /* |
| 737 | * Create from a list of values, and the attribute string for selecting |
| 738 | * a value on each invocation. The attributes string must be static |
| 739 | * data, since we don't make a copy. Currently we only allow built-in |
| 740 | * attribute selections, which we define in a static structure. |
| 741 | */ |
| 742 | CTPNStrOneOfBasecxx . . $ CTPNStrOneOfBase#CTPNStrOneOfBase(e0cefd3848448cc2).(int dstr, class CTPNListcxx . . $ CTPNList# *lst, class CTcSymObjcxx . . $ CTcSymObj# *state_obj) |
| 743 | { |
| 744 | dstr_cxx . . $ CTPNStrOneOfBase#dstr_. = dstr; |
| 745 | lst_cxx . . $ CTPNStrOneOfBase#lst_. = lst; |
| 746 | state_obj_cxx . . $ CTPNStrOneOfBase#state_obj_. = state_obj; |
| 747 | } |
| 748 | |
| 749 | /* this is part of a dstring expression */ |
| 750 | virtual int is_dstring_exprcxx . . $ CTPNStrOneOfBase#is_dstring_expr(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 751 | |
| 752 | /* adjust for dynamic compilation */ |
| 753 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStrOneOfBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 754 | |
| 755 | /* folder constants */ |
| 756 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStrOneOfBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 757 | |
| 758 | /* |
| 759 | * The overall "one of" list has a return value if it's in a |
| 760 | * single-quoted string, since the individual elements will themselves |
| 761 | * be represented as single-quoted strings. If we're in a |
| 762 | * double-quoted string, the individual elements are double-quoted |
| 763 | * strings. |
| 764 | */ |
| 765 | int has_return_valuecxx . . $ CTPNStrOneOfBase#has_return_value(455f465bc33b4cdf).() const { return !dstr_cxx . . $ CTPNStrOneOfBase#dstr_.; } |
| 766 | |
| 767 | protected: |
| 768 | /* type of string - double quoted or single quoted */ |
| 769 | int dstr_cxx . . $ CTPNStrOneOfBase#dstr_.; |
| 770 | |
| 771 | /* the underlying list of substrings to choose from */ |
| 772 | class CTPNListcxx . . $ CTPNList# *lst_cxx . . $ CTPNStrOneOfBase#lst_.; |
| 773 | |
| 774 | /* the state object (an anonymous OneOfIndexGen instance) */ |
| 775 | class CTcSymObjcxx . . $ CTcSymObj# *state_obj_cxx . . $ CTPNStrOneOfBase#state_obj_.; |
| 776 | }; |
| 777 | |
| 778 | |
| 779 | /* ------------------------------------------------------------------------ */ |
| 780 | /* |
| 781 | * List node. A list has an underlying linked list of elements. |
| 782 | */ |
| 783 | class CTPNListBasecxx . . $ CTPNListBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 784 | { |
| 785 | public: |
| 786 | CTPNListBasecxx . . $ CTPNListBase#CTPNListBase(49f6e7a06ebc5aa8).() |
| 787 | { |
| 788 | /* there are initially no elements */ |
| 789 | cnt_cxx . . $ CTPNListBase#cnt_. = 0; |
| 790 | head_cxx . . $ CTPNListBase#head_. = tail_cxx . . $ CTPNListBase#tail_. = 0; |
| 791 | |
| 792 | /* |
| 793 | * initially, the list is constant, because it's just an empty |
| 794 | * list; as we add elements, we'll check for constants, and |
| 795 | * we'll clear the constant flag the first time we add a |
| 796 | * non-constant element |
| 797 | */ |
| 798 | is_const_cxx . . $ CTPNListBase#is_const_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; |
| 799 | |
| 800 | /* presume it's not a lookup table list */ |
| 801 | is_lookup_table_cxx . . $ CTPNListBase#is_lookup_table_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 802 | |
| 803 | /* set my constant value to point to myself */ |
| 804 | const_val_cxx . . $ CTPNListBase#const_val_..set_listcxx . . $ CTcConstVal#set_list(a298648cd4b6e35e).((class CTPNListcxx . . $ CTPNList# *)this); |
| 805 | } |
| 806 | |
| 807 | /* add an element to the list with a given expression */ |
| 808 | void add_elementcxx . . $ CTPNListBase#add_element(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *expr); |
| 809 | |
| 810 | /* remove each occurrence of a constant element from the list */ |
| 811 | void remove_elementcxx . . $ CTPNListBase#remove_element(63e889a2aa8150b1).(const class CTcConstValcxx . . $ CTcConstVal# *val); |
| 812 | |
| 813 | /* get the constant value of the list */ |
| 814 | CTcConstValcxx . . $ CTcConstVal# *get_const_valcxx . . $ CTPNListBase#get_const_val(78964007e8d3aff7).() |
| 815 | { |
| 816 | /* |
| 817 | * return our constant value only if we have one AND we're not a |
| 818 | * lookup table - a lookup table requires a NEW operation at |
| 819 | * run-time, so even if the underlying list of source values is |
| 820 | * constant, the overall list value isn't |
| 821 | */ |
| 822 | return (is_const_cxx . . $ CTPNListBase#is_const_. && !is_lookup_table_cxx . . $ CTPNListBase#is_lookup_table_. ? &const_val_cxx . . $ CTPNListBase#const_val_. : 0); |
| 823 | } |
| 824 | |
| 825 | /* |
| 826 | * get the first/last element - other elements can be reached by |
| 827 | * traversing the linked list of elements starting with the head or |
| 828 | * tail |
| 829 | */ |
| 830 | class CTPNListElecxx . . $ CTPNListEle# *get_headcxx . . $ CTPNListBase#get_head(d14f3a301de8e88a).() const { return head_cxx . . $ CTPNListBase#head_.; } |
| 831 | class CTPNListElecxx . . $ CTPNListEle# *get_tailcxx . . $ CTPNListBase#get_tail(d14f3a301de8e88a).() const { return tail_cxx . . $ CTPNListBase#tail_.; } |
| 832 | |
| 833 | /* get the constant element at the given index */ |
| 834 | CTcPrsNodecxx . . $ CTcPrsNode# *get_const_elecxx . . $ CTPNListBase#get_const_ele(439104714bca4206).(int index); |
| 835 | |
| 836 | /* get the number of elements in the list */ |
| 837 | int get_countcxx . . $ CTPNListBase#get_count(455f465bc33b4cdf).() const { return cnt_cxx . . $ CTPNListBase#cnt_.; } |
| 838 | |
| 839 | /* fold constants */ |
| 840 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNListBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 841 | |
| 842 | /* adjust for dynamic (run-time) compilation */ |
| 843 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNListBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 844 | |
| 845 | /* mark it as a lookup table list */ |
| 846 | void set_lookup_tablecxx . . $ CTPNListBase#set_lookup_table(49f6e7a06ebc5aa8).() { is_lookup_table_cxx . . $ CTPNListBase#is_lookup_table_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 847 | |
| 848 | protected: |
| 849 | /* number of elements in the list */ |
| 850 | int cnt_cxx . . $ CTPNListBase#cnt_.; |
| 851 | |
| 852 | /* head and tail of list of elements */ |
| 853 | class CTPNListElecxx . . $ CTPNListEle# *head_cxx . . $ CTPNListBase#head_.; |
| 854 | class CTPNListElecxx . . $ CTPNListEle# *tail_cxx . . $ CTPNListBase#tail_.; |
| 855 | |
| 856 | /* |
| 857 | * our constant value - this is valid only when all elements of the |
| 858 | * list are constant, as indicated by the is_const_ paremeter |
| 859 | */ |
| 860 | CTcConstValcxx . . $ CTcConstVal# const_val_cxx . . $ CTPNListBase#const_val_.; |
| 861 | |
| 862 | /* flag: all elements of the list are constant */ |
| 863 | unsigned int is_const_cxx . . $ CTPNListBase#is_const_. : 1; |
| 864 | |
| 865 | /* flag: this is a LookupTable list */ |
| 866 | unsigned int is_lookup_table_cxx . . $ CTPNListBase#is_lookup_table_. : 1; |
| 867 | }; |
| 868 | |
| 869 | /* |
| 870 | * List Element. Each list element is represented by one of these |
| 871 | * objects; these are in turn linked together into a list. |
| 872 | */ |
| 873 | class CTPNListEleBasecxx . . $ CTPNListEleBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 874 | { |
| 875 | public: |
| 876 | CTPNListEleBasecxx . . $ CTPNListEleBase#CTPNListEleBase(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *expr) |
| 877 | { |
| 878 | /* remember the underlying expression */ |
| 879 | expr_cxx . . $ CTPNListEleBase#expr_. = expr; |
| 880 | |
| 881 | /* this element isn't in a list yet */ |
| 882 | next_cxx . . $ CTPNListEleBase#next_. = 0; |
| 883 | prev_cxx . . $ CTPNListEleBase#prev_. = 0; |
| 884 | } |
| 885 | |
| 886 | /* get/set the next element */ |
| 887 | class CTPNListElecxx . . $ CTPNListEle# *get_nextcxx . . $ CTPNListEleBase#get_next(d14f3a301de8e88a).() const { return next_cxx . . $ CTPNListEleBase#next_.; } |
| 888 | void set_nextcxx . . $ CTPNListEleBase#set_next(ba7d91a8a6c5545).(class CTPNListElecxx . . $ CTPNListEle# *nxt) { next_cxx . . $ CTPNListEleBase#next_. = nxt; } |
| 889 | |
| 890 | /* get/set the previous element */ |
| 891 | class CTPNListElecxx . . $ CTPNListEle# *get_prevcxx . . $ CTPNListEleBase#get_prev(d14f3a301de8e88a).() const { return prev_cxx . . $ CTPNListEleBase#prev_.; } |
| 892 | void set_prevcxx . . $ CTPNListEleBase#set_prev(ba7d91a8a6c5545).(class CTPNListElecxx . . $ CTPNListEle# *prv) { prev_cxx . . $ CTPNListEleBase#prev_. = prv; } |
| 893 | |
| 894 | /* get the underlying expression */ |
| 895 | CTcPrsNodecxx . . $ CTcPrsNode# *get_exprcxx . . $ CTPNListEleBase#get_expr(d201019a7d73592c).() const { return expr_cxx . . $ CTPNListEleBase#expr_.; } |
| 896 | |
| 897 | /* fold constants */ |
| 898 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNListEleBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 899 | { |
| 900 | /* fold constants in my expression */ |
| 901 | expr_cxx . . $ CTPNListEleBase#expr_. = expr_cxx . . $ CTPNListEleBase#expr_.->fold_constantscxx . . $ CTcPrsNodeBase#fold_constants(ec2152be3a5a18d3).(symtab); |
| 902 | |
| 903 | /* return myself unchanged (although my contents may be changed) */ |
| 904 | return this; |
| 905 | } |
| 906 | |
| 907 | /* adjust for dynamic (run-time) compilation */ |
| 908 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNListEleBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 909 | { |
| 910 | /* adjust my expression */ |
| 911 | expr_cxx . . $ CTPNListEleBase#expr_. = expr_cxx . . $ CTPNListEleBase#expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 912 | |
| 913 | /* return myself otherwise unchanged */ |
| 914 | return this; |
| 915 | } |
| 916 | |
| 917 | protected: |
| 918 | /* the underlying expression */ |
| 919 | CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNListEleBase#expr_.; |
| 920 | |
| 921 | /* the next element of the list */ |
| 922 | class CTPNListElecxx . . $ CTPNListEle# *next_cxx . . $ CTPNListEleBase#next_.; |
| 923 | |
| 924 | /* previous element of the list */ |
| 925 | class CTPNListElecxx . . $ CTPNListEle# *prev_cxx . . $ CTPNListEleBase#prev_.; |
| 926 | }; |
| 927 | |
| 928 | /* ------------------------------------------------------------------------ */ |
| 929 | /* |
| 930 | * Member with no arguments |
| 931 | */ |
| 932 | class CTPNMemberBasecxx . . $ CTPNMemberBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 933 | { |
| 934 | public: |
| 935 | CTPNMemberBasecxx . . $ CTPNMemberBase#CTPNMemberBase(4056ff28648387bf).(CTcPrsNodecxx . . $ CTcPrsNode# *obj_expr, CTcPrsNodecxx . . $ CTcPrsNode# *prop_expr, |
| 936 | int prop_is_expr) |
| 937 | { |
| 938 | /* remember the subexpressions */ |
| 939 | obj_expr_cxx . . $ CTPNMemberBase#obj_expr_. = obj_expr; |
| 940 | prop_expr_cxx . . $ CTPNMemberBase#prop_expr_. = prop_expr; |
| 941 | |
| 942 | /* remember whether or not the property is an expression */ |
| 943 | prop_is_expr_cxx . . $ CTPNMemberBase#prop_is_expr_. = prop_is_expr; |
| 944 | } |
| 945 | |
| 946 | /* a member with no arguments can always be used as an lvalue */ |
| 947 | virtual int check_lvaluecxx . . $ CTPNMemberBase#check_lvalue(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 948 | virtual int check_lvalue_resolvedcxx . . $ CTPNMemberBase#check_lvalue_resolved(4e8c269856e3e20f).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) const |
| 949 | { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 950 | |
| 951 | /* get the subexpressions */ |
| 952 | CTcPrsNodecxx . . $ CTcPrsNode# *get_obj_exprcxx . . $ CTPNMemberBase#get_obj_expr(d201019a7d73592c).() const { return obj_expr_cxx . . $ CTPNMemberBase#obj_expr_.; } |
| 953 | CTcPrsNodecxx . . $ CTcPrsNode# *get_prop_exprcxx . . $ CTPNMemberBase#get_prop_expr(d201019a7d73592c).() const { return prop_expr_cxx . . $ CTPNMemberBase#prop_expr_.; } |
| 954 | |
| 955 | /* fold constants */ |
| 956 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNMemberBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 957 | { |
| 958 | /* fold constants in the object and property expressions */ |
| 959 | obj_expr_cxx . . $ CTPNMemberBase#obj_expr_. = obj_expr_cxx . . $ CTPNMemberBase#obj_expr_.->fold_constantscxx . . $ CTcPrsNodeBase#fold_constants(ec2152be3a5a18d3).(symtab); |
| 960 | prop_expr_cxx . . $ CTPNMemberBase#prop_expr_. = prop_expr_cxx . . $ CTPNMemberBase#prop_expr_.->fold_constantscxx . . $ CTcPrsNodeBase#fold_constants(ec2152be3a5a18d3).(symtab); |
| 961 | |
| 962 | /* return myself with no further evaluation */ |
| 963 | return this; |
| 964 | } |
| 965 | |
| 966 | /* adjust for dynamic (run-time) compilation */ |
| 967 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNMemberBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 968 | |
| 969 | protected: |
| 970 | /* object expression (left of '.') */ |
| 971 | CTcPrsNodecxx . . $ CTcPrsNode# *obj_expr_cxx . . $ CTPNMemberBase#obj_expr_.; |
| 972 | |
| 973 | /* property expression (right of '.') */ |
| 974 | CTcPrsNodecxx . . $ CTcPrsNode# *prop_expr_cxx . . $ CTPNMemberBase#prop_expr_.; |
| 975 | |
| 976 | /* flag: the property is an expression, not a simple property name */ |
| 977 | unsigned int prop_is_expr_cxx . . $ CTPNMemberBase#prop_is_expr_. : 1; |
| 978 | }; |
| 979 | |
| 980 | /* |
| 981 | * The target must also define another class, CTPNSpecDebugMember, a |
| 982 | * subclass of CTPNMember. This new class must ensure at run-time that |
| 983 | * the property evaluation has no side effects. |
| 984 | */ |
| 985 | /* class CTPNSpecDebugMember: public CTPNMember ... */ |
| 986 | |
| 987 | /* |
| 988 | * Member with arguments - this is for a property evaluation with an |
| 989 | * argument list. (Simple property evaluation without arguments is a |
| 990 | * normal binary node subclass.) |
| 991 | */ |
| 992 | class CTPNMemArgBasecxx . . $ CTPNMemArgBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 993 | { |
| 994 | public: |
| 995 | CTPNMemArgBasecxx . . $ CTPNMemArgBase#CTPNMemArgBase(16e3753bfc4129dd).(CTcPrsNodecxx . . $ CTcPrsNode# *obj_expr, CTcPrsNodecxx . . $ CTcPrsNode# *prop_expr, |
| 996 | int prop_is_expr, class CTPNArglistcxx . . $ CTPNArglist# *arglist) |
| 997 | { |
| 998 | /* save the subexpressions */ |
| 999 | obj_expr_cxx . . $ CTPNMemArgBase#obj_expr_. = obj_expr; |
| 1000 | prop_expr_cxx . . $ CTPNMemArgBase#prop_expr_. = prop_expr; |
| 1001 | arglist_cxx . . $ CTPNMemArgBase#arglist_. = arglist; |
| 1002 | |
| 1003 | /* remember whether or not the property is an expression */ |
| 1004 | prop_is_expr_cxx . . $ CTPNMemArgBase#prop_is_expr_. = prop_is_expr; |
| 1005 | } |
| 1006 | |
| 1007 | /* get the subexpressions */ |
| 1008 | CTcPrsNodecxx . . $ CTcPrsNode# *get_obj_exprcxx . . $ CTPNMemArgBase#get_obj_expr(d201019a7d73592c).() const { return obj_expr_cxx . . $ CTPNMemArgBase#obj_expr_.; } |
| 1009 | CTcPrsNodecxx . . $ CTcPrsNode# *get_prop_exprcxx . . $ CTPNMemArgBase#get_prop_expr(d201019a7d73592c).() const { return prop_expr_cxx . . $ CTPNMemArgBase#prop_expr_.; } |
| 1010 | class CTPNArglistcxx . . $ CTPNArglist# *get_arg_listcxx . . $ CTPNMemArgBase#get_arg_list(b53ed4538afc7c51).() const { return arglist_cxx . . $ CTPNMemArgBase#arglist_.; } |
| 1011 | |
| 1012 | /* fold constants */ |
| 1013 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNMemArgBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 1014 | |
| 1015 | /* adjust for dynamic (run-time) compilation */ |
| 1016 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNMemArgBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 1017 | |
| 1018 | protected: |
| 1019 | /* object expression (left of '.') */ |
| 1020 | CTcPrsNodecxx . . $ CTcPrsNode# *obj_expr_cxx . . $ CTPNMemArgBase#obj_expr_.; |
| 1021 | |
| 1022 | /* property expression (right of '.') */ |
| 1023 | CTcPrsNodecxx . . $ CTcPrsNode# *prop_expr_cxx . . $ CTPNMemArgBase#prop_expr_.; |
| 1024 | |
| 1025 | /* argument list */ |
| 1026 | class CTPNArglistcxx . . $ CTPNArglist# *arglist_cxx . . $ CTPNMemArgBase#arglist_.; |
| 1027 | |
| 1028 | /* flag: the property is an expression, not a simple property name */ |
| 1029 | unsigned int prop_is_expr_cxx . . $ CTPNMemArgBase#prop_is_expr_. : 1; |
| 1030 | }; |
| 1031 | |
| 1032 | /* ------------------------------------------------------------------------ */ |
| 1033 | /* |
| 1034 | * Subscript |
| 1035 | */ |
| 1036 | class CTPNSubscriptBasecxx . . $ CTPNSubscriptBase#: public CTPNBincxx . . $ CTPNBin# |
| 1037 | { |
| 1038 | public: |
| 1039 | CTPNSubscriptBasecxx . . $ CTPNSubscriptBase#CTPNSubscriptBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1040 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1041 | |
| 1042 | /* a subscripted array element can be assigned into */ |
| 1043 | virtual int check_lvaluecxx . . $ CTPNSubscriptBase#check_lvalue(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1044 | virtual int check_lvalue_resolvedcxx . . $ CTPNSubscriptBase#check_lvalue_resolved(4e8c269856e3e20f).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) const |
| 1045 | { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1046 | |
| 1047 | /* fold constants */ |
| 1048 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNSubscriptBase#fold_binop(f036da583a06c490).(); |
| 1049 | }; |
| 1050 | |
| 1051 | |
| 1052 | /* ------------------------------------------------------------------------ */ |
| 1053 | /* |
| 1054 | * Comma operator |
| 1055 | */ |
| 1056 | class CTPNCommaBasecxx . . $ CTPNCommaBase#: public CTPNBincxx . . $ CTPNBin# |
| 1057 | { |
| 1058 | public: |
| 1059 | CTPNCommaBasecxx . . $ CTPNCommaBase#CTPNCommaBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1060 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1061 | |
| 1062 | /* fold constants */ |
| 1063 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNCommaBase#fold_binop(f036da583a06c490).(); |
| 1064 | |
| 1065 | /* |
| 1066 | * a comma expression's value is the value of the right operand, so the |
| 1067 | * type is boolean if the right operand's type is boolean |
| 1068 | */ |
| 1069 | virtual int is_boolcxx . . $ CTPNCommaBase#is_bool(455f465bc33b4cdf).() const { return right_cxx . . $ CTPNBinBase#right_.->is_boolcxx . . $ CTcPrsNodeBase#is_bool(455f465bc33b4cdf).(); } |
| 1070 | |
| 1071 | /* |
| 1072 | * determine if I have a value - I have a value if my right |
| 1073 | * subexpression has a value |
| 1074 | */ |
| 1075 | virtual int has_return_valuecxx . . $ CTPNCommaBase#has_return_value(455f465bc33b4cdf).() const |
| 1076 | { return right_cxx . . $ CTPNBinBase#right_.->has_return_valuecxx . . $ CTcPrsNodeBase#has_return_value(455f465bc33b4cdf).(); } |
| 1077 | |
| 1078 | /* this is part of a dstring expression if either side is */ |
| 1079 | virtual int is_dstring_exprcxx . . $ CTPNCommaBase#is_dstring_expr(455f465bc33b4cdf).() const |
| 1080 | { return left_cxx . . $ CTPNBinBase#left_.->is_dstring_exprcxx . . $ CTcPrsNodeBase#is_dstring_expr(455f465bc33b4cdf).() || right_cxx . . $ CTPNBinBase#right_.->is_dstring_exprcxx . . $ CTcPrsNodeBase#is_dstring_expr(455f465bc33b4cdf).(); } |
| 1081 | }; |
| 1082 | |
| 1083 | /* ------------------------------------------------------------------------ */ |
| 1084 | /* |
| 1085 | * Add |
| 1086 | */ |
| 1087 | class CTPNAddBasecxx . . $ CTPNAddBase#: public CTPNBincxx . . $ CTPNBin# |
| 1088 | { |
| 1089 | public: |
| 1090 | CTPNAddBasecxx . . $ CTPNAddBase#CTPNAddBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1091 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1092 | |
| 1093 | /* fold constants */ |
| 1094 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNAddBase#fold_binop(f036da583a06c490).(); |
| 1095 | }; |
| 1096 | |
| 1097 | /* ------------------------------------------------------------------------ */ |
| 1098 | /* |
| 1099 | * Subtract |
| 1100 | */ |
| 1101 | class CTPNSubBasecxx . . $ CTPNSubBase#: public CTPNBincxx . . $ CTPNBin# |
| 1102 | { |
| 1103 | public: |
| 1104 | CTPNSubBasecxx . . $ CTPNSubBase#CTPNSubBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1105 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1106 | |
| 1107 | /* fold constants */ |
| 1108 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNSubBase#fold_binop(f036da583a06c490).(); |
| 1109 | }; |
| 1110 | |
| 1111 | /* ------------------------------------------------------------------------ */ |
| 1112 | /* |
| 1113 | * Equality Comparison |
| 1114 | */ |
| 1115 | class CTPNEqBasecxx . . $ CTPNEqBase#: public CTPNBincxx . . $ CTPNBin# |
| 1116 | { |
| 1117 | public: |
| 1118 | CTPNEqBasecxx . . $ CTPNEqBase#CTPNEqBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1119 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1120 | |
| 1121 | /* fold constants */ |
| 1122 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNEqBase#fold_binop(f036da583a06c490).(); |
| 1123 | |
| 1124 | /* comparison operators yield boolean results */ |
| 1125 | virtual int is_boolcxx . . $ CTPNEqBase#is_bool(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1126 | }; |
| 1127 | |
| 1128 | /* ------------------------------------------------------------------------ */ |
| 1129 | /* |
| 1130 | * Inequality Comparison |
| 1131 | */ |
| 1132 | class CTPNNeBasecxx . . $ CTPNNeBase#: public CTPNBincxx . . $ CTPNBin# |
| 1133 | { |
| 1134 | public: |
| 1135 | CTPNNeBasecxx . . $ CTPNNeBase#CTPNNeBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1136 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1137 | |
| 1138 | /* fold constants */ |
| 1139 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNNeBase#fold_binop(f036da583a06c490).(); |
| 1140 | |
| 1141 | /* comparison operators yield boolean results */ |
| 1142 | virtual int is_boolcxx . . $ CTPNNeBase#is_bool(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1143 | }; |
| 1144 | |
| 1145 | /* ------------------------------------------------------------------------ */ |
| 1146 | /* |
| 1147 | * 'is in' |
| 1148 | */ |
| 1149 | class CTPNIsInBasecxx . . $ CTPNIsInBase#: public CTPNBincxx . . $ CTPNBin# |
| 1150 | { |
| 1151 | public: |
| 1152 | CTPNIsInBasecxx . . $ CTPNIsInBase#CTPNIsInBase(6b1ba6291bddd291).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, class CTPNArglistcxx . . $ CTPNArglist# *rhs); |
| 1153 | |
| 1154 | /* fold constants */ |
| 1155 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNIsInBase#fold_binop(f036da583a06c490).(); |
| 1156 | |
| 1157 | /* comparison operators yield boolean results */ |
| 1158 | virtual int is_boolcxx . . $ CTPNIsInBase#is_bool(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1159 | |
| 1160 | protected: |
| 1161 | /* |
| 1162 | * flag: if true, we have a constant true value (because the left |
| 1163 | * side is a constant, and the right side list contains the same |
| 1164 | * constant) |
| 1165 | */ |
| 1166 | unsigned int const_true_cxx . . $ CTPNIsInBase#const_true_. : 1; |
| 1167 | }; |
| 1168 | |
| 1169 | /* ------------------------------------------------------------------------ */ |
| 1170 | /* |
| 1171 | * 'not in' |
| 1172 | */ |
| 1173 | class CTPNNotInBasecxx . . $ CTPNNotInBase#: public CTPNBincxx . . $ CTPNBin# |
| 1174 | { |
| 1175 | public: |
| 1176 | CTPNNotInBasecxx . . $ CTPNNotInBase#CTPNNotInBase(6b1ba6291bddd291).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, class CTPNArglistcxx . . $ CTPNArglist# *rhs); |
| 1177 | |
| 1178 | /* fold constants */ |
| 1179 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNNotInBase#fold_binop(f036da583a06c490).(); |
| 1180 | |
| 1181 | /* comparison operators yield boolean results */ |
| 1182 | virtual int is_boolcxx . . $ CTPNNotInBase#is_bool(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1183 | |
| 1184 | /* |
| 1185 | * flag: if true, we have a constant true value (because the left |
| 1186 | * side is a constant, and the right side list is entirely constants |
| 1187 | * and doesn't contain the left side value) |
| 1188 | */ |
| 1189 | unsigned int const_false_cxx . . $ CTPNNotInBase#const_false_. : 1; |
| 1190 | }; |
| 1191 | |
| 1192 | /* ------------------------------------------------------------------------ */ |
| 1193 | /* |
| 1194 | * Logical AND operator node |
| 1195 | */ |
| 1196 | class CTPNAndBasecxx . . $ CTPNAndBase#: public CTPNBincxx . . $ CTPNBin# |
| 1197 | { |
| 1198 | public: |
| 1199 | CTPNAndBasecxx . . $ CTPNAndBase#CTPNAndBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1200 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1201 | |
| 1202 | /* a logical AND always yields a boolean */ |
| 1203 | virtual int is_boolcxx . . $ CTPNAndBase#is_bool(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1204 | |
| 1205 | /* fold constants */ |
| 1206 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNAndBase#fold_binop(f036da583a06c490).(); |
| 1207 | }; |
| 1208 | |
| 1209 | /* ------------------------------------------------------------------------ */ |
| 1210 | /* |
| 1211 | * Logical OR operator node |
| 1212 | */ |
| 1213 | class CTPNOrBasecxx . . $ CTPNOrBase#: public CTPNBincxx . . $ CTPNBin# |
| 1214 | { |
| 1215 | public: |
| 1216 | CTPNOrBasecxx . . $ CTPNOrBase#CTPNOrBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1217 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1218 | |
| 1219 | /* a logical OR always yields a boolean value */ |
| 1220 | virtual int is_boolcxx . . $ CTPNOrBase#is_bool(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1221 | |
| 1222 | /* fold constants */ |
| 1223 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_binopcxx . . $ CTPNOrBase#fold_binop(f036da583a06c490).(); |
| 1224 | }; |
| 1225 | |
| 1226 | /* ------------------------------------------------------------------------ */ |
| 1227 | /* |
| 1228 | * Simple assignment operator |
| 1229 | */ |
| 1230 | class CTPNAsiBasecxx . . $ CTPNAsiBase#: public CTPNBincxx . . $ CTPNBin# |
| 1231 | { |
| 1232 | public: |
| 1233 | CTPNAsiBasecxx . . $ CTPNAsiBase#CTPNAsiBase(f8ff410c95c1307).(CTcPrsNodecxx . . $ CTcPrsNode# *lhs, CTcPrsNodecxx . . $ CTcPrsNode# *rhs) |
| 1234 | : CTPNBincxx . . $ CTPNBin#(lhs, rhs) { } |
| 1235 | |
| 1236 | /* we're a simple assignment operator */ |
| 1237 | virtual int is_simple_asicxx . . $ CTPNAsiBase#is_simple_asi(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1238 | |
| 1239 | /* adjust for dynamic (run-time) compilation */ |
| 1240 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNAsiBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 1241 | { |
| 1242 | /* if it's speculative, don't allow it, because of side effects */ |
| 1243 | if (info->speculativecxx . . $ tcpn_dyncomp_info#speculative.) |
| 1244 | err_throwcxx . . $ err_throw(cb2f890c2fdad230).(VMERR_BAD_SPEC_EVALcxx . . $ `tads3/vmerrnum.h:537:9`!); |
| 1245 | |
| 1246 | /* inherit default processing */ |
| 1247 | return CTPNBincxx . . $ CTPNBin#::adjust_for_dyncxx . . $ CTPNBinBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 1248 | } |
| 1249 | }; |
| 1250 | |
| 1251 | /* ------------------------------------------------------------------------ */ |
| 1252 | /* |
| 1253 | * NOT operator node |
| 1254 | */ |
| 1255 | class CTPNNotBasecxx . . $ CTPNNotBase#: public CTPNUnarycxx . . $ CTPNUnary# |
| 1256 | { |
| 1257 | public: |
| 1258 | CTPNNotBasecxx . . $ CTPNNotBase#CTPNNotBase(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *sub) : CTPNUnarycxx . . $ CTPNUnary#(sub) { } |
| 1259 | |
| 1260 | /* NOT always yields a boolean value */ |
| 1261 | virtual int is_boolcxx . . $ CTPNNotBase#is_bool(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1262 | |
| 1263 | /* fold constants */ |
| 1264 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_unopcxx . . $ CTPNNotBase#fold_unop(f036da583a06c490).(); |
| 1265 | }; |
| 1266 | |
| 1267 | /* ------------------------------------------------------------------------ */ |
| 1268 | /* |
| 1269 | * If-nil node - operator ?? |
| 1270 | */ |
| 1271 | class CTPNIfnilBasecxx . . $ CTPNIfnilBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 1272 | { |
| 1273 | public: |
| 1274 | CTPNIfnilBasecxx . . $ CTPNIfnilBase#CTPNIfnilBase(f8ff410c95c1307).(class CTcPrsNodecxx . . $ CTcPrsNode# *first, class CTcPrsNodecxx . . $ CTcPrsNode# *second) |
| 1275 | { |
| 1276 | first_cxx . . $ CTPNIfnilBase#first_. = first; |
| 1277 | second_cxx . . $ CTPNIfnilBase#second_. = second; |
| 1278 | } |
| 1279 | |
| 1280 | /* fold constants */ |
| 1281 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNIfnilBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 1282 | |
| 1283 | /* I have a return value if one or the other of my subnodes has a value */ |
| 1284 | virtual int has_return_valuecxx . . $ CTPNIfnilBase#has_return_value(455f465bc33b4cdf).() const |
| 1285 | { return first_cxx . . $ CTPNIfnilBase#first_.->has_return_valuecxx . . $ CTcPrsNodeBase#has_return_value(455f465bc33b4cdf).() || second_cxx . . $ CTPNIfnilBase#second_.->has_return_valuecxx . . $ CTcPrsNodeBase#has_return_value(455f465bc33b4cdf).(); } |
| 1286 | |
| 1287 | /* adjust for dynamic (run-time) compilation */ |
| 1288 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNIfnilBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 1289 | { |
| 1290 | /* adjust my subexpressions */ |
| 1291 | first_cxx . . $ CTPNIfnilBase#first_. = first_cxx . . $ CTPNIfnilBase#first_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 1292 | second_cxx . . $ CTPNIfnilBase#second_. = second_cxx . . $ CTPNIfnilBase#second_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 1293 | return this; |
| 1294 | } |
| 1295 | |
| 1296 | protected: |
| 1297 | class CTcPrsNodecxx . . $ CTcPrsNode# *first_cxx . . $ CTPNIfnilBase#first_.; |
| 1298 | class CTcPrsNodecxx . . $ CTcPrsNode# *second_cxx . . $ CTPNIfnilBase#second_.; |
| 1299 | }; |
| 1300 | |
| 1301 | /* ------------------------------------------------------------------------ */ |
| 1302 | /* |
| 1303 | * Conditional operator parse node |
| 1304 | */ |
| 1305 | class CTPNIfBasecxx . . $ CTPNIfBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 1306 | { |
| 1307 | public: |
| 1308 | CTPNIfBasecxx . . $ CTPNIfBase#CTPNIfBase(4c5769988c9a9e0e).(class CTcPrsNodecxx . . $ CTcPrsNode# *first, class CTcPrsNodecxx . . $ CTcPrsNode# *second, |
| 1309 | class CTcPrsNodecxx . . $ CTcPrsNode# *third) |
| 1310 | { |
| 1311 | first_cxx . . $ CTPNIfBase#first_. = first; |
| 1312 | second_cxx . . $ CTPNIfBase#second_. = second; |
| 1313 | third_cxx . . $ CTPNIfBase#third_. = third; |
| 1314 | } |
| 1315 | |
| 1316 | /* fold constants */ |
| 1317 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNIfBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 1318 | |
| 1319 | /* add the branches */ |
| 1320 | void set_condcxx . . $ CTPNIfBase#set_cond(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *e) { first_cxx . . $ CTPNIfBase#first_. = e; } |
| 1321 | void set_thencxx . . $ CTPNIfBase#set_then(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *e) { second_cxx . . $ CTPNIfBase#second_. = e; } |
| 1322 | void set_elsecxx . . $ CTPNIfBase#set_else(ce51daeb60ee86bb).(CTcPrsNodecxx . . $ CTcPrsNode# *e) { third_cxx . . $ CTPNIfBase#third_. = e; } |
| 1323 | |
| 1324 | /* I have a return value if one or the other of my subnodes has a value */ |
| 1325 | virtual int has_return_valuecxx . . $ CTPNIfBase#has_return_value(455f465bc33b4cdf).() const |
| 1326 | { return second_cxx . . $ CTPNIfBase#second_.->has_return_valuecxx . . $ CTcPrsNodeBase#has_return_value(455f465bc33b4cdf).() || third_cxx . . $ CTPNIfBase#third_.->has_return_valuecxx . . $ CTcPrsNodeBase#has_return_value(455f465bc33b4cdf).(); } |
| 1327 | |
| 1328 | /* adjust for dynamic (run-time) compilation */ |
| 1329 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNIfBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 1330 | { |
| 1331 | /* adjust my subexpressions */ |
| 1332 | first_cxx . . $ CTPNIfBase#first_. = first_cxx . . $ CTPNIfBase#first_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 1333 | second_cxx . . $ CTPNIfBase#second_. = second_cxx . . $ CTPNIfBase#second_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 1334 | third_cxx . . $ CTPNIfBase#third_. = third_cxx . . $ CTPNIfBase#third_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 1335 | |
| 1336 | /* return myself otherwise unchanged */ |
| 1337 | return this; |
| 1338 | } |
| 1339 | |
| 1340 | protected: |
| 1341 | class CTcPrsNodecxx . . $ CTcPrsNode# *first_cxx . . $ CTPNIfBase#first_.; |
| 1342 | class CTcPrsNodecxx . . $ CTcPrsNode# *second_cxx . . $ CTPNIfBase#second_.; |
| 1343 | class CTcPrsNodecxx . . $ CTcPrsNode# *third_cxx . . $ CTPNIfBase#third_.; |
| 1344 | }; |
| 1345 | |
| 1346 | /* ------------------------------------------------------------------------ */ |
| 1347 | /* |
| 1348 | * Derived target-independent symbol classes |
| 1349 | */ |
| 1350 | |
| 1351 | /* |
| 1352 | * Undefined symbol. During symbol resolution (after all parsing is |
| 1353 | * completed), when we encounter a symbol that isn't defined, we can use |
| 1354 | * this symbol type to provide a placeholder. Creating an unknown |
| 1355 | * symbol is an error, so the program cannot be successfully compiled |
| 1356 | * once an undefined symbol is encountered, but this at least allows |
| 1357 | * compilation to proceed through the rest of the program to check for |
| 1358 | * other errors. |
| 1359 | */ |
| 1360 | class CTcSymUndefBasecxx . . $ CTcSymUndefBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 1361 | { |
| 1362 | public: |
| 1363 | CTcSymUndefBasecxx . . $ CTcSymUndefBase#CTcSymUndefBase(ef41e1d728a7d23b).(const char *str, size_t len, int copy) |
| 1364 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_UNKNOWNcxx . . $ TC_SYM_UNKNOWN.) { } |
| 1365 | |
| 1366 | /* do not write this to a symbol file */ |
| 1367 | virtual int write_to_sym_filecxx . . $ CTcSymUndefBase#write_to_sym_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *) { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 1368 | |
| 1369 | /* do not write this to an object file */ |
| 1370 | virtual int write_to_obj_filecxx . . $ CTcSymUndefBase#write_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *) { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 1371 | |
| 1372 | /* this can't be an lvalue */ |
| 1373 | virtual int check_lvaluecxx . . $ CTcSymUndefBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 1374 | }; |
| 1375 | |
| 1376 | /* |
| 1377 | * Function. At construction time, a function's actual code offset is |
| 1378 | * never known; we cannot know a function's code offset until after |
| 1379 | * we've finished code generation. |
| 1380 | */ |
| 1381 | class CTcSymFuncBasecxx . . $ CTcSymFuncBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 1382 | { |
| 1383 | public: |
| 1384 | CTcSymFuncBasecxx . . $ CTcSymFuncBase#CTcSymFuncBase(1e140fd0475675f3).(const char *str, size_t len, int copy, |
| 1385 | int argc, int opt_argc, int varargs, int has_retval, |
| 1386 | int is_multimethod, int is_multimethod_base, |
| 1387 | int is_extern, int has_proto) |
| 1388 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_FUNCcxx . . $ TC_SYM_FUNC.) |
| 1389 | { |
| 1390 | /* remember the interface information */ |
| 1391 | argc_cxx . . $ CTcSymFuncBase#argc_. = argc; |
| 1392 | opt_argc_cxx . . $ CTcSymFuncBase#opt_argc_. = opt_argc; |
| 1393 | varargs_cxx . . $ CTcSymFuncBase#varargs_. = varargs; |
| 1394 | has_retval_cxx . . $ CTcSymFuncBase#has_retval_. = has_retval; |
| 1395 | is_multimethod_cxx . . $ CTcSymFuncBase#is_multimethod_. = is_multimethod; |
| 1396 | is_multimethod_base_cxx . . $ CTcSymFuncBase#is_multimethod_base_. = is_multimethod_base; |
| 1397 | |
| 1398 | /* note whether it's external */ |
| 1399 | is_extern_cxx . . $ CTcSymFuncBase#is_extern_. = is_extern; |
| 1400 | |
| 1401 | /* note whether it has a prototype */ |
| 1402 | has_proto_cxx . . $ CTcSymFuncBase#has_proto_. = has_proto; |
| 1403 | |
| 1404 | /* no code stream anchor yet */ |
| 1405 | anchor_cxx . . $ CTcSymFuncBase#anchor_. = 0; |
| 1406 | |
| 1407 | /* no fixups yet */ |
| 1408 | fixups_cxx . . $ CTcSymFuncBase#fixups_. = 0; |
| 1409 | |
| 1410 | /* this isn't replacing an external function */ |
| 1411 | ext_replace_cxx . . $ CTcSymFuncBase#ext_replace_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1412 | |
| 1413 | /* we don't know our code body yet */ |
| 1414 | code_body_cxx . . $ CTcSymFuncBase#code_body_. = 0; |
| 1415 | |
| 1416 | /* there's no base modified symbol */ |
| 1417 | mod_base_cxx . . $ CTcSymFuncBase#mod_base_. = 0; |
| 1418 | |
| 1419 | /* we haven't been modified yet */ |
| 1420 | mod_global_cxx . . $ CTcSymFuncBase#mod_global_. = 0; |
| 1421 | |
| 1422 | /* assume it's not defined in this file */ |
| 1423 | mm_def_cxx . . $ CTcSymFuncBase#mm_def_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1424 | } |
| 1425 | |
| 1426 | /* determine if I'm an unresolved external */ |
| 1427 | virtual int is_unresolved_externcxx . . $ CTcSymFuncBase#is_unresolved_extern(455f465bc33b4cdf).() const { return is_extern_cxx . . $ CTcSymFuncBase#is_extern_.; } |
| 1428 | |
| 1429 | /* this can't be an lvalue */ |
| 1430 | virtual int check_lvaluecxx . . $ CTcSymFuncBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 1431 | |
| 1432 | /* |
| 1433 | * Get the argument count. If is_varargs() returns true, this is a |
| 1434 | * minimum argument count; otherwise, this is the exact number of |
| 1435 | * arguments required. |
| 1436 | */ |
| 1437 | int get_argccxx . . $ CTcSymFuncBase#get_argc(455f465bc33b4cdf).() const { return argc_cxx . . $ CTcSymFuncBase#argc_.; } |
| 1438 | int get_opt_argccxx . . $ CTcSymFuncBase#get_opt_argc(455f465bc33b4cdf).() const { return opt_argc_cxx . . $ CTcSymFuncBase#opt_argc_.; } |
| 1439 | int is_varargscxx . . $ CTcSymFuncBase#is_varargs(455f465bc33b4cdf).() const { return varargs_cxx . . $ CTcSymFuncBase#varargs_.; } |
| 1440 | |
| 1441 | /* is the argument list within the correct range? */ |
| 1442 | int argc_okcxx . . $ CTcSymFuncBase#argc_ok(7ccb52b1bfe01045).(int n) const |
| 1443 | { |
| 1444 | /* |
| 1445 | * the argument list is correct if it has at least the fixed |
| 1446 | * arguments, AND either we have varargs (in which case there's no |
| 1447 | * upper limit) or the argument count is less than the maximum |
| 1448 | * (which is the fixed plus optionals) |
| 1449 | */ |
| 1450 | return (n >= argc_cxx . . $ CTcSymFuncBase#argc_. |
| 1451 | && (varargs_cxx . . $ CTcSymFuncBase#varargs_. || n <= argc_cxx . . $ CTcSymFuncBase#argc_. + opt_argc_cxx . . $ CTcSymFuncBase#opt_argc_.)); |
| 1452 | } |
| 1453 | |
| 1454 | /* build a descriptive message about the argument list, for errors */ |
| 1455 | const char *get_argc_desccxx . . $ CTcSymFuncBase#get_argc_desc(bff12ae9a608a69a).(char *buf) |
| 1456 | { |
| 1457 | if (varargs_cxx . . $ CTcSymFuncBase#varargs_.) |
| 1458 | sprintf(buf, "%d+", argc_cxx . . $ CTcSymFuncBase#argc_.); |
| 1459 | else if (opt_argc_cxx . . $ CTcSymFuncBase#opt_argc_. != 0) |
| 1460 | sprintf(buf, "%d-%d", argc_cxx . . $ CTcSymFuncBase#argc_., argc_cxx . . $ CTcSymFuncBase#argc_. + opt_argc_cxx . . $ CTcSymFuncBase#opt_argc_.); |
| 1461 | else |
| 1462 | sprintf(buf, "%d", argc_cxx . . $ CTcSymFuncBase#argc_.); |
| 1463 | |
| 1464 | return buf; |
| 1465 | } |
| 1466 | |
| 1467 | /* get/set the 'extern' flag */ |
| 1468 | int is_externcxx . . $ CTcSymFuncBase#is_extern(455f465bc33b4cdf).() const { return is_extern_cxx . . $ CTcSymFuncBase#is_extern_.; } |
| 1469 | void set_externcxx . . $ CTcSymFuncBase#set_extern(d4f767463ce0a6b3).(int f) { is_extern_cxx . . $ CTcSymFuncBase#is_extern_. = f; } |
| 1470 | |
| 1471 | /* get/set the 'has prototype' flag */ |
| 1472 | int has_protocxx . . $ CTcSymFuncBase#has_proto(455f465bc33b4cdf).() const { return has_proto_cxx . . $ CTcSymFuncBase#has_proto_.; } |
| 1473 | void set_has_protocxx . . $ CTcSymFuncBase#set_has_proto(d4f767463ce0a6b3).(int f) { has_proto_cxx . . $ CTcSymFuncBase#has_proto_. = f; } |
| 1474 | |
| 1475 | /* get/set the multi-method flag */ |
| 1476 | int is_multimethodcxx . . $ CTcSymFuncBase#is_multimethod(455f465bc33b4cdf).() const { return is_multimethod_cxx . . $ CTcSymFuncBase#is_multimethod_.; } |
| 1477 | void set_multimethodcxx . . $ CTcSymFuncBase#set_multimethod(d4f767463ce0a6b3).(int f) { is_multimethod_cxx . . $ CTcSymFuncBase#is_multimethod_. = f; } |
| 1478 | |
| 1479 | /* get/set the multi-method base function flag */ |
| 1480 | int is_multimethod_basecxx . . $ CTcSymFuncBase#is_multimethod_base(455f465bc33b4cdf).() const { return is_multimethod_base_cxx . . $ CTcSymFuncBase#is_multimethod_base_.; } |
| 1481 | void set_multimethod_basecxx . . $ CTcSymFuncBase#set_multimethod_base(d4f767463ce0a6b3).(int f) { is_multimethod_base_cxx . . $ CTcSymFuncBase#is_multimethod_base_. = f; } |
| 1482 | |
| 1483 | /* is this multi-method defined in this file? */ |
| 1484 | int is_mm_defcxx . . $ CTcSymFuncBase#is_mm_def(455f465bc33b4cdf).() const { return mm_def_cxx . . $ CTcSymFuncBase#mm_def_.; } |
| 1485 | void set_mm_defcxx . . $ CTcSymFuncBase#set_mm_def(d4f767463ce0a6b3).(int f) { mm_def_cxx . . $ CTcSymFuncBase#mm_def_. = f; } |
| 1486 | |
| 1487 | /* get/set the external 'replace' flag */ |
| 1488 | int get_ext_replacecxx . . $ CTcSymFuncBase#get_ext_replace(455f465bc33b4cdf).() const { return ext_replace_cxx . . $ CTcSymFuncBase#ext_replace_.; } |
| 1489 | void set_ext_replacecxx . . $ CTcSymFuncBase#set_ext_replace(d4f767463ce0a6b3).(int f) { ext_replace_cxx . . $ CTcSymFuncBase#ext_replace_. = f; } |
| 1490 | |
| 1491 | /* get/set the modified base symbol */ |
| 1492 | class CTcSymFunccxx . . $ CTcSymFunc# *get_mod_basecxx . . $ CTcSymFuncBase#get_mod_base(d785b0f451677e53).() const { return mod_base_cxx . . $ CTcSymFuncBase#mod_base_.; } |
| 1493 | void set_mod_basecxx . . $ CTcSymFuncBase#set_mod_base(1fdce7cc5bd8948b).(class CTcSymFunccxx . . $ CTcSymFunc# *f) { mod_base_cxx . . $ CTcSymFuncBase#mod_base_. = f; } |
| 1494 | |
| 1495 | /* |
| 1496 | * Get/set the global symbol. For a function replaced with 'modify', |
| 1497 | * this is the original symbol for the function, which is still in the |
| 1498 | * global symbol table. Otherwise, this is simply null. |
| 1499 | */ |
| 1500 | class CTcSymFunccxx . . $ CTcSymFunc# *get_mod_globalcxx . . $ CTcSymFuncBase#get_mod_global(d785b0f451677e53).() const { return mod_global_cxx . . $ CTcSymFuncBase#mod_global_.; } |
| 1501 | void set_mod_globalcxx . . $ CTcSymFuncBase#set_mod_global(1fdce7cc5bd8948b).(class CTcSymFunccxx . . $ CTcSymFunc# *f) { mod_global_cxx . . $ CTcSymFuncBase#mod_global_. = f; } |
| 1502 | |
| 1503 | /* get/set my code body */ |
| 1504 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *get_code_bodycxx . . $ CTcSymFuncBase#get_code_body(7f18ad9cf00df111).() const { return code_body_cxx . . $ CTcSymFuncBase#code_body_.; } |
| 1505 | void set_code_bodycxx . . $ CTcSymFuncBase#set_code_body(33da234aa72cf072).(class CTPNCodeBodycxx . . $ CTPNCodeBody# *cb) { code_body_cxx . . $ CTcSymFuncBase#code_body_. = cb; } |
| 1506 | |
| 1507 | /* determine if the function has a return value */ |
| 1508 | int has_retvalcxx . . $ CTcSymFuncBase#has_retval(455f465bc33b4cdf).() const { return has_retval_cxx . . $ CTcSymFuncBase#has_retval_.; } |
| 1509 | |
| 1510 | /* the name of a function used alone yields its address */ |
| 1511 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantcxx . . $ CTcSymFuncBase#fold_constant(f036da583a06c490).(); |
| 1512 | |
| 1513 | /* write some additional data to the symbol file */ |
| 1514 | virtual int write_to_sym_filecxx . . $ CTcSymFuncBase#write_to_sym_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1515 | |
| 1516 | /* write some additional data to the object file */ |
| 1517 | virtual int write_to_obj_filecxx . . $ CTcSymFuncBase#write_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1518 | |
| 1519 | /* read from a symbol file */ |
| 1520 | static class CTcSymbolcxx . . $ CTcSymbol# *read_from_sym_filecxx . . $ CTcSymFuncBase#read_from_sym_file(58cc6b2a3fd946ec).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1521 | |
| 1522 | /* load from an object file */ |
| 1523 | static int load_from_obj_filecxx . . $ CTcSymFuncBase#load_from_obj_file(f510970e88362930).(class CVmFilecxx . . $ CVmFile# *fp, const textchar_tcxx . . $ textchar_t# *fname); |
| 1524 | |
| 1525 | /* get my anchor */ |
| 1526 | struct CTcStreamAnchorcxx . . $ CTcStreamAnchor# *get_anchorcxx . . $ CTcSymFuncBase#get_anchor(541a84903a42f042).() const { return anchor_cxx . . $ CTcSymFuncBase#anchor_.; } |
| 1527 | |
| 1528 | /* |
| 1529 | * Set my anchor. This must be invoked during code generation when |
| 1530 | * our code body is generated. |
| 1531 | */ |
| 1532 | virtual void set_anchorcxx . . $ CTcSymFuncBase#set_anchor(d336b0b4f046ae00).(struct CTcStreamAnchorcxx . . $ CTcStreamAnchor# *anchor) |
| 1533 | { anchor_cxx . . $ CTcSymFuncBase#anchor_. = anchor; } |
| 1534 | |
| 1535 | /* get a pointer to my fixup list anchor */ |
| 1536 | virtual struct CTcAbsFixupcxx . . $ CTcAbsFixup# **get_fixup_list_anchorcxx . . $ CTcSymFuncBase#get_fixup_list_anchor(5f4ae355284525b7).() { return &fixups_cxx . . $ CTcSymFuncBase#fixups_.; } |
| 1537 | |
| 1538 | /* add an absolute fixup for the symbol at the given stream offset */ |
| 1539 | void add_abs_fixupcxx . . $ CTcSymFuncBase#add_abs_fixup(f8a15ca01c25f43c).(class CTcDataStreamcxx . . $ CTcDataStream# *ds, ulongcxx . . $ ulong# ofs); |
| 1540 | |
| 1541 | /* add an absolute fixup for the symbol at the current stream offset */ |
| 1542 | void add_abs_fixupcxx . . $ CTcSymFuncBase#add_abs_fixup(ed3738fb00585409).(class CTcDataStreamcxx . . $ CTcDataStream# *ds); |
| 1543 | |
| 1544 | /* determine if I have a return value when called as a function */ |
| 1545 | virtual int has_return_value_on_callcxx . . $ CTcSymFuncBase#has_return_value_on_call(455f465bc33b4cdf).() const |
| 1546 | { return has_retval_cxx . . $ CTcSymFuncBase#has_retval_.; } |
| 1547 | |
| 1548 | /* get the number of allocated modified base function offsets */ |
| 1549 | int get_mod_base_offset_countcxx . . $ CTcSymFuncBase#get_mod_base_offset_count(455f465bc33b4cdf).() const |
| 1550 | { return mod_base_ofs_list_cxx . . $ CTcSymFuncBase#mod_base_ofs_list_..get_countcxx . . $ CArrayList#get_count(fe4d2d262d4164a8).(); } |
| 1551 | |
| 1552 | /* get a modified base function offset by index */ |
| 1553 | ulongcxx . . $ ulong# get_mod_base_offsetcxx . . $ CTcSymFuncBase#get_mod_base_offset(c104ebd7d68b2193).(int idx) |
| 1554 | { return (ulongcxx . . $ ulong#)mod_base_ofs_list_cxx . . $ CTcSymFuncBase#mod_base_ofs_list_..get_ele_longcxx . . $ CArrayList#get_ele_long(96016858155b84d5).(idx); } |
| 1555 | |
| 1556 | /* add a modified base function offset */ |
| 1557 | void add_mod_base_offsetcxx . . $ CTcSymFuncBase#add_mod_base_offset(2c44cd906ae4e829).(ulongcxx . . $ ulong# ofs) |
| 1558 | { mod_base_ofs_list_cxx . . $ CTcSymFuncBase#mod_base_ofs_list_..add_elecxx . . $ CArrayList#add_ele(1624ee8275b10bda).((long)ofs); } |
| 1559 | |
| 1560 | /* clear the modified base offset list */ |
| 1561 | void clear_mod_base_offsetscxx . . $ CTcSymFuncBase#clear_mod_base_offsets(49f6e7a06ebc5aa8).() { mod_base_ofs_list_cxx . . $ CTcSymFuncBase#mod_base_ofs_list_..clearcxx . . $ CArrayList#clear(49f6e7a06ebc5aa8).(); } |
| 1562 | |
| 1563 | /* |
| 1564 | * Set the absolute address. For debugger expressions, this sets the |
| 1565 | * code pool address specified in the debugger source expression. |
| 1566 | */ |
| 1567 | virtual void set_abs_addrcxx . . $ CTcSymFuncBase#set_abs_addr(cb2f890c2fdad230).(uint32_t addr) = 0; |
| 1568 | |
| 1569 | protected: |
| 1570 | /* head of the fixup list for our function's code */ |
| 1571 | struct CTcAbsFixupcxx . . $ CTcAbsFixup# *fixups_cxx . . $ CTcSymFuncBase#fixups_.; |
| 1572 | |
| 1573 | /* |
| 1574 | * my stream anchor - this records my byte stream data size, code |
| 1575 | * stream offset, and (after linking) final pool address |
| 1576 | */ |
| 1577 | struct CTcStreamAnchorcxx . . $ CTcStreamAnchor# *anchor_cxx . . $ CTcSymFuncBase#anchor_.; |
| 1578 | |
| 1579 | /* the code body of the function */ |
| 1580 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *code_body_cxx . . $ CTcSymFuncBase#code_body_.; |
| 1581 | |
| 1582 | /* argument count */ |
| 1583 | int argc_cxx . . $ CTcSymFuncBase#argc_.; |
| 1584 | |
| 1585 | /* number of additional optional arguments */ |
| 1586 | int opt_argc_cxx . . $ CTcSymFuncBase#opt_argc_.; |
| 1587 | |
| 1588 | /* the original symbol we modified, if any */ |
| 1589 | class CTcSymFunccxx . . $ CTcSymFunc# *mod_base_cxx . . $ CTcSymFuncBase#mod_base_.; |
| 1590 | |
| 1591 | /* global symbol, for a modified function */ |
| 1592 | class CTcSymFunccxx . . $ CTcSymFunc# *mod_global_cxx . . $ CTcSymFuncBase#mod_global_.; |
| 1593 | |
| 1594 | /* array of modified base function code stream offsets */ |
| 1595 | CPrsArrayListcxx . . $ CPrsArrayList# mod_base_ofs_list_cxx . . $ CTcSymFuncBase#mod_base_ofs_list_.; |
| 1596 | |
| 1597 | /* flag: variable arguments (in which case argc_ is only a minimum) */ |
| 1598 | unsigned int varargs_cxx . . $ CTcSymFuncBase#varargs_. : 1; |
| 1599 | |
| 1600 | /* flag: the function has a return value (false -> void function) */ |
| 1601 | unsigned int has_retval_cxx . . $ CTcSymFuncBase#has_retval_. : 1; |
| 1602 | |
| 1603 | /* flag: this function is external to us */ |
| 1604 | unsigned int is_extern_cxx . . $ CTcSymFuncBase#is_extern_. : 1; |
| 1605 | |
| 1606 | /* flag: this function replaces an external function */ |
| 1607 | unsigned int ext_replace_cxx . . $ CTcSymFuncBase#ext_replace_. : 1; |
| 1608 | |
| 1609 | /* flag: this is a multi-method */ |
| 1610 | unsigned int is_multimethod_cxx . . $ CTcSymFuncBase#is_multimethod_. : 1; |
| 1611 | |
| 1612 | /* flag: this is a multi-method base function */ |
| 1613 | unsigned int is_multimethod_base_cxx . . $ CTcSymFuncBase#is_multimethod_base_. : 1; |
| 1614 | |
| 1615 | /* flag: this multi-method is defined in this file */ |
| 1616 | unsigned int mm_def_cxx . . $ CTcSymFuncBase#mm_def_. : 1; |
| 1617 | |
| 1618 | /* |
| 1619 | * Flag: this function has a known prototype. An 'extern' function |
| 1620 | * declaration is allowed without a prototype, in which case the |
| 1621 | * function can be defined elsewhere with any prototype. |
| 1622 | */ |
| 1623 | unsigned int has_proto_cxx . . $ CTcSymFuncBase#has_proto_. : 1; |
| 1624 | }; |
| 1625 | |
| 1626 | /* |
| 1627 | * metaclass symbol - property list entry |
| 1628 | */ |
| 1629 | class CTcSymMetaPropcxx . . $ CTcSymMetaProp# |
| 1630 | { |
| 1631 | public: |
| 1632 | CTcSymMetaPropcxx . . $ CTcSymMetaProp#CTcSymMetaProp(4f6065646aba8dd).(class CTcSymPropcxx . . $ CTcSymProp# *prop, int is_static) |
| 1633 | { |
| 1634 | /* remember the property symbol */ |
| 1635 | prop_cxx . . $ CTcSymMetaProp#prop_. = prop; |
| 1636 | |
| 1637 | /* remember whether it's static */ |
| 1638 | is_static_cxx . . $ CTcSymMetaProp#is_static_. = is_static; |
| 1639 | |
| 1640 | /* not in a list yet */ |
| 1641 | nxt_cxx . . $ CTcSymMetaProp#nxt_. = 0; |
| 1642 | } |
| 1643 | |
| 1644 | /* property symbol for this entry */ |
| 1645 | class CTcSymPropcxx . . $ CTcSymProp# *prop_cxx . . $ CTcSymMetaProp#prop_.; |
| 1646 | |
| 1647 | /* next entry in the list */ |
| 1648 | CTcSymMetaPropcxx . . $ CTcSymMetaProp# *nxt_cxx . . $ CTcSymMetaProp#nxt_.; |
| 1649 | |
| 1650 | /* flag: the property is declared as 'static' */ |
| 1651 | unsigned int is_static_cxx . . $ CTcSymMetaProp#is_static_. : 1; |
| 1652 | }; |
| 1653 | |
| 1654 | /* |
| 1655 | * Metaclass. |
| 1656 | * |
| 1657 | * Metaclasses must be declared per module. However, we store "soft" |
| 1658 | * references in symbol files, purely so that the defined() operator knows |
| 1659 | * whether a metaclass is included in the build. The soft references don't |
| 1660 | * contain any property table information, so we still need a full |
| 1661 | * 'intrinsic class' definition in each module. |
| 1662 | */ |
| 1663 | class CTcSymMetaclassBasecxx . . $ CTcSymMetaclassBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 1664 | { |
| 1665 | public: |
| 1666 | CTcSymMetaclassBasecxx . . $ CTcSymMetaclassBase#CTcSymMetaclassBase(2356309660a41ea).(const char *str, size_t len, int copy, |
| 1667 | int meta_idx, tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# class_obj) |
| 1668 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_METACLASScxx . . $ TC_SYM_METACLASS.) |
| 1669 | { |
| 1670 | /* remember the metaclass dependency list index */ |
| 1671 | meta_idx_cxx . . $ CTcSymMetaclassBase#meta_idx_. = meta_idx; |
| 1672 | |
| 1673 | /* we have no properties in our list yet */ |
| 1674 | prop_head_cxx . . $ CTcSymMetaclassBase#prop_head_. = 0; |
| 1675 | prop_tail_cxx . . $ CTcSymMetaclassBase#prop_tail_. = 0; |
| 1676 | prop_cnt_cxx . . $ CTcSymMetaclassBase#prop_cnt_. = 0; |
| 1677 | |
| 1678 | /* remember my class object */ |
| 1679 | class_obj_cxx . . $ CTcSymMetaclassBase#class_obj_. = class_obj; |
| 1680 | |
| 1681 | /* we have no modification object yet */ |
| 1682 | mod_obj_cxx . . $ CTcSymMetaclassBase#mod_obj_. = 0; |
| 1683 | |
| 1684 | /* we don't have a superclass yet */ |
| 1685 | super_meta_cxx . . $ CTcSymMetaclassBase#super_meta_. = 0; |
| 1686 | |
| 1687 | /* assume it's not an external symbol */ |
| 1688 | ext_cxx . . $ CTcSymMetaclassBase#ext_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1689 | |
| 1690 | /* not yet referenced */ |
| 1691 | ref_cxx . . $ CTcSymMetaclassBase#ref_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1692 | } |
| 1693 | |
| 1694 | /* this can't be an lvalue */ |
| 1695 | virtual int check_lvaluecxx . . $ CTcSymMetaclassBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 1696 | |
| 1697 | /* add a property to my list */ |
| 1698 | void add_propcxx . . $ CTcSymMetaclassBase#add_prop(100b231c9dbcf5c8).(const char *txt, size_t len, const char *obj_fname, |
| 1699 | int is_static); |
| 1700 | void add_propcxx . . $ CTcSymMetaclassBase#add_prop(4f6065646aba8dd).(class CTcSymPropcxx . . $ CTcSymProp# *prop, int is_static); |
| 1701 | |
| 1702 | /* get the head of the property symbol list */ |
| 1703 | CTcSymMetaPropcxx . . $ CTcSymMetaProp# *get_prop_headcxx . . $ CTcSymMetaclassBase#get_prop_head(6325817707e4a9a2).() const { return prop_head_cxx . . $ CTcSymMetaclassBase#prop_head_.; } |
| 1704 | |
| 1705 | /* get the nth property ID from the metaclass method table */ |
| 1706 | CTcSymMetaPropcxx . . $ CTcSymMetaProp# *get_nth_propcxx . . $ CTcSymMetaclassBase#get_nth_prop(81963d09259a5590).(int n) const; |
| 1707 | |
| 1708 | /* get/set the metaclass dependency table index */ |
| 1709 | int get_meta_idxcxx . . $ CTcSymMetaclassBase#get_meta_idx(455f465bc33b4cdf).() const { return meta_idx_cxx . . $ CTcSymMetaclassBase#meta_idx_.; } |
| 1710 | void set_meta_idxcxx . . $ CTcSymMetaclassBase#set_meta_idx(d4f767463ce0a6b3).(int idx) { meta_idx_cxx . . $ CTcSymMetaclassBase#meta_idx_. = idx; } |
| 1711 | |
| 1712 | /* write to a symbol file */ |
| 1713 | virtual int write_to_sym_filecxx . . $ CTcSymMetaclassBase#write_to_sym_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1714 | |
| 1715 | /* read from a symbol file */ |
| 1716 | static class CTcSymbolcxx . . $ CTcSymbol# *read_from_sym_filecxx . . $ CTcSymMetaclassBase#read_from_sym_file(58cc6b2a3fd946ec).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1717 | |
| 1718 | /* write some additional data to the object file */ |
| 1719 | virtual int write_to_obj_filecxx . . $ CTcSymMetaclassBase#write_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1720 | |
| 1721 | /* load from an object file */ |
| 1722 | static int load_from_obj_filecxx . . $ CTcSymMetaclassBase#load_from_obj_file(efd2807d5ec6d69c).(class CVmFilecxx . . $ CVmFile# *fp, |
| 1723 | const textchar_tcxx . . $ textchar_t# *fname, |
| 1724 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# *obj_xlat); |
| 1725 | |
| 1726 | /* get my class object */ |
| 1727 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# get_class_objcxx . . $ CTcSymMetaclassBase#get_class_obj(ddd8539a2fcdd4ce).() const { return class_obj_cxx . . $ CTcSymMetaclassBase#class_obj_.; } |
| 1728 | |
| 1729 | /* get/set my modification object */ |
| 1730 | class CTcSymObjcxx . . $ CTcSymObj# *get_mod_objcxx . . $ CTcSymMetaclassBase#get_mod_obj(8b0e43bb7c20f05b).() const { return mod_obj_cxx . . $ CTcSymMetaclassBase#mod_obj_.; } |
| 1731 | void set_mod_objcxx . . $ CTcSymMetaclassBase#set_mod_obj(1d808c2b1231e833).(CTcSymObjcxx . . $ CTcSymObj# *obj) { mod_obj_cxx . . $ CTcSymMetaclassBase#mod_obj_. = obj; } |
| 1732 | |
| 1733 | /* get/set my intrinsic superclass */ |
| 1734 | class CTcSymMetaclasscxx . . $ CTcSymMetaclass# *get_super_metacxx . . $ CTcSymMetaclassBase#get_super_meta(8e1ed3bce8002600).() const { return super_meta_cxx . . $ CTcSymMetaclassBase#super_meta_.; } |
| 1735 | void set_super_metacxx . . $ CTcSymMetaclassBase#set_super_meta(edae27da7b2553ea).(class CTcSymMetaclasscxx . . $ CTcSymMetaclass# *sc) { super_meta_cxx . . $ CTcSymMetaclassBase#super_meta_. = sc; } |
| 1736 | |
| 1737 | /* |
| 1738 | * Get/set the external reference status. An external metaclass is one |
| 1739 | * that's defined in another module; we have visibility to it via a |
| 1740 | * reference in a symbol file. This definition isn't sufficient to |
| 1741 | * actually use the metaclass; the metaclass must be declared per |
| 1742 | * module via an explicitly included 'intrinsic class' statment. The |
| 1743 | * external reference is sufficient for the defined() operator, though, |
| 1744 | * so we can test whether a metaclass is part of the build within a |
| 1745 | * module that doesn't declare the metaclass. |
| 1746 | */ |
| 1747 | int is_extcxx . . $ CTcSymMetaclassBase#is_ext(455f465bc33b4cdf).() const { return ext_cxx . . $ CTcSymMetaclassBase#ext_.; } |
| 1748 | void set_extcxx . . $ CTcSymMetaclassBase#set_ext(d4f767463ce0a6b3).(int f) { ext_cxx . . $ CTcSymMetaclassBase#ext_. = f; } |
| 1749 | |
| 1750 | protected: |
| 1751 | /* our intrinsic superclass */ |
| 1752 | class CTcSymMetaclasscxx . . $ CTcSymMetaclass# *super_meta_cxx . . $ CTcSymMetaclassBase#super_meta_.; |
| 1753 | |
| 1754 | /* metaclass dependency table index */ |
| 1755 | int meta_idx_cxx . . $ CTcSymMetaclassBase#meta_idx_.; |
| 1756 | |
| 1757 | /* list of properties */ |
| 1758 | CTcSymMetaPropcxx . . $ CTcSymMetaProp# *prop_head_cxx . . $ CTcSymMetaclassBase#prop_head_.; |
| 1759 | CTcSymMetaPropcxx . . $ CTcSymMetaProp# *prop_tail_cxx . . $ CTcSymMetaclassBase#prop_tail_.; |
| 1760 | |
| 1761 | /* |
| 1762 | * modification object - this is the object that contains the user |
| 1763 | * methods added to the intrinsic class via 'modify' |
| 1764 | */ |
| 1765 | class CTcSymObjcxx . . $ CTcSymObj# *mod_obj_cxx . . $ CTcSymMetaclassBase#mod_obj_.; |
| 1766 | |
| 1767 | /* number of properties in our list */ |
| 1768 | int prop_cnt_cxx . . $ CTcSymMetaclassBase#prop_cnt_.; |
| 1769 | |
| 1770 | /* the object that represents the class */ |
| 1771 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# class_obj_cxx . . $ CTcSymMetaclassBase#class_obj_.; |
| 1772 | |
| 1773 | /* is this an external metaclass symbol? */ |
| 1774 | uintcxx . . $ uint# ext_cxx . . $ CTcSymMetaclassBase#ext_. : 1; |
| 1775 | |
| 1776 | /* has our object been referenced in code generation? */ |
| 1777 | uintcxx . . $ uint# ref_cxx . . $ CTcSymMetaclassBase#ref_. : 1; |
| 1778 | }; |
| 1779 | |
| 1780 | /* |
| 1781 | * Object. An object's ID number can be assigned as soon as the object |
| 1782 | * is defined during parsing. |
| 1783 | */ |
| 1784 | class CTcSymObjBasecxx . . $ CTcSymObjBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 1785 | { |
| 1786 | public: |
| 1787 | CTcSymObjBasecxx . . $ CTcSymObjBase#CTcSymObjBase(74fff653c9717d86).(const char *str, size_t len, int copy, ulongcxx . . $ ulong# obj_id, |
| 1788 | int is_extern, tc_metaclass_tcxx . . $ tc_metaclass_t# meta, |
| 1789 | class CTcDictEntrycxx . . $ CTcDictEntry# *dict) |
| 1790 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_OBJcxx . . $ TC_SYM_OBJ.) |
| 1791 | { |
| 1792 | /* store the object ID */ |
| 1793 | obj_id_cxx . . $ CTcSymObjBase#obj_id_. = obj_id; |
| 1794 | |
| 1795 | /* note whether it's external */ |
| 1796 | is_extern_cxx . . $ CTcSymObjBase#is_extern_. = is_extern; |
| 1797 | |
| 1798 | /* we're not yet referenced */ |
| 1799 | ref_cxx . . $ CTcSymObjBase#ref_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1800 | |
| 1801 | /* we don't have a stream offset yet */ |
| 1802 | stream_ofs_cxx . . $ CTcSymObjBase#stream_ofs_. = 0xffffffff; |
| 1803 | |
| 1804 | /* we're don't 'modify' or 'replace' an external object */ |
| 1805 | ext_modify_cxx . . $ CTcSymObjBase#ext_modify_. = ext_replace_cxx . . $ CTcSymObjBase#ext_replace_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1806 | |
| 1807 | /* I haven't been modified yet */ |
| 1808 | modified_cxx . . $ CTcSymObjBase#modified_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1809 | |
| 1810 | /* presume we won't modify another object */ |
| 1811 | mod_base_sym_cxx . . $ CTcSymObjBase#mod_base_sym_. = 0; |
| 1812 | |
| 1813 | /* presume we won't be modified by another object */ |
| 1814 | modifying_obj_cxx . . $ CTcSymObjBase#modifying_obj_..sym_cxx . . $ CTcSymObjBase#$anonymous_type_0#sym_. = 0; |
| 1815 | |
| 1816 | /* no parse tree yet */ |
| 1817 | obj_stm_cxx . . $ CTcSymObjBase#obj_stm_. = 0; |
| 1818 | |
| 1819 | /* no self-reference fixups yet */ |
| 1820 | fixups_cxx . . $ CTcSymObjBase#fixups_. = 0; |
| 1821 | |
| 1822 | /* no deleted properties yet */ |
| 1823 | first_del_prop_cxx . . $ CTcSymObjBase#first_del_prop_. = 0; |
| 1824 | |
| 1825 | /* set the metaclass */ |
| 1826 | metaclass_cxx . . $ CTcSymObjBase#metaclass_. = meta; |
| 1827 | |
| 1828 | /* set the dictionary */ |
| 1829 | dict_cxx . . $ CTcSymObjBase#dict_. = dict; |
| 1830 | |
| 1831 | /* not yet written to object file */ |
| 1832 | written_to_obj_cxx . . $ CTcSymObjBase#written_to_obj_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1833 | counted_in_obj_cxx . . $ CTcSymObjBase#counted_in_obj_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1834 | |
| 1835 | /* no object file index yet */ |
| 1836 | obj_file_idx_cxx . . $ CTcSymObjBase#obj_file_idx_. = 0; |
| 1837 | |
| 1838 | /* no vocabulary yet */ |
| 1839 | vocab_cxx . . $ CTcSymObjBase#vocab_. = 0; |
| 1840 | |
| 1841 | /* no superclasses in our list yet */ |
| 1842 | sc_cxx . . $ CTcSymObjBase#sc_. = 0; |
| 1843 | |
| 1844 | /* no superclass names in our list yet */ |
| 1845 | sc_name_head_cxx . . $ CTcSymObjBase#sc_name_head_. = 0; |
| 1846 | sc_name_tail_cxx . . $ CTcSymObjBase#sc_name_tail_. = 0; |
| 1847 | |
| 1848 | /* presume we're not a class */ |
| 1849 | is_class_cxx . . $ CTcSymObjBase#is_class_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1850 | |
| 1851 | /* we haven't built our inherited vocabulary list yet */ |
| 1852 | vocab_inherited_cxx . . $ CTcSymObjBase#vocab_inherited_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1853 | |
| 1854 | /* presume we're fully nonymous */ |
| 1855 | anon_cxx . . $ CTcSymObjBase#anon_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1856 | |
| 1857 | /* assume we will have no metaclass-specific extra data object */ |
| 1858 | meta_extra_cxx . . $ CTcSymObjBase#meta_extra_. = 0; |
| 1859 | |
| 1860 | /* we're not yet explicitly based on the root object class */ |
| 1861 | sc_is_root_cxx . . $ CTcSymObjBase#sc_is_root_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1862 | |
| 1863 | /* no templates for this class yet */ |
| 1864 | template_head_cxx . . $ CTcSymObjBase#template_head_. = template_tail_cxx . . $ CTcSymObjBase#template_tail_. = 0; |
| 1865 | |
| 1866 | /* we don't have a private grammar rule list yet */ |
| 1867 | grammar_entry_cxx . . $ CTcSymObjBase#grammar_entry_. = 0; |
| 1868 | |
| 1869 | /* presume it's not transient */ |
| 1870 | transient_cxx . . $ CTcSymObjBase#transient_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 1871 | } |
| 1872 | |
| 1873 | /* this can't be an lvalue */ |
| 1874 | virtual int check_lvaluecxx . . $ CTcSymObjBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 1875 | |
| 1876 | /* get/set my metaclass */ |
| 1877 | tc_metaclass_tcxx . . $ tc_metaclass_t# get_metaclasscxx . . $ CTcSymObjBase#get_metaclass(3d9c3b363c8157e).() const { return metaclass_cxx . . $ CTcSymObjBase#metaclass_.; } |
| 1878 | void set_metaclasscxx . . $ CTcSymObjBase#set_metaclass(352d600493d1a1db).(tc_metaclass_tcxx . . $ tc_metaclass_t# meta) { metaclass_cxx . . $ CTcSymObjBase#metaclass_. = meta; } |
| 1879 | |
| 1880 | /* determine if I'm an unresolved external */ |
| 1881 | virtual int is_unresolved_externcxx . . $ CTcSymObjBase#is_unresolved_extern(455f465bc33b4cdf).() const { return is_extern_cxx . . $ CTcSymObjBase#is_extern_.; } |
| 1882 | |
| 1883 | /* get/set the object ID */ |
| 1884 | ulongcxx . . $ ulong# get_obj_idcxx . . $ CTcSymObjBase#get_obj_id(fe4d2d262d4164a8).() const { return obj_id_cxx . . $ CTcSymObjBase#obj_id_.; } |
| 1885 | void set_obj_idcxx . . $ CTcSymObjBase#set_obj_id(2c44cd906ae4e829).(ulongcxx . . $ ulong# obj_id) { obj_id_cxx . . $ CTcSymObjBase#obj_id_. = obj_id; } |
| 1886 | |
| 1887 | /* |
| 1888 | * Get/set the 'extern' flag. If an object symbol is defined as |
| 1889 | * extern, it means that the object is referenced but not defined in |
| 1890 | * the current file. This is used for separate compilation; extern |
| 1891 | * objects must be resolved during linking. |
| 1892 | */ |
| 1893 | int is_externcxx . . $ CTcSymObjBase#is_extern(455f465bc33b4cdf).() const { return is_extern_cxx . . $ CTcSymObjBase#is_extern_.; } |
| 1894 | void set_externcxx . . $ CTcSymObjBase#set_extern(d4f767463ce0a6b3).(int f) { is_extern_cxx . . $ CTcSymObjBase#is_extern_. = f; } |
| 1895 | |
| 1896 | /* get the appropriate object data stream for this object */ |
| 1897 | class CTcDataStreamcxx . . $ CTcDataStream# *get_streamcxx . . $ CTcSymObjBase#get_stream(2a8ad4cccb103a9e).() |
| 1898 | { return get_stream_from_metacxx . . $ CTcSymObjBase#get_stream_from_meta(4d31f19b28d09e09).(metaclass_cxx . . $ CTcSymObjBase#metaclass_.); } |
| 1899 | |
| 1900 | /* get/set my object stream offset */ |
| 1901 | ulongcxx . . $ ulong# get_stream_ofscxx . . $ CTcSymObjBase#get_stream_ofs(fe4d2d262d4164a8).() const { return stream_ofs_cxx . . $ CTcSymObjBase#stream_ofs_.; } |
| 1902 | void set_stream_ofscxx . . $ CTcSymObjBase#set_stream_ofs(2c44cd906ae4e829).(ulongcxx . . $ ulong# ofs) { stream_ofs_cxx . . $ CTcSymObjBase#stream_ofs_. = ofs; } |
| 1903 | |
| 1904 | /* get/set my object statement's parse tree */ |
| 1905 | class CTPNStmObjectcxx . . $ CTPNStmObject# *get_obj_stmcxx . . $ CTcSymObjBase#get_obj_stm(d5a4320d89b350ff).() const { return obj_stm_cxx . . $ CTcSymObjBase#obj_stm_.; } |
| 1906 | void set_obj_stmcxx . . $ CTcSymObjBase#set_obj_stm(28fc1443acde4d6f).(class CTPNStmObjectcxx . . $ CTPNStmObject# *obj_stm) { obj_stm_cxx . . $ CTcSymObjBase#obj_stm_. = obj_stm; } |
| 1907 | |
| 1908 | /* get/set the external 'modify' flag */ |
| 1909 | int get_ext_modifycxx . . $ CTcSymObjBase#get_ext_modify(455f465bc33b4cdf).() const { return ext_modify_cxx . . $ CTcSymObjBase#ext_modify_.; } |
| 1910 | void set_ext_modifycxx . . $ CTcSymObjBase#set_ext_modify(d4f767463ce0a6b3).(int f) { ext_modify_cxx . . $ CTcSymObjBase#ext_modify_. = f; } |
| 1911 | |
| 1912 | /* get/set the external 'replace' flag */ |
| 1913 | int get_ext_replacecxx . . $ CTcSymObjBase#get_ext_replace(455f465bc33b4cdf).() const { return ext_replace_cxx . . $ CTcSymObjBase#ext_replace_.; } |
| 1914 | void set_ext_replacecxx . . $ CTcSymObjBase#set_ext_replace(d4f767463ce0a6b3).(int f) { ext_replace_cxx . . $ CTcSymObjBase#ext_replace_. = f; } |
| 1915 | |
| 1916 | /* |
| 1917 | * Get/Set the 'modify' base object. For a 'modify' object, this sets |
| 1918 | * the symbol (which is always a synthesized symbol) of the object |
| 1919 | * being modified. |
| 1920 | */ |
| 1921 | class CTcSymObjcxx . . $ CTcSymObj# *get_mod_base_symcxx . . $ CTcSymObjBase#get_mod_base_sym(8b0e43bb7c20f05b).() const { return mod_base_sym_cxx . . $ CTcSymObjBase#mod_base_sym_.; } |
| 1922 | void set_mod_base_symcxx . . $ CTcSymObjBase#set_mod_base_sym(1d808c2b1231e833).(class CTcSymObjcxx . . $ CTcSymObj# *sym); |
| 1923 | |
| 1924 | /* |
| 1925 | * Get/set the modifiying object - this is the 'modify' object |
| 1926 | * that's modifying us. When we set this value, we'll also tell the |
| 1927 | * modified object that we are its modifier. |
| 1928 | */ |
| 1929 | class CTcSymObjcxx . . $ CTcSymObj# *get_modifying_symcxx . . $ CTcSymObjBase#get_modifying_sym(8b0e43bb7c20f05b).() const |
| 1930 | { return modifying_obj_cxx . . $ CTcSymObjBase#modifying_obj_..sym_cxx . . $ CTcSymObjBase#$anonymous_type_0#sym_.; } |
| 1931 | void set_modifying_symcxx . . $ CTcSymObjBase#set_modifying_sym(1d808c2b1231e833).(CTcSymObjcxx . . $ CTcSymObj# *sym) |
| 1932 | { modifying_obj_cxx . . $ CTcSymObjBase#modifying_obj_..sym_cxx . . $ CTcSymObjBase#$anonymous_type_0#sym_. = sym; } |
| 1933 | |
| 1934 | /* |
| 1935 | * Get/set the modifying object ID - the ID can be used instead of |
| 1936 | * the symbol, if desired. Note that only one or the other may be |
| 1937 | * stored, since they share the same data space. |
| 1938 | */ |
| 1939 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# get_modifying_obj_idcxx . . $ CTcSymObjBase#get_modifying_obj_id(ddd8539a2fcdd4ce).() const |
| 1940 | { return modifying_obj_cxx . . $ CTcSymObjBase#modifying_obj_..id_cxx . . $ CTcSymObjBase#$anonymous_type_0#id_.; } |
| 1941 | void set_modifying_obj_idcxx . . $ CTcSymObjBase#set_modifying_obj_id(cb2f890c2fdad230).(tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# id) |
| 1942 | { modifying_obj_cxx . . $ CTcSymObjBase#modifying_obj_..id_cxx . . $ CTcSymObjBase#$anonymous_type_0#id_. = id; } |
| 1943 | |
| 1944 | /* |
| 1945 | * get/set the 'modified' flag - this flag indicates that this is a |
| 1946 | * placeholder symbol for a modified object |
| 1947 | */ |
| 1948 | int get_modifiedcxx . . $ CTcSymObjBase#get_modified(455f465bc33b4cdf).() const { return modified_cxx . . $ CTcSymObjBase#modified_.; } |
| 1949 | void set_modifiedcxx . . $ CTcSymObjBase#set_modified(d4f767463ce0a6b3).(int f) { modified_cxx . . $ CTcSymObjBase#modified_. = f; } |
| 1950 | |
| 1951 | /* |
| 1952 | * Synthesize a placeholder symbol to use for modified objects. |
| 1953 | * This symbol keeps track of the original object after |
| 1954 | * modification. |
| 1955 | */ |
| 1956 | static class CTcSymObjcxx . . $ CTcSymObj# *synthesize_modified_obj_symcxx . . $ CTcSymObjBase#synthesize_modified_obj_sym(5cc7f034df661ca8).(int anon); |
| 1957 | |
| 1958 | /* |
| 1959 | * synthesize the name of a modified object base class symbol given |
| 1960 | * the base class's object ID |
| 1961 | */ |
| 1962 | static void synthesize_modified_obj_namecxx . . $ CTcSymObjBase#synthesize_modified_obj_name(2ae3250752bf8d86).(char *buf, |
| 1963 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# obj_id); |
| 1964 | |
| 1965 | /* add a self-reference fixup */ |
| 1966 | void add_self_ref_fixupcxx . . $ CTcSymObjBase#add_self_ref_fixup(f8a15ca01c25f43c).(class CTcDataStreamcxx . . $ CTcDataStream# *stream, ulongcxx . . $ ulong# ofs); |
| 1967 | |
| 1968 | /* an object's value is a compile-time constant */ |
| 1969 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantcxx . . $ CTcSymObjBase#fold_constant(f036da583a06c490).(); |
| 1970 | |
| 1971 | /* |
| 1972 | * we can't take the address of an object - an object symbol yields a |
| 1973 | * reference to begin with, so taking its address is meaningless |
| 1974 | */ |
| 1975 | virtual int has_addrcxx . . $ CTcSymObjBase#has_addr(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 1976 | |
| 1977 | /* write some additional data to the symbol file */ |
| 1978 | virtual int write_to_sym_filecxx . . $ CTcSymObjBase#write_to_sym_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1979 | |
| 1980 | /* write some additional data to the object file */ |
| 1981 | virtual int write_to_obj_filecxx . . $ CTcSymObjBase#write_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1982 | |
| 1983 | /* write myself as a modified base object to an object file */ |
| 1984 | int write_to_obj_file_as_modifiedcxx . . $ CTcSymObjBase#write_to_obj_file_as_modified(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1985 | |
| 1986 | /* write references to the object file */ |
| 1987 | virtual int write_refs_to_obj_filecxx . . $ CTcSymObjBase#write_refs_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 1988 | |
| 1989 | /* load references from the object file */ |
| 1990 | virtual void load_refs_from_obj_filecxx . . $ CTcSymObjBase#load_refs_from_obj_file(3758c9a2ad12f782).(class CVmFilecxx . . $ CVmFile# *fp, |
| 1991 | const textchar_tcxx . . $ textchar_t# *fname, |
| 1992 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# *obj_xlat, |
| 1993 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# *prop_xlat); |
| 1994 | |
| 1995 | /* mark the object as referenced */ |
| 1996 | void mark_referencedcxx . . $ CTcSymObjBase#mark_referenced(49f6e7a06ebc5aa8).() { ref_cxx . . $ CTcSymObjBase#ref_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 1997 | |
| 1998 | /* read from a symbol file */ |
| 1999 | static class CTcSymbolcxx . . $ CTcSymbol# *read_from_sym_filecxx . . $ CTcSymObjBase#read_from_sym_file(58cc6b2a3fd946ec).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2000 | |
| 2001 | /* load from an object file */ |
| 2002 | static int load_from_obj_filecxx . . $ CTcSymObjBase#load_from_obj_file(548b7616439f90ff).(class CVmFilecxx . . $ CVmFile# *fp, const textchar_tcxx . . $ textchar_t# *fname, |
| 2003 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# *obj_xlat, int anon); |
| 2004 | |
| 2005 | /* load a modified base object from an object file */ |
| 2006 | static class CTcSymObjcxx . . $ CTcSymObj# * |
| 2007 | load_from_obj_file_modbasecxx . . $ CTcSymObjBase#load_from_obj_file_modbase(9ae8250ec71aaa3).(class CVmFilecxx . . $ CVmFile# *fp, const textchar_tcxx . . $ textchar_t# *fname, |
| 2008 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# *obj_xlat, |
| 2009 | const textchar_tcxx . . $ textchar_t# *mod_name, |
| 2010 | size_t mod_name_len, int anon); |
| 2011 | |
| 2012 | /* get/set the head of my fixup list */ |
| 2013 | struct CTcIdFixupcxx . . $ CTcIdFixup# *get_fixupscxx . . $ CTcSymObjBase#get_fixups(a93cd0d17cf1ec8a).() const { return fixups_cxx . . $ CTcSymObjBase#fixups_.; } |
| 2014 | void set_fixupscxx . . $ CTcSymObjBase#set_fixups(7252e79a6b6fa427).(struct CTcIdFixupcxx . . $ CTcIdFixup# *fixups) { fixups_cxx . . $ CTcSymObjBase#fixups_. = fixups; } |
| 2015 | |
| 2016 | /* apply our internal fixups */ |
| 2017 | virtual void apply_internal_fixupscxx . . $ CTcSymObjBase#apply_internal_fixups(49f6e7a06ebc5aa8).(); |
| 2018 | |
| 2019 | /* add a deleted property entry */ |
| 2020 | void add_del_prop_entrycxx . . $ CTcSymObjBase#add_del_prop_entry(3e679d9e5d4f99b2).(class CTcSymPropcxx . . $ CTcSymProp# *prop) |
| 2021 | { add_del_prop_to_listcxx . . $ CTcSymObjBase#add_del_prop_to_list(93a36b4874008fce).(&first_del_prop_cxx . . $ CTcSymObjBase#first_del_prop_., prop); } |
| 2022 | |
| 2023 | /* get the head of my deleted property list */ |
| 2024 | class CTcObjPropDelcxx . . $ CTcObjPropDel# *get_first_del_propcxx . . $ CTcSymObjBase#get_first_del_prop(fbc1ff0772c61e38).() const |
| 2025 | { return first_del_prop_cxx . . $ CTcSymObjBase#first_del_prop_.; } |
| 2026 | |
| 2027 | /* set the head of my deleted property list, replacing any old list */ |
| 2028 | void set_del_prop_headcxx . . $ CTcSymObjBase#set_del_prop_head(692f71b5ee77822).(class CTcObjPropDelcxx . . $ CTcObjPropDel# *list_head) |
| 2029 | { first_del_prop_cxx . . $ CTcSymObjBase#first_del_prop_. = list_head; } |
| 2030 | |
| 2031 | /* |
| 2032 | * Delete a property from 'modify' base objects. This must be |
| 2033 | * defined by the target-specific code subclass, because the action |
| 2034 | * of this routine is specific to the code generator. |
| 2035 | * |
| 2036 | * This carries out a link-time 'replace' on a property in a |
| 2037 | * 'modify' object. This object is the 'modify' object; we must |
| 2038 | * delete the property in all of the base classes of this object |
| 2039 | * that were modified by this 'modify' or by a 'modify' to which |
| 2040 | * this 'modify' indirectly applies. Do not delete the property |
| 2041 | * from this object - only from its modified base classes. Stop |
| 2042 | * upon reaching a non-modified base class, because this is the base |
| 2043 | * class of the original. |
| 2044 | */ |
| 2045 | virtual void delete_prop_from_mod_basecxx . . $ CTcSymObjBase#delete_prop_from_mod_base(ed53e3bbd3fa2f69).(tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop_id) = 0; |
| 2046 | |
| 2047 | /* |
| 2048 | * Mark the compiled data for this object as a class object. This |
| 2049 | * must be defined by the target-specific code subclass, because we |
| 2050 | * need to modify the generated code for the object. |
| 2051 | * |
| 2052 | * This routine is called when an object loaded from an object file |
| 2053 | * is modified by an object in another object file, and hence |
| 2054 | * becomes a base class at link-time. We call this on the original, |
| 2055 | * which doesn't know it's being modified until link time. |
| 2056 | */ |
| 2057 | virtual void mark_compiled_as_classcxx . . $ CTcSymObjBase#mark_compiled_as_class(49f6e7a06ebc5aa8).() = 0; |
| 2058 | |
| 2059 | /* get/set the symbol's containing dictionary */ |
| 2060 | class CTcDictEntrycxx . . $ CTcDictEntry# *get_dictcxx . . $ CTcSymObjBase#get_dict(d82119eccf04d887).() const { return dict_cxx . . $ CTcSymObjBase#dict_.; } |
| 2061 | void set_dictcxx . . $ CTcSymObjBase#set_dict(894c88d6e8e5b222).(class CTcDictEntrycxx . . $ CTcDictEntry# *dict) { dict_cxx . . $ CTcSymObjBase#dict_. = dict; } |
| 2062 | |
| 2063 | /* get/set my object file index */ |
| 2064 | uintcxx . . $ uint# get_obj_file_idxcxx . . $ CTcSymObjBase#get_obj_file_idx(ddd8539a2fcdd4ce).() const { return obj_file_idx_cxx . . $ CTcSymObjBase#obj_file_idx_.; } |
| 2065 | void set_obj_file_idxcxx . . $ CTcSymObjBase#set_obj_file_idx(cb2f890c2fdad230).(uintcxx . . $ uint# idx) { obj_file_idx_cxx . . $ CTcSymObjBase#obj_file_idx_. = idx; } |
| 2066 | |
| 2067 | /* add a word to my vocabulary list */ |
| 2068 | void add_vocab_wordcxx . . $ CTcSymObjBase#add_vocab_word(34a9bb4274024cd7).(const char *txt, size_t len, tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop); |
| 2069 | |
| 2070 | /* delete a vocabulary property from my list (for 'replace') */ |
| 2071 | void delete_vocab_propcxx . . $ CTcSymObjBase#delete_vocab_prop(ed53e3bbd3fa2f69).(tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop); |
| 2072 | |
| 2073 | /* get/set the vocabulary word list head */ |
| 2074 | class CTcVocabEntrycxx . . $ CTcVocabEntry# *get_vocab_headcxx . . $ CTcSymObjBase#get_vocab_head(9a52e6bdf39819ca).() const { return vocab_cxx . . $ CTcSymObjBase#vocab_.; } |
| 2075 | void set_vocab_headcxx . . $ CTcSymObjBase#set_vocab_head(24c49b7787cf40ec).(class CTcVocabEntrycxx . . $ CTcVocabEntry# *entry) { vocab_cxx . . $ CTcSymObjBase#vocab_. = entry; } |
| 2076 | |
| 2077 | /* build my dictionary */ |
| 2078 | virtual void build_dictionarycxx . . $ CTcSymObjBase#build_dictionary(49f6e7a06ebc5aa8).(); |
| 2079 | |
| 2080 | /* inherit my vocabulary from superclasses (used during linking) */ |
| 2081 | void inherit_vocabcxx . . $ CTcSymObjBase#inherit_vocab(49f6e7a06ebc5aa8).(); |
| 2082 | |
| 2083 | /* add my vocabulary words to a subclass's vocabulary (for linking) */ |
| 2084 | void add_vocab_to_subclasscxx . . $ CTcSymObjBase#add_vocab_to_subclass(1d808c2b1231e833).(class CTcSymObjcxx . . $ CTcSymObj# *sub); |
| 2085 | |
| 2086 | /* get/set my class flag (used and valid only during linking) */ |
| 2087 | int is_classcxx . . $ CTcSymObjBase#is_class(455f465bc33b4cdf).() const { return is_class_cxx . . $ CTcSymObjBase#is_class_. != 0; } |
| 2088 | void set_is_classcxx . . $ CTcSymObjBase#set_is_class(d4f767463ce0a6b3).(int is_class) { is_class_cxx . . $ CTcSymObjBase#is_class_. = (is_class != 0); } |
| 2089 | |
| 2090 | /* get/set the resolved superclass list head (link-time only) */ |
| 2091 | class CTcObjScEntrycxx . . $ CTcObjScEntry# *get_sc_headcxx . . $ CTcSymObjBase#get_sc_head(6efc5d25e9afb38).() const { return sc_cxx . . $ CTcSymObjBase#sc_.; } |
| 2092 | void set_sc_headcxx . . $ CTcSymObjBase#set_sc_head(6fbdf5228bb9874).(class CTcObjScEntrycxx . . $ CTcObjScEntry# *sc) { sc_cxx . . $ CTcSymObjBase#sc_. = sc; } |
| 2093 | |
| 2094 | /* get the named superclass list head (compile-time only) */ |
| 2095 | class CTPNSuperclasscxx . . $ CTPNSuperclass# *get_sc_name_headcxx . . $ CTcSymObjBase#get_sc_name_head(e0c9c37a8c357c8e).() const { return sc_name_head_cxx . . $ CTcSymObjBase#sc_name_head_.; } |
| 2096 | |
| 2097 | /* clear the named superclass list */ |
| 2098 | void clear_sc_namescxx . . $ CTcSymObjBase#clear_sc_names(49f6e7a06ebc5aa8).() { sc_name_head_cxx . . $ CTcSymObjBase#sc_name_head_. = sc_name_tail_cxx . . $ CTcSymObjBase#sc_name_tail_. = 0; } |
| 2099 | |
| 2100 | /* copy the name list from another object symbol */ |
| 2101 | void copy_sc_namescxx . . $ CTcSymObjBase#copy_sc_names(a0288ec41fe7dd29).(CTcSymObjBasecxx . . $ CTcSymObjBase# *other_obj) |
| 2102 | { |
| 2103 | /* point our entries directly to the other symbol's */ |
| 2104 | sc_name_head_cxx . . $ CTcSymObjBase#sc_name_head_. = other_obj->sc_name_head_cxx . . $ CTcSymObjBase#sc_name_head_.; |
| 2105 | sc_name_tail_cxx . . $ CTcSymObjBase#sc_name_tail_. = other_obj->sc_name_tail_cxx . . $ CTcSymObjBase#sc_name_tail_.; |
| 2106 | } |
| 2107 | |
| 2108 | /* |
| 2109 | * Add a named superclass. |
| 2110 | * |
| 2111 | * We keep a superclass list here, separately from the superclass list |
| 2112 | * that the associated object statement itself maintains, because we |
| 2113 | * want hierarchy information for external objects as well as objects |
| 2114 | * defined in the current module. An external object has only a |
| 2115 | * symbol table entry, so there's no object statement in which to |
| 2116 | * stash the object list for such objects. |
| 2117 | * |
| 2118 | * In addition, this symbolic superclass list isn't exactly the same |
| 2119 | * as the true superclass list, because the symbolic list doesn't |
| 2120 | * include the special unnamed objects created when 'modify' is used. |
| 2121 | * The list we keep here mirrors the apparent structure as represented |
| 2122 | * in the source code. |
| 2123 | */ |
| 2124 | void add_sc_name_entrycxx . . $ CTcSymObjBase#add_sc_name_entry(7cafb6e0818eff3b).(const char *txt, size_t len); |
| 2125 | |
| 2126 | /* |
| 2127 | * determine if I have the given superclass - returns true if the |
| 2128 | * given superclass is among my direct superclasses, or if any of my |
| 2129 | * direct superclasses has the given superclass |
| 2130 | */ |
| 2131 | int has_superclasscxx . . $ CTcSymObjBase#has_superclass(81daa8f0ef8ce2b).(class CTcSymObjcxx . . $ CTcSymObj# *sc_sym) const; |
| 2132 | |
| 2133 | /* get/set the anonymous flag */ |
| 2134 | int is_anoncxx . . $ CTcSymObjBase#is_anon(455f465bc33b4cdf).() const { return anon_cxx . . $ CTcSymObjBase#anon_. != 0; } |
| 2135 | void set_anoncxx . . $ CTcSymObjBase#set_anon(d4f767463ce0a6b3).(int f) { anon_cxx . . $ CTcSymObjBase#anon_. = (f != 0); } |
| 2136 | |
| 2137 | /* get/set the metaclass extra data for this object */ |
| 2138 | void *get_meta_extracxx . . $ CTcSymObjBase#get_meta_extra(45a5c5ac6be858a8).() const { return meta_extra_cxx . . $ CTcSymObjBase#meta_extra_.; } |
| 2139 | void set_meta_extracxx . . $ CTcSymObjBase#set_meta_extra(5d22bdacc48458e8).(void *ptr) { meta_extra_cxx . . $ CTcSymObjBase#meta_extra_. = ptr; } |
| 2140 | |
| 2141 | /* |
| 2142 | * get/set the root-object-superclass flag - if this is set, it means |
| 2143 | * that the object was explicitly defined with 'object' (the root |
| 2144 | * object type) as its superclass |
| 2145 | */ |
| 2146 | int sc_is_rootcxx . . $ CTcSymObjBase#sc_is_root(455f465bc33b4cdf).() const { return sc_is_root_cxx . . $ CTcSymObjBase#sc_is_root_.; } |
| 2147 | void set_sc_is_rootcxx . . $ CTcSymObjBase#set_sc_is_root(d4f767463ce0a6b3).(int f) { sc_is_root_cxx . . $ CTcSymObjBase#sc_is_root_. = (f != 0); } |
| 2148 | |
| 2149 | /* add a class-specific template */ |
| 2150 | void add_templatecxx . . $ CTcSymObjBase#add_template(316e072826ca6c5e).(class CTcObjTemplatecxx . . $ CTcObjTemplate# *tpl); |
| 2151 | |
| 2152 | /* get the head/tail of my template list */ |
| 2153 | class CTcObjTemplatecxx . . $ CTcObjTemplate# *get_first_templatecxx . . $ CTcSymObjBase#get_first_template(411056c92afe8914).() const |
| 2154 | { return template_head_cxx . . $ CTcSymObjBase#template_head_.; } |
| 2155 | class CTcObjTemplatecxx . . $ CTcObjTemplate# *get_last_templatecxx . . $ CTcSymObjBase#get_last_template(411056c92afe8914).() const |
| 2156 | { return template_tail_cxx . . $ CTcSymObjBase#template_tail_.; } |
| 2157 | |
| 2158 | /* |
| 2159 | * Create our grammar rule entry object. If we already have one, |
| 2160 | * we'll discard it in favor of the new one; this allows a 'replace' |
| 2161 | * or 'modify' to override any previously-defined grammar rules. |
| 2162 | */ |
| 2163 | class CTcGramProdEntrycxx . . $ CTcGramProdEntry# *create_grammar_entrycxx . . $ CTcSymObjBase#create_grammar_entry(efc1795a1995a7b3).( |
| 2164 | const char *prod_sym, size_t prod_sym_len); |
| 2165 | |
| 2166 | /* get my grammar rule list */ |
| 2167 | class CTcGramProdEntrycxx . . $ CTcGramProdEntry# *get_grammar_entrycxx . . $ CTcSymObjBase#get_grammar_entry(a18f684d7c1639d5).() const |
| 2168 | { return grammar_entry_cxx . . $ CTcSymObjBase#grammar_entry_.; } |
| 2169 | |
| 2170 | /* |
| 2171 | * merge my grammar rule list (if any) into the global rule list for |
| 2172 | * the associated production object |
| 2173 | */ |
| 2174 | void merge_grammar_entrycxx . . $ CTcSymObjBase#merge_grammar_entry(49f6e7a06ebc5aa8).(); |
| 2175 | |
| 2176 | /* get/set transient status */ |
| 2177 | int is_transientcxx . . $ CTcSymObjBase#is_transient(455f465bc33b4cdf).() const { return transient_cxx . . $ CTcSymObjBase#transient_.; } |
| 2178 | void set_transientcxx . . $ CTcSymObjBase#set_transient(49f6e7a06ebc5aa8).() { transient_cxx . . $ CTcSymObjBase#transient_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 2179 | |
| 2180 | protected: |
| 2181 | /* add a deleted property entry to a list */ |
| 2182 | static void add_del_prop_to_listcxx . . $ CTcSymObjBase#add_del_prop_to_list(93a36b4874008fce).(class CTcObjPropDelcxx . . $ CTcObjPropDel# **list_head, |
| 2183 | class CTcSymPropcxx . . $ CTcSymProp# *prop); |
| 2184 | |
| 2185 | /* main object file writer routine */ |
| 2186 | int write_to_obj_file_maincxx . . $ CTcSymObjBase#write_to_obj_file_main(55f024ebabc290c2).(CVmFilecxx . . $ CVmFile# *fp); |
| 2187 | |
| 2188 | /* main object file loader routine */ |
| 2189 | static class CTcSymObjcxx . . $ CTcSymObj# * |
| 2190 | load_from_obj_file_maincxx . . $ CTcSymObjBase#load_from_obj_file_main(9ae8250ec71aaa3).(class CVmFilecxx . . $ CVmFile# *fp, const textchar_tcxx . . $ textchar_t# *fname, |
| 2191 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# *obj_xlat, |
| 2192 | const textchar_tcxx . . $ textchar_t# *mod_name, |
| 2193 | size_t mod_name_len, int anon); |
| 2194 | |
| 2195 | /* get the stream for a given metaclass */ |
| 2196 | static class CTcDataStreamcxx . . $ CTcDataStream# *get_stream_from_metacxx . . $ CTcSymObjBase#get_stream_from_meta(4d31f19b28d09e09).(tc_metaclass_tcxx . . $ tc_metaclass_t# meta); |
| 2197 | |
| 2198 | /* the object's ID */ |
| 2199 | ulongcxx . . $ ulong# obj_id_cxx . . $ CTcSymObjBase#obj_id_.; |
| 2200 | |
| 2201 | /* |
| 2202 | * the object stream (G_os, or other stream as appropriate) offset of |
| 2203 | * our data - this is valid after code generation if we're not |
| 2204 | * external |
| 2205 | */ |
| 2206 | ulongcxx . . $ ulong# stream_ofs_cxx . . $ CTcSymObjBase#stream_ofs_.; |
| 2207 | |
| 2208 | /* the parse tree for our object definition */ |
| 2209 | class CTPNStmObjectcxx . . $ CTPNStmObject# *obj_stm_cxx . . $ CTcSymObjBase#obj_stm_.; |
| 2210 | |
| 2211 | /* head of our self-reference object ID fixup list */ |
| 2212 | struct CTcIdFixupcxx . . $ CTcIdFixup# *fixups_cxx . . $ CTcSymObjBase#fixups_.; |
| 2213 | |
| 2214 | /* |
| 2215 | * Head of list of deleted properties. This list is used only in |
| 2216 | * the top object in a stack of modified objects (i.e., this list is |
| 2217 | * attached to the latest 'modify' object), and only when the bottom |
| 2218 | * object in the stack is external to the current translation unit. |
| 2219 | * This is the list of objects that must be deleted at link time, |
| 2220 | * because they're external to the current translation unit. |
| 2221 | */ |
| 2222 | class CTcObjPropDelcxx . . $ CTcObjPropDel# *first_del_prop_cxx . . $ CTcSymObjBase#first_del_prop_.; |
| 2223 | |
| 2224 | /* |
| 2225 | * Base symbol for a 'modify' object. This is the synthesized |
| 2226 | * symbol for the object that this object modifies. |
| 2227 | */ |
| 2228 | class CTcSymObjcxx . . $ CTcSymObj# *mod_base_sym_cxx . . $ CTcSymObjBase#mod_base_sym_.; |
| 2229 | |
| 2230 | /* |
| 2231 | * Modifying symbol for an object modified by a 'modify' object. |
| 2232 | * This points to the object that is modifying us - it's simply the |
| 2233 | * reverse link of mod_base_sym_. |
| 2234 | */ |
| 2235 | unioncxx . . $ CTcSymObjBase#$anonymous_type_0# |
| 2236 | { |
| 2237 | class CTcSymObjcxx . . $ CTcSymObj# *sym_cxx . . $ CTcSymObjBase#$anonymous_type_0#sym_.; |
| 2238 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# id_cxx . . $ CTcSymObjBase#$anonymous_type_0#id_.; |
| 2239 | } modifying_obj_cxx . . $ CTcSymObjBase#modifying_obj_.; |
| 2240 | |
| 2241 | /* the dictionary holding my vocabulary words */ |
| 2242 | class CTcDictEntrycxx . . $ CTcDictEntry# *dict_cxx . . $ CTcSymObjBase#dict_.; |
| 2243 | |
| 2244 | /* head of vocabulary list for this object */ |
| 2245 | class CTcVocabEntrycxx . . $ CTcVocabEntry# *vocab_cxx . . $ CTcSymObjBase#vocab_.; |
| 2246 | |
| 2247 | /* |
| 2248 | * Head of superclass list - this list is used and valid ONLY during |
| 2249 | * linking; it is null during compilation. Because a class or object |
| 2250 | * can be defined before its superclasses, and can be defined in |
| 2251 | * separate a separate module from its superclass, we can't resolve |
| 2252 | * superclasses until link time. |
| 2253 | */ |
| 2254 | class CTcObjScEntrycxx . . $ CTcObjScEntry# *sc_cxx . . $ CTcSymObjBase#sc_.; |
| 2255 | |
| 2256 | /* |
| 2257 | * Superclass name list. This list is used and valid ONLY during |
| 2258 | * normal compilation, and keeps track of the symbolic name structure |
| 2259 | * of the class hiearchy. We don't resolve these names; we simply |
| 2260 | * keep track of the names as they appear in the source code. |
| 2261 | * |
| 2262 | * Note that the entries in this list must all have valid txt_ entries |
| 2263 | * - no entries with sym_ values are allowed in this list. |
| 2264 | */ |
| 2265 | class CTPNSuperclasscxx . . $ CTPNSuperclass# *sc_name_head_cxx . . $ CTcSymObjBase#sc_name_head_.; |
| 2266 | class CTPNSuperclasscxx . . $ CTPNSuperclass# *sc_name_tail_cxx . . $ CTcSymObjBase#sc_name_tail_.; |
| 2267 | |
| 2268 | /* pointer to metaclass-specific extra data */ |
| 2269 | void *meta_extra_cxx . . $ CTcSymObjBase#meta_extra_.; |
| 2270 | |
| 2271 | /* the object's metaclass */ |
| 2272 | tc_metaclass_tcxx . . $ tc_metaclass_t# metaclass_cxx . . $ CTcSymObjBase#metaclass_.; |
| 2273 | |
| 2274 | /* list of templates associated with this class */ |
| 2275 | class CTcObjTemplatecxx . . $ CTcObjTemplate# *template_head_cxx . . $ CTcSymObjBase#template_head_.; |
| 2276 | class CTcObjTemplatecxx . . $ CTcObjTemplate# *template_tail_cxx . . $ CTcSymObjBase#template_tail_.; |
| 2277 | |
| 2278 | /* object file index - used for serializing to the object file */ |
| 2279 | uintcxx . . $ uint# obj_file_idx_cxx . . $ CTcSymObjBase#obj_file_idx_.; |
| 2280 | |
| 2281 | /* grammar rule list, if we have one */ |
| 2282 | class CTcGramProdEntrycxx . . $ CTcGramProdEntry# *grammar_entry_cxx . . $ CTcSymObjBase#grammar_entry_.; |
| 2283 | |
| 2284 | /* flag: this object is external to us */ |
| 2285 | uintcxx . . $ uint# is_extern_cxx . . $ CTcSymObjBase#is_extern_. : 1; |
| 2286 | |
| 2287 | /* flag: the object has been referenced */ |
| 2288 | uintcxx . . $ uint# ref_cxx . . $ CTcSymObjBase#ref_. : 1; |
| 2289 | |
| 2290 | /* |
| 2291 | * 'modify' and 'replace' flags - these indicate that this object |
| 2292 | * modifies/replaces an *external* object, hence the modify/replace |
| 2293 | * action must be performed at link time |
| 2294 | */ |
| 2295 | uintcxx . . $ uint# ext_modify_cxx . . $ CTcSymObjBase#ext_modify_. : 1; |
| 2296 | uintcxx . . $ uint# ext_replace_cxx . . $ CTcSymObjBase#ext_replace_. : 1; |
| 2297 | |
| 2298 | /* flag: I've been modified by another object */ |
| 2299 | uintcxx . . $ uint# modified_cxx . . $ CTcSymObjBase#modified_. : 1; |
| 2300 | |
| 2301 | /* flag: I'm a 'class' object (used and valid only during linking) */ |
| 2302 | uintcxx . . $ uint# is_class_cxx . . $ CTcSymObjBase#is_class_. : 1; |
| 2303 | |
| 2304 | /* flag: this object has been written to the object file */ |
| 2305 | uintcxx . . $ uint# written_to_obj_cxx . . $ CTcSymObjBase#written_to_obj_. : 1; |
| 2306 | |
| 2307 | /* flag: this object has been counted as written to the object file */ |
| 2308 | uintcxx . . $ uint# counted_in_obj_cxx . . $ CTcSymObjBase#counted_in_obj_. : 1; |
| 2309 | |
| 2310 | /* |
| 2311 | * flag: we've built our full vocabulary by explicitly inheriting |
| 2312 | * our superclass's words into our own list |
| 2313 | */ |
| 2314 | uintcxx . . $ uint# vocab_inherited_cxx . . $ CTcSymObjBase#vocab_inherited_. : 1; |
| 2315 | |
| 2316 | /* flag: this object is anonymous */ |
| 2317 | uintcxx . . $ uint# anon_cxx . . $ CTcSymObjBase#anon_. : 1; |
| 2318 | |
| 2319 | /* |
| 2320 | * flag: we are explicitly defined with the root object ('object') as |
| 2321 | * our superclass |
| 2322 | */ |
| 2323 | uintcxx . . $ uint# sc_is_root_cxx . . $ CTcSymObjBase#sc_is_root_. : 1; |
| 2324 | |
| 2325 | /* flag: the object is transient */ |
| 2326 | uintcxx . . $ uint# transient_cxx . . $ CTcSymObjBase#transient_. : 1; |
| 2327 | }; |
| 2328 | |
| 2329 | /* |
| 2330 | * Object vocabulary word entry |
| 2331 | */ |
| 2332 | class CTcVocabEntrycxx . . $ CTcVocabEntry# |
| 2333 | { |
| 2334 | public: |
| 2335 | CTcVocabEntrycxx . . $ CTcVocabEntry#CTcVocabEntry(34a9bb4274024cd7).(const char *txt, size_t len, tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop) |
| 2336 | { |
| 2337 | /* |
| 2338 | * keep a reference to the text - assume it's in parser memory, |
| 2339 | * so it'll stay around for the duration of the compilation |
| 2340 | */ |
| 2341 | txt_cxx . . $ CTcVocabEntry#txt_. = txt; |
| 2342 | len_cxx . . $ CTcVocabEntry#len_. = len; |
| 2343 | |
| 2344 | /* remember; the property */ |
| 2345 | prop_cxx . . $ CTcVocabEntry#prop_. = prop; |
| 2346 | |
| 2347 | /* not in a list yet */ |
| 2348 | nxt_cxx . . $ CTcVocabEntry#nxt_. = 0; |
| 2349 | } |
| 2350 | |
| 2351 | /* text of word */ |
| 2352 | const char *txt_cxx . . $ CTcVocabEntry#txt_.; |
| 2353 | size_t len_cxx . . $ CTcVocabEntry#len_.; |
| 2354 | |
| 2355 | /* property of the word association */ |
| 2356 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop_cxx . . $ CTcVocabEntry#prop_.; |
| 2357 | |
| 2358 | /* next entry in list */ |
| 2359 | CTcVocabEntrycxx . . $ CTcVocabEntry# *nxt_cxx . . $ CTcVocabEntry#nxt_.; |
| 2360 | }; |
| 2361 | |
| 2362 | /* |
| 2363 | * Object superclass list entry |
| 2364 | */ |
| 2365 | class CTcObjScEntrycxx . . $ CTcObjScEntry# |
| 2366 | { |
| 2367 | public: |
| 2368 | CTcObjScEntrycxx . . $ CTcObjScEntry#CTcObjScEntry(1d808c2b1231e833).(class CTcSymObjcxx . . $ CTcSymObj# *sym) |
| 2369 | { |
| 2370 | /* remember the object symbol */ |
| 2371 | sym_cxx . . $ CTcObjScEntry#sym_. = sym; |
| 2372 | |
| 2373 | /* not in a list yet */ |
| 2374 | nxt_cxx . . $ CTcObjScEntry#nxt_. = 0; |
| 2375 | } |
| 2376 | |
| 2377 | /* object symbol */ |
| 2378 | class CTcSymObjcxx . . $ CTcSymObj# *sym_cxx . . $ CTcObjScEntry#sym_.; |
| 2379 | |
| 2380 | /* next superclass list entry */ |
| 2381 | CTcObjScEntrycxx . . $ CTcObjScEntry# *nxt_cxx . . $ CTcObjScEntry#nxt_.; |
| 2382 | }; |
| 2383 | |
| 2384 | |
| 2385 | /* |
| 2386 | * Property. A property's ID can be assigned as soon as the property is |
| 2387 | * first used in an object definition. |
| 2388 | */ |
| 2389 | class CTcSymPropBasecxx . . $ CTcSymPropBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 2390 | { |
| 2391 | public: |
| 2392 | CTcSymPropBasecxx . . $ CTcSymPropBase#CTcSymPropBase(34ab358be9709955).(const char *str, size_t len, int copy, |
| 2393 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop) |
| 2394 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_PROPcxx . . $ TC_SYM_PROP.) |
| 2395 | { |
| 2396 | /* remember our property ID */ |
| 2397 | prop_cxx . . $ CTcSymPropBase#prop_. = prop; |
| 2398 | |
| 2399 | /* we're not referenced yet */ |
| 2400 | ref_cxx . . $ CTcSymPropBase#ref_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 2401 | |
| 2402 | /* presume it's not a vocabulary property */ |
| 2403 | vocab_cxx . . $ CTcSymPropBase#vocab_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 2404 | |
| 2405 | /* presume it's not a weak property assumption */ |
| 2406 | weak_cxx . . $ CTcSymPropBase#weak_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 2407 | } |
| 2408 | |
| 2409 | /* get the property ID */ |
| 2410 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# get_propcxx . . $ CTcSymPropBase#get_prop(72085aa11f4b6e09).() const { return prop_cxx . . $ CTcSymPropBase#prop_.; } |
| 2411 | |
| 2412 | /* we can get the address of a property */ |
| 2413 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_addr_constcxx . . $ CTcSymPropBase#fold_addr_const(f036da583a06c490).(); |
| 2414 | |
| 2415 | /* we can assign to a property */ |
| 2416 | virtual int check_lvaluecxx . . $ CTcSymPropBase#check_lvalue(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 2417 | |
| 2418 | /* we can take the address of a property */ |
| 2419 | virtual int has_addrcxx . . $ CTcSymPropBase#has_addr(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 2420 | |
| 2421 | /* mark the property as referenced */ |
| 2422 | void mark_referencedcxx . . $ CTcSymPropBase#mark_referenced(49f6e7a06ebc5aa8).() { ref_cxx . . $ CTcSymPropBase#ref_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 2423 | |
| 2424 | /* get/set the vocabulary-property flag */ |
| 2425 | int is_vocabcxx . . $ CTcSymPropBase#is_vocab(455f465bc33b4cdf).() const { return vocab_cxx . . $ CTcSymPropBase#vocab_.; } |
| 2426 | void set_vocabcxx . . $ CTcSymPropBase#set_vocab(d4f767463ce0a6b3).(int flag) { vocab_cxx . . $ CTcSymPropBase#vocab_. = (flag != 0); } |
| 2427 | |
| 2428 | /* get/set the "weak" flag */ |
| 2429 | int is_weakcxx . . $ CTcSymPropBase#is_weak(455f465bc33b4cdf).() const { return weak_cxx . . $ CTcSymPropBase#weak_.; } |
| 2430 | void set_weakcxx . . $ CTcSymPropBase#set_weak(d4f767463ce0a6b3).(int flag) { weak_cxx . . $ CTcSymPropBase#weak_. = (flag != 0); } |
| 2431 | |
| 2432 | /* read/write symbol file */ |
| 2433 | static class CTcSymbolcxx . . $ CTcSymbol# *read_from_sym_filecxx . . $ CTcSymPropBase#read_from_sym_file(58cc6b2a3fd946ec).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2434 | virtual int write_to_sym_filecxx . . $ CTcSymPropBase#write_to_sym_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2435 | |
| 2436 | /* write to an object file */ |
| 2437 | int write_to_obj_filecxx . . $ CTcSymPropBase#write_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2438 | |
| 2439 | /* load from an object file */ |
| 2440 | static int load_from_obj_filecxx . . $ CTcSymPropBase#load_from_obj_file(3ce33e312d226d66).(class CVmFilecxx . . $ CVmFile# *fp, const textchar_tcxx . . $ textchar_t# *fname, |
| 2441 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# *prop_xlat); |
| 2442 | |
| 2443 | protected: |
| 2444 | /* property ID */ |
| 2445 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop_cxx . . $ CTcSymPropBase#prop_.; |
| 2446 | |
| 2447 | /* flag: the property is referenced */ |
| 2448 | unsigned int ref_cxx . . $ CTcSymPropBase#ref_. : 1; |
| 2449 | |
| 2450 | /* flag: this is a vocabulary property */ |
| 2451 | unsigned int vocab_cxx . . $ CTcSymPropBase#vocab_. : 1; |
| 2452 | |
| 2453 | /* |
| 2454 | * Flag: this is a "weak" property definition. A weak definition is |
| 2455 | * one that can be overridden by a conflicting definition for the same |
| 2456 | * symbol using another type. Symbols used with "&" are assumed to be |
| 2457 | * properties, but only if we don't later find a conflicting |
| 2458 | * definition; the weak flag tells us that we can drop the property |
| 2459 | * assumption without complaint if we do find a different definition |
| 2460 | * for the symbol later. |
| 2461 | */ |
| 2462 | unsigned int weak_cxx . . $ CTcSymPropBase#weak_.: 1; |
| 2463 | }; |
| 2464 | |
| 2465 | /* |
| 2466 | * Enumerator |
| 2467 | */ |
| 2468 | class CTcSymEnumBasecxx . . $ CTcSymEnumBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 2469 | { |
| 2470 | public: |
| 2471 | CTcSymEnumBasecxx . . $ CTcSymEnumBase#CTcSymEnumBase(cdd3e809c78c606).(const char *str, size_t len, int copy, ulongcxx . . $ ulong# id, |
| 2472 | int is_token) |
| 2473 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_ENUMcxx . . $ TC_SYM_ENUM.) |
| 2474 | { |
| 2475 | /* remember my ID */ |
| 2476 | enum_id_cxx . . $ CTcSymEnumBase#enum_id_. = id; |
| 2477 | |
| 2478 | /* remember if it's a 'token' enum */ |
| 2479 | is_token_cxx . . $ CTcSymEnumBase#is_token_. = is_token; |
| 2480 | |
| 2481 | /* not yet referenced */ |
| 2482 | ref_cxx . . $ CTcSymEnumBase#ref_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 2483 | } |
| 2484 | |
| 2485 | /* this can't be an lvalue */ |
| 2486 | virtual int check_lvaluecxx . . $ CTcSymEnumBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 2487 | |
| 2488 | /* mark the symbol as referenced */ |
| 2489 | void mark_referencedcxx . . $ CTcSymEnumBase#mark_referenced(49f6e7a06ebc5aa8).() { ref_cxx . . $ CTcSymEnumBase#ref_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 2490 | |
| 2491 | /* an object's value is a compile-time constant */ |
| 2492 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantcxx . . $ CTcSymEnumBase#fold_constant(f036da583a06c490).(); |
| 2493 | |
| 2494 | /* get my enumerator ID */ |
| 2495 | ulongcxx . . $ ulong# get_enum_idcxx . . $ CTcSymEnumBase#get_enum_id(fe4d2d262d4164a8).() const { return enum_id_cxx . . $ CTcSymEnumBase#enum_id_.; } |
| 2496 | |
| 2497 | /* get/set the 'token' flag */ |
| 2498 | int is_tokencxx . . $ CTcSymEnumBase#is_token(455f465bc33b4cdf).() const { return is_token_cxx . . $ CTcSymEnumBase#is_token_. != 0; } |
| 2499 | void set_is_tokencxx . . $ CTcSymEnumBase#set_is_token(d4f767463ce0a6b3).(int flag) { is_token_cxx . . $ CTcSymEnumBase#is_token_. = (flag != 0); } |
| 2500 | |
| 2501 | /* write to a symbol file */ |
| 2502 | virtual int write_to_sym_filecxx . . $ CTcSymEnumBase#write_to_sym_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2503 | |
| 2504 | /* read from a symbol file */ |
| 2505 | static class CTcSymbolcxx . . $ CTcSymbol# *read_from_sym_filecxx . . $ CTcSymEnumBase#read_from_sym_file(58cc6b2a3fd946ec).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2506 | |
| 2507 | /* write to an object file */ |
| 2508 | int write_to_obj_filecxx . . $ CTcSymEnumBase#write_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2509 | |
| 2510 | /* load from an object file */ |
| 2511 | static int load_from_obj_filecxx . . $ CTcSymEnumBase#load_from_obj_file(90d56ac782e7c37f).(class CVmFilecxx . . $ CVmFile# *fp, const textchar_tcxx . . $ textchar_t# *fname, |
| 2512 | ulongcxx . . $ ulong# *enum_xlat); |
| 2513 | |
| 2514 | protected: |
| 2515 | /* my enumerator ID */ |
| 2516 | ulongcxx . . $ ulong# enum_id_cxx . . $ CTcSymEnumBase#enum_id_.; |
| 2517 | |
| 2518 | /* flag: this is a 'token' enum */ |
| 2519 | unsigned int is_token_cxx . . $ CTcSymEnumBase#is_token_. : 1; |
| 2520 | |
| 2521 | /* referenced? */ |
| 2522 | unsigned int ref_cxx . . $ CTcSymEnumBase#ref_. : 1; |
| 2523 | }; |
| 2524 | |
| 2525 | |
| 2526 | /* |
| 2527 | * local variable/parameter |
| 2528 | */ |
| 2529 | class CTcSymLocalBasecxx . . $ CTcSymLocalBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 2530 | { |
| 2531 | public: |
| 2532 | CTcSymLocalBasecxx . . $ CTcSymLocalBase#CTcSymLocalBase(1dbdfdcd17b14bc).(const char *str, size_t len, int copy, |
| 2533 | int is_param, int var_num); |
| 2534 | |
| 2535 | /* get the variable number */ |
| 2536 | int get_var_numcxx . . $ CTcSymLocalBase#get_var_num(455f465bc33b4cdf).() const { return var_num_cxx . . $ CTcSymLocalBase#var_num_.; } |
| 2537 | |
| 2538 | /* true -> parameter, false -> local variable */ |
| 2539 | int is_paramcxx . . $ CTcSymLocalBase#is_param(455f465bc33b4cdf).() const { return is_param_cxx . . $ CTcSymLocalBase#is_param_.; } |
| 2540 | |
| 2541 | /* get/set the parameter position (0 is the leftmost argument) */ |
| 2542 | int get_param_indexcxx . . $ CTcSymLocalBase#get_param_index(455f465bc33b4cdf).() const { return param_index_cxx . . $ CTcSymLocalBase#param_index_.; } |
| 2543 | void set_param_indexcxx . . $ CTcSymLocalBase#set_param_index(d4f767463ce0a6b3).(int n) { param_index_cxx . . $ CTcSymLocalBase#param_index_. = n; } |
| 2544 | |
| 2545 | /* true -> named parameter */ |
| 2546 | int is_named_paramcxx . . $ CTcSymLocalBase#is_named_param(455f465bc33b4cdf).() const { return is_named_param_cxx . . $ CTcSymLocalBase#is_named_param_.; } |
| 2547 | void set_named_paramcxx . . $ CTcSymLocalBase#set_named_param(d4f767463ce0a6b3).(int f) { is_named_param_cxx . . $ CTcSymLocalBase#is_named_param_. = f; } |
| 2548 | |
| 2549 | /* true -> optional parameter */ |
| 2550 | int is_opt_paramcxx . . $ CTcSymLocalBase#is_opt_param(455f465bc33b4cdf).() const { return is_opt_param_cxx . . $ CTcSymLocalBase#is_opt_param_.; } |
| 2551 | void set_opt_paramcxx . . $ CTcSymLocalBase#set_opt_param(d4f767463ce0a6b3).(int f) { is_opt_param_cxx . . $ CTcSymLocalBase#is_opt_param_. = f; } |
| 2552 | |
| 2553 | /* get/set the default value expression */ |
| 2554 | CTcPrsNodecxx . . $ CTcPrsNode# *get_defval_exprcxx . . $ CTcSymLocalBase#get_defval_expr(d201019a7d73592c).() const { return defval_expr_cxx . . $ CTcSymLocalBase#defval_expr_.; } |
| 2555 | int get_defval_seqnocxx . . $ CTcSymLocalBase#get_defval_seqno(455f465bc33b4cdf).() const { return defval_seqno_cxx . . $ CTcSymLocalBase#defval_seqno_.; } |
| 2556 | void set_defval_exprcxx . . $ CTcSymLocalBase#set_defval_expr(4e7033bfaf559f50).(CTcPrsNodecxx . . $ CTcPrsNode# *expr, int seqno) |
| 2557 | { |
| 2558 | defval_expr_cxx . . $ CTcSymLocalBase#defval_expr_. = expr; |
| 2559 | defval_seqno_cxx . . $ CTcSymLocalBase#defval_seqno_. = seqno; |
| 2560 | } |
| 2561 | |
| 2562 | /* |
| 2563 | * get/set "list parameter" flag - a list parameter is still a local, |
| 2564 | * but from the programmer's perspective acts like a parameter because |
| 2565 | * its role is to contain a list of varargs parameters beyond a certain |
| 2566 | * point in the argument list |
| 2567 | */ |
| 2568 | int is_list_paramcxx . . $ CTcSymLocalBase#is_list_param(455f465bc33b4cdf).() const { return is_list_param_cxx . . $ CTcSymLocalBase#is_list_param_.; } |
| 2569 | void set_list_paramcxx . . $ CTcSymLocalBase#set_list_param(d4f767463ce0a6b3).(int f) { is_list_param_cxx . . $ CTcSymLocalBase#is_list_param_. = f; } |
| 2570 | |
| 2571 | /* |
| 2572 | * true -> "context local" - A context local is a local variable |
| 2573 | * contained in a scope enclosing an anonymous function. Because |
| 2574 | * the lifetime of an anonymous function can exceed that of the |
| 2575 | * activation record that was active when the anonymous function |
| 2576 | * object was created, every local variable in a scope that is |
| 2577 | * referenced from within an anonymous function defined within that |
| 2578 | * scope must be stored in a separate context object, rather than in |
| 2579 | * the activation record. The context object is created along with |
| 2580 | * the activation record, but it is not destroyed with the |
| 2581 | * activation record; instead, a reference to the context object is |
| 2582 | * stored in the anonymous function, which ensures that the context |
| 2583 | * object stays reachable as long as the anonymous function object |
| 2584 | * itself is reachable. |
| 2585 | */ |
| 2586 | int is_ctx_localcxx . . $ CTcSymLocalBase#is_ctx_local(455f465bc33b4cdf).() const { return (is_ctx_local_cxx . . $ CTcSymLocalBase#is_ctx_local_. != 0); } |
| 2587 | |
| 2588 | /* |
| 2589 | * Establish the variable as a context local, assigning the property |
| 2590 | * ID of the context object that stores the variable's value, and |
| 2591 | * the local variable that contains the context object itself. |
| 2592 | */ |
| 2593 | void set_ctx_levelcxx . . $ CTcSymLocalBase#set_ctx_level(d4f767463ce0a6b3).(int ctx_level) |
| 2594 | { |
| 2595 | /* it's a context local now */ |
| 2596 | is_ctx_local_cxx . . $ CTcSymLocalBase#is_ctx_local_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; |
| 2597 | |
| 2598 | /* remember the context level */ |
| 2599 | ctx_level_cxx . . $ CTcSymLocalBase#ctx_level_. = ctx_level; |
| 2600 | |
| 2601 | /* we don't know our context array index yet */ |
| 2602 | ctx_arr_idx_cxx . . $ CTcSymLocalBase#ctx_arr_idx_. = 0; |
| 2603 | } |
| 2604 | |
| 2605 | /* |
| 2606 | * get/set the original local in the enclosing scope for an |
| 2607 | * anonymous function's inherited local |
| 2608 | */ |
| 2609 | class CTcSymLocalcxx . . $ CTcSymLocal# *get_ctx_origcxx . . $ CTcSymLocalBase#get_ctx_orig(5d463298f784f8ee).() const { return ctx_orig_cxx . . $ CTcSymLocalBase#ctx_orig_.; } |
| 2610 | void set_ctx_origcxx . . $ CTcSymLocalBase#set_ctx_orig(5f47b5948ac68c2c).(class CTcSymLocalcxx . . $ CTcSymLocal# *orig) { ctx_orig_cxx . . $ CTcSymLocalBase#ctx_orig_. = orig; } |
| 2611 | |
| 2612 | /* get my context array index */ |
| 2613 | int get_ctx_arr_idxcxx . . $ CTcSymLocalBase#get_ctx_arr_idx(455f465bc33b4cdf).() const; |
| 2614 | |
| 2615 | /* we can always assign to a local */ |
| 2616 | virtual int check_lvaluecxx . . $ CTcSymLocalBase#check_lvalue(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 2617 | |
| 2618 | /* |
| 2619 | * get/set the 'used' flag - this tracks whether or not the |
| 2620 | * variable's value was referenced anywhere in the scope in which it |
| 2621 | * was defined |
| 2622 | */ |
| 2623 | int get_val_usedcxx . . $ CTcSymLocalBase#get_val_used(455f465bc33b4cdf).() const { return val_used_cxx . . $ CTcSymLocalBase#val_used_.; } |
| 2624 | void set_val_usedcxx . . $ CTcSymLocalBase#set_val_used(d4f767463ce0a6b3).(int f); |
| 2625 | |
| 2626 | /* |
| 2627 | * get/set the 'assigned' flag - this tracks whether or not the |
| 2628 | * variable has been assigned a value |
| 2629 | */ |
| 2630 | int get_val_assignedcxx . . $ CTcSymLocalBase#get_val_assigned(455f465bc33b4cdf).() const { return val_assigned_cxx . . $ CTcSymLocalBase#val_assigned_.; } |
| 2631 | void set_val_assignedcxx . . $ CTcSymLocalBase#set_val_assigned(d4f767463ce0a6b3).(int f); |
| 2632 | |
| 2633 | /* get the source location where the symbol was defined */ |
| 2634 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *get_src_desccxx . . $ CTcSymLocalBase#get_src_desc(4ade2e38c8e31a01).() const { return src_desc_cxx . . $ CTcSymLocalBase#src_desc_.; } |
| 2635 | long get_src_linenumcxx . . $ CTcSymLocalBase#get_src_linenum(57a65ae535d7db84).() const { return src_linenum_cxx . . $ CTcSymLocalBase#src_linenum_.; } |
| 2636 | |
| 2637 | /* get/set reference flag */ |
| 2638 | int is_referencedcxx . . $ CTcSymLocalBase#is_referenced(455f465bc33b4cdf).() const { return referenced_cxx . . $ CTcSymLocalBase#referenced_. != 0; } |
| 2639 | void mark_referencedcxx . . $ CTcSymLocalBase#mark_referenced(49f6e7a06ebc5aa8).() { referenced_cxx . . $ CTcSymLocalBase#referenced_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 2640 | |
| 2641 | /* check for references in local scope */ |
| 2642 | virtual void check_local_referencescxx . . $ CTcSymLocalBase#check_local_references(49f6e7a06ebc5aa8).(); |
| 2643 | |
| 2644 | /* create a new context copy */ |
| 2645 | virtual class CTcSymbolcxx . . $ CTcSymbol# *new_ctx_varcxx . . $ CTcSymLocalBase#new_ctx_var(f33533242378c43d).() const; |
| 2646 | |
| 2647 | /* apply context variable conversion */ |
| 2648 | virtual int apply_ctx_var_convcxx . . $ CTcSymLocalBase#apply_ctx_var_conv(84e39bf497ac8301).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab, |
| 2649 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *code_body); |
| 2650 | |
| 2651 | /* finish context variable conversion */ |
| 2652 | virtual void finish_ctx_var_convcxx . . $ CTcSymLocalBase#finish_ctx_var_conv(49f6e7a06ebc5aa8).(); |
| 2653 | |
| 2654 | /* convert this variable to a context variable */ |
| 2655 | void convert_to_ctx_varcxx . . $ CTcSymLocalBase#convert_to_ctx_var(3e454b8ccf442868).(int val_used, int val_assigned); |
| 2656 | |
| 2657 | protected: |
| 2658 | /* source location where the symbol was defined */ |
| 2659 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *src_desc_cxx . . $ CTcSymLocalBase#src_desc_.; |
| 2660 | long src_linenum_cxx . . $ CTcSymLocalBase#src_linenum_.; |
| 2661 | |
| 2662 | /* variable number - stack frame offset for local or parameter */ |
| 2663 | int var_num_cxx . . $ CTcSymLocalBase#var_num_.; |
| 2664 | |
| 2665 | /* |
| 2666 | * Parameter index. This is the index within the formal parameter list |
| 2667 | * of a positional parameter variable. For regular positional |
| 2668 | * parameters, this is the same as var_num_. However, it's different |
| 2669 | * for *optional* parameters, because optional parameters are actually |
| 2670 | * stored in local variables, meaning that var_num_ is a *local* number |
| 2671 | * rather than an argument number. In order to generate the code that |
| 2672 | * loads the actual argument value into the local variable, we have to |
| 2673 | * keep track of both stack locations. This is where we keep track of |
| 2674 | * the parameter index. |
| 2675 | */ |
| 2676 | int param_index_cxx . . $ CTcSymLocalBase#param_index_.; |
| 2677 | |
| 2678 | /* |
| 2679 | * context variable number - if this is a context variable, this is |
| 2680 | * the stack frame index of the variable containing the object |
| 2681 | * containing our value |
| 2682 | */ |
| 2683 | int ctx_var_num_cxx . . $ CTcSymLocalBase#ctx_var_num_.; |
| 2684 | |
| 2685 | /* |
| 2686 | * Context level - this is the nesting level of the anonymous |
| 2687 | * function's context. A level of 0 indicates a local variable in |
| 2688 | * the current function; a level of 1 indicates a variable in the |
| 2689 | * enclosing scope; 2 is the next enclosing scope; and so on. |
| 2690 | */ |
| 2691 | int ctx_level_cxx . . $ CTcSymLocalBase#ctx_level_.; |
| 2692 | |
| 2693 | /* |
| 2694 | * for a context variable, the index of this variable in the local |
| 2695 | * context array (zero means that it's not assigned) |
| 2696 | */ |
| 2697 | int ctx_arr_idx_cxx . . $ CTcSymLocalBase#ctx_arr_idx_.; |
| 2698 | |
| 2699 | /* |
| 2700 | * for a variable within an anonymous function, the original local |
| 2701 | * variable symbol from the enclosing scope to which this variable |
| 2702 | * refers |
| 2703 | */ |
| 2704 | class CTcSymLocalcxx . . $ CTcSymLocal# *ctx_orig_cxx . . $ CTcSymLocalBase#ctx_orig_.; |
| 2705 | |
| 2706 | /* |
| 2707 | * For a formal parameter with a default value, the default value |
| 2708 | * expression, and the sequence number among the default expressions. |
| 2709 | * We process these expressions at function entry in left-to-right |
| 2710 | * order for the argument list, to ensure a predicatable order for |
| 2711 | * dependency resolution and side effects. |
| 2712 | */ |
| 2713 | class CTcPrsNodecxx . . $ CTcPrsNode# *defval_expr_cxx . . $ CTcSymLocalBase#defval_expr_.; |
| 2714 | int defval_seqno_cxx . . $ CTcSymLocalBase#defval_seqno_.; |
| 2715 | |
| 2716 | /* true -> parameter, false -> local variable */ |
| 2717 | unsigned int is_param_cxx . . $ CTcSymLocalBase#is_param_. : 1; |
| 2718 | |
| 2719 | /* true -> named parameter */ |
| 2720 | unsigned int is_named_param_cxx . . $ CTcSymLocalBase#is_named_param_. : 1; |
| 2721 | |
| 2722 | /* true -> optional parametre */ |
| 2723 | unsigned int is_opt_param_cxx . . $ CTcSymLocalBase#is_opt_param_. : 1; |
| 2724 | |
| 2725 | /* |
| 2726 | * true -> not a real parameter, but a "parameter list" local - this is |
| 2727 | * a local variable into which we deposit a list of the parameters |
| 2728 | * beyond a certain point, defined via the "[varname]" syntax in a |
| 2729 | * formal parameter list |
| 2730 | */ |
| 2731 | unsigned int is_list_param_cxx . . $ CTcSymLocalBase#is_list_param_. : 1; |
| 2732 | |
| 2733 | /* true -> this is a context local variable */ |
| 2734 | unsigned int is_ctx_local_cxx . . $ CTcSymLocalBase#is_ctx_local_. : 1; |
| 2735 | |
| 2736 | /* flag: the context variable number has been assigned */ |
| 2737 | unsigned int ctx_var_num_set_cxx . . $ CTcSymLocalBase#ctx_var_num_set_. : 1; |
| 2738 | |
| 2739 | /* true -> the value was referenced somewhere in its scope */ |
| 2740 | unsigned int val_used_cxx . . $ CTcSymLocalBase#val_used_. : 1; |
| 2741 | |
| 2742 | /* true -> the value was assigned */ |
| 2743 | unsigned int val_assigned_cxx . . $ CTcSymLocalBase#val_assigned_. : 1; |
| 2744 | |
| 2745 | /* true -> symbol has been referenced */ |
| 2746 | unsigned int referenced_cxx . . $ CTcSymLocalBase#referenced_. : 1; |
| 2747 | }; |
| 2748 | |
| 2749 | /* |
| 2750 | * Dynamic local. This is a symbol entry for a local variable accessed |
| 2751 | * through a StackFrameRef object, for dynamic compilation. |
| 2752 | */ |
| 2753 | class CTcSymDynLocalBasecxx . . $ CTcSymDynLocalBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 2754 | { |
| 2755 | public: |
| 2756 | CTcSymDynLocalBasecxx . . $ CTcSymDynLocalBase#CTcSymDynLocalBase(b89d2eb400d8f6bd).(const char *str, size_t len, int copy, |
| 2757 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# fref, int varnum, int ctxidx) |
| 2758 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_DYNLOCALcxx . . $ TC_SYM_DYNLOCAL.) |
| 2759 | { |
| 2760 | fref_cxx . . $ CTcSymDynLocalBase#fref_. = fref; |
| 2761 | varnum_cxx . . $ CTcSymDynLocalBase#varnum_. = varnum; |
| 2762 | ctxidx_cxx . . $ CTcSymDynLocalBase#ctxidx_. = ctxidx; |
| 2763 | } |
| 2764 | |
| 2765 | protected: |
| 2766 | /* the StackFrameRef object giving the frame containing the variable */ |
| 2767 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# fref_cxx . . $ CTcSymDynLocalBase#fref_.; |
| 2768 | |
| 2769 | /* the variable number in the frame */ |
| 2770 | int varnum_cxx . . $ CTcSymDynLocalBase#varnum_.; |
| 2771 | |
| 2772 | /* the context index (0 if it's an ordinary frame variable) */ |
| 2773 | int ctxidx_cxx . . $ CTcSymDynLocalBase#ctxidx_.; |
| 2774 | }; |
| 2775 | |
| 2776 | /* |
| 2777 | * Built-in function |
| 2778 | */ |
| 2779 | class CTcSymBifBasecxx . . $ CTcSymBifBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 2780 | { |
| 2781 | public: |
| 2782 | CTcSymBifBasecxx . . $ CTcSymBifBase#CTcSymBifBase(817b1172d27ceaea).(const char *str, size_t len, int copy, |
| 2783 | ushortcxx . . $ ushort# func_set_id, ushortcxx . . $ ushort# func_idx, int has_retval, |
| 2784 | int min_argc, int max_argc, int varargs) |
| 2785 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_BIFcxx . . $ TC_SYM_BIF.) |
| 2786 | { |
| 2787 | func_set_id_cxx . . $ CTcSymBifBase#func_set_id_. = func_set_id; |
| 2788 | func_idx_cxx . . $ CTcSymBifBase#func_idx_. = func_idx; |
| 2789 | has_retval_cxx . . $ CTcSymBifBase#has_retval_. = has_retval; |
| 2790 | min_argc_cxx . . $ CTcSymBifBase#min_argc_. = min_argc; |
| 2791 | max_argc_cxx . . $ CTcSymBifBase#max_argc_. = max_argc; |
| 2792 | varargs_cxx . . $ CTcSymBifBase#varargs_. = varargs; |
| 2793 | } |
| 2794 | |
| 2795 | /* this can't be an lvalue */ |
| 2796 | virtual int check_lvaluecxx . . $ CTcSymBifBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 2797 | |
| 2798 | /* get the function set ID and index in the function set */ |
| 2799 | ushortcxx . . $ ushort# get_func_set_idcxx . . $ CTcSymBifBase#get_func_set_id(72085aa11f4b6e09).() const { return func_set_id_cxx . . $ CTcSymBifBase#func_set_id_.; } |
| 2800 | ushortcxx . . $ ushort# get_func_idxcxx . . $ CTcSymBifBase#get_func_idx(72085aa11f4b6e09).() const { return func_idx_cxx . . $ CTcSymBifBase#func_idx_.; } |
| 2801 | |
| 2802 | /* |
| 2803 | * Get the minimum and maximum argument counts. If is_varargs() |
| 2804 | * returns true, there is no maximum, in which case get_max_argc() |
| 2805 | * is not meaningful. |
| 2806 | */ |
| 2807 | int get_min_argccxx . . $ CTcSymBifBase#get_min_argc(455f465bc33b4cdf).() const { return min_argc_cxx . . $ CTcSymBifBase#min_argc_.; } |
| 2808 | int get_max_argccxx . . $ CTcSymBifBase#get_max_argc(455f465bc33b4cdf).() const { return max_argc_cxx . . $ CTcSymBifBase#max_argc_.; } |
| 2809 | int is_varargscxx . . $ CTcSymBifBase#is_varargs(455f465bc33b4cdf).() const { return varargs_cxx . . $ CTcSymBifBase#varargs_.; } |
| 2810 | |
| 2811 | /* determine if the function has a return value */ |
| 2812 | int has_retvalcxx . . $ CTcSymBifBase#has_retval(455f465bc33b4cdf).() const { return has_retval_cxx . . $ CTcSymBifBase#has_retval_.; } |
| 2813 | |
| 2814 | /* |
| 2815 | * Do not write this to a symbol export file - this symbol is |
| 2816 | * external to us, hence we have no need to define it for other |
| 2817 | * modules to import. |
| 2818 | */ |
| 2819 | virtual int write_to_sym_filecxx . . $ CTcSymBifBase#write_to_sym_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *) { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 2820 | |
| 2821 | /* write to an object file */ |
| 2822 | virtual int write_to_obj_filecxx . . $ CTcSymBifBase#write_to_obj_file(55f024ebabc290c2).(class CVmFilecxx . . $ CVmFile# *fp); |
| 2823 | |
| 2824 | /* load from an object file */ |
| 2825 | static int load_from_obj_filecxx . . $ CTcSymBifBase#load_from_obj_file(f510970e88362930).(class CVmFilecxx . . $ CVmFile# *fp, const textchar_tcxx . . $ textchar_t# *fname); |
| 2826 | |
| 2827 | protected: |
| 2828 | /* function set ID */ |
| 2829 | ushortcxx . . $ ushort# func_set_id_cxx . . $ CTcSymBifBase#func_set_id_.; |
| 2830 | |
| 2831 | /* index within the function set */ |
| 2832 | ushortcxx . . $ ushort# func_idx_cxx . . $ CTcSymBifBase#func_idx_.; |
| 2833 | |
| 2834 | /* minimum and maximum argument count, and varargs flag */ |
| 2835 | int min_argc_cxx . . $ CTcSymBifBase#min_argc_.; |
| 2836 | int max_argc_cxx . . $ CTcSymBifBase#max_argc_.; |
| 2837 | unsigned int varargs_cxx . . $ CTcSymBifBase#varargs_. : 1; |
| 2838 | |
| 2839 | /* true -> function has a return value, false -> void return */ |
| 2840 | unsigned int has_retval_cxx . . $ CTcSymBifBase#has_retval_. : 1; |
| 2841 | }; |
| 2842 | |
| 2843 | /* |
| 2844 | * External function |
| 2845 | */ |
| 2846 | class CTcSymExtfnBasecxx . . $ CTcSymExtfnBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 2847 | { |
| 2848 | public: |
| 2849 | CTcSymExtfnBasecxx . . $ CTcSymExtfnBase#CTcSymExtfnBase(df581d812f64a9b8).(const char *str, size_t len, int copy, |
| 2850 | int argc, int varargs, int has_retval) |
| 2851 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_EXTFNcxx . . $ TC_SYM_EXTFN.) |
| 2852 | { |
| 2853 | /* offset is not yet known */ |
| 2854 | argc_cxx . . $ CTcSymExtfnBase#argc_. = argc; |
| 2855 | varargs_cxx . . $ CTcSymExtfnBase#varargs_. = varargs; |
| 2856 | has_retval_cxx . . $ CTcSymExtfnBase#has_retval_. = has_retval; |
| 2857 | } |
| 2858 | |
| 2859 | /* this can't be an lvalue */ |
| 2860 | virtual int check_lvaluecxx . . $ CTcSymExtfnBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 2861 | |
| 2862 | /* |
| 2863 | * Get the argument count. If is_varargs() returns true, this is a |
| 2864 | * minimum argument count; otherwise, this is the exact number of |
| 2865 | * arguments required. |
| 2866 | */ |
| 2867 | int get_argccxx . . $ CTcSymExtfnBase#get_argc(455f465bc33b4cdf).() const { return argc_cxx . . $ CTcSymExtfnBase#argc_.; } |
| 2868 | int is_varargscxx . . $ CTcSymExtfnBase#is_varargs(455f465bc33b4cdf).() const { return varargs_cxx . . $ CTcSymExtfnBase#varargs_.; } |
| 2869 | |
| 2870 | /* determine if the function has a return value */ |
| 2871 | int has_retvalcxx . . $ CTcSymExtfnBase#has_retval(455f465bc33b4cdf).() const { return has_retval_cxx . . $ CTcSymExtfnBase#has_retval_.; } |
| 2872 | |
| 2873 | protected: |
| 2874 | /* argument count */ |
| 2875 | int argc_cxx . . $ CTcSymExtfnBase#argc_.; |
| 2876 | |
| 2877 | /* flag: variable arguments (in which case argc_ is only a minimum) */ |
| 2878 | unsigned int varargs_cxx . . $ CTcSymExtfnBase#varargs_. : 1; |
| 2879 | |
| 2880 | /* flag: function has a return value (false -> void function) */ |
| 2881 | unsigned int has_retval_cxx . . $ CTcSymExtfnBase#has_retval_. : 1; |
| 2882 | }; |
| 2883 | |
| 2884 | /* |
| 2885 | * Code ("goto") label. |
| 2886 | */ |
| 2887 | class CTcSymLabelBasecxx . . $ CTcSymLabelBase#: public CTcSymbolcxx . . $ CTcSymbol# |
| 2888 | { |
| 2889 | public: |
| 2890 | CTcSymLabelBasecxx . . $ CTcSymLabelBase#CTcSymLabelBase(ef41e1d728a7d23b).(const char *str, size_t len, int copy) |
| 2891 | : CTcSymbolcxx . . $ CTcSymbol#CTcSymbol(71e818f0b7da5f0f).(str, len, copy, TC_SYM_LABELcxx . . $ TC_SYM_LABEL.) |
| 2892 | { |
| 2893 | /* the symbol is not yet referenced */ |
| 2894 | referenced_cxx . . $ CTcSymLabelBase#referenced_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 2895 | |
| 2896 | /* we don't know the defining statement node yet */ |
| 2897 | stm_cxx . . $ CTcSymLabelBase#stm_. = 0; |
| 2898 | } |
| 2899 | |
| 2900 | /* this can't be an lvalue */ |
| 2901 | virtual int check_lvaluecxx . . $ CTcSymLabelBase#check_lvalue(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 2902 | |
| 2903 | /* get/set the defining statement node */ |
| 2904 | class CTPNStmLabelcxx . . $ CTPNStmLabel# *get_stmcxx . . $ CTcSymLabelBase#get_stm(bb4a7e633d1fe919).() const { return stm_cxx . . $ CTcSymLabelBase#stm_.; } |
| 2905 | void set_stmcxx . . $ CTcSymLabelBase#set_stm(dd1943a73b7bf776).(class CTPNStmLabelcxx . . $ CTPNStmLabel# *stm) { stm_cxx . . $ CTcSymLabelBase#stm_. = stm; } |
| 2906 | |
| 2907 | /* add control flow flags to our statement */ |
| 2908 | void add_control_flow_flagscxx . . $ CTcSymLabelBase#add_control_flow_flags(2c44cd906ae4e829).(ulongcxx . . $ ulong# flags); |
| 2909 | |
| 2910 | protected: |
| 2911 | /* the defining statement's parse node */ |
| 2912 | class CTPNStmLabelcxx . . $ CTPNStmLabel# *stm_cxx . . $ CTcSymLabelBase#stm_.; |
| 2913 | |
| 2914 | /* |
| 2915 | * flag: the symbol is referenced by at least one statement (we keep |
| 2916 | * track of this so that we warn when a label is defined but never |
| 2917 | * used as a target) |
| 2918 | */ |
| 2919 | unsigned int referenced_cxx . . $ CTcSymLabelBase#referenced_. : 1; |
| 2920 | }; |
| 2921 | |
| 2922 | |
| 2923 | /* ------------------------------------------------------------------------ */ |
| 2924 | /* |
| 2925 | * Program Node. This is the top-level node in the tree; this node |
| 2926 | * contains the entire program as a sublist. |
| 2927 | */ |
| 2928 | class CTPNStmProgcxx . . $ CTPNStmProg#: public CTPNStmcxx . . $ CTPNStm# |
| 2929 | { |
| 2930 | public: |
| 2931 | CTPNStmProgcxx . . $ CTPNStmProg#CTPNStmProg(5a51aa86da9c51a3).(class CTPNStmTopcxx . . $ CTPNStmTop# *first_stm) |
| 2932 | { |
| 2933 | /* remember the head of our statement list */ |
| 2934 | first_stm_cxx . . $ CTPNStmProg#first_stm_. = first_stm; |
| 2935 | } |
| 2936 | |
| 2937 | /* fold constants */ |
| 2938 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmProg#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 2939 | |
| 2940 | /* |
| 2941 | * Generate the program code and write to the image file. After |
| 2942 | * parsing, if parsing is successful, the compiler can invoke this |
| 2943 | * routine to construct the image file; there is no need to invoke |
| 2944 | * gen_code() directly. |
| 2945 | */ |
| 2946 | void build_imagecxx . . $ CTPNStmProg#build_image(a3cc115dc5bd560c).(class CVmFilecxx . . $ CVmFile# *image_fp, ucharcxx . . $ uchar# xor_mask, |
| 2947 | const char tool_data[4]); |
| 2948 | |
| 2949 | /* |
| 2950 | * Generate the program code and write to the object file. After |
| 2951 | * parsing, if parsing is successful, the compiler can invoke this |
| 2952 | * routine to construct the object file. |
| 2953 | */ |
| 2954 | void build_object_filecxx . . $ CTPNStmProg#build_object_file(ddea2d08cba9502b).(class CVmFilecxx . . $ CVmFile# *object_fp, class CTcMakecxx . . $ CTcMake# *make_obj); |
| 2955 | |
| 2956 | /* generate code for the program */ |
| 2957 | virtual void gen_codecxx . . $ CTPNStmProg#gen_code(3e454b8ccf442868).(int discard, int for_condition); |
| 2958 | |
| 2959 | protected: |
| 2960 | /* |
| 2961 | * Generate code. Returns zero on success, non-zero on error. This |
| 2962 | * is a common routine used by build_image() and build_object_file() |
| 2963 | * to complete code generation after parsing. |
| 2964 | */ |
| 2965 | int gen_code_for_buildcxx . . $ CTPNStmProg#gen_code_for_build(b126dc7c1de90089).(); |
| 2966 | |
| 2967 | /* head of our list */ |
| 2968 | class CTPNStmTopcxx . . $ CTPNStmTop# *first_stm_cxx . . $ CTPNStmProg#first_stm_.; |
| 2969 | }; |
| 2970 | |
| 2971 | |
| 2972 | /* ------------------------------------------------------------------------ */ |
| 2973 | /* |
| 2974 | * Top-level object - this is a base class for statements which can |
| 2975 | * appear as top-level definitions, such as functions and objects. |
| 2976 | * |
| 2977 | * This class should not need to be derived per target, so further |
| 2978 | * target-generic base classes are derived from this directly. |
| 2979 | */ |
| 2980 | class CTPNStmTopcxx . . $ CTPNStmTop#: public CTPNStmcxx . . $ CTPNStm# |
| 2981 | { |
| 2982 | public: |
| 2983 | CTPNStmTopcxx . . $ CTPNStmTop#CTPNStmTop(49f6e7a06ebc5aa8).() |
| 2984 | { |
| 2985 | /* we're not in a list yet */ |
| 2986 | next_stm_top_cxx . . $ CTPNStmTop#next_stm_top_. = 0; |
| 2987 | } |
| 2988 | |
| 2989 | /* get/set the next top-level statement in the top-level list */ |
| 2990 | CTPNStmTopcxx . . $ CTPNStmTop# *get_next_stm_topcxx . . $ CTPNStmTop#get_next_stm_top(a72969cb53f0b334).() const { return next_stm_top_cxx . . $ CTPNStmTop#next_stm_top_.; } |
| 2991 | void set_next_stm_topcxx . . $ CTPNStmTop#set_next_stm_top(5a51aa86da9c51a3).(CTPNStmTopcxx . . $ CTPNStmTop# *nxt) { next_stm_top_cxx . . $ CTPNStmTop#next_stm_top_. = nxt; } |
| 2992 | |
| 2993 | /* |
| 2994 | * Check the local symbol table. This is called after all of the |
| 2995 | * code has been generated for the entire program, which ensures |
| 2996 | * that all of the code that could affect any local symbols (even |
| 2997 | * those shared through context variables) has been finished. By |
| 2998 | * default we do nothing. |
| 2999 | */ |
| 3000 | virtual void check_localscxx . . $ CTPNStmTop#check_locals(49f6e7a06ebc5aa8).() { } |
| 3001 | |
| 3002 | /* get/set the dynamic compilation run-time object ID */ |
| 3003 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# get_dyn_obj_idcxx . . $ CTPNStmTop#get_dyn_obj_id(ddd8539a2fcdd4ce).() const { return dyn_obj_id_cxx . . $ CTPNStmTop#dyn_obj_id_.; } |
| 3004 | void set_dyn_obj_idcxx . . $ CTPNStmTop#set_dyn_obj_id(cb2f890c2fdad230).(tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# id) { dyn_obj_id_cxx . . $ CTPNStmTop#dyn_obj_id_. = id; } |
| 3005 | |
| 3006 | protected: |
| 3007 | /* |
| 3008 | * Dynamic code compilation object ID. When we compile new source code |
| 3009 | * at run-time, the bytecode is stored in a DynamicFunc instance rather |
| 3010 | * than in the constant code pool, because the code pool is limited to |
| 3011 | * code loaded from the image file. Before generating code, the |
| 3012 | * dynamic compiler assigns a new DynamicFunc ID to each top-level |
| 3013 | * statement in the nested statement list. The DynamicFunc instances |
| 3014 | * aren't actually populated until the code is generated, but the |
| 3015 | * object numbers are assigned in advance to allow cross-references in |
| 3016 | * generated code. |
| 3017 | */ |
| 3018 | tctarg_obj_id_tcxx . . $ tctarg_obj_id_t# dyn_obj_id_cxx . . $ CTPNStmTop#dyn_obj_id_.; |
| 3019 | |
| 3020 | /* next top-level statement in the top-level list */ |
| 3021 | CTPNStmTopcxx . . $ CTPNStmTop# *next_stm_top_cxx . . $ CTPNStmTop#next_stm_top_.; |
| 3022 | }; |
| 3023 | |
| 3024 | |
| 3025 | /* ------------------------------------------------------------------------ */ |
| 3026 | /* |
| 3027 | * Anonymous function |
| 3028 | */ |
| 3029 | class CTPNAnonFuncBasecxx . . $ CTPNAnonFuncBase#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 3030 | { |
| 3031 | public: |
| 3032 | CTPNAnonFuncBasecxx . . $ CTPNAnonFuncBase#CTPNAnonFuncBase(d2a4346ee1ebdd0b).(class CTPNCodeBodycxx . . $ CTPNCodeBody# *code_body, int has_retval, |
| 3033 | int is_method) |
| 3034 | { |
| 3035 | /* remember my code body and return value status */ |
| 3036 | code_body_cxx . . $ CTPNAnonFuncBase#code_body_. = code_body; |
| 3037 | has_retval_cxx . . $ CTPNAnonFuncBase#has_retval_. = has_retval; |
| 3038 | is_method_cxx . . $ CTPNAnonFuncBase#is_method_. = is_method; |
| 3039 | } |
| 3040 | |
| 3041 | /* no constant value */ |
| 3042 | virtual class CTcConstValcxx . . $ CTcConstVal# *get_const_valcxx . . $ CTPNAnonFuncBase#get_const_val(78964007e8d3aff7).() { return 0; } |
| 3043 | |
| 3044 | /* I have a return value when called if the underlying code body does */ |
| 3045 | virtual int has_return_value_on_callcxx . . $ CTPNAnonFuncBase#has_return_value_on_call(455f465bc33b4cdf).() const { return has_retval_cxx . . $ CTPNAnonFuncBase#has_retval_.; } |
| 3046 | |
| 3047 | /* |
| 3048 | * fold constants - we don't have to fold constants in the |
| 3049 | * underlying code body, because its constants will be folded along |
| 3050 | * with other top-level statements |
| 3051 | */ |
| 3052 | virtual class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNAnonFuncBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) |
| 3053 | { return this; } |
| 3054 | |
| 3055 | /* adjust for dynamic (run-time) compilation */ |
| 3056 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNAnonFuncBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 3057 | { return this; } |
| 3058 | |
| 3059 | /* mark as replaced/obsolete */ |
| 3060 | void set_replacedcxx . . $ CTPNAnonFuncBase#set_replaced(d4f767463ce0a6b3).(int flag); |
| 3061 | |
| 3062 | protected: |
| 3063 | /* code body of the function */ |
| 3064 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *code_body_cxx . . $ CTPNAnonFuncBase#code_body_.; |
| 3065 | |
| 3066 | /* true -> the underlying code body has a return value */ |
| 3067 | unsigned int has_retval_cxx . . $ CTPNAnonFuncBase#has_retval_. : 1; |
| 3068 | |
| 3069 | /* true -> this is a method; false -> it's a function */ |
| 3070 | unsigned int is_method_cxx . . $ CTPNAnonFuncBase#is_method_. : 1; |
| 3071 | }; |
| 3072 | |
| 3073 | /* ------------------------------------------------------------------------ */ |
| 3074 | /* |
| 3075 | * Code Body. A code body has local variables, goto labels, and a |
| 3076 | * compound statement. |
| 3077 | */ |
| 3078 | class CTPNCodeBodyBasecxx . . $ CTPNCodeBodyBase#: public CTPNStmTopcxx . . $ CTPNStmTop# |
| 3079 | { |
| 3080 | public: |
| 3081 | CTPNCodeBodyBasecxx . . $ CTPNCodeBodyBase#CTPNCodeBodyBase(aef84a1754618449).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *lcltab, class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *gototab, |
| 3082 | class CTPNStmcxx . . $ CTPNStm# *stm, int argc, int opt_argc, int varargs, |
| 3083 | int varargs_list, class CTcSymLocalcxx . . $ CTcSymLocal# *varargs_list_local, |
| 3084 | int local_cnt, int self_valid, |
| 3085 | struct CTcCodeBodyRefcxx . . $ CTcCodeBodyRef# *enclosing_code_body); |
| 3086 | |
| 3087 | /* |
| 3088 | * Mark the code as having been replaced - this is used when this is |
| 3089 | * the code body for a function, and the function is replaced by |
| 3090 | * another implementation in the same translation unit. When we've |
| 3091 | * been replaced, we can't be referenced, hence we don't need to |
| 3092 | * generate any code. |
| 3093 | */ |
| 3094 | void set_replacedcxx . . $ CTPNCodeBodyBase#set_replaced(d4f767463ce0a6b3).(int f) { replaced_cxx . . $ CTPNCodeBodyBase#replaced_. = f; } |
| 3095 | int is_replacedcxx . . $ CTPNCodeBodyBase#is_replaced(455f465bc33b4cdf).() const { return replaced_cxx . . $ CTPNCodeBodyBase#replaced_.; } |
| 3096 | |
| 3097 | /* |
| 3098 | * Set our fixup list anchor - our creator must invoke this if we |
| 3099 | * are to use a fixup list associated with a symbol table entry. A |
| 3100 | * code body that can be reached from a symbol table entry (such as |
| 3101 | * a function name) must have its fixup list anchor associated with |
| 3102 | * the symbol table entry so that we can create the necessary |
| 3103 | * associations in an object file. |
| 3104 | */ |
| 3105 | void set_symbol_fixup_listcxx . . $ CTPNCodeBodyBase#set_symbol_fixup_list(8d02c9781aeeb838).(class CTcSymFunccxx . . $ CTcSymFunc# *sym, |
| 3106 | struct CTcAbsFixupcxx . . $ CTcAbsFixup# **fixup_list_anchor) |
| 3107 | { |
| 3108 | /* remember the information */ |
| 3109 | fixup_owner_sym_cxx . . $ CTPNCodeBodyBase#fixup_owner_sym_. = sym; |
| 3110 | fixup_list_anchor_cxx . . $ CTPNCodeBodyBase#fixup_list_anchor_. = fixup_list_anchor; |
| 3111 | } |
| 3112 | |
| 3113 | /* use our internal fixup list */ |
| 3114 | void use_internal_fixup_listcxx . . $ CTPNCodeBodyBase#use_internal_fixup_list(49f6e7a06ebc5aa8).() |
| 3115 | { |
| 3116 | /* we have no function symbol */ |
| 3117 | fixup_owner_sym_cxx . . $ CTPNCodeBodyBase#fixup_owner_sym_. = 0; |
| 3118 | |
| 3119 | /* use our internal list anchor */ |
| 3120 | fixup_list_anchor_cxx . . $ CTPNCodeBodyBase#fixup_list_anchor_. = &internal_fixups_cxx . . $ CTPNCodeBodyBase#internal_fixups_.; |
| 3121 | } |
| 3122 | |
| 3123 | /* get my associated function symbol, if there is one */ |
| 3124 | class CTcSymFunccxx . . $ CTcSymFunc# *get_func_symcxx . . $ CTPNCodeBodyBase#get_func_sym(d785b0f451677e53).() const { return fixup_owner_sym_cxx . . $ CTPNCodeBodyBase#fixup_owner_sym_.; } |
| 3125 | |
| 3126 | /* fold constants */ |
| 3127 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNCodeBodyBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3128 | |
| 3129 | /* |
| 3130 | * Check for unreferenced labels. Scans the 'goto' symbol table and |
| 3131 | * ensures that each labeled statement has been referenced; logs |
| 3132 | * a warning for each label that isn't referenced. |
| 3133 | */ |
| 3134 | void check_unreferenced_labelscxx . . $ CTPNCodeBodyBase#check_unreferenced_labels(49f6e7a06ebc5aa8).(); |
| 3135 | |
| 3136 | /* get a pointer to my fixup list head */ |
| 3137 | struct CTcAbsFixupcxx . . $ CTcAbsFixup# **get_fixup_list_headcxx . . $ CTPNCodeBodyBase#get_fixup_list_head(590d3e872253f62f).() const |
| 3138 | { return fixup_list_anchor_cxx . . $ CTPNCodeBodyBase#fixup_list_anchor_.; } |
| 3139 | |
| 3140 | /* set the location of the opening brace */ |
| 3141 | void set_start_locationcxx . . $ CTPNCodeBodyBase#set_start_location(307809b21b6915c0).(class CTcTokFileDesccxx . . $ CTcTokFileDesc# *desc, long linenum) |
| 3142 | { |
| 3143 | start_desc_cxx . . $ CTPNCodeBodyBase#start_desc_. = desc; |
| 3144 | start_linenum_cxx . . $ CTPNCodeBodyBase#start_linenum_. = linenum; |
| 3145 | } |
| 3146 | |
| 3147 | /* set the location of the closing brace */ |
| 3148 | void set_end_locationcxx . . $ CTPNCodeBodyBase#set_end_location(307809b21b6915c0).(class CTcTokFileDesccxx . . $ CTcTokFileDesc# *desc, long linenum) |
| 3149 | { |
| 3150 | end_desc_cxx . . $ CTPNCodeBodyBase#end_desc_. = desc; |
| 3151 | end_linenum_cxx . . $ CTPNCodeBodyBase#end_linenum_. = linenum; |
| 3152 | } |
| 3153 | |
| 3154 | /* add an absolute fixup for the symbol at the given stream offset */ |
| 3155 | void add_abs_fixupcxx . . $ CTPNCodeBodyBase#add_abs_fixup(f8a15ca01c25f43c).(class CTcDataStreamcxx . . $ CTcDataStream# *ds, ulongcxx . . $ ulong# ofs); |
| 3156 | |
| 3157 | /* add an absolute fixup for the symbol at the current stream offset */ |
| 3158 | void add_abs_fixupcxx . . $ CTPNCodeBodyBase#add_abs_fixup(ed3738fb00585409).(class CTcDataStreamcxx . . $ CTcDataStream# *ds); |
| 3159 | |
| 3160 | /* mark the code body as requiring a local variable context object */ |
| 3161 | void set_local_ctxcxx . . $ CTPNCodeBodyBase#set_local_ctx(3e454b8ccf442868).(int var_num, int max_local_arr_idx) |
| 3162 | { |
| 3163 | /* note that we have a local context */ |
| 3164 | has_local_ctx_cxx . . $ CTPNCodeBodyBase#has_local_ctx_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; |
| 3165 | |
| 3166 | /* |
| 3167 | * remember our the local variable number that contains our |
| 3168 | * context object |
| 3169 | */ |
| 3170 | local_ctx_var_cxx . . $ CTPNCodeBodyBase#local_ctx_var_. = var_num; |
| 3171 | |
| 3172 | /* remember our maximum context local array index */ |
| 3173 | local_ctx_arr_size_cxx . . $ CTPNCodeBodyBase#local_ctx_arr_size_. = max_local_arr_idx; |
| 3174 | } |
| 3175 | |
| 3176 | /* does this function have a local context? */ |
| 3177 | int has_local_ctxcxx . . $ CTPNCodeBodyBase#has_local_ctx(455f465bc33b4cdf).() const { return has_local_ctx_cxx . . $ CTPNCodeBodyBase#has_local_ctx_.; } |
| 3178 | |
| 3179 | /* |
| 3180 | * Get the context variable for a given recursion level, creating |
| 3181 | * the new variable if necessary. Level 1 is the first enclosing |
| 3182 | * scope, 2 is the next enclosing scope, and so on. |
| 3183 | */ |
| 3184 | int get_or_add_ctx_var_for_levelcxx . . $ CTPNCodeBodyBase#get_or_add_ctx_var_for_level(7864480464b09eea).(int level); |
| 3185 | |
| 3186 | /* |
| 3187 | * find a context variable given a requested level; returns true if |
| 3188 | * successful, false if not |
| 3189 | */ |
| 3190 | int get_ctx_var_for_levelcxx . . $ CTPNCodeBodyBase#get_ctx_var_for_level(ac48f4a6ffa9e770).(int level, int *varnum); |
| 3191 | |
| 3192 | /* get the head of the local context list */ |
| 3193 | struct CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx# *get_ctx_headcxx . . $ CTPNCodeBodyBase#get_ctx_head(d3ee30303821a071).() const { return ctx_head_cxx . . $ CTPNCodeBodyBase#ctx_head_.; } |
| 3194 | struct CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx# *get_ctx_tailcxx . . $ CTPNCodeBodyBase#get_ctx_tail(d3ee30303821a071).() const { return ctx_tail_cxx . . $ CTPNCodeBodyBase#ctx_tail_.; } |
| 3195 | |
| 3196 | /* mark this as an anonymous method */ |
| 3197 | int is_anon_methodcxx . . $ CTPNCodeBodyBase#is_anon_method(455f465bc33b4cdf).() const { return is_anon_method_cxx . . $ CTPNCodeBodyBase#is_anon_method_.; } |
| 3198 | void set_anon_methodcxx . . $ CTPNCodeBodyBase#set_anon_method(d4f767463ce0a6b3).(int f) { is_anon_method_cxx . . $ CTPNCodeBodyBase#is_anon_method_. = f; } |
| 3199 | |
| 3200 | /* mark this as a dynamic function or method */ |
| 3201 | int is_dyn_funccxx . . $ CTPNCodeBodyBase#is_dyn_func(455f465bc33b4cdf).() const { return is_dyn_func_cxx . . $ CTPNCodeBodyBase#is_dyn_func_.; } |
| 3202 | int is_dyn_methodcxx . . $ CTPNCodeBodyBase#is_dyn_method(455f465bc33b4cdf).() const { return is_dyn_method_cxx . . $ CTPNCodeBodyBase#is_dyn_method_.; } |
| 3203 | void set_dyn_funccxx . . $ CTPNCodeBodyBase#set_dyn_func(d4f767463ce0a6b3).(int f) { is_dyn_func_cxx . . $ CTPNCodeBodyBase#is_dyn_func_. = f; } |
| 3204 | void set_dyn_methodcxx . . $ CTPNCodeBodyBase#set_dyn_method(d4f767463ce0a6b3).(int f) { is_dyn_method_cxx . . $ CTPNCodeBodyBase#is_dyn_method_. = f; } |
| 3205 | |
| 3206 | /* get/set 'self' reference status */ |
| 3207 | int self_referencedcxx . . $ CTPNCodeBodyBase#self_referenced(455f465bc33b4cdf).() const { return self_referenced_cxx . . $ CTPNCodeBodyBase#self_referenced_.; } |
| 3208 | void set_self_referencedcxx . . $ CTPNCodeBodyBase#set_self_referenced(d4f767463ce0a6b3).(int f) { self_referenced_cxx . . $ CTPNCodeBodyBase#self_referenced_. = f; } |
| 3209 | |
| 3210 | /* get/set full method context reference status */ |
| 3211 | int full_method_ctx_referencedcxx . . $ CTPNCodeBodyBase#full_method_ctx_referenced(455f465bc33b4cdf).() const |
| 3212 | { return full_method_ctx_referenced_cxx . . $ CTPNCodeBodyBase#full_method_ctx_referenced_.; } |
| 3213 | void set_full_method_ctx_referencedcxx . . $ CTPNCodeBodyBase#set_full_method_ctx_referenced(d4f767463ce0a6b3).(int f) |
| 3214 | { full_method_ctx_referenced_cxx . . $ CTPNCodeBodyBase#full_method_ctx_referenced_. = f; } |
| 3215 | |
| 3216 | /* get/set the local context need for 'self' */ |
| 3217 | int local_ctx_needs_selfcxx . . $ CTPNCodeBodyBase#local_ctx_needs_self(455f465bc33b4cdf).() const { return local_ctx_needs_self_cxx . . $ CTPNCodeBodyBase#local_ctx_needs_self_.; } |
| 3218 | void set_local_ctx_needs_selfcxx . . $ CTPNCodeBodyBase#set_local_ctx_needs_self(d4f767463ce0a6b3).(int f) { local_ctx_needs_self_cxx . . $ CTPNCodeBodyBase#local_ctx_needs_self_. = f; } |
| 3219 | |
| 3220 | /* get/set the local context need for the full method context */ |
| 3221 | int local_ctx_needs_full_method_ctxcxx . . $ CTPNCodeBodyBase#local_ctx_needs_full_method_ctx(455f465bc33b4cdf).() const |
| 3222 | { return local_ctx_needs_full_method_ctx_cxx . . $ CTPNCodeBodyBase#local_ctx_needs_full_method_ctx_.; } |
| 3223 | void set_local_ctx_needs_full_method_ctxcxx . . $ CTPNCodeBodyBase#set_local_ctx_needs_full_method_ctx(d4f767463ce0a6b3).(int f) |
| 3224 | { local_ctx_needs_full_method_ctx_cxx . . $ CTPNCodeBodyBase#local_ctx_needs_full_method_ctx_. = f; } |
| 3225 | |
| 3226 | /* get/set the operator overload flag */ |
| 3227 | int is_operator_overloadcxx . . $ CTPNCodeBodyBase#is_operator_overload(455f465bc33b4cdf).() const { return op_overload_cxx . . $ CTPNCodeBodyBase#op_overload_.; } |
| 3228 | void set_operator_overloadcxx . . $ CTPNCodeBodyBase#set_operator_overload(d4f767463ce0a6b3).(int f) { op_overload_cxx . . $ CTPNCodeBodyBase#op_overload_. = f; } |
| 3229 | |
| 3230 | /* |
| 3231 | * Get the base function symbol for a code body defining a modified |
| 3232 | * function (i.e., 'modify <funcname>...'). This is the function to |
| 3233 | * which 'replaced' refers within this code body and within nested code |
| 3234 | * bodies. |
| 3235 | */ |
| 3236 | class CTcSymFunccxx . . $ CTcSymFunc# *get_replaced_funccxx . . $ CTPNCodeBodyBase#get_replaced_func(d785b0f451677e53).() const; |
| 3237 | |
| 3238 | /* get the immediately enclosing code body */ |
| 3239 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *get_enclosingcxx . . $ CTPNCodeBodyBase#get_enclosing(7f18ad9cf00df111).() const; |
| 3240 | |
| 3241 | /* get my argument count */ |
| 3242 | int get_argccxx . . $ CTPNCodeBodyBase#get_argc(455f465bc33b4cdf).() const { return argc_cxx . . $ CTPNCodeBodyBase#argc_.; } |
| 3243 | int get_opt_argccxx . . $ CTPNCodeBodyBase#get_opt_argc(455f465bc33b4cdf).() const { return opt_argc_cxx . . $ CTPNCodeBodyBase#opt_argc_.; } |
| 3244 | |
| 3245 | /* adjust for dynamic (run-time) compilation */ |
| 3246 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNCodeBodyBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3247 | { |
| 3248 | stm_cxx . . $ CTPNCodeBodyBase#stm_. = (CTPNStmcxx . . $ CTPNStm# *)stm_cxx . . $ CTPNCodeBodyBase#stm_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3249 | return this; |
| 3250 | } |
| 3251 | |
| 3252 | protected: |
| 3253 | /* enumerator callback for unreferenced label check */ |
| 3254 | static void unref_label_cbcxx . . $ CTPNCodeBodyBase#unref_label_cb(2dd3746092ed32b).(void *ctx, class CTcSymbolcxx . . $ CTcSymbol# *sym); |
| 3255 | |
| 3256 | /* get the outermost enclosing code cody */ |
| 3257 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *get_outermost_enclosingcxx . . $ CTPNCodeBodyBase#get_outermost_enclosing(7f18ad9cf00df111).() const; |
| 3258 | |
| 3259 | /* source location of opening brace */ |
| 3260 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *start_desc_cxx . . $ CTPNCodeBodyBase#start_desc_.; |
| 3261 | long start_linenum_cxx . . $ CTPNCodeBodyBase#start_linenum_.; |
| 3262 | |
| 3263 | /* source location of the end of the code body (the closing '}') */ |
| 3264 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *end_desc_cxx . . $ CTPNCodeBodyBase#end_desc_.; |
| 3265 | long end_linenum_cxx . . $ CTPNCodeBodyBase#end_linenum_.; |
| 3266 | |
| 3267 | /* local symbol table for the code body */ |
| 3268 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *lcltab_cxx . . $ CTPNCodeBodyBase#lcltab_.; |
| 3269 | |
| 3270 | /* goto symbol table for the code body */ |
| 3271 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *gototab_cxx . . $ CTPNCodeBodyBase#gototab_.; |
| 3272 | |
| 3273 | /* statement making up the code body */ |
| 3274 | class CTPNStmcxx . . $ CTPNStm# *stm_cxx . . $ CTPNCodeBodyBase#stm_.; |
| 3275 | |
| 3276 | /* |
| 3277 | * fixup list head pointer - this will be set to &internal_fixups_ |
| 3278 | * if we don't have a symbol table fixup list, or will point to our |
| 3279 | * symbol table fixup list if we have an external symbol providing |
| 3280 | * the fixup list |
| 3281 | */ |
| 3282 | struct CTcAbsFixupcxx . . $ CTcAbsFixup# **fixup_list_anchor_cxx . . $ CTPNCodeBodyBase#fixup_list_anchor_.; |
| 3283 | |
| 3284 | /* our symbol table entry, if our fixup list is defined there */ |
| 3285 | class CTcSymFunccxx . . $ CTcSymFunc# *fixup_owner_sym_cxx . . $ CTPNCodeBodyBase#fixup_owner_sym_.; |
| 3286 | |
| 3287 | /* |
| 3288 | * Our internal list head for our fixup list for references to this |
| 3289 | * code block. This is used only if we don't have an external fixup |
| 3290 | * list defined in a symbol table entry. |
| 3291 | */ |
| 3292 | struct CTcAbsFixupcxx . . $ CTcAbsFixup# *internal_fixups_cxx . . $ CTPNCodeBodyBase#internal_fixups_.; |
| 3293 | |
| 3294 | /* enclosing code body pointer */ |
| 3295 | struct CTcCodeBodyRefcxx . . $ CTcCodeBodyRef# *enclosing_code_body_cxx . . $ CTPNCodeBodyBase#enclosing_code_body_.; |
| 3296 | |
| 3297 | /* head/tail of anonymous function context list */ |
| 3298 | struct CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx# *ctx_head_cxx . . $ CTPNCodeBodyBase#ctx_head_.; |
| 3299 | struct CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx# *ctx_tail_cxx . . $ CTPNCodeBodyBase#ctx_tail_.; |
| 3300 | |
| 3301 | /* number of local variable slots required */ |
| 3302 | int local_cnt_cxx . . $ CTPNCodeBodyBase#local_cnt_.; |
| 3303 | |
| 3304 | /* number of arguments */ |
| 3305 | int argc_cxx . . $ CTPNCodeBodyBase#argc_.; |
| 3306 | |
| 3307 | /* number of additional optional arguments */ |
| 3308 | int opt_argc_cxx . . $ CTPNCodeBodyBase#opt_argc_.; |
| 3309 | |
| 3310 | /* if function has a varargs-list local, this is the local ID */ |
| 3311 | class CTcSymLocalcxx . . $ CTcSymLocal# *varargs_list_local_cxx . . $ CTPNCodeBodyBase#varargs_list_local_.; |
| 3312 | |
| 3313 | /* if function has a local context, this is its local ID */ |
| 3314 | int local_ctx_var_cxx . . $ CTPNCodeBodyBase#local_ctx_var_.; |
| 3315 | |
| 3316 | /* |
| 3317 | * number of slots in the local context array, if we have a local |
| 3318 | * context at all |
| 3319 | */ |
| 3320 | int local_ctx_arr_size_cxx . . $ CTPNCodeBodyBase#local_ctx_arr_size_.; |
| 3321 | |
| 3322 | /* |
| 3323 | * flag: we have a varargs-list local (varargs_list_local_ has the |
| 3324 | * local variable symbol object) |
| 3325 | */ |
| 3326 | unsigned int varargs_list_cxx . . $ CTPNCodeBodyBase#varargs_list_. : 1; |
| 3327 | |
| 3328 | /* flag: function takes variable number of arguments */ |
| 3329 | unsigned int varargs_cxx . . $ CTPNCodeBodyBase#varargs_. : 1; |
| 3330 | |
| 3331 | /* flag: I've been replaced (and hence don't need codegen) */ |
| 3332 | unsigned int replaced_cxx . . $ CTPNCodeBodyBase#replaced_. : 1; |
| 3333 | |
| 3334 | /* |
| 3335 | * flag: the code body requires a local context - this is set if we |
| 3336 | * have any local variables that are stored in context objects for |
| 3337 | * use in anonymous functions |
| 3338 | */ |
| 3339 | unsigned int has_local_ctx_cxx . . $ CTPNCodeBodyBase#has_local_ctx_. : 1; |
| 3340 | |
| 3341 | /* flag: the local context requires 'self' */ |
| 3342 | unsigned int local_ctx_needs_self_cxx . . $ CTPNCodeBodyBase#local_ctx_needs_self_. : 1; |
| 3343 | |
| 3344 | /* |
| 3345 | * flag: the local context requires the full method context (self, |
| 3346 | * targetprop, targetobj, definingobj) |
| 3347 | */ |
| 3348 | unsigned int local_ctx_needs_full_method_ctx_cxx . . $ CTPNCodeBodyBase#local_ctx_needs_full_method_ctx_. : 1; |
| 3349 | |
| 3350 | /* flag: 'self' is valid in this code body */ |
| 3351 | unsigned int self_valid_cxx . . $ CTPNCodeBodyBase#self_valid_. : 1; |
| 3352 | |
| 3353 | /* flags: 'self' and full method context referenced in this code body */ |
| 3354 | unsigned int self_referenced_cxx . . $ CTPNCodeBodyBase#self_referenced_. : 1; |
| 3355 | unsigned int full_method_ctx_referenced_cxx . . $ CTPNCodeBodyBase#full_method_ctx_referenced_. : 1; |
| 3356 | |
| 3357 | /* flag: this is an operator overload method */ |
| 3358 | unsigned int op_overload_cxx . . $ CTPNCodeBodyBase#op_overload_. : 1; |
| 3359 | |
| 3360 | /* flag: this is an anonymous method */ |
| 3361 | unsigned int is_anon_method_cxx . . $ CTPNCodeBodyBase#is_anon_method_. : 1; |
| 3362 | |
| 3363 | /* flags: this is a dynamic function/method */ |
| 3364 | unsigned int is_dyn_func_cxx . . $ CTPNCodeBodyBase#is_dyn_func_. : 1; |
| 3365 | unsigned int is_dyn_method_cxx . . $ CTPNCodeBodyBase#is_dyn_method_. : 1; |
| 3366 | }; |
| 3367 | |
| 3368 | /* |
| 3369 | * Context level information |
| 3370 | */ |
| 3371 | struct CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx# |
| 3372 | { |
| 3373 | CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx#CTcCodeBodyCtx(49f6e7a06ebc5aa8).() { } |
| 3374 | |
| 3375 | /* level number */ |
| 3376 | int level_cxx . . $ CTcCodeBodyCtx#level_.; |
| 3377 | |
| 3378 | /* local variable containing the context object for this level */ |
| 3379 | int var_num_cxx . . $ CTcCodeBodyCtx#var_num_.; |
| 3380 | |
| 3381 | /* next/previous level structure in list */ |
| 3382 | CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx# *nxt_cxx . . $ CTcCodeBodyCtx#nxt_.; |
| 3383 | CTcCodeBodyCtxcxx . . $ CTcCodeBodyCtx# *prv_cxx . . $ CTcCodeBodyCtx#prv_.; |
| 3384 | }; |
| 3385 | |
| 3386 | /* |
| 3387 | * Code body reference. |
| 3388 | * |
| 3389 | * We don't create a CTPNCodeBody object for a code body we're parsing |
| 3390 | * until after we finish parsing it, so we can't establish a pointer to an |
| 3391 | * enclosing code body while we're parsing a nested code body within the |
| 3392 | * enclosing one. However, we want nested code body objects to be able to |
| 3393 | * refer to their enclosing code bodies. To deal with this, we create a |
| 3394 | * "code body reference" object for each code body at the start of parsing |
| 3395 | * the code body, and then fill it in with the code body object once we |
| 3396 | * finish parsing; nested code bodies can refer to the reference object |
| 3397 | * during parsing, so that after parsing they can get to the code body |
| 3398 | * itself. |
| 3399 | */ |
| 3400 | struct CTcCodeBodyRefcxx . . $ CTcCodeBodyRef# |
| 3401 | { |
| 3402 | CTcCodeBodyRefcxx . . $ CTcCodeBodyRef#CTcCodeBodyRef(49f6e7a06ebc5aa8).() { ptrcxx . . $ CTcCodeBodyRef#ptr. = 0; } |
| 3403 | |
| 3404 | /* pointer to enclosing code body */ |
| 3405 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *ptrcxx . . $ CTcCodeBodyRef#ptr.; |
| 3406 | }; |
| 3407 | |
| 3408 | /* ------------------------------------------------------------------------ */ |
| 3409 | /* |
| 3410 | * Compound statement. A compound statement simply contains a list of |
| 3411 | * statements to be executed in sequence; this corresponds to a set of |
| 3412 | * statements enclosed in braces. A compound statement can have its own |
| 3413 | * set of local variables, since the enclosing braces constitute a local |
| 3414 | * scope. |
| 3415 | */ |
| 3416 | class CTPNStmCompBasecxx . . $ CTPNStmCompBase#: public CTPNStmcxx . . $ CTPNStm# |
| 3417 | { |
| 3418 | public: |
| 3419 | CTPNStmCompBasecxx . . $ CTPNStmCompBase#CTPNStmCompBase(133dc26f55551dd4).(class CTPNStmcxx . . $ CTPNStm# *first_stm, class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3420 | |
| 3421 | /* get my first statement */ |
| 3422 | class CTPNStmcxx . . $ CTPNStm# *get_first_stmcxx . . $ CTPNStmCompBase#get_first_stm(4c8eac0b2da777a8).() const { return first_stm_cxx . . $ CTPNStmCompBase#first_stm_.; } |
| 3423 | |
| 3424 | /* get the local scope's symbol table */ |
| 3425 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *get_symtabcxx . . $ CTPNStmCompBase#get_symtab(9a3349846dc17eb8).() const { return symtab_cxx . . $ CTPNStmCompBase#symtab_.; } |
| 3426 | |
| 3427 | /* set our own-scope flag */ |
| 3428 | void set_has_own_scopecxx . . $ CTPNStmCompBase#set_has_own_scope(d4f767463ce0a6b3).(int f) { has_own_scope_cxx . . $ CTPNStmCompBase#has_own_scope_. = f; } |
| 3429 | |
| 3430 | /* fold constants */ |
| 3431 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmCompBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3432 | |
| 3433 | /* generate code for the compound statement */ |
| 3434 | virtual void gen_codecxx . . $ CTPNStmCompBase#gen_code(3e454b8ccf442868).(int discard, int for_condition); |
| 3435 | |
| 3436 | /* evaluate control flow for the statement list */ |
| 3437 | virtual unsigned long get_control_flowcxx . . $ CTPNStmCompBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 3438 | |
| 3439 | /* |
| 3440 | * Determine if this statement has a code label. We have a code |
| 3441 | * label if our first statement has a code label. |
| 3442 | */ |
| 3443 | virtual int has_code_labelcxx . . $ CTPNStmCompBase#has_code_label(455f465bc33b4cdf).() const |
| 3444 | { |
| 3445 | return (first_stm_cxx . . $ CTPNStmCompBase#first_stm_. == 0 ? FALSEcxx . . $ `tads3/t3std.h:336:10`! : first_stm_cxx . . $ CTPNStmCompBase#first_stm_.->has_code_labelcxx . . $ CTPNStmBase#has_code_label(455f465bc33b4cdf).()); |
| 3446 | } |
| 3447 | |
| 3448 | /* get the location of the closing brace */ |
| 3449 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *get_end_desccxx . . $ CTPNStmCompBase#get_end_desc(4ade2e38c8e31a01).() const { return end_desc_cxx . . $ CTPNStmCompBase#end_desc_.; } |
| 3450 | long get_end_linenumcxx . . $ CTPNStmCompBase#get_end_linenum(57a65ae535d7db84).() const { return end_linenum_cxx . . $ CTPNStmCompBase#end_linenum_.; } |
| 3451 | |
| 3452 | /* adjust for dynamic (run-time) compilation */ |
| 3453 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmCompBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *); |
| 3454 | |
| 3455 | protected: |
| 3456 | /* source location of closing brace */ |
| 3457 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *end_desc_cxx . . $ CTPNStmCompBase#end_desc_.; |
| 3458 | long end_linenum_cxx . . $ CTPNStmCompBase#end_linenum_.; |
| 3459 | |
| 3460 | /* first statement in our list of statements */ |
| 3461 | class CTPNStmcxx . . $ CTPNStm# *first_stm_cxx . . $ CTPNStmCompBase#first_stm_.; |
| 3462 | |
| 3463 | /* |
| 3464 | * our local symbol table; this is a private symbol table with the |
| 3465 | * symbols for our local scope if we have any, or is simply the |
| 3466 | * enclosing scope's symbol table if there are no variables in the |
| 3467 | * local scope |
| 3468 | */ |
| 3469 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab_cxx . . $ CTPNStmCompBase#symtab_.; |
| 3470 | |
| 3471 | /* |
| 3472 | * flag: we have our own private symbol table (it's not the |
| 3473 | * enclosing scope's symbol table) |
| 3474 | */ |
| 3475 | unsigned int has_own_scope_cxx . . $ CTPNStmCompBase#has_own_scope_. : 1; |
| 3476 | }; |
| 3477 | |
| 3478 | /* ------------------------------------------------------------------------ */ |
| 3479 | /* |
| 3480 | * Null statement - this is the statement that results from an empty |
| 3481 | * pair of braces, or simply a semicolon. |
| 3482 | */ |
| 3483 | class CTPNStmNullBasecxx . . $ CTPNStmNullBase#: public CTPNStmcxx . . $ CTPNStm# |
| 3484 | { |
| 3485 | public: |
| 3486 | CTPNStmNullBasecxx . . $ CTPNStmNullBase#CTPNStmNullBase(49f6e7a06ebc5aa8).() { } |
| 3487 | |
| 3488 | /* fold constants */ |
| 3489 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmNullBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) { return this; } |
| 3490 | |
| 3491 | /* generate code for the compound statement */ |
| 3492 | virtual void gen_codecxx . . $ CTPNStmNullBase#gen_code(3e454b8ccf442868).(int, int) { } |
| 3493 | |
| 3494 | /* adjust for dynamic (run-time) compilation */ |
| 3495 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmNullBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *) |
| 3496 | { return this; } |
| 3497 | }; |
| 3498 | |
| 3499 | /* ------------------------------------------------------------------------ */ |
| 3500 | /* |
| 3501 | * Expression statement. |
| 3502 | */ |
| 3503 | class CTPNStmExprBasecxx . . $ CTPNStmExprBase#: public CTPNStmcxx . . $ CTPNStm# |
| 3504 | { |
| 3505 | public: |
| 3506 | CTPNStmExprBasecxx . . $ CTPNStmExprBase#CTPNStmExprBase(ce51daeb60ee86bb).(class CTcPrsNodecxx . . $ CTcPrsNode# *expr) |
| 3507 | { |
| 3508 | /* remember my expression */ |
| 3509 | expr_cxx . . $ CTPNStmExprBase#expr_. = expr; |
| 3510 | } |
| 3511 | |
| 3512 | /* fold constants */ |
| 3513 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmExprBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3514 | |
| 3515 | /* generate code for the compound statement */ |
| 3516 | virtual void gen_codecxx . . $ CTPNStmExprBase#gen_code(3e454b8ccf442868).(int discard, int for_condition); |
| 3517 | |
| 3518 | /* adjust for dynamic (run-time) compilation */ |
| 3519 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmExprBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3520 | { |
| 3521 | expr_cxx . . $ CTPNStmExprBase#expr_. = expr_cxx . . $ CTPNStmExprBase#expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3522 | return this; |
| 3523 | } |
| 3524 | |
| 3525 | protected: |
| 3526 | /* our expression */ |
| 3527 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNStmExprBase#expr_.; |
| 3528 | }; |
| 3529 | |
| 3530 | /* ------------------------------------------------------------------------ */ |
| 3531 | /* |
| 3532 | * Static property initializer statement. This is used to hold the |
| 3533 | * expression of a static initializer, just under the CTPNObjProp |
| 3534 | * element in the tree. |
| 3535 | */ |
| 3536 | class CTPNStmStaticPropInitBasecxx . . $ CTPNStmStaticPropInitBase#: public CTPNStmcxx . . $ CTPNStm# |
| 3537 | { |
| 3538 | public: |
| 3539 | CTPNStmStaticPropInitBasecxx . . $ CTPNStmStaticPropInitBase#CTPNStmStaticPropInitBase(d12686b6a521aa55).(class CTcPrsNodecxx . . $ CTcPrsNode# *expr, |
| 3540 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop) |
| 3541 | { |
| 3542 | /* remember my expression and the property to be initialized */ |
| 3543 | expr_cxx . . $ CTPNStmStaticPropInitBase#expr_. = expr; |
| 3544 | prop_cxx . . $ CTPNStmStaticPropInitBase#prop_. = prop; |
| 3545 | } |
| 3546 | |
| 3547 | /* |
| 3548 | * fold constants - this is never used, because we always fold the |
| 3549 | * constants in the underlying expression before we create one of |
| 3550 | * these nodes, as this type of node is only created during constant |
| 3551 | * folding of the containing property initializer node |
| 3552 | */ |
| 3553 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmStaticPropInitBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) { return this; } |
| 3554 | |
| 3555 | protected: |
| 3556 | /* our expression */ |
| 3557 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNStmStaticPropInitBase#expr_.; |
| 3558 | |
| 3559 | /* property we initialize */ |
| 3560 | tctarg_prop_id_tcxx . . $ tctarg_prop_id_t# prop_cxx . . $ CTPNStmStaticPropInitBase#prop_.; |
| 3561 | }; |
| 3562 | |
| 3563 | /* ------------------------------------------------------------------------ */ |
| 3564 | /* |
| 3565 | * 'if' statement |
| 3566 | */ |
| 3567 | class CTPNStmIfBasecxx . . $ CTPNStmIfBase#: public CTPNStmcxx . . $ CTPNStm# |
| 3568 | { |
| 3569 | public: |
| 3570 | CTPNStmIfBasecxx . . $ CTPNStmIfBase#CTPNStmIfBase(5504bca5383c5611).(class CTcPrsNodecxx . . $ CTcPrsNode# *cond_expr, |
| 3571 | class CTPNStmcxx . . $ CTPNStm# *then_part, class CTPNStmcxx . . $ CTPNStm# *else_part) |
| 3572 | { |
| 3573 | /* remember the condition and the two statements */ |
| 3574 | cond_expr_cxx . . $ CTPNStmIfBase#cond_expr_. = cond_expr; |
| 3575 | then_part_cxx . . $ CTPNStmIfBase#then_part_. = then_part; |
| 3576 | else_part_cxx . . $ CTPNStmIfBase#else_part_. = else_part; |
| 3577 | } |
| 3578 | |
| 3579 | /* fold constants */ |
| 3580 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmIfBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3581 | |
| 3582 | /* evaluate control flow for the conditional */ |
| 3583 | virtual unsigned long get_control_flowcxx . . $ CTPNStmIfBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 3584 | |
| 3585 | /* adjust for dynamic (run-time) compilation */ |
| 3586 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmIfBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3587 | { |
| 3588 | if (then_part_cxx . . $ CTPNStmIfBase#then_part_. != 0) |
| 3589 | then_part_cxx . . $ CTPNStmIfBase#then_part_. = (CTPNStmcxx . . $ CTPNStm# *)then_part_cxx . . $ CTPNStmIfBase#then_part_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3590 | if (else_part_cxx . . $ CTPNStmIfBase#else_part_. != 0) |
| 3591 | else_part_cxx . . $ CTPNStmIfBase#else_part_. = (CTPNStmcxx . . $ CTPNStm# *)else_part_cxx . . $ CTPNStmIfBase#else_part_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3592 | return this; |
| 3593 | } |
| 3594 | |
| 3595 | protected: |
| 3596 | /* condition expression */ |
| 3597 | class CTcPrsNodecxx . . $ CTcPrsNode# *cond_expr_cxx . . $ CTPNStmIfBase#cond_expr_.; |
| 3598 | |
| 3599 | /* 'then' and 'else' substatements */ |
| 3600 | class CTPNStmcxx . . $ CTPNStm# *then_part_cxx . . $ CTPNStmIfBase#then_part_.; |
| 3601 | class CTPNStmcxx . . $ CTPNStm# *else_part_cxx . . $ CTPNStmIfBase#else_part_.; |
| 3602 | }; |
| 3603 | |
| 3604 | /* ------------------------------------------------------------------------ */ |
| 3605 | /* |
| 3606 | * 'for' statement |
| 3607 | */ |
| 3608 | class CTPNStmForBasecxx . . $ CTPNStmForBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 3609 | { |
| 3610 | public: |
| 3611 | CTPNStmForBasecxx . . $ CTPNStmForBase#CTPNStmForBase(e23ff09783059def).(class CTcPrsNodecxx . . $ CTcPrsNode# *init_expr, |
| 3612 | class CTcPrsNodecxx . . $ CTcPrsNode# *cond_expr, |
| 3613 | class CTcPrsNodecxx . . $ CTcPrsNode# *reinit_expr, |
| 3614 | class CTPNForIncxx . . $ CTPNForIn# *in_exprs, |
| 3615 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab, |
| 3616 | class CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing_stm) |
| 3617 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing_stm) |
| 3618 | { |
| 3619 | /* remember the statement parts */ |
| 3620 | init_expr_cxx . . $ CTPNStmForBase#init_expr_. = init_expr; |
| 3621 | cond_expr_cxx . . $ CTPNStmForBase#cond_expr_. = cond_expr; |
| 3622 | reinit_expr_cxx . . $ CTPNStmForBase#reinit_expr_. = reinit_expr; |
| 3623 | in_exprs_cxx . . $ CTPNStmForBase#in_exprs_. = in_exprs; |
| 3624 | symtab_cxx . . $ CTPNStmForBase#symtab_. = symtab; |
| 3625 | |
| 3626 | /* no body yet */ |
| 3627 | body_stm_cxx . . $ CTPNStmForBase#body_stm_. = 0; |
| 3628 | |
| 3629 | /* |
| 3630 | * presume we use our parent's symbol table, not our own private |
| 3631 | * one |
| 3632 | */ |
| 3633 | has_own_scope_cxx . . $ CTPNStmForBase#has_own_scope_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 3634 | } |
| 3635 | |
| 3636 | /* set the body */ |
| 3637 | void set_bodycxx . . $ CTPNStmForBase#set_body(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *body) { body_stm_cxx . . $ CTPNStmForBase#body_stm_. = body; } |
| 3638 | |
| 3639 | /* fold constants */ |
| 3640 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmForBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3641 | |
| 3642 | /* evaluate control flow for the loop */ |
| 3643 | virtual unsigned long get_control_flowcxx . . $ CTPNStmForBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 3644 | |
| 3645 | /* set our own-scope flag */ |
| 3646 | void set_has_own_scopecxx . . $ CTPNStmForBase#set_has_own_scope(d4f767463ce0a6b3).(int f) { has_own_scope_cxx . . $ CTPNStmForBase#has_own_scope_. = f; } |
| 3647 | |
| 3648 | /* adjust for dynamic (run-time) compilation */ |
| 3649 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmForBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3650 | { |
| 3651 | if (init_expr_cxx . . $ CTPNStmForBase#init_expr_. != 0) |
| 3652 | init_expr_cxx . . $ CTPNStmForBase#init_expr_. = init_expr_cxx . . $ CTPNStmForBase#init_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3653 | if (cond_expr_cxx . . $ CTPNStmForBase#cond_expr_. != 0) |
| 3654 | cond_expr_cxx . . $ CTPNStmForBase#cond_expr_. = cond_expr_cxx . . $ CTPNStmForBase#cond_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3655 | if (reinit_expr_cxx . . $ CTPNStmForBase#reinit_expr_. != 0) |
| 3656 | reinit_expr_cxx . . $ CTPNStmForBase#reinit_expr_. = reinit_expr_cxx . . $ CTPNStmForBase#reinit_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3657 | if (body_stm_cxx . . $ CTPNStmForBase#body_stm_. != 0) |
| 3658 | body_stm_cxx . . $ CTPNStmForBase#body_stm_. = (CTPNStmcxx . . $ CTPNStm# *)body_stm_cxx . . $ CTPNStmForBase#body_stm_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3659 | |
| 3660 | return this; |
| 3661 | } |
| 3662 | |
| 3663 | protected: |
| 3664 | /* initialization expression */ |
| 3665 | class CTcPrsNodecxx . . $ CTcPrsNode# *init_expr_cxx . . $ CTPNStmForBase#init_expr_.; |
| 3666 | |
| 3667 | /* loop condition expression */ |
| 3668 | class CTcPrsNodecxx . . $ CTcPrsNode# *cond_expr_cxx . . $ CTPNStmForBase#cond_expr_.; |
| 3669 | |
| 3670 | /* reinitialization expression */ |
| 3671 | class CTcPrsNodecxx . . $ CTcPrsNode# *reinit_expr_cxx . . $ CTPNStmForBase#reinit_expr_.; |
| 3672 | |
| 3673 | /* |
| 3674 | * Head of list of "in" expressions (lval in collection, lval in |
| 3675 | * from..to). These appear as ordinary expressions within the |
| 3676 | * init_expr_ comma list, but we track them separately here, since they |
| 3677 | * implicitly generate code in the condition and reinit phases as well. |
| 3678 | */ |
| 3679 | class CTPNForIncxx . . $ CTPNForIn# *in_exprs_cxx . . $ CTPNStmForBase#in_exprs_.; |
| 3680 | |
| 3681 | /* body of the loop */ |
| 3682 | class CTPNStmcxx . . $ CTPNStm# *body_stm_cxx . . $ CTPNStmForBase#body_stm_.; |
| 3683 | |
| 3684 | /* our local scope symbol table */ |
| 3685 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab_cxx . . $ CTPNStmForBase#symtab_.; |
| 3686 | |
| 3687 | /* flag: we have our own private symbol table (not our parent's) */ |
| 3688 | unsigned int has_own_scope_cxx . . $ CTPNStmForBase#has_own_scope_. : 1; |
| 3689 | }; |
| 3690 | |
| 3691 | /* ------------------------------------------------------------------------ */ |
| 3692 | /* |
| 3693 | * '<variable> in <expression>' node, for 'for' statements. Since 3.1, |
| 3694 | * regular 'for' statements can include 'in' clauses mixed in with other |
| 3695 | * initializer expressions. |
| 3696 | */ |
| 3697 | class CTPNVarInBasecxx . . $ CTPNVarInBase#: public CTPNForIncxx . . $ CTPNForIn# |
| 3698 | { |
| 3699 | public: |
| 3700 | CTPNVarInBasecxx . . $ CTPNVarInBase#CTPNVarInBase(4056ff28648387bf).(class CTcPrsNodecxx . . $ CTcPrsNode# *lval, class CTcPrsNodecxx . . $ CTcPrsNode# *expr, |
| 3701 | int iter_local_id) |
| 3702 | { |
| 3703 | lval_cxx . . $ CTPNVarInBase#lval_. = lval; |
| 3704 | expr_cxx . . $ CTPNVarInBase#expr_. = expr; |
| 3705 | iter_local_id_cxx . . $ CTPNVarInBase#iter_local_id_. = iter_local_id; |
| 3706 | } |
| 3707 | |
| 3708 | /* fold constants */ |
| 3709 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNVarInBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3710 | |
| 3711 | /* adjust for dynamic (run-time) compilation */ |
| 3712 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNVarInBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3713 | { |
| 3714 | lval_cxx . . $ CTPNVarInBase#lval_. = lval_cxx . . $ CTPNVarInBase#lval_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3715 | expr_cxx . . $ CTPNVarInBase#expr_. = expr_cxx . . $ CTPNVarInBase#expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3716 | |
| 3717 | return this; |
| 3718 | } |
| 3719 | |
| 3720 | protected: |
| 3721 | /* the lvalue for the control variable */ |
| 3722 | class CTcPrsNodecxx . . $ CTcPrsNode# *lval_cxx . . $ CTPNVarInBase#lval_.; |
| 3723 | |
| 3724 | /* the collection expression */ |
| 3725 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNVarInBase#expr_.; |
| 3726 | |
| 3727 | /* private local variable for the iterator */ |
| 3728 | int iter_local_id_cxx . . $ CTPNVarInBase#iter_local_id_.; |
| 3729 | }; |
| 3730 | |
| 3731 | /* |
| 3732 | * '<variable> in <from> .. <to>' node, for 'for' statements. Since 3.1, |
| 3733 | * 'for' statements can include 'in' clauses with range expressions using |
| 3734 | * '..'. |
| 3735 | */ |
| 3736 | class CTPNVarInRangeBasecxx . . $ CTPNVarInRangeBase#: public CTPNForIncxx . . $ CTPNForIn# |
| 3737 | { |
| 3738 | public: |
| 3739 | CTPNVarInRangeBasecxx . . $ CTPNVarInRangeBase#CTPNVarInRangeBase(6d7a19a74d94ec37).(class CTcPrsNodecxx . . $ CTcPrsNode# *lval, |
| 3740 | class CTcPrsNodecxx . . $ CTcPrsNode# *from_expr, |
| 3741 | class CTcPrsNodecxx . . $ CTcPrsNode# *to_expr, |
| 3742 | class CTcPrsNodecxx . . $ CTcPrsNode# *step_expr, |
| 3743 | int to_local_id, int step_local_id) |
| 3744 | { |
| 3745 | lval_cxx . . $ CTPNVarInRangeBase#lval_. = lval; |
| 3746 | from_expr_cxx . . $ CTPNVarInRangeBase#from_expr_. = from_expr; |
| 3747 | to_expr_cxx . . $ CTPNVarInRangeBase#to_expr_. = to_expr; |
| 3748 | step_expr_cxx . . $ CTPNVarInRangeBase#step_expr_. = step_expr; |
| 3749 | to_local_id_cxx . . $ CTPNVarInRangeBase#to_local_id_. = to_local_id; |
| 3750 | step_local_id_cxx . . $ CTPNVarInRangeBase#step_local_id_. = step_local_id; |
| 3751 | } |
| 3752 | |
| 3753 | /* adjust for dynamic (run-time) compilation */ |
| 3754 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNVarInRangeBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3755 | { |
| 3756 | lval_cxx . . $ CTPNVarInRangeBase#lval_. = lval_cxx . . $ CTPNVarInRangeBase#lval_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3757 | from_expr_cxx . . $ CTPNVarInRangeBase#from_expr_. = from_expr_cxx . . $ CTPNVarInRangeBase#from_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3758 | to_expr_cxx . . $ CTPNVarInRangeBase#to_expr_. = to_expr_cxx . . $ CTPNVarInRangeBase#to_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3759 | if (step_expr_cxx . . $ CTPNVarInRangeBase#step_expr_. != 0) |
| 3760 | step_expr_cxx . . $ CTPNVarInRangeBase#step_expr_. = step_expr_cxx . . $ CTPNVarInRangeBase#step_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3761 | |
| 3762 | return this; |
| 3763 | } |
| 3764 | |
| 3765 | /* fold constants */ |
| 3766 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNVarInRangeBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3767 | |
| 3768 | protected: |
| 3769 | /* the lvalue for the control variable */ |
| 3770 | class CTcPrsNodecxx . . $ CTcPrsNode# *lval_cxx . . $ CTPNVarInRangeBase#lval_.; |
| 3771 | |
| 3772 | /* the 'from' and 'to' expressions */ |
| 3773 | class CTcPrsNodecxx . . $ CTcPrsNode# *from_expr_cxx . . $ CTPNVarInRangeBase#from_expr_.; |
| 3774 | class CTcPrsNodecxx . . $ CTcPrsNode# *to_expr_cxx . . $ CTPNVarInRangeBase#to_expr_.; |
| 3775 | |
| 3776 | /* the optional 'step' expression */ |
| 3777 | class CTcPrsNodecxx . . $ CTcPrsNode# *step_expr_cxx . . $ CTPNVarInRangeBase#step_expr_.; |
| 3778 | |
| 3779 | /* local variable number for the evaluated "to" expression */ |
| 3780 | int to_local_id_cxx . . $ CTPNVarInRangeBase#to_local_id_.; |
| 3781 | |
| 3782 | /* |
| 3783 | * local variable number for the evaluated "step" expression - this is |
| 3784 | * used only if we have a non-constant step expression |
| 3785 | */ |
| 3786 | int step_local_id_cxx . . $ CTPNVarInRangeBase#step_local_id_.; |
| 3787 | }; |
| 3788 | |
| 3789 | /* ------------------------------------------------------------------------ */ |
| 3790 | /* |
| 3791 | * 'foreach' statement |
| 3792 | */ |
| 3793 | class CTPNStmForeachBasecxx . . $ CTPNStmForeachBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 3794 | { |
| 3795 | public: |
| 3796 | CTPNStmForeachBasecxx . . $ CTPNStmForeachBase#CTPNStmForeachBase(bd1e643d43a0e8dd).(class CTcPrsNodecxx . . $ CTcPrsNode# *iter_expr, |
| 3797 | class CTcPrsNodecxx . . $ CTcPrsNode# *coll_expr, |
| 3798 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab, |
| 3799 | class CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing_stm, |
| 3800 | int iter_local_id) |
| 3801 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing_stm) |
| 3802 | { |
| 3803 | /* remember the statement parts */ |
| 3804 | iter_expr_cxx . . $ CTPNStmForeachBase#iter_expr_. = iter_expr; |
| 3805 | coll_expr_cxx . . $ CTPNStmForeachBase#coll_expr_. = coll_expr; |
| 3806 | symtab_cxx . . $ CTPNStmForeachBase#symtab_. = symtab; |
| 3807 | |
| 3808 | /* no body yet */ |
| 3809 | body_stm_cxx . . $ CTPNStmForeachBase#body_stm_. = 0; |
| 3810 | |
| 3811 | /* remember my private iterator local */ |
| 3812 | iter_local_id_cxx . . $ CTPNStmForeachBase#iter_local_id_. = iter_local_id; |
| 3813 | |
| 3814 | /* |
| 3815 | * presume we use our parent's symbol table, not our own private |
| 3816 | * one |
| 3817 | */ |
| 3818 | has_own_scope_cxx . . $ CTPNStmForeachBase#has_own_scope_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 3819 | } |
| 3820 | |
| 3821 | /* set the body */ |
| 3822 | void set_bodycxx . . $ CTPNStmForeachBase#set_body(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *body) { body_stm_cxx . . $ CTPNStmForeachBase#body_stm_. = body; } |
| 3823 | |
| 3824 | /* fold constants */ |
| 3825 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmForeachBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3826 | |
| 3827 | /* evaluate control flow for the loop */ |
| 3828 | virtual unsigned long get_control_flowcxx . . $ CTPNStmForeachBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 3829 | |
| 3830 | /* set our own-scope flag */ |
| 3831 | void set_has_own_scopecxx . . $ CTPNStmForeachBase#set_has_own_scope(d4f767463ce0a6b3).(int f) { has_own_scope_cxx . . $ CTPNStmForeachBase#has_own_scope_. = f; } |
| 3832 | |
| 3833 | /* adjust for dynamic (run-time) compilation */ |
| 3834 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmForeachBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3835 | { |
| 3836 | iter_expr_cxx . . $ CTPNStmForeachBase#iter_expr_. = iter_expr_cxx . . $ CTPNStmForeachBase#iter_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3837 | coll_expr_cxx . . $ CTPNStmForeachBase#coll_expr_. = coll_expr_cxx . . $ CTPNStmForeachBase#coll_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3838 | body_stm_cxx . . $ CTPNStmForeachBase#body_stm_. = (CTPNStmcxx . . $ CTPNStm# *)body_stm_cxx . . $ CTPNStmForeachBase#body_stm_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3839 | return this; |
| 3840 | } |
| 3841 | |
| 3842 | protected: |
| 3843 | /* iteration lvalue expression */ |
| 3844 | class CTcPrsNodecxx . . $ CTcPrsNode# *iter_expr_cxx . . $ CTPNStmForeachBase#iter_expr_.; |
| 3845 | |
| 3846 | /* collection expression */ |
| 3847 | class CTcPrsNodecxx . . $ CTcPrsNode# *coll_expr_cxx . . $ CTPNStmForeachBase#coll_expr_.; |
| 3848 | |
| 3849 | /* body of the loop */ |
| 3850 | class CTPNStmcxx . . $ CTPNStm# *body_stm_cxx . . $ CTPNStmForeachBase#body_stm_.; |
| 3851 | |
| 3852 | /* our local scope symbol table */ |
| 3853 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab_cxx . . $ CTPNStmForeachBase#symtab_.; |
| 3854 | |
| 3855 | /* ID of secret local variable containing the iterator object */ |
| 3856 | int iter_local_id_cxx . . $ CTPNStmForeachBase#iter_local_id_.; |
| 3857 | |
| 3858 | /* flag: we have our own private symbol table (not our parent's) */ |
| 3859 | unsigned int has_own_scope_cxx . . $ CTPNStmForeachBase#has_own_scope_. : 1; |
| 3860 | }; |
| 3861 | |
| 3862 | /* ------------------------------------------------------------------------ */ |
| 3863 | /* |
| 3864 | * 'while' statement - this is an enclosing statement, because it can |
| 3865 | * interact with 'try' blocks with 'break' and 'continue' statements |
| 3866 | * used within the body of the loop |
| 3867 | */ |
| 3868 | class CTPNStmWhileBasecxx . . $ CTPNStmWhileBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 3869 | { |
| 3870 | public: |
| 3871 | CTPNStmWhileBasecxx . . $ CTPNStmWhileBase#CTPNStmWhileBase(e725fcab4773f45b).(class CTcPrsNodecxx . . $ CTcPrsNode# *cond_expr, |
| 3872 | class CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing_stm) |
| 3873 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing_stm) |
| 3874 | { |
| 3875 | /* remember the statement parts */ |
| 3876 | cond_expr_cxx . . $ CTPNStmWhileBase#cond_expr_. = cond_expr; |
| 3877 | |
| 3878 | /* no body yet */ |
| 3879 | body_stm_cxx . . $ CTPNStmWhileBase#body_stm_. = 0; |
| 3880 | } |
| 3881 | |
| 3882 | /* set the body */ |
| 3883 | void set_bodycxx . . $ CTPNStmWhileBase#set_body(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *body) { body_stm_cxx . . $ CTPNStmWhileBase#body_stm_. = body; } |
| 3884 | |
| 3885 | /* fold constants */ |
| 3886 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmWhileBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3887 | |
| 3888 | /* evaluate control flow for the loop */ |
| 3889 | virtual unsigned long get_control_flowcxx . . $ CTPNStmWhileBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 3890 | |
| 3891 | /* adjust for dynamic (run-time) compilation */ |
| 3892 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmWhileBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3893 | { |
| 3894 | cond_expr_cxx . . $ CTPNStmWhileBase#cond_expr_. = cond_expr_cxx . . $ CTPNStmWhileBase#cond_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3895 | body_stm_cxx . . $ CTPNStmWhileBase#body_stm_. = (CTPNStmcxx . . $ CTPNStm# *)body_stm_cxx . . $ CTPNStmWhileBase#body_stm_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3896 | return this; |
| 3897 | } |
| 3898 | |
| 3899 | protected: |
| 3900 | /* loop condition expression */ |
| 3901 | class CTcPrsNodecxx . . $ CTcPrsNode# *cond_expr_cxx . . $ CTPNStmWhileBase#cond_expr_.; |
| 3902 | |
| 3903 | /* body of the loop */ |
| 3904 | class CTPNStmcxx . . $ CTPNStm# *body_stm_cxx . . $ CTPNStmWhileBase#body_stm_.; |
| 3905 | }; |
| 3906 | |
| 3907 | /* ------------------------------------------------------------------------ */ |
| 3908 | /* |
| 3909 | * 'do-while' statement |
| 3910 | */ |
| 3911 | class CTPNStmDoWhileBasecxx . . $ CTPNStmDoWhileBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 3912 | { |
| 3913 | public: |
| 3914 | CTPNStmDoWhileBasecxx . . $ CTPNStmDoWhileBase#CTPNStmDoWhileBase(1ca02b42dc5d0941).(class CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing_stm) |
| 3915 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing_stm) |
| 3916 | { |
| 3917 | /* no condition or body yet */ |
| 3918 | cond_expr_cxx . . $ CTPNStmDoWhileBase#cond_expr_. = 0; |
| 3919 | body_stm_cxx . . $ CTPNStmDoWhileBase#body_stm_. = 0; |
| 3920 | |
| 3921 | /* |
| 3922 | * we don't know the location of the 'while' part yet, so assume |
| 3923 | * it's at the same location as the 'do' for now |
| 3924 | */ |
| 3925 | while_desc_cxx . . $ CTPNStmDoWhileBase#while_desc_. = file_cxx . . $ CTPNStmBase#file_.; |
| 3926 | while_linenum_cxx . . $ CTPNStmDoWhileBase#while_linenum_. = linenum_cxx . . $ CTPNStmBase#linenum_.; |
| 3927 | } |
| 3928 | |
| 3929 | /* set the condition */ |
| 3930 | void set_condcxx . . $ CTPNStmDoWhileBase#set_cond(ce51daeb60ee86bb).(class CTcPrsNodecxx . . $ CTcPrsNode# *cond) { cond_expr_cxx . . $ CTPNStmDoWhileBase#cond_expr_. = cond; } |
| 3931 | |
| 3932 | /* set the body */ |
| 3933 | void set_bodycxx . . $ CTPNStmDoWhileBase#set_body(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *body) { body_stm_cxx . . $ CTPNStmDoWhileBase#body_stm_. = body; } |
| 3934 | |
| 3935 | /* fold constants */ |
| 3936 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmDoWhileBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 3937 | |
| 3938 | /* evaluate control flow for the loop */ |
| 3939 | virtual unsigned long get_control_flowcxx . . $ CTPNStmDoWhileBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 3940 | |
| 3941 | /* set the source location of the 'while' statement */ |
| 3942 | void set_while_poscxx . . $ CTPNStmDoWhileBase#set_while_pos(307809b21b6915c0).(class CTcTokFileDesccxx . . $ CTcTokFileDesc# *desc, long linenum) |
| 3943 | { |
| 3944 | while_desc_cxx . . $ CTPNStmDoWhileBase#while_desc_. = desc; |
| 3945 | while_linenum_cxx . . $ CTPNStmDoWhileBase#while_linenum_. = linenum; |
| 3946 | } |
| 3947 | |
| 3948 | /* adjust for dynamic (run-time) compilation */ |
| 3949 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmDoWhileBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3950 | { |
| 3951 | cond_expr_cxx . . $ CTPNStmDoWhileBase#cond_expr_. = cond_expr_cxx . . $ CTPNStmDoWhileBase#cond_expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3952 | body_stm_cxx . . $ CTPNStmDoWhileBase#body_stm_. = (CTPNStmcxx . . $ CTPNStm# *)body_stm_cxx . . $ CTPNStmDoWhileBase#body_stm_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 3953 | return this; |
| 3954 | } |
| 3955 | |
| 3956 | protected: |
| 3957 | /* source location of 'while' */ |
| 3958 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *while_desc_cxx . . $ CTPNStmDoWhileBase#while_desc_.; |
| 3959 | long while_linenum_cxx . . $ CTPNStmDoWhileBase#while_linenum_.; |
| 3960 | |
| 3961 | /* loop condition expression */ |
| 3962 | class CTcPrsNodecxx . . $ CTcPrsNode# *cond_expr_cxx . . $ CTPNStmDoWhileBase#cond_expr_.; |
| 3963 | |
| 3964 | /* body of the loop */ |
| 3965 | class CTPNStmcxx . . $ CTPNStm# *body_stm_cxx . . $ CTPNStmDoWhileBase#body_stm_.; |
| 3966 | }; |
| 3967 | |
| 3968 | /* ------------------------------------------------------------------------ */ |
| 3969 | /* |
| 3970 | * 'break' statement |
| 3971 | */ |
| 3972 | class CTPNStmBreakBasecxx . . $ CTPNStmBreakBase#: public CTPNStmcxx . . $ CTPNStm# |
| 3973 | { |
| 3974 | public: |
| 3975 | CTPNStmBreakBasecxx . . $ CTPNStmBreakBase#CTPNStmBreakBase(49f6e7a06ebc5aa8).() |
| 3976 | { |
| 3977 | /* no label yet */ |
| 3978 | lbl_cxx . . $ CTPNStmBreakBase#lbl_. = 0; |
| 3979 | lbl_len_cxx . . $ CTPNStmBreakBase#lbl_len_. = 0; |
| 3980 | } |
| 3981 | |
| 3982 | /* fold constants */ |
| 3983 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmBreakBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) |
| 3984 | { |
| 3985 | /* we have nothing to fold - return unchangdd */ |
| 3986 | return this; |
| 3987 | } |
| 3988 | |
| 3989 | /* evaluate control flow for the statement */ |
| 3990 | virtual unsigned long get_control_flowcxx . . $ CTPNStmBreakBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 3991 | |
| 3992 | /* set my label */ |
| 3993 | void set_labelcxx . . $ CTPNStmBreakBase#set_label(cf347308e962de74).(const class CTcTokencxx . . $ CTcToken# *tok); |
| 3994 | |
| 3995 | /* adjust for dynamic (run-time) compilation */ |
| 3996 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmBreakBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 3997 | { return this; } |
| 3998 | |
| 3999 | protected: |
| 4000 | /* my break-to label, if specified */ |
| 4001 | const textchar_tcxx . . $ textchar_t# *lbl_cxx . . $ CTPNStmBreakBase#lbl_.; |
| 4002 | size_t lbl_len_cxx . . $ CTPNStmBreakBase#lbl_len_.; |
| 4003 | }; |
| 4004 | |
| 4005 | /* ------------------------------------------------------------------------ */ |
| 4006 | /* |
| 4007 | * 'continue' statement |
| 4008 | */ |
| 4009 | class CTPNStmContinueBasecxx . . $ CTPNStmContinueBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4010 | { |
| 4011 | public: |
| 4012 | CTPNStmContinueBasecxx . . $ CTPNStmContinueBase#CTPNStmContinueBase(49f6e7a06ebc5aa8).() |
| 4013 | { |
| 4014 | /* no label yet */ |
| 4015 | lbl_cxx . . $ CTPNStmContinueBase#lbl_. = 0; |
| 4016 | lbl_len_cxx . . $ CTPNStmContinueBase#lbl_len_. = 0; |
| 4017 | } |
| 4018 | |
| 4019 | /* fold constants */ |
| 4020 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmContinueBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) |
| 4021 | { |
| 4022 | /* we have nothing to fold - return unchangdd */ |
| 4023 | return this; |
| 4024 | } |
| 4025 | |
| 4026 | /* evaluate control flow for the statement */ |
| 4027 | virtual unsigned long get_control_flowcxx . . $ CTPNStmContinueBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4028 | |
| 4029 | /* set my label */ |
| 4030 | void set_labelcxx . . $ CTPNStmContinueBase#set_label(cf347308e962de74).(const class CTcTokencxx . . $ CTcToken# *tok); |
| 4031 | |
| 4032 | /* adjust for dynamic (run-time) compilation */ |
| 4033 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmContinueBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4034 | { return this; } |
| 4035 | |
| 4036 | protected: |
| 4037 | /* my break-to label, if specified */ |
| 4038 | const textchar_tcxx . . $ textchar_t# *lbl_cxx . . $ CTPNStmContinueBase#lbl_.; |
| 4039 | size_t lbl_len_cxx . . $ CTPNStmContinueBase#lbl_len_.; |
| 4040 | }; |
| 4041 | |
| 4042 | /* ------------------------------------------------------------------------ */ |
| 4043 | /* |
| 4044 | * 'return' statement; if the expression node is null, this is a simple |
| 4045 | * void return |
| 4046 | */ |
| 4047 | class CTPNStmReturnBasecxx . . $ CTPNStmReturnBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4048 | { |
| 4049 | public: |
| 4050 | CTPNStmReturnBasecxx . . $ CTPNStmReturnBase#CTPNStmReturnBase(ce51daeb60ee86bb).(class CTcPrsNodecxx . . $ CTcPrsNode# *expr) |
| 4051 | { |
| 4052 | /* remember the expression */ |
| 4053 | expr_cxx . . $ CTPNStmReturnBase#expr_. = expr; |
| 4054 | } |
| 4055 | |
| 4056 | /* fold constants */ |
| 4057 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmReturnBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4058 | |
| 4059 | /* evaluate control flow for the statement */ |
| 4060 | virtual unsigned long get_control_flowcxx . . $ CTPNStmReturnBase#get_control_flow(79dc3568750208f6).(int /*warn*/) const |
| 4061 | { |
| 4062 | /* |
| 4063 | * we return a value if we have an expression, otherwise we're |
| 4064 | * just a void return |
| 4065 | */ |
| 4066 | return (expr_cxx . . $ CTPNStmReturnBase#expr_. == 0 ? TCPRS_FLOW_RET_VOIDcxx . . $ `tads3/tcpnint.h:314:9`! : TCPRS_FLOW_RET_VALcxx . . $ `tads3/tcpnint.h:315:9`!); |
| 4067 | } |
| 4068 | |
| 4069 | /* adjust for dynamic (run-time) compilation */ |
| 4070 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmReturnBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4071 | { |
| 4072 | expr_cxx . . $ CTPNStmReturnBase#expr_. = expr_cxx . . $ CTPNStmReturnBase#expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4073 | return this; |
| 4074 | } |
| 4075 | |
| 4076 | protected: |
| 4077 | /* the expression to return, or null for a void return */ |
| 4078 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNStmReturnBase#expr_.; |
| 4079 | }; |
| 4080 | |
| 4081 | /* ------------------------------------------------------------------------ */ |
| 4082 | /* |
| 4083 | * 'switch' statement. This is an 'enclosing' statement type because |
| 4084 | * 'break' can refer to the statement from within the code body. |
| 4085 | */ |
| 4086 | class CTPNStmSwitchBasecxx . . $ CTPNStmSwitchBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 4087 | { |
| 4088 | public: |
| 4089 | CTPNStmSwitchBasecxx . . $ CTPNStmSwitchBase#CTPNStmSwitchBase(1ca02b42dc5d0941).(class CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing_stm) |
| 4090 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing_stm) |
| 4091 | { |
| 4092 | /* we have no body or expression yet */ |
| 4093 | expr_cxx . . $ CTPNStmSwitchBase#expr_. = 0; |
| 4094 | body_cxx . . $ CTPNStmSwitchBase#body_. = 0; |
| 4095 | |
| 4096 | /* we have no case or default labels yet */ |
| 4097 | case_cnt_cxx . . $ CTPNStmSwitchBase#case_cnt_. = 0; |
| 4098 | has_default_cxx . . $ CTPNStmSwitchBase#has_default_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 4099 | } |
| 4100 | |
| 4101 | /* set my expression */ |
| 4102 | void set_exprcxx . . $ CTPNStmSwitchBase#set_expr(ce51daeb60ee86bb).(class CTcPrsNodecxx . . $ CTcPrsNode# *expr) { expr_cxx . . $ CTPNStmSwitchBase#expr_. = expr; } |
| 4103 | |
| 4104 | /* set my body */ |
| 4105 | void set_bodycxx . . $ CTPNStmSwitchBase#set_body(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *body) { body_cxx . . $ CTPNStmSwitchBase#body_. = body; } |
| 4106 | |
| 4107 | /* fold constants */ |
| 4108 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmSwitchBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4109 | |
| 4110 | /* evaluate control flow for the statement */ |
| 4111 | virtual unsigned long get_control_flowcxx . . $ CTPNStmSwitchBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4112 | |
| 4113 | /* get the number of 'case' labels */ |
| 4114 | int get_case_cntcxx . . $ CTPNStmSwitchBase#get_case_cnt(455f465bc33b4cdf).() const { return case_cnt_cxx . . $ CTPNStmSwitchBase#case_cnt_.; } |
| 4115 | |
| 4116 | /* determine if there's a 'default' label */ |
| 4117 | int get_has_defaultcxx . . $ CTPNStmSwitchBase#get_has_default(455f465bc33b4cdf).() const { return has_default_cxx . . $ CTPNStmSwitchBase#has_default_. != 0; } |
| 4118 | |
| 4119 | /* increment the number of case labels */ |
| 4120 | void inc_case_cntcxx . . $ CTPNStmSwitchBase#inc_case_cnt(49f6e7a06ebc5aa8).() { ++case_cnt_cxx . . $ CTPNStmSwitchBase#case_cnt_.; } |
| 4121 | |
| 4122 | /* mark that the body has a 'default' label */ |
| 4123 | void set_has_defaultcxx . . $ CTPNStmSwitchBase#set_has_default(49f6e7a06ebc5aa8).() { has_default_cxx . . $ CTPNStmSwitchBase#has_default_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 4124 | |
| 4125 | /* adjust for dynamic (run-time) compilation */ |
| 4126 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmSwitchBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4127 | { |
| 4128 | expr_cxx . . $ CTPNStmSwitchBase#expr_. = expr_cxx . . $ CTPNStmSwitchBase#expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4129 | body_cxx . . $ CTPNStmSwitchBase#body_. = (CTPNStmcxx . . $ CTPNStm# *)body_cxx . . $ CTPNStmSwitchBase#body_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4130 | return this; |
| 4131 | } |
| 4132 | |
| 4133 | protected: |
| 4134 | /* the controlling expression */ |
| 4135 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNStmSwitchBase#expr_.; |
| 4136 | |
| 4137 | /* body of the switch */ |
| 4138 | class CTPNStmcxx . . $ CTPNStm# *body_cxx . . $ CTPNStmSwitchBase#body_.; |
| 4139 | |
| 4140 | /* number of case labels */ |
| 4141 | int case_cnt_cxx . . $ CTPNStmSwitchBase#case_cnt_.; |
| 4142 | |
| 4143 | /* flag: we have a 'default' label */ |
| 4144 | unsigned int has_default_cxx . . $ CTPNStmSwitchBase#has_default_. : 1; |
| 4145 | }; |
| 4146 | |
| 4147 | |
| 4148 | /* ------------------------------------------------------------------------ */ |
| 4149 | /* |
| 4150 | * code label statement - a code label contains the statement that it |
| 4151 | * labels. This is an enclosing statement type because targeting a |
| 4152 | * label with a 'goto', 'break', or 'continue' requires that we be able |
| 4153 | * to find intermediate 'try' blocks. |
| 4154 | */ |
| 4155 | class CTPNStmLabelBasecxx . . $ CTPNStmLabelBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 4156 | { |
| 4157 | public: |
| 4158 | CTPNStmLabelBasecxx . . $ CTPNStmLabelBase#CTPNStmLabelBase(95b0b8990fb70fef).(class CTcSymLabelcxx . . $ CTcSymLabel# *lbl, CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing) |
| 4159 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing) |
| 4160 | { |
| 4161 | /* remember my label */ |
| 4162 | lbl_cxx . . $ CTPNStmLabelBase#lbl_. = lbl; |
| 4163 | |
| 4164 | /* we have no enclosed statement yet */ |
| 4165 | stm_cxx . . $ CTPNStmLabelBase#stm_. = 0; |
| 4166 | |
| 4167 | /* we're not targeted with any 'break' or 'continue' statements yet */ |
| 4168 | control_flow_flags_cxx . . $ CTPNStmLabelBase#control_flow_flags_. = 0; |
| 4169 | } |
| 4170 | |
| 4171 | /* set my enclosed statement */ |
| 4172 | void set_stmcxx . . $ CTPNStmLabelBase#set_stm(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *stm) { stm_cxx . . $ CTPNStmLabelBase#stm_. = stm; } |
| 4173 | |
| 4174 | /* fold constants */ |
| 4175 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmLabelBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4176 | |
| 4177 | /* evaluate control flow for the statement */ |
| 4178 | virtual unsigned long get_control_flowcxx . . $ CTPNStmLabelBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4179 | |
| 4180 | /* I am a code label, thus I have a code label */ |
| 4181 | virtual int has_code_labelcxx . . $ CTPNStmLabelBase#has_code_label(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 4182 | |
| 4183 | /* |
| 4184 | * add explicit targeting flags (break, continue, goto) to my |
| 4185 | * statement |
| 4186 | */ |
| 4187 | void add_control_flow_flagscxx . . $ CTPNStmLabelBase#add_control_flow_flags(2c44cd906ae4e829).(ulongcxx . . $ ulong# flags); |
| 4188 | |
| 4189 | /* get my explicit control flow flag */ |
| 4190 | ulongcxx . . $ ulong# get_explicit_control_flow_flagscxx . . $ CTPNStmLabelBase#get_explicit_control_flow_flags(fe4d2d262d4164a8).() const |
| 4191 | { return control_flow_flags_cxx . . $ CTPNStmLabelBase#control_flow_flags_.; } |
| 4192 | |
| 4193 | /* adjust for dynamic (run-time) compilation */ |
| 4194 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmLabelBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4195 | { |
| 4196 | stm_cxx . . $ CTPNStmLabelBase#stm_. = (CTPNStmcxx . . $ CTPNStm# *)stm_cxx . . $ CTPNStmLabelBase#stm_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4197 | return this; |
| 4198 | } |
| 4199 | |
| 4200 | protected: |
| 4201 | /* my label */ |
| 4202 | class CTcSymLabelcxx . . $ CTcSymLabel# *lbl_cxx . . $ CTPNStmLabelBase#lbl_.; |
| 4203 | |
| 4204 | /* my enclosed statement */ |
| 4205 | class CTPNStmcxx . . $ CTPNStm# *stm_cxx . . $ CTPNStmLabelBase#stm_.; |
| 4206 | |
| 4207 | /* |
| 4208 | * My explicit control flow flags. Any time this label appears in a |
| 4209 | * 'break' or 'continue' statement enclosed within the labeled |
| 4210 | * statement, we'll set the appropriate flags here. When charting |
| 4211 | * the control flow through the statement, we will take these into |
| 4212 | * account after charting the flow through our body. |
| 4213 | */ |
| 4214 | ulongcxx . . $ ulong# control_flow_flags_cxx . . $ CTPNStmLabelBase#control_flow_flags_.; |
| 4215 | }; |
| 4216 | |
| 4217 | /* ------------------------------------------------------------------------ */ |
| 4218 | /* |
| 4219 | * 'goto' statement |
| 4220 | */ |
| 4221 | class CTPNStmGotoBasecxx . . $ CTPNStmGotoBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4222 | { |
| 4223 | public: |
| 4224 | CTPNStmGotoBasecxx . . $ CTPNStmGotoBase#CTPNStmGotoBase(7cafb6e0818eff3b).(const textchar_tcxx . . $ textchar_t# *lbl, size_t lbl_len) |
| 4225 | { |
| 4226 | /* |
| 4227 | * remember the label - we can store a reference to it without |
| 4228 | * copying, because the tokenizer keeps symbol token text around |
| 4229 | * throughout compilation |
| 4230 | */ |
| 4231 | lbl_cxx . . $ CTPNStmGotoBase#lbl_. = lbl; |
| 4232 | lbl_len_cxx . . $ CTPNStmGotoBase#lbl_len_. = lbl_len; |
| 4233 | } |
| 4234 | |
| 4235 | /* fold constants */ |
| 4236 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmGotoBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) |
| 4237 | { |
| 4238 | /* 'goto' statements are unaffected by constant folding */ |
| 4239 | return this; |
| 4240 | } |
| 4241 | |
| 4242 | /* evaluate control flow for the statement */ |
| 4243 | virtual unsigned long get_control_flowcxx . . $ CTPNStmGotoBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4244 | |
| 4245 | /* adjust for dynamic (run-time) compilation */ |
| 4246 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmGotoBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4247 | { return this; } |
| 4248 | |
| 4249 | protected: |
| 4250 | /* our code label text */ |
| 4251 | const textchar_tcxx . . $ textchar_t# *lbl_cxx . . $ CTPNStmGotoBase#lbl_.; |
| 4252 | size_t lbl_len_cxx . . $ CTPNStmGotoBase#lbl_len_.; |
| 4253 | }; |
| 4254 | |
| 4255 | |
| 4256 | /* ------------------------------------------------------------------------ */ |
| 4257 | /* |
| 4258 | * 'case' label statement |
| 4259 | */ |
| 4260 | class CTPNStmCaseBasecxx . . $ CTPNStmCaseBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4261 | { |
| 4262 | public: |
| 4263 | CTPNStmCaseBasecxx . . $ CTPNStmCaseBase#CTPNStmCaseBase(49f6e7a06ebc5aa8).() |
| 4264 | { |
| 4265 | /* we have no statement or expression yet */ |
| 4266 | expr_cxx . . $ CTPNStmCaseBase#expr_. = 0; |
| 4267 | stm_cxx . . $ CTPNStmCaseBase#stm_. = 0; |
| 4268 | } |
| 4269 | |
| 4270 | /* set my expression */ |
| 4271 | void set_exprcxx . . $ CTPNStmCaseBase#set_expr(ce51daeb60ee86bb).(class CTcPrsNodecxx . . $ CTcPrsNode# *expr) { expr_cxx . . $ CTPNStmCaseBase#expr_. = expr; } |
| 4272 | |
| 4273 | /* set my enclosed statement */ |
| 4274 | void set_stmcxx . . $ CTPNStmCaseBase#set_stm(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *stm) { stm_cxx . . $ CTPNStmCaseBase#stm_. = stm; } |
| 4275 | |
| 4276 | /* fold constants */ |
| 4277 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmCaseBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4278 | |
| 4279 | /* evaluate control flow for the statement */ |
| 4280 | virtual unsigned long get_control_flowcxx . . $ CTPNStmCaseBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4281 | |
| 4282 | /* I am a code label, thus I have a code label */ |
| 4283 | virtual int has_code_labelcxx . . $ CTPNStmCaseBase#has_code_label(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 4284 | |
| 4285 | /* adjust for dynamic (run-time) compilation */ |
| 4286 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmCaseBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4287 | { |
| 4288 | expr_cxx . . $ CTPNStmCaseBase#expr_. = expr_cxx . . $ CTPNStmCaseBase#expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4289 | stm_cxx . . $ CTPNStmCaseBase#stm_. = (CTPNStmcxx . . $ CTPNStm# *)stm_cxx . . $ CTPNStmCaseBase#stm_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4290 | return this; |
| 4291 | } |
| 4292 | |
| 4293 | protected: |
| 4294 | /* my expression */ |
| 4295 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNStmCaseBase#expr_.; |
| 4296 | |
| 4297 | /* my enclosed statement */ |
| 4298 | class CTPNStmcxx . . $ CTPNStm# *stm_cxx . . $ CTPNStmCaseBase#stm_.; |
| 4299 | }; |
| 4300 | |
| 4301 | /* ------------------------------------------------------------------------ */ |
| 4302 | /* |
| 4303 | * 'default' label statement |
| 4304 | */ |
| 4305 | class CTPNStmDefaultBasecxx . . $ CTPNStmDefaultBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4306 | { |
| 4307 | public: |
| 4308 | CTPNStmDefaultBasecxx . . $ CTPNStmDefaultBase#CTPNStmDefaultBase(49f6e7a06ebc5aa8).() |
| 4309 | { |
| 4310 | /* we have no statement yet */ |
| 4311 | stm_cxx . . $ CTPNStmDefaultBase#stm_. = 0; |
| 4312 | } |
| 4313 | |
| 4314 | /* set my enclosed statement */ |
| 4315 | void set_stmcxx . . $ CTPNStmDefaultBase#set_stm(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *stm) { stm_cxx . . $ CTPNStmDefaultBase#stm_. = stm; } |
| 4316 | |
| 4317 | /* fold constants */ |
| 4318 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmDefaultBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4319 | |
| 4320 | /* evaluate control flow for the statement */ |
| 4321 | virtual unsigned long get_control_flowcxx . . $ CTPNStmDefaultBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4322 | |
| 4323 | /* I am a code label, thus I have a code label */ |
| 4324 | virtual int has_code_labelcxx . . $ CTPNStmDefaultBase#has_code_label(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 4325 | |
| 4326 | /* adjust for dynamic (run-time) compilation */ |
| 4327 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmDefaultBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4328 | { return this; } |
| 4329 | |
| 4330 | protected: |
| 4331 | /* my enclosed statement */ |
| 4332 | class CTPNStmcxx . . $ CTPNStm# *stm_cxx . . $ CTPNStmDefaultBase#stm_.; |
| 4333 | }; |
| 4334 | |
| 4335 | /* ------------------------------------------------------------------------ */ |
| 4336 | /* |
| 4337 | * 'try' statement |
| 4338 | */ |
| 4339 | class CTPNStmTryBasecxx . . $ CTPNStmTryBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 4340 | { |
| 4341 | public: |
| 4342 | CTPNStmTryBasecxx . . $ CTPNStmTryBase#CTPNStmTryBase(1ca02b42dc5d0941).(CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing) |
| 4343 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing) |
| 4344 | { |
| 4345 | /* we have no protected body yet */ |
| 4346 | body_stm_cxx . . $ CTPNStmTryBase#body_stm_. = 0; |
| 4347 | |
| 4348 | /* we have no 'catch' or 'finally' clause yet */ |
| 4349 | first_catch_stm_cxx . . $ CTPNStmTryBase#first_catch_stm_. = last_catch_stm_cxx . . $ CTPNStmTryBase#last_catch_stm_. = 0; |
| 4350 | finally_stm_cxx . . $ CTPNStmTryBase#finally_stm_. = 0; |
| 4351 | } |
| 4352 | |
| 4353 | /* set my protected statement */ |
| 4354 | void set_body_stmcxx . . $ CTPNStmTryBase#set_body_stm(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *body_stm) { body_stm_cxx . . $ CTPNStmTryBase#body_stm_. = body_stm; } |
| 4355 | |
| 4356 | /* add a catch to my list */ |
| 4357 | void add_catchcxx . . $ CTPNStmTryBase#add_catch(23db4269512884a8).(class CTPNStmCatchcxx . . $ CTPNStmCatch# *catch_stm); |
| 4358 | |
| 4359 | /* set the 'finally' clause */ |
| 4360 | void set_finallycxx . . $ CTPNStmTryBase#set_finally(54639b1c666f7e1e).(class CTPNStmFinallycxx . . $ CTPNStmFinally# *finally_stm) |
| 4361 | { finally_stm_cxx . . $ CTPNStmTryBase#finally_stm_. = finally_stm; } |
| 4362 | |
| 4363 | /* determine if I have any 'catch' or 'finally' clauses */ |
| 4364 | int has_catch_or_finallycxx . . $ CTPNStmTryBase#has_catch_or_finally(455f465bc33b4cdf).() const |
| 4365 | { |
| 4366 | return (first_catch_stm_cxx . . $ CTPNStmTryBase#first_catch_stm_. != 0 || finally_stm_cxx . . $ CTPNStmTryBase#finally_stm_. != 0); |
| 4367 | } |
| 4368 | |
| 4369 | /* fold constants */ |
| 4370 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmTryBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4371 | |
| 4372 | /* evaluate control flow for the statement list */ |
| 4373 | virtual unsigned long get_control_flowcxx . . $ CTPNStmTryBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4374 | |
| 4375 | /* adjust for dynamic (run-time) compilation */ |
| 4376 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmTryBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 4377 | |
| 4378 | protected: |
| 4379 | /* my enclosed statement */ |
| 4380 | class CTPNStmcxx . . $ CTPNStm# *body_stm_cxx . . $ CTPNStmTryBase#body_stm_.; |
| 4381 | |
| 4382 | /* head and tail of my 'catch' clause list */ |
| 4383 | class CTPNStmCatchcxx . . $ CTPNStmCatch# *first_catch_stm_cxx . . $ CTPNStmTryBase#first_catch_stm_.; |
| 4384 | class CTPNStmCatchcxx . . $ CTPNStmCatch# *last_catch_stm_cxx . . $ CTPNStmTryBase#last_catch_stm_.; |
| 4385 | |
| 4386 | /* my 'finally' clause, if any */ |
| 4387 | class CTPNStmFinallycxx . . $ CTPNStmFinally# *finally_stm_cxx . . $ CTPNStmTryBase#finally_stm_.; |
| 4388 | }; |
| 4389 | |
| 4390 | /* ------------------------------------------------------------------------ */ |
| 4391 | /* |
| 4392 | * 'catch' clause |
| 4393 | */ |
| 4394 | class CTPNStmCatchBasecxx . . $ CTPNStmCatchBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4395 | { |
| 4396 | public: |
| 4397 | CTPNStmCatchBasecxx . . $ CTPNStmCatchBase#CTPNStmCatchBase(49f6e7a06ebc5aa8).() |
| 4398 | { |
| 4399 | /* we have no statement yet */ |
| 4400 | body_cxx . . $ CTPNStmCatchBase#body_. = 0; |
| 4401 | |
| 4402 | /* we don't know our exception class yet */ |
| 4403 | exc_class_cxx . . $ CTPNStmCatchBase#exc_class_. = 0; |
| 4404 | exc_class_len_cxx . . $ CTPNStmCatchBase#exc_class_len_. = 0; |
| 4405 | |
| 4406 | /* we don't know our exception variable yet */ |
| 4407 | exc_var_cxx . . $ CTPNStmCatchBase#exc_var_. = 0; |
| 4408 | |
| 4409 | /* we're not in a list yet */ |
| 4410 | next_catch_cxx . . $ CTPNStmCatchBase#next_catch_. = 0; |
| 4411 | |
| 4412 | /* we don't know our local symbol table yet */ |
| 4413 | symtab_cxx . . $ CTPNStmCatchBase#symtab_. = 0; |
| 4414 | } |
| 4415 | |
| 4416 | /* set my enclosed statement */ |
| 4417 | void set_bodycxx . . $ CTPNStmCatchBase#set_body(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *body) { body_cxx . . $ CTPNStmCatchBase#body_. = body; } |
| 4418 | |
| 4419 | /* set my exception class name */ |
| 4420 | void set_exc_classcxx . . $ CTPNStmCatchBase#set_exc_class(cf347308e962de74).(const class CTcTokencxx . . $ CTcToken# *tok); |
| 4421 | |
| 4422 | /* set my exception variable */ |
| 4423 | void set_exc_varcxx . . $ CTPNStmCatchBase#set_exc_var(5f47b5948ac68c2c).(class CTcSymLocalcxx . . $ CTcSymLocal# *var) { exc_var_cxx . . $ CTPNStmCatchBase#exc_var_. = var; } |
| 4424 | |
| 4425 | /* fold constants */ |
| 4426 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmCatchBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4427 | |
| 4428 | /* evaluate control flow for the clause */ |
| 4429 | virtual unsigned long get_control_flowcxx . . $ CTPNStmCatchBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4430 | |
| 4431 | /* get/set the next 'catch' clause in our list */ |
| 4432 | CTPNStmCatchcxx . . $ CTPNStmCatch# *get_next_catchcxx . . $ CTPNStmCatchBase#get_next_catch(1780d36600f686e).() const { return next_catch_cxx . . $ CTPNStmCatchBase#next_catch_.; } |
| 4433 | void set_next_catchcxx . . $ CTPNStmCatchBase#set_next_catch(23db4269512884a8).(CTPNStmCatchcxx . . $ CTPNStmCatch# *nxt) { next_catch_cxx . . $ CTPNStmCatchBase#next_catch_. = nxt; } |
| 4434 | |
| 4435 | /* set my local-scope symbol table */ |
| 4436 | void set_symtabcxx . . $ CTPNStmCatchBase#set_symtab(c962e9a9c00d44f1).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) { symtab_cxx . . $ CTPNStmCatchBase#symtab_. = symtab; } |
| 4437 | |
| 4438 | /* adjust for dynamic (run-time) compilation */ |
| 4439 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmCatchBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4440 | { |
| 4441 | body_cxx . . $ CTPNStmCatchBase#body_. = (CTPNStmcxx . . $ CTPNStm# *)body_cxx . . $ CTPNStmCatchBase#body_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4442 | return this; |
| 4443 | } |
| 4444 | |
| 4445 | protected: |
| 4446 | /* the body of the 'catch' block */ |
| 4447 | class CTPNStmcxx . . $ CTPNStm# *body_cxx . . $ CTPNStmCatchBase#body_.; |
| 4448 | |
| 4449 | /* exception name */ |
| 4450 | const textchar_tcxx . . $ textchar_t# *exc_class_cxx . . $ CTPNStmCatchBase#exc_class_.; |
| 4451 | size_t exc_class_len_cxx . . $ CTPNStmCatchBase#exc_class_len_.; |
| 4452 | |
| 4453 | /* exception variable (formal parameter to 'catch' block) */ |
| 4454 | class CTcSymLocalcxx . . $ CTcSymLocal# *exc_var_cxx . . $ CTPNStmCatchBase#exc_var_.; |
| 4455 | |
| 4456 | /* next 'catch' clause in our list */ |
| 4457 | CTPNStmCatchcxx . . $ CTPNStmCatch# *next_catch_cxx . . $ CTPNStmCatchBase#next_catch_.; |
| 4458 | |
| 4459 | /* my local-scope symbol table (for my formal parameter) */ |
| 4460 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab_cxx . . $ CTPNStmCatchBase#symtab_.; |
| 4461 | }; |
| 4462 | |
| 4463 | /* ------------------------------------------------------------------------ */ |
| 4464 | /* |
| 4465 | * 'finally' clause |
| 4466 | */ |
| 4467 | class CTPNStmFinallyBasecxx . . $ CTPNStmFinallyBase#: public CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# |
| 4468 | { |
| 4469 | public: |
| 4470 | CTPNStmFinallyBasecxx . . $ CTPNStmFinallyBase#CTPNStmFinallyBase(f24e6ada125e5e3).(CTPNStmEnclosingcxx . . $ CTPNStmEnclosing# *enclosing, |
| 4471 | int exc_local_id, int jsr_local_id) |
| 4472 | : CTPNStmEnclosingcxx . . $ CTPNStmEnclosing#CTPNStmEnclosing(1ca02b42dc5d0941).(enclosing) |
| 4473 | { |
| 4474 | /* we have no body yet */ |
| 4475 | body_cxx . . $ CTPNStmFinallyBase#body_. = 0; |
| 4476 | |
| 4477 | /* remember our local variable ID's */ |
| 4478 | exc_local_id_cxx . . $ CTPNStmFinallyBase#exc_local_id_. = exc_local_id; |
| 4479 | jsr_local_id_cxx . . $ CTPNStmFinallyBase#jsr_local_id_. = jsr_local_id; |
| 4480 | |
| 4481 | /* use my starting position as the ending position for now */ |
| 4482 | end_desc_cxx . . $ CTPNStmFinallyBase#end_desc_. = file_cxx . . $ CTPNStmBase#file_.; |
| 4483 | end_linenum_cxx . . $ CTPNStmFinallyBase#end_linenum_. = linenum_cxx . . $ CTPNStmBase#linenum_.; |
| 4484 | } |
| 4485 | |
| 4486 | /* set my body */ |
| 4487 | void set_bodycxx . . $ CTPNStmFinallyBase#set_body(66f550fb8ff45219).(class CTPNStmcxx . . $ CTPNStm# *stm) { body_cxx . . $ CTPNStmFinallyBase#body_. = stm; } |
| 4488 | |
| 4489 | /* |
| 4490 | * set my ending source position (i.e., the position of the closing |
| 4491 | * brace of the block of code contained within the 'finally' block |
| 4492 | */ |
| 4493 | void set_end_poscxx . . $ CTPNStmFinallyBase#set_end_pos(307809b21b6915c0).(class CTcTokFileDesccxx . . $ CTcTokFileDesc# *desc, long linenum) |
| 4494 | { |
| 4495 | end_desc_cxx . . $ CTPNStmFinallyBase#end_desc_. = desc; |
| 4496 | end_linenum_cxx . . $ CTPNStmFinallyBase#end_linenum_. = linenum; |
| 4497 | } |
| 4498 | |
| 4499 | /* get the ending source position information */ |
| 4500 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *get_end_desccxx . . $ CTPNStmFinallyBase#get_end_desc(4ade2e38c8e31a01).() const { return end_desc_cxx . . $ CTPNStmFinallyBase#end_desc_.; } |
| 4501 | long get_end_linenumcxx . . $ CTPNStmFinallyBase#get_end_linenum(57a65ae535d7db84).() const { return end_linenum_cxx . . $ CTPNStmFinallyBase#end_linenum_.; } |
| 4502 | |
| 4503 | /* fold constants */ |
| 4504 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmFinallyBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4505 | |
| 4506 | /* evaluate control flow for the clause */ |
| 4507 | virtual unsigned long get_control_flowcxx . . $ CTPNStmFinallyBase#get_control_flow(79dc3568750208f6).(int warn) const; |
| 4508 | |
| 4509 | /* adjust for dynamic (run-time) compilation */ |
| 4510 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmFinallyBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4511 | { |
| 4512 | body_cxx . . $ CTPNStmFinallyBase#body_. = (CTPNStmcxx . . $ CTPNStm# *)body_cxx . . $ CTPNStmFinallyBase#body_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4513 | return this; |
| 4514 | } |
| 4515 | |
| 4516 | protected: |
| 4517 | /* my body */ |
| 4518 | class CTPNStmcxx . . $ CTPNStm# *body_cxx . . $ CTPNStmFinallyBase#body_.; |
| 4519 | |
| 4520 | /* |
| 4521 | * our exception local ID - this is an unnamed local variable that |
| 4522 | * we use to store our exception parameter temporarily while we run |
| 4523 | * the 'finally' block |
| 4524 | */ |
| 4525 | int exc_local_id_cxx . . $ CTPNStmFinallyBase#exc_local_id_.; |
| 4526 | |
| 4527 | /* |
| 4528 | * our subroutine return address local ID - this is another unnamed |
| 4529 | * local that we use to store our subroutine return address |
| 4530 | */ |
| 4531 | int jsr_local_id_cxx . . $ CTPNStmFinallyBase#jsr_local_id_.; |
| 4532 | |
| 4533 | /* |
| 4534 | * source position of end of the 'finally' clause - we keep track of |
| 4535 | * this location because code generated after the return from |
| 4536 | * calling the 'finally' clause is most sensibly thought of as being |
| 4537 | * at this location |
| 4538 | */ |
| 4539 | class CTcTokFileDesccxx . . $ CTcTokFileDesc# *end_desc_cxx . . $ CTPNStmFinallyBase#end_desc_.; |
| 4540 | long end_linenum_cxx . . $ CTPNStmFinallyBase#end_linenum_.; |
| 4541 | }; |
| 4542 | |
| 4543 | /* ------------------------------------------------------------------------ */ |
| 4544 | /* |
| 4545 | * 'throw' statement |
| 4546 | */ |
| 4547 | class CTPNStmThrowBasecxx . . $ CTPNStmThrowBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4548 | { |
| 4549 | public: |
| 4550 | CTPNStmThrowBasecxx . . $ CTPNStmThrowBase#CTPNStmThrowBase(ce51daeb60ee86bb).(class CTcPrsNodecxx . . $ CTcPrsNode# *expr) |
| 4551 | { |
| 4552 | /* remember the expression to be thrown */ |
| 4553 | expr_cxx . . $ CTPNStmThrowBase#expr_. = expr; |
| 4554 | } |
| 4555 | |
| 4556 | /* fold constants */ |
| 4557 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmThrowBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4558 | |
| 4559 | /* evaluate control flow for the statement */ |
| 4560 | virtual unsigned long get_control_flowcxx . . $ CTPNStmThrowBase#get_control_flow(79dc3568750208f6).(int /*warn*/) const |
| 4561 | { |
| 4562 | /* this statement always exits by 'throw' (obviously) */ |
| 4563 | return TCPRS_FLOW_THROWcxx . . $ `tads3/tcpnint.h:313:9`!; |
| 4564 | } |
| 4565 | |
| 4566 | /* adjust for dynamic (run-time) compilation */ |
| 4567 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNStmThrowBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info) |
| 4568 | { |
| 4569 | expr_cxx . . $ CTPNStmThrowBase#expr_. = expr_cxx . . $ CTPNStmThrowBase#expr_.->adjust_for_dyncxx . . $ CTcPrsNodeBase#adjust_for_dyn(a690a7dea3c3d74b).(info); |
| 4570 | return this; |
| 4571 | } |
| 4572 | |
| 4573 | protected: |
| 4574 | /* expression to throw */ |
| 4575 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNStmThrowBase#expr_.; |
| 4576 | }; |
| 4577 | |
| 4578 | /* ------------------------------------------------------------------------ */ |
| 4579 | /* |
| 4580 | * 'dictionary' statement |
| 4581 | */ |
| 4582 | class CTPNStmDictBasecxx . . $ CTPNStmDictBase#: public CTPNStmTopcxx . . $ CTPNStmTop# |
| 4583 | { |
| 4584 | public: |
| 4585 | CTPNStmDictBasecxx . . $ CTPNStmDictBase#CTPNStmDictBase(894c88d6e8e5b222).(class CTcDictEntrycxx . . $ CTcDictEntry# *dict) |
| 4586 | { |
| 4587 | /* remember the dictionary entry */ |
| 4588 | dict_cxx . . $ CTPNStmDictBase#dict_. = dict; |
| 4589 | } |
| 4590 | |
| 4591 | /* fold constants - this has no effect on us */ |
| 4592 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmDictBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) { return this; } |
| 4593 | |
| 4594 | protected: |
| 4595 | /* the underlying dictionary entry */ |
| 4596 | class CTcDictEntrycxx . . $ CTcDictEntry# *dict_cxx . . $ CTPNStmDictBase#dict_.; |
| 4597 | }; |
| 4598 | |
| 4599 | |
| 4600 | /* ------------------------------------------------------------------------ */ |
| 4601 | /* |
| 4602 | * Parse node for object superclass list entries |
| 4603 | */ |
| 4604 | class CTPNSuperclasscxx . . $ CTPNSuperclass#: public CTcPrsNodecxx . . $ CTcPrsNode# |
| 4605 | { |
| 4606 | public: |
| 4607 | CTPNSuperclasscxx . . $ CTPNSuperclass#CTPNSuperclass(7cafb6e0818eff3b).(const textchar_tcxx . . $ textchar_t# *sym, size_t len) |
| 4608 | { |
| 4609 | /* remember my name */ |
| 4610 | sym_txt_cxx . . $ CTPNSuperclass#sym_txt_. = sym; |
| 4611 | sym_len_cxx . . $ CTPNSuperclass#sym_len_. = len; |
| 4612 | |
| 4613 | /* we have a name instead of a symbol object */ |
| 4614 | sym_cxx . . $ CTPNSuperclass#sym_. = 0; |
| 4615 | |
| 4616 | /* I'm not in a list yet */ |
| 4617 | nxt_cxx . . $ CTPNSuperclass#nxt_. = prv_cxx . . $ CTPNSuperclass#prv_. = 0; |
| 4618 | } |
| 4619 | |
| 4620 | CTPNSuperclasscxx . . $ CTPNSuperclass#CTPNSuperclass(3ddcefa113cb28cb).(class CTcSymbolcxx . . $ CTcSymbol# *sym) |
| 4621 | { |
| 4622 | /* remember my symbol */ |
| 4623 | sym_cxx . . $ CTPNSuperclass#sym_. = sym; |
| 4624 | |
| 4625 | /* we have the symbol, so we don't need to store the name */ |
| 4626 | sym_txt_cxx . . $ CTPNSuperclass#sym_txt_. = 0; |
| 4627 | sym_len_cxx . . $ CTPNSuperclass#sym_len_. = 0; |
| 4628 | |
| 4629 | /* I'm not in a list yet */ |
| 4630 | nxt_cxx . . $ CTPNSuperclass#nxt_. = 0; |
| 4631 | } |
| 4632 | |
| 4633 | /* fold constants */ |
| 4634 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNSuperclass#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 4635 | { return this; } |
| 4636 | |
| 4637 | /* generate code for the compound statement */ |
| 4638 | virtual void gen_codecxx . . $ CTPNSuperclass#gen_code(3e454b8ccf442868).(int discard, int for_condition) { } |
| 4639 | |
| 4640 | /* get my symbol */ |
| 4641 | class CTcSymbolcxx . . $ CTcSymbol# *get_symcxx . . $ CTPNSuperclass#get_sym(f33533242378c43d).() const; |
| 4642 | |
| 4643 | /* get my text - valid only if we are storing text, not a symbol */ |
| 4644 | const char *get_sym_txtcxx . . $ CTPNSuperclass#get_sym_txt(a9f41ea0e82d88cf).() const { return sym_txt_cxx . . $ CTPNSuperclass#sym_txt_.; } |
| 4645 | size_t get_sym_lencxx . . $ CTPNSuperclass#get_sym_len(fe4d2d262d4164a8).() const { return sym_len_cxx . . $ CTPNSuperclass#sym_len_.; } |
| 4646 | |
| 4647 | /* am I a subclass of the given class? */ |
| 4648 | int is_subclass_ofcxx . . $ CTPNSuperclass#is_subclass_of(9469ecd70af64a39).(const CTPNSuperclasscxx . . $ CTPNSuperclass# *sc) const; |
| 4649 | |
| 4650 | /* next/previous entry in my list */ |
| 4651 | CTPNSuperclasscxx . . $ CTPNSuperclass# *nxt_cxx . . $ CTPNSuperclass#nxt_., *prv_cxx . . $ CTPNSuperclass#prv_.; |
| 4652 | |
| 4653 | protected: |
| 4654 | /* my symbol - if this isn't set, we'll use sym_txt_ instead */ |
| 4655 | class CTcSymbolcxx . . $ CTcSymbol# *sym_cxx . . $ CTPNSuperclass#sym_.; |
| 4656 | |
| 4657 | /* my name - we use this if sym_ is not set */ |
| 4658 | const textchar_tcxx . . $ textchar_t# *sym_txt_cxx . . $ CTPNSuperclass#sym_txt_.; |
| 4659 | size_t sym_len_cxx . . $ CTPNSuperclass#sym_len_.; |
| 4660 | }; |
| 4661 | |
| 4662 | /* |
| 4663 | * Superclass list |
| 4664 | */ |
| 4665 | class CTPNSuperclassListcxx . . $ CTPNSuperclassList# |
| 4666 | { |
| 4667 | public: |
| 4668 | CTPNSuperclassListcxx . . $ CTPNSuperclassList#CTPNSuperclassList(49f6e7a06ebc5aa8).() { head_cxx . . $ CTPNSuperclassList#head_. = tail_cxx . . $ CTPNSuperclassList#tail_. = 0; dst_cxx . . $ CTPNSuperclassList#dst_. = &head_cxx . . $ CTPNSuperclassList#head_.; } |
| 4669 | |
| 4670 | void appendcxx . . $ CTPNSuperclassList#append(6ecae79a245be973).(class CTPNSuperclasscxx . . $ CTPNSuperclass# *sc) |
| 4671 | { |
| 4672 | /* set the 'next' pointer for the current tail */ |
| 4673 | *dst_cxx . . $ CTPNSuperclassList#dst_. = sc; |
| 4674 | *(dst_cxx . . $ CTPNSuperclassList#dst_. = &sc->nxt_cxx . . $ CTPNSuperclass#nxt_.) = 0; |
| 4675 | |
| 4676 | /* set the 'previous' pointer for the new entry */ |
| 4677 | sc->prv_cxx . . $ CTPNSuperclass#prv_. = tail_cxx . . $ CTPNSuperclassList#tail_.; |
| 4678 | tail_cxx . . $ CTPNSuperclassList#tail_. = sc; |
| 4679 | } |
| 4680 | |
| 4681 | /* head and tail of our list */ |
| 4682 | class CTPNSuperclasscxx . . $ CTPNSuperclass# *head_cxx . . $ CTPNSuperclassList#head_.; |
| 4683 | class CTPNSuperclasscxx . . $ CTPNSuperclass# *tail_cxx . . $ CTPNSuperclassList#tail_.; |
| 4684 | |
| 4685 | private: |
| 4686 | class CTPNSuperclasscxx . . $ CTPNSuperclass# **dst_cxx . . $ CTPNSuperclassList#dst_.; |
| 4687 | }; |
| 4688 | |
| 4689 | |
| 4690 | /* |
| 4691 | * Property list |
| 4692 | */ |
| 4693 | class CTPNPropListcxx . . $ CTPNPropList# |
| 4694 | { |
| 4695 | public: |
| 4696 | CTPNPropListcxx . . $ CTPNPropList#CTPNPropList(49f6e7a06ebc5aa8).() { first_cxx . . $ CTPNPropList#first_. = last_cxx . . $ CTPNPropList#last_. = 0; dst_cxx . . $ CTPNPropList#dst_. = &first_cxx . . $ CTPNPropList#first_.; cnt_cxx . . $ CTPNPropList#cnt_. = 0; } |
| 4697 | |
| 4698 | /* append a property to our list */ |
| 4699 | void appendcxx . . $ CTPNPropList#append(5fc49430c98251b2).(class CTPNObjPropcxx . . $ CTPNObjProp# *prop); |
| 4700 | |
| 4701 | /* delete a property from our list; returns true if found, false if not */ |
| 4702 | int delcxx . . $ CTPNPropList#del(28af09f9ca84002d).(class CTcSymPropcxx . . $ CTcSymProp# *sym); |
| 4703 | |
| 4704 | /* head/tail of our property list */ |
| 4705 | class CTPNObjPropcxx . . $ CTPNObjProp# *first_cxx . . $ CTPNPropList#first_.; |
| 4706 | class CTPNObjPropcxx . . $ CTPNObjProp# *last_cxx . . $ CTPNPropList#last_.; |
| 4707 | |
| 4708 | /* number of properties in the list */ |
| 4709 | int cnt_cxx . . $ CTPNPropList#cnt_.; |
| 4710 | |
| 4711 | private: |
| 4712 | /* next destination for append() */ |
| 4713 | class CTPNObjPropcxx . . $ CTPNObjProp# **dst_cxx . . $ CTPNPropList#dst_.; |
| 4714 | }; |
| 4715 | |
| 4716 | |
| 4717 | /* ------------------------------------------------------------------------ */ |
| 4718 | /* |
| 4719 | * Mix-in base for an object definer node. This is instantiated in the |
| 4720 | * top-level object statement class (CTPNStmObject) and the in-line object |
| 4721 | * definition expression node (CTPNInlineObject). |
| 4722 | */ |
| 4723 | class CTPNObjDefcxx . . $ CTPNObjDef# |
| 4724 | { |
| 4725 | public: |
| 4726 | CTPNObjDefcxx . . $ CTPNObjDef#CTPNObjDef(49f6e7a06ebc5aa8).() |
| 4727 | { |
| 4728 | /* presume there's no object symbol */ |
| 4729 | obj_sym_cxx . . $ CTPNObjDef#obj_sym_. = 0; |
| 4730 | |
| 4731 | /* presume we won't have an undescribed superclass */ |
| 4732 | undesc_sc_cxx . . $ CTPNObjDef#undesc_sc_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 4733 | |
| 4734 | /* presume we won't have a template usage error */ |
| 4735 | bad_template_cxx . . $ CTPNObjDef#bad_template_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 4736 | } |
| 4737 | |
| 4738 | /* is this a regular object or an inline object? */ |
| 4739 | virtual int is_inline_objectcxx . . $ CTPNObjDef#is_inline_object(455f465bc33b4cdf).() const = 0; |
| 4740 | |
| 4741 | /* set the 'undescribed class' flag */ |
| 4742 | int has_undesc_sccxx . . $ CTPNObjDef#has_undesc_sc(455f465bc33b4cdf).() const { return undesc_sc_cxx . . $ CTPNObjDef#undesc_sc_.; } |
| 4743 | void set_undesc_sccxx . . $ CTPNObjDef#set_undesc_sc(d4f767463ce0a6b3).(int f) { undesc_sc_cxx . . $ CTPNObjDef#undesc_sc_. = f; } |
| 4744 | |
| 4745 | /* get/set the 'bad template' flag */ |
| 4746 | int has_bad_templatecxx . . $ CTPNObjDef#has_bad_template(455f465bc33b4cdf).() const { return bad_template_cxx . . $ CTPNObjDef#bad_template_.; } |
| 4747 | void note_bad_templatecxx . . $ CTPNObjDef#note_bad_template(d4f767463ce0a6b3).(int f) { bad_template_cxx . . $ CTPNObjDef#bad_template_. = f; } |
| 4748 | |
| 4749 | /* add a property value */ |
| 4750 | class CTPNObjPropcxx . . $ CTPNObjProp# *add_propcxx . . $ CTPNObjDef#add_prop(daed4fe6e941d361).( |
| 4751 | class CTcSymPropcxx . . $ CTcSymProp# *prop_sym, class CTcPrsNodecxx . . $ CTcPrsNode# *expr, |
| 4752 | int replace, int is_static); |
| 4753 | |
| 4754 | /* |
| 4755 | * Add a method. 'expr' is the original expression for cases where the |
| 4756 | * code body is derived from a simple expression in the source code |
| 4757 | * rather than an explicit code block. Keeping the original expression |
| 4758 | * allows us to use a simple constant value if the expression ends up |
| 4759 | * folding to a constant. |
| 4760 | */ |
| 4761 | class CTPNObjPropcxx . . $ CTPNObjProp# *add_methodcxx . . $ CTPNObjDef#add_method(1818e6370d75b44a).( |
| 4762 | class CTcSymPropcxx . . $ CTcSymProp# *prop_sym, class CTPNCodeBodycxx . . $ CTPNCodeBody# *code_body, |
| 4763 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr, int replace); |
| 4764 | |
| 4765 | /* |
| 4766 | * Add a method to an inline object. The method in this case is |
| 4767 | * represented as an anonymous method object. 'expr' is the original |
| 4768 | * expression for cases where the anonymous function is derived from a |
| 4769 | * simple expression in the source code rather than an explicit code |
| 4770 | * block. |
| 4771 | */ |
| 4772 | class CTPNObjPropcxx . . $ CTPNObjProp# *add_inline_methodcxx . . $ CTPNObjDef#add_inline_method(8e7532ec18a19e80).( |
| 4773 | class CTcSymPropcxx . . $ CTcSymProp# *prop_sym, class CTPNAnonFunccxx . . $ CTPNAnonFunc# *inline_method, |
| 4774 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr, int replace); |
| 4775 | |
| 4776 | /* add a property as a nested object value */ |
| 4777 | virtual int parse_nested_obj_propcxx . . $ CTPNObjDef#parse_nested_obj_prop(78b3e2e2ab418d31).( |
| 4778 | class CTPNObjPropcxx . . $ CTPNObjProp#* &new_prop, int *err, |
| 4779 | struct tcprs_term_infocxx . . $ tcprs_term_info# *term_info, |
| 4780 | const class CTcTokencxx . . $ CTcToken# *prop_tok, int replace) = 0; |
| 4781 | |
| 4782 | /* delete a property */ |
| 4783 | virtual void delete_propertycxx . . $ CTPNObjDef#delete_property(3e679d9e5d4f99b2).(class CTcSymPropcxx . . $ CTcSymProp# *prop_sym) |
| 4784 | { proplist_cxx . . $ CTPNObjDef#proplist_..delcxx . . $ CTPNPropList#del(28af09f9ca84002d).(prop_sym); } |
| 4785 | |
| 4786 | /* get my superclass list */ |
| 4787 | CTPNSuperclassListcxx . . $ CTPNSuperclassList# &get_superclass_listcxx . . $ CTPNObjDef#get_superclass_list(a63b4b499709eb8a).() { return sclist_cxx . . $ CTPNObjDef#sclist_.; } |
| 4788 | |
| 4789 | /* get my first superclass */ |
| 4790 | class CTPNSuperclasscxx . . $ CTPNSuperclass# *get_first_sccxx . . $ CTPNObjDef#get_first_sc(e0c9c37a8c357c8e).() const { return sclist_cxx . . $ CTPNObjDef#sclist_..head_cxx . . $ CTPNSuperclassList#head_.; } |
| 4791 | |
| 4792 | /* get my first property */ |
| 4793 | class CTPNObjPropcxx . . $ CTPNObjProp# *get_first_propcxx . . $ CTPNObjDef#get_first_prop(c5ca4cc71e6ff1ff).() const { return proplist_cxx . . $ CTPNObjDef#proplist_..first_cxx . . $ CTPNPropList#first_.; } |
| 4794 | |
| 4795 | /* get the object symbol */ |
| 4796 | class CTcSymObjcxx . . $ CTcSymObj# *get_obj_symcxx . . $ CTPNObjDef#get_obj_sym(8b0e43bb7c20f05b).() const { return obj_sym_cxx . . $ CTPNObjDef#obj_sym_.; } |
| 4797 | |
| 4798 | /* |
| 4799 | * set my object symbol - when an object is modified (via the 'modify' |
| 4800 | * statement), the object tree can be moved to a new symbol |
| 4801 | */ |
| 4802 | void set_obj_symcxx . . $ CTPNObjDef#set_obj_sym(1d808c2b1231e833).(class CTcSymObjcxx . . $ CTcSymObj# *obj_sym) { obj_sym_cxx . . $ CTPNObjDef#obj_sym_. = obj_sym; } |
| 4803 | |
| 4804 | /* fold constants in the property list */ |
| 4805 | void fold_proplistcxx . . $ CTPNObjDef#fold_proplist(c962e9a9c00d44f1).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 4806 | |
| 4807 | protected: |
| 4808 | /* add an entry to my property list */ |
| 4809 | virtual void add_prop_entrycxx . . $ CTPNObjDef#add_prop_entry(e176e8f914f8182e).(class CTPNObjPropcxx . . $ CTPNObjProp# *prop, int /*replace*/) |
| 4810 | { proplist_cxx . . $ CTPNObjDef#proplist_..appendcxx . . $ CTPNPropList#append(5fc49430c98251b2).(prop); } |
| 4811 | |
| 4812 | /* object name symbol */ |
| 4813 | class CTcSymObjcxx . . $ CTcSymObj# *obj_sym_cxx . . $ CTPNObjDef#obj_sym_.; |
| 4814 | |
| 4815 | /* property list */ |
| 4816 | CTPNPropListcxx . . $ CTPNPropList# proplist_cxx . . $ CTPNObjDef#proplist_.; |
| 4817 | |
| 4818 | /* superclass list */ |
| 4819 | CTPNSuperclassListcxx . . $ CTPNSuperclassList# sclist_cxx . . $ CTPNObjDef#sclist_.; |
| 4820 | |
| 4821 | /* |
| 4822 | * Flag: this object definition includes an undescribed superclass. |
| 4823 | * This indicates that we're based on a class that was explicitly |
| 4824 | * defined as 'extern', in which case it can't be used as the source of |
| 4825 | * a template, since we know nothing about the class other than that it |
| 4826 | * is indeed a class. |
| 4827 | */ |
| 4828 | unsigned int undesc_sc_cxx . . $ CTPNObjDef#undesc_sc_. : 1; |
| 4829 | |
| 4830 | /* flag: this object definition used a template that wasn't matched */ |
| 4831 | unsigned int bad_template_cxx . . $ CTPNObjDef#bad_template_. : 1; |
| 4832 | }; |
| 4833 | |
| 4834 | |
| 4835 | /* ------------------------------------------------------------------------ */ |
| 4836 | /* |
| 4837 | * object definition statement base class |
| 4838 | */ |
| 4839 | class CTPNStmObjectBasecxx . . $ CTPNStmObjectBase#: public CTPNStmTopcxx . . $ CTPNStmTop#, public CTPNObjDefcxx . . $ CTPNObjDef# |
| 4840 | { |
| 4841 | public: |
| 4842 | CTPNStmObjectBasecxx . . $ CTPNStmObjectBase#CTPNStmObjectBase(4091a0efa0d028c1).(class CTcSymObjcxx . . $ CTcSymObj# *obj_sym, int is_class) |
| 4843 | { |
| 4844 | /* remember our defining global symbol */ |
| 4845 | obj_sym_cxx . . $ CTPNObjDef#obj_sym_. = obj_sym; |
| 4846 | |
| 4847 | /* we're not yet replaced by another object */ |
| 4848 | replaced_cxx . . $ CTPNStmObjectBase#replaced_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 4849 | |
| 4850 | /* we're not yet modified */ |
| 4851 | modified_cxx . . $ CTPNStmObjectBase#modified_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 4852 | |
| 4853 | /* note whether I'm a class or an ordinary object instance */ |
| 4854 | is_class_cxx . . $ CTPNStmObjectBase#is_class_. = is_class; |
| 4855 | |
| 4856 | /* presume it's not transient */ |
| 4857 | transient_cxx . . $ CTPNStmObjectBase#transient_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 4858 | } |
| 4859 | |
| 4860 | /* this is a regular top-level object definition */ |
| 4861 | virtual int is_inline_objectcxx . . $ CTPNStmObjectBase#is_inline_object(455f465bc33b4cdf).() const { return FALSEcxx . . $ `tads3/t3std.h:336:10`!; } |
| 4862 | |
| 4863 | /* |
| 4864 | * mark the object as replaced - this indicates that another object |
| 4865 | * in the same translation unit has replaced this object, hence we |
| 4866 | * should not generate any code for this object |
| 4867 | */ |
| 4868 | void set_replacedcxx . . $ CTPNStmObjectBase#set_replaced(d4f767463ce0a6b3).(int f) { replaced_cxx . . $ CTPNStmObjectBase#replaced_. = f; } |
| 4869 | |
| 4870 | /* |
| 4871 | * Mark the object as modified - this indicates that another object |
| 4872 | * in the same translation unit has modified this object. We'll |
| 4873 | * store this information in the object stream header data for use |
| 4874 | * at link time. |
| 4875 | */ |
| 4876 | void set_modifiedcxx . . $ CTPNStmObjectBase#set_modified(d4f767463ce0a6b3).(int f) { modified_cxx . . $ CTPNStmObjectBase#modified_. = f; } |
| 4877 | |
| 4878 | /* add a superclass with the given name or symbol */ |
| 4879 | void add_superclasscxx . . $ CTPNStmObjectBase#add_superclass(cf347308e962de74).(const class CTcTokencxx . . $ CTcToken# *tok); |
| 4880 | void add_superclasscxx . . $ CTPNStmObjectBase#add_superclass(3ddcefa113cb28cb).(class CTcSymbolcxx . . $ CTcSymbol# *sym); |
| 4881 | |
| 4882 | /* determine if I'm a class object */ |
| 4883 | int is_classcxx . . $ CTPNStmObjectBase#is_class(455f465bc33b4cdf).() const { return (is_class_cxx . . $ CTPNStmObjectBase#is_class_. != 0); } |
| 4884 | |
| 4885 | /* |
| 4886 | * Delete a property value. This is used when a 'modify' object |
| 4887 | * defines a property with 'replace', so that the property defined in |
| 4888 | * the modified original object is removed entirely rather than left in |
| 4889 | * as an inherited property. |
| 4890 | */ |
| 4891 | virtual void delete_propertycxx . . $ CTPNStmObjectBase#delete_property(3e679d9e5d4f99b2).(class CTcSymPropcxx . . $ CTcSymProp# *prop_sym); |
| 4892 | |
| 4893 | /* |
| 4894 | * Add an implicit constructor. This should be called just before |
| 4895 | * code generation; we'll check to see if the object requires an |
| 4896 | * implicit constructor, and add one to the object if so. An object |
| 4897 | * provides an implicit constructor if it has multiple superclasses |
| 4898 | * and no explicit constructor. |
| 4899 | */ |
| 4900 | void add_implicit_constructorcxx . . $ CTPNStmObjectBase#add_implicit_constructor(49f6e7a06ebc5aa8).(); |
| 4901 | |
| 4902 | /* get/set the 'transient' status */ |
| 4903 | int is_transientcxx . . $ CTPNStmObjectBase#is_transient(455f465bc33b4cdf).() const { return transient_cxx . . $ CTPNStmObjectBase#transient_.; } |
| 4904 | void set_transientcxx . . $ CTPNStmObjectBase#set_transient(49f6e7a06ebc5aa8).() { transient_cxx . . $ CTPNStmObjectBase#transient_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 4905 | |
| 4906 | /* add a property as a nested object value */ |
| 4907 | virtual int parse_nested_obj_propcxx . . $ CTPNStmObjectBase#parse_nested_obj_prop(78b3e2e2ab418d31).( |
| 4908 | class CTPNObjPropcxx . . $ CTPNObjProp#* &new_prop, int *err, |
| 4909 | struct tcprs_term_infocxx . . $ tcprs_term_info# *term_info, |
| 4910 | const class CTcTokencxx . . $ CTcToken# *prop_tok, int replace); |
| 4911 | |
| 4912 | /* fold constants */ |
| 4913 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmObjectBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 4914 | { |
| 4915 | CTPNObjDefcxx . . $ CTPNObjDef#::fold_proplistcxx . . $ CTPNObjDef#fold_proplist(c962e9a9c00d44f1).(symtab); |
| 4916 | return this; |
| 4917 | } |
| 4918 | |
| 4919 | protected: |
| 4920 | /* add an entry to my property list */ |
| 4921 | virtual void add_prop_entrycxx . . $ CTPNStmObjectBase#add_prop_entry(e176e8f914f8182e).(class CTPNObjPropcxx . . $ CTPNObjProp# *prop, int replace); |
| 4922 | |
| 4923 | /* flag: I'm a class */ |
| 4924 | unsigned int is_class_cxx . . $ CTPNStmObjectBase#is_class_. : 1; |
| 4925 | |
| 4926 | /* flag: I've been replaced by another object */ |
| 4927 | unsigned int replaced_cxx . . $ CTPNStmObjectBase#replaced_. : 1; |
| 4928 | |
| 4929 | /* flag: I've been modified by another object */ |
| 4930 | unsigned int modified_cxx . . $ CTPNStmObjectBase#modified_. : 1; |
| 4931 | |
| 4932 | /* flag: the object is transient */ |
| 4933 | unsigned int transient_cxx . . $ CTPNStmObjectBase#transient_. : 1; |
| 4934 | }; |
| 4935 | |
| 4936 | /* ------------------------------------------------------------------------ */ |
| 4937 | /* |
| 4938 | * In-line object definition. This represents an object defined in-line as |
| 4939 | * part of an expression. This type of object definition creates a new |
| 4940 | * instance of the specified object when the expression is evaluated, using |
| 4941 | * anonymous methods for code properties. (Anonymous methods are the same |
| 4942 | * as anonymous functions, aka closures, except that they bind only to the |
| 4943 | * local variables in the lexically enclosing frame but not to the 'self' |
| 4944 | * context.) Using anonymous methods allows methods defined in the object |
| 4945 | * to read and write the lexically enclosing frame's local variables, so |
| 4946 | * that the entire object acts like a closure. |
| 4947 | */ |
| 4948 | class CTPNInlineObjectBasecxx . . $ CTPNInlineObjectBase#: public CTcPrsNodecxx . . $ CTcPrsNode#, public CTPNObjDefcxx . . $ CTPNObjDef# |
| 4949 | { |
| 4950 | public: |
| 4951 | /* fold constants */ |
| 4952 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNInlineObjectBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab) |
| 4953 | { |
| 4954 | CTPNObjDefcxx . . $ CTPNObjDef#::fold_proplistcxx . . $ CTPNObjDef#fold_proplist(c962e9a9c00d44f1).(symtab); |
| 4955 | return this; |
| 4956 | } |
| 4957 | |
| 4958 | /* this is an inline object definition */ |
| 4959 | virtual int is_inline_objectcxx . . $ CTPNInlineObjectBase#is_inline_object(455f465bc33b4cdf).() const { return TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 4960 | |
| 4961 | /* parse a nested object property */ |
| 4962 | virtual int parse_nested_obj_propcxx . . $ CTPNInlineObjectBase#parse_nested_obj_prop(78b3e2e2ab418d31).( |
| 4963 | class CTPNObjPropcxx . . $ CTPNObjProp#* &new_prop, int *err, |
| 4964 | struct tcprs_term_infocxx . . $ tcprs_term_info# *term_info, |
| 4965 | const class CTcTokencxx . . $ CTcToken# *prop_tok, int replace); |
| 4966 | |
| 4967 | /* adjust for dynamic execution */ |
| 4968 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNInlineObjectBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 4969 | }; |
| 4970 | |
| 4971 | /* ------------------------------------------------------------------------ */ |
| 4972 | /* |
| 4973 | * Parse node entry for a property value or method entry in an object |
| 4974 | * definition statement's property list. We can have either an |
| 4975 | * expression entry or a code body entry; we keep open the possibility |
| 4976 | * of either one in this single class (rather than subclassing for the |
| 4977 | * two possibilities) because we might have to transform from an |
| 4978 | * expression to a code body if we find a non-constant expression, which |
| 4979 | * we can't determine until constant-folding time. |
| 4980 | */ |
| 4981 | class CTPNObjPropBasecxx . . $ CTPNObjPropBase#: public CTPNStmcxx . . $ CTPNStm# |
| 4982 | { |
| 4983 | friend class CTPNObjDefcxx . . $ CTPNObjDef#; |
| 4984 | friend class CTPNStmObjectBasecxx . . $ CTPNStmObjectBase#; |
| 4985 | friend class CTPNStmObjectcxx . . $ CTPNStmObject#; |
| 4986 | friend class CTPNPropListcxx . . $ CTPNPropList#; |
| 4987 | |
| 4988 | public: |
| 4989 | CTPNObjPropBasecxx . . $ CTPNObjPropBase#CTPNObjPropBase(d868fa34d2c18ad3).(class CTPNObjDefcxx . . $ CTPNObjDef# *objdef, class CTcSymPropcxx . . $ CTcSymProp# *prop_sym, |
| 4990 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr, class CTPNCodeBodycxx . . $ CTPNCodeBody# *code_body, |
| 4991 | class CTPNAnonFunccxx . . $ CTPNAnonFunc# *inline_method, int is_static) |
| 4992 | { |
| 4993 | /* remember the object and property information */ |
| 4994 | objdef_cxx . . $ CTPNObjPropBase#objdef_. = objdef; |
| 4995 | prop_sym_cxx . . $ CTPNObjPropBase#prop_sym_. = prop_sym; |
| 4996 | |
| 4997 | /* not in a property list yet */ |
| 4998 | nxt_cxx . . $ CTPNObjPropBase#nxt_. = 0; |
| 4999 | |
| 5000 | /* remember our expression and code body values */ |
| 5001 | expr_cxx . . $ CTPNObjPropBase#expr_. = expr; |
| 5002 | code_body_cxx . . $ CTPNObjPropBase#code_body_. = code_body; |
| 5003 | inline_method_cxx . . $ CTPNObjPropBase#inline_method_. = inline_method; |
| 5004 | |
| 5005 | /* remember if it's static */ |
| 5006 | is_static_cxx . . $ CTPNObjPropBase#is_static_. = is_static; |
| 5007 | |
| 5008 | /* by default, properties cannot be overwritten with redefinitions */ |
| 5009 | is_overwritable_cxx . . $ CTPNObjPropBase#is_overwritable_. = FALSEcxx . . $ `tads3/t3std.h:336:10`!; |
| 5010 | } |
| 5011 | |
| 5012 | /* get my property symbol */ |
| 5013 | class CTcSymPropcxx . . $ CTcSymProp# *get_prop_symcxx . . $ CTPNObjPropBase#get_prop_sym(d265586021cb45c7).() const { return prop_sym_cxx . . $ CTPNObjPropBase#prop_sym_.; } |
| 5014 | |
| 5015 | /* fold constants */ |
| 5016 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNObjPropBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab); |
| 5017 | |
| 5018 | /* adjust for dynamic execution */ |
| 5019 | class CTcPrsNodecxx . . $ CTcPrsNode# *adjust_for_dyncxx . . $ CTPNObjPropBase#adjust_for_dyn(a690a7dea3c3d74b).(const tcpn_dyncomp_infocxx . . $ tcpn_dyncomp_info# *info); |
| 5020 | |
| 5021 | /* get the next property of this object */ |
| 5022 | class CTPNObjPropcxx . . $ CTPNObjProp# *get_next_propcxx . . $ CTPNObjPropBase#get_next_prop(c5ca4cc71e6ff1ff).() const { return nxt_cxx . . $ CTPNObjPropBase#nxt_.; } |
| 5023 | |
| 5024 | /* am I a constructor? */ |
| 5025 | int is_constructorcxx . . $ CTPNObjPropBase#is_constructor(455f465bc33b4cdf).() const; |
| 5026 | |
| 5027 | /* |
| 5028 | * Set/get flag indicating that we're overwritable. An overwritable |
| 5029 | * property can be superseded with a duplicate definition of the same |
| 5030 | * property in the same object. By default, it's an error to define |
| 5031 | * the same property more than once in the same object, but properties |
| 5032 | * defined with certain implicit notation can be overwritten with an |
| 5033 | * explicit redefinition. Specifically, a 'location' property added |
| 5034 | * with the '+' notation can be overwritten, and the automatic |
| 5035 | * 'sourceTextOrder' and 'sourceTextGroup' properties can be |
| 5036 | * overwritten. |
| 5037 | */ |
| 5038 | int is_overwritablecxx . . $ CTPNObjPropBase#is_overwritable(455f465bc33b4cdf).() const { return is_overwritable_cxx . . $ CTPNObjPropBase#is_overwritable_.; } |
| 5039 | void set_overwritablecxx . . $ CTPNObjPropBase#set_overwritable(49f6e7a06ebc5aa8).() { is_overwritable_cxx . . $ CTPNObjPropBase#is_overwritable_. = TRUEcxx . . $ `tads3/t3std.h:333:10`!; } |
| 5040 | |
| 5041 | protected: |
| 5042 | /* my object statement */ |
| 5043 | class CTPNObjDefcxx . . $ CTPNObjDef# *objdef_cxx . . $ CTPNObjPropBase#objdef_.; |
| 5044 | |
| 5045 | /* my property symbol */ |
| 5046 | class CTcSymPropcxx . . $ CTcSymProp# *prop_sym_cxx . . $ CTPNObjPropBase#prop_sym_.; |
| 5047 | |
| 5048 | /* next property in my list */ |
| 5049 | class CTPNObjPropcxx . . $ CTPNObjProp# *nxt_cxx . . $ CTPNObjPropBase#nxt_.; |
| 5050 | |
| 5051 | /* my value expression */ |
| 5052 | class CTcPrsNodecxx . . $ CTcPrsNode# *expr_cxx . . $ CTPNObjPropBase#expr_.; |
| 5053 | |
| 5054 | /* symbol table in effect for this expression */ |
| 5055 | class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *symtab_cxx . . $ CTPNObjPropBase#symtab_.; |
| 5056 | |
| 5057 | /* my code body node */ |
| 5058 | class CTPNCodeBodycxx . . $ CTPNCodeBody# *code_body_cxx . . $ CTPNObjPropBase#code_body_.; |
| 5059 | |
| 5060 | /* for in-line objects, code is represented as an anonymous method */ |
| 5061 | class CTPNAnonFunccxx . . $ CTPNAnonFunc# *inline_method_cxx . . $ CTPNObjPropBase#inline_method_.; |
| 5062 | |
| 5063 | /* am I static? */ |
| 5064 | unsigned int is_static_cxx . . $ CTPNObjPropBase#is_static_. : 1; |
| 5065 | |
| 5066 | /* am I overwritable? */ |
| 5067 | unsigned int is_overwritable_cxx . . $ CTPNObjPropBase#is_overwritable_. : 1; |
| 5068 | }; |
| 5069 | |
| 5070 | /* |
| 5071 | * Deleted property object. This is used for an entry in a deleted |
| 5072 | * property list for a 'modify' object. |
| 5073 | */ |
| 5074 | class CTcObjPropDelcxx . . $ CTcObjPropDel#: public CTcPrsAllocObjcxx . . $ CTcPrsAllocObj# |
| 5075 | { |
| 5076 | public: |
| 5077 | CTcObjPropDelcxx . . $ CTcObjPropDel#CTcObjPropDel(3e679d9e5d4f99b2).(class CTcSymPropcxx . . $ CTcSymProp# *prop_sym) |
| 5078 | { |
| 5079 | /* save the property information */ |
| 5080 | prop_sym_cxx . . $ CTcObjPropDel#prop_sym_. = prop_sym; |
| 5081 | |
| 5082 | /* not in a list yet */ |
| 5083 | nxt_cxx . . $ CTcObjPropDel#nxt_. = 0; |
| 5084 | } |
| 5085 | |
| 5086 | /* the property to delete */ |
| 5087 | class CTcSymPropcxx . . $ CTcSymProp# *prop_sym_cxx . . $ CTcObjPropDel#prop_sym_.; |
| 5088 | |
| 5089 | /* next in list */ |
| 5090 | CTcObjPropDelcxx . . $ CTcObjPropDel# *nxt_cxx . . $ CTcObjPropDel#nxt_.; |
| 5091 | }; |
| 5092 | |
| 5093 | /* |
| 5094 | * Implicit constructor statement. |
| 5095 | */ |
| 5096 | class CTPNStmImplicitCtorBasecxx . . $ CTPNStmImplicitCtorBase#: public CTPNStmcxx . . $ CTPNStm# |
| 5097 | { |
| 5098 | public: |
| 5099 | CTPNStmImplicitCtorBasecxx . . $ CTPNStmImplicitCtorBase#CTPNStmImplicitCtorBase(28fc1443acde4d6f).(class CTPNStmObjectcxx . . $ CTPNStmObject# *obj_stm) |
| 5100 | { |
| 5101 | /* remember my object statement */ |
| 5102 | obj_stm_cxx . . $ CTPNStmImplicitCtorBase#obj_stm_. = obj_stm; |
| 5103 | } |
| 5104 | |
| 5105 | /* fold constants */ |
| 5106 | class CTcPrsNodecxx . . $ CTcPrsNode# *fold_constantscxx . . $ CTPNStmImplicitCtorBase#fold_constants(ec2152be3a5a18d3).(class CTcPrsSymtabcxx . . $ CTcPrsSymtab# *) { return this; } |
| 5107 | |
| 5108 | protected: |
| 5109 | /* my object statement */ |
| 5110 | class CTPNStmObjectcxx . . $ CTPNStmObject# *obj_stm_cxx . . $ CTPNStmImplicitCtorBase#obj_stm_.; |
| 5111 | }; |
| 5112 | |
| 5113 | #endif /* TCPNDRV_H */ |
| 5114 |