compiler/libec: (#307, #70) Warning on undeclared class; Overriding namespaces
[sdk] / compiler / bootstrap / libec / bootstrap / copy.c
1 /* Code generated from eC source file: copy.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #include <stdint.h>
39 #include <sys/types.h>
40 struct __ecereNameSpace__ecere__sys__OldList
41 {
42 void *  first;
43 void *  last;
44 int count;
45 unsigned int offset;
46 unsigned int circ;
47 } __attribute__ ((gcc_struct));
48
49 struct __ecereNameSpace__ecere__sys__BTNode;
50
51 struct __ecereNameSpace__ecere__com__DataValue
52 {
53 union
54 {
55 char c;
56 unsigned char uc;
57 short s;
58 unsigned short us;
59 int i;
60 unsigned int ui;
61 void *  p;
62 float f;
63 double d;
64 long long i64;
65 uint64 ui64;
66 } __attribute__ ((gcc_struct)) __anon1;
67 } __attribute__ ((gcc_struct));
68
69 struct __ecereNameSpace__ecere__com__SerialBuffer
70 {
71 unsigned char *  _buffer;
72 unsigned int count;
73 unsigned int _size;
74 unsigned int pos;
75 } __attribute__ ((gcc_struct));
76
77 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
78
79 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
80
81 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
82
83 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
84
85 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
86
87 struct CodePosition
88 {
89 int line;
90 int charPos;
91 int pos;
92 int included;
93 } __attribute__ ((gcc_struct));
94
95 struct Context;
96
97 struct TemplateParameter;
98
99 struct ClassFunction;
100
101 struct External;
102
103 struct ModuleImport;
104
105 struct ClassImport;
106
107 struct PropertyDef;
108
109 struct PropertyWatch;
110
111 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
112
113 struct __ecereNameSpace__ecere__com__GlobalFunction;
114
115 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
116
117 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
118
119 struct Location
120 {
121 struct CodePosition start;
122 struct CodePosition end;
123 } __attribute__ ((gcc_struct));
124
125 struct Attrib
126 {
127 struct Location loc;
128 int type;
129 struct __ecereNameSpace__ecere__sys__OldList *  attribs;
130 } __attribute__ ((gcc_struct));
131
132 struct ExtDecl
133 {
134 struct Location loc;
135 int type;
136 union
137 {
138 char * s;
139 struct Attrib * attr;
140 } __attribute__ ((gcc_struct)) __anon1;
141 } __attribute__ ((gcc_struct));
142
143 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
144
145 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
146
147 extern struct ExtDecl * MkExtDeclString(char * s);
148
149 struct __ecereNameSpace__ecere__com__Class;
150
151 struct __ecereNameSpace__ecere__com__Instance
152 {
153 void * *  _vTbl;
154 struct __ecereNameSpace__ecere__com__Class * _class;
155 int _refCount;
156 } __attribute__ ((gcc_struct));
157
158 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
159
160 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
161
162 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
163
164 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
165
166 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
167
168 struct __ecereNameSpace__ecere__com__Property;
169
170 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
171
172 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
173
174 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
175
176 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
177
178 struct Identifier;
179
180 extern struct Identifier * MkIdentifier(const char *  string);
181
182 struct Expression;
183
184 extern struct Expression * MkExpDummy(void);
185
186 extern struct Expression * MkExpIdentifier(struct Identifier * id);
187
188 extern struct Expression * MkExpConstant(const char *  string);
189
190 extern struct Expression * MkExpString(const char *  string);
191
192 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
193
194 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
195
196 extern struct Expression * MkExpIndex(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * index);
197
198 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
199
200 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
201
202 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
203
204 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
205
206 struct Symbol;
207
208 extern struct Symbol * FindClass(const char *  name);
209
210 struct Declaration;
211
212 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
213
214 struct Specifier;
215
216 struct Identifier
217 {
218 struct Identifier * prev;
219 struct Identifier * next;
220 struct Location loc;
221 struct Symbol * classSym;
222 struct Specifier * _class;
223 char *  string;
224 struct Identifier * badID;
225 } __attribute__ ((gcc_struct));
226
227 struct Specifier
228 {
229 struct Specifier * prev;
230 struct Specifier * next;
231 struct Location loc;
232 int type;
233 union
234 {
235 int specifier;
236 struct
237 {
238 struct ExtDecl * extDecl;
239 char *  name;
240 struct Symbol * symbol;
241 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
242 struct Specifier * nsSpec;
243 } __attribute__ ((gcc_struct)) __anon1;
244 struct
245 {
246 struct Identifier * id;
247 struct __ecereNameSpace__ecere__sys__OldList *  list;
248 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
249 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
250 unsigned int addNameSpace;
251 struct Context * ctx;
252 struct ExtDecl * extDeclStruct;
253 } __attribute__ ((gcc_struct)) __anon2;
254 struct Expression * expression;
255 struct Specifier * _class;
256 struct TemplateParameter * templateParameter;
257 } __attribute__ ((gcc_struct)) __anon1;
258 } __attribute__ ((gcc_struct));
259
260 extern struct Specifier * MkSpecifier(int specifier);
261
262 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
263
264 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
265
266 extern struct Specifier * MkSpecifierSubClass(struct Specifier * _class);
267
268 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
269
270 struct Declarator;
271
272 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
273
274 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
275
276 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
277
278 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
279
280 extern struct Declarator * MkDeclaratorEnumArray(struct Declarator * declarator, struct Specifier * _class);
281
282 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
283
284 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
285
286 extern struct Declarator * MkDeclaratorExtended(struct ExtDecl * extended, struct Declarator * declarator);
287
288 extern struct Declarator * MkDeclaratorExtendedEnd(struct ExtDecl * extended, struct Declarator * declarator);
289
290 struct __ecereNameSpace__ecere__sys__Item;
291
292 struct __ecereNameSpace__ecere__sys__Item
293 {
294 struct __ecereNameSpace__ecere__sys__Item * prev;
295 struct __ecereNameSpace__ecere__sys__Item * next;
296 } __attribute__ ((gcc_struct));
297
298 struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void *))
299 {
300 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
301
302 if(source)
303 {
304 struct __ecereNameSpace__ecere__sys__Item * item;
305
306 list = MkList();
307 for(item = (*source).first; item; item = item->next)
308 ListAdd(list, CopyFunction(item));
309 }
310 return list;
311 }
312
313 struct Pointer;
314
315 struct Pointer
316 {
317 struct Pointer * prev;
318 struct Pointer * next;
319 struct Location loc;
320 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
321 struct Pointer * pointer;
322 } __attribute__ ((gcc_struct));
323
324 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
325
326 struct Declarator
327 {
328 struct Declarator * prev;
329 struct Declarator * next;
330 struct Location loc;
331 int type;
332 struct Symbol * symbol;
333 struct Declarator * declarator;
334 union
335 {
336 struct Identifier * identifier;
337 struct
338 {
339 struct Expression * exp;
340 struct Expression * posExp;
341 struct Attrib * attrib;
342 } __attribute__ ((gcc_struct)) structDecl;
343 struct
344 {
345 struct Expression * exp;
346 struct Specifier * enumClass;
347 } __attribute__ ((gcc_struct)) array;
348 struct
349 {
350 struct __ecereNameSpace__ecere__sys__OldList * parameters;
351 } __attribute__ ((gcc_struct)) function;
352 struct
353 {
354 struct Pointer * pointer;
355 } __attribute__ ((gcc_struct)) pointer;
356 struct
357 {
358 struct ExtDecl * extended;
359 } __attribute__ ((gcc_struct)) extended;
360 } __attribute__ ((gcc_struct)) __anon1;
361 } __attribute__ ((gcc_struct));
362
363 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
364
365 struct Initializer;
366
367 struct Initializer
368 {
369 struct Initializer * prev;
370 struct Initializer * next;
371 struct Location loc;
372 int type;
373 union
374 {
375 struct Expression * exp;
376 struct __ecereNameSpace__ecere__sys__OldList *  list;
377 } __attribute__ ((gcc_struct)) __anon1;
378 unsigned int isConstant;
379 struct Identifier * id;
380 } __attribute__ ((gcc_struct));
381
382 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
383
384 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
385
386 struct MembersInit;
387
388 struct MembersInit
389 {
390 struct MembersInit * prev;
391 struct MembersInit * next;
392 struct Location loc;
393 int type;
394 union
395 {
396 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
397 struct ClassFunction * function;
398 } __attribute__ ((gcc_struct)) __anon1;
399 } __attribute__ ((gcc_struct));
400
401 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
402
403 struct Statement;
404
405 extern struct Expression * MkExpExtensionCompound(struct Statement * compound);
406
407 struct Statement
408 {
409 struct Statement * prev;
410 struct Statement * next;
411 struct Location loc;
412 int type;
413 union
414 {
415 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
416 struct
417 {
418 struct Identifier * id;
419 struct Statement * stmt;
420 } __attribute__ ((gcc_struct)) labeled;
421 struct
422 {
423 struct Expression * exp;
424 struct Statement * stmt;
425 } __attribute__ ((gcc_struct)) caseStmt;
426 struct
427 {
428 struct __ecereNameSpace__ecere__sys__OldList * declarations;
429 struct __ecereNameSpace__ecere__sys__OldList * statements;
430 struct Context * context;
431 unsigned int isSwitch;
432 } __attribute__ ((gcc_struct)) compound;
433 struct
434 {
435 struct __ecereNameSpace__ecere__sys__OldList * exp;
436 struct Statement * stmt;
437 struct Statement * elseStmt;
438 } __attribute__ ((gcc_struct)) ifStmt;
439 struct
440 {
441 struct __ecereNameSpace__ecere__sys__OldList * exp;
442 struct Statement * stmt;
443 } __attribute__ ((gcc_struct)) switchStmt;
444 struct
445 {
446 struct __ecereNameSpace__ecere__sys__OldList * exp;
447 struct Statement * stmt;
448 } __attribute__ ((gcc_struct)) whileStmt;
449 struct
450 {
451 struct __ecereNameSpace__ecere__sys__OldList * exp;
452 struct Statement * stmt;
453 } __attribute__ ((gcc_struct)) doWhile;
454 struct
455 {
456 struct Statement * init;
457 struct Statement * check;
458 struct __ecereNameSpace__ecere__sys__OldList * increment;
459 struct Statement * stmt;
460 } __attribute__ ((gcc_struct)) forStmt;
461 struct
462 {
463 struct Identifier * id;
464 } __attribute__ ((gcc_struct)) gotoStmt;
465 struct
466 {
467 struct Specifier * spec;
468 char * statements;
469 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
470 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
471 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
472 } __attribute__ ((gcc_struct)) asmStmt;
473 struct
474 {
475 struct Expression * watcher;
476 struct Expression * object;
477 struct __ecereNameSpace__ecere__sys__OldList * watches;
478 } __attribute__ ((gcc_struct)) _watch;
479 struct
480 {
481 struct Identifier * id;
482 struct __ecereNameSpace__ecere__sys__OldList * exp;
483 struct __ecereNameSpace__ecere__sys__OldList * filter;
484 struct Statement * stmt;
485 } __attribute__ ((gcc_struct)) forEachStmt;
486 struct Declaration * decl;
487 } __attribute__ ((gcc_struct)) __anon1;
488 } __attribute__ ((gcc_struct));
489
490 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
491
492 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
493
494 extern struct Statement * MkBadDeclStmt(struct Declaration * decl);
495
496 struct __ecereNameSpace__ecere__sys__BinaryTree;
497
498 struct __ecereNameSpace__ecere__sys__BinaryTree
499 {
500 struct __ecereNameSpace__ecere__sys__BTNode * root;
501 int count;
502 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
503 void (*  FreeKey)(void *  key);
504 } __attribute__ ((gcc_struct));
505
506 struct Attrib *  CopyAttrib(struct Attrib *  attrib);
507
508 struct ExtDecl * CopyExtDecl(struct ExtDecl * extDecl)
509 {
510 if(extDecl)
511 {
512 if(extDecl->type == 1)
513 return MkExtDeclAttrib(CopyAttrib(extDecl->__anon1.attr));
514 else if(extDecl->type == 0)
515 return MkExtDeclString(__ecereNameSpace__ecere__sys__CopyString(extDecl->__anon1.s));
516 }
517 return (((void *)0));
518 }
519
520 struct __ecereNameSpace__ecere__com__Method;
521
522 struct __ecereNameSpace__ecere__com__Module;
523
524 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
525
526 struct Type;
527
528 struct __ecereNameSpace__ecere__com__Property
529 {
530 struct __ecereNameSpace__ecere__com__Property * prev;
531 struct __ecereNameSpace__ecere__com__Property * next;
532 const char *  name;
533 unsigned int isProperty;
534 int memberAccess;
535 int id;
536 struct __ecereNameSpace__ecere__com__Class * _class;
537 const char *  dataTypeString;
538 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
539 struct Type * dataType;
540 void (*  Set)(void * , int);
541 int (*  Get)(void * );
542 unsigned int (*  IsSet)(void * );
543 void *  data;
544 void *  symbol;
545 int vid;
546 unsigned int conversion;
547 unsigned int watcherOffset;
548 const char *  category;
549 unsigned int compiled;
550 unsigned int selfWatchable;
551 unsigned int isWatchable;
552 } __attribute__ ((gcc_struct));
553
554 struct __ecereNameSpace__ecere__com__Method
555 {
556 const char *  name;
557 struct __ecereNameSpace__ecere__com__Method * parent;
558 struct __ecereNameSpace__ecere__com__Method * left;
559 struct __ecereNameSpace__ecere__com__Method * right;
560 int depth;
561 int (*  function)();
562 int vid;
563 int type;
564 struct __ecereNameSpace__ecere__com__Class * _class;
565 void *  symbol;
566 const char *  dataTypeString;
567 struct Type * dataType;
568 int memberAccess;
569 } __attribute__ ((gcc_struct));
570
571 struct Symbol
572 {
573 char *  string;
574 struct Symbol * parent;
575 struct Symbol * left;
576 struct Symbol * right;
577 int depth;
578 struct Type * type;
579 union
580 {
581 struct __ecereNameSpace__ecere__com__Method * method;
582 struct __ecereNameSpace__ecere__com__Property * _property;
583 struct __ecereNameSpace__ecere__com__Class * registered;
584 } __attribute__ ((gcc_struct)) __anon1;
585 unsigned int notYetDeclared;
586 union
587 {
588 struct
589 {
590 struct External * pointerExternal;
591 struct External * structExternal;
592 } __attribute__ ((gcc_struct)) __anon1;
593 struct
594 {
595 struct External * externalGet;
596 struct External * externalSet;
597 struct External * externalPtr;
598 struct External * externalIsSet;
599 } __attribute__ ((gcc_struct)) __anon2;
600 struct
601 {
602 struct External * methodExternal;
603 struct External * methodCodeExternal;
604 } __attribute__ ((gcc_struct)) __anon3;
605 } __attribute__ ((gcc_struct)) __anon2;
606 unsigned int imported;
607 unsigned int declaredStructSym;
608 struct __ecereNameSpace__ecere__com__Class * _class;
609 unsigned int declaredStruct;
610 unsigned int needConstructor;
611 unsigned int needDestructor;
612 char *  constructorName;
613 char *  structName;
614 char *  className;
615 char *  destructorName;
616 struct ModuleImport * module;
617 struct ClassImport * _import;
618 struct Location nameLoc;
619 unsigned int isParam;
620 unsigned int isRemote;
621 unsigned int isStruct;
622 unsigned int fireWatchersDone;
623 int declaring;
624 unsigned int classData;
625 unsigned int isStatic;
626 char *  shortName;
627 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
628 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
629 struct Context * ctx;
630 int isIterator;
631 struct Expression * propCategory;
632 unsigned int mustRegister;
633 } __attribute__ ((gcc_struct));
634
635 struct Type
636 {
637 struct Type * prev;
638 struct Type * next;
639 int refCount;
640 union
641 {
642 struct Symbol * _class;
643 struct
644 {
645 struct __ecereNameSpace__ecere__sys__OldList members;
646 char *  enumName;
647 } __attribute__ ((gcc_struct)) __anon1;
648 struct
649 {
650 struct Type * returnType;
651 struct __ecereNameSpace__ecere__sys__OldList params;
652 struct Symbol * thisClass;
653 unsigned int staticMethod;
654 struct TemplateParameter * thisClassTemplate;
655 } __attribute__ ((gcc_struct)) __anon2;
656 struct
657 {
658 struct __ecereNameSpace__ecere__com__Method * method;
659 struct __ecereNameSpace__ecere__com__Class * methodClass;
660 struct __ecereNameSpace__ecere__com__Class * usedClass;
661 } __attribute__ ((gcc_struct)) __anon3;
662 struct
663 {
664 struct Type * arrayType;
665 int arraySize;
666 struct Expression * arraySizeExp;
667 unsigned int freeExp;
668 struct Symbol * enumClass;
669 } __attribute__ ((gcc_struct)) __anon4;
670 struct Type * type;
671 struct TemplateParameter * templateParameter;
672 } __attribute__ ((gcc_struct)) __anon1;
673 int kind;
674 unsigned int size;
675 char *  name;
676 char *  typeName;
677 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
678 int classObjectType;
679 int alignment;
680 unsigned int offset;
681 int bitFieldCount;
682 int count;
683 unsigned int isSigned : 1;
684 unsigned int constant : 1;
685 unsigned int truth : 1;
686 unsigned int byReference : 1;
687 unsigned int extraParam : 1;
688 unsigned int directClassAccess : 1;
689 unsigned int computing : 1;
690 unsigned int keepCast : 1;
691 unsigned int passAsTemplate : 1;
692 unsigned int dllExport : 1;
693 unsigned int attrStdcall : 1;
694 unsigned int declaredWithStruct : 1;
695 unsigned int typedByReference : 1;
696 unsigned int casted : 1;
697 unsigned int pointerAlignment : 1;
698 } __attribute__ ((gcc_struct));
699
700 struct Instantiation;
701
702 struct Instantiation
703 {
704 struct Instantiation * prev;
705 struct Instantiation * next;
706 struct Location loc;
707 struct Specifier * _class;
708 struct Expression * exp;
709 struct __ecereNameSpace__ecere__sys__OldList *  members;
710 struct Symbol * symbol;
711 unsigned int fullSet;
712 unsigned int isConstant;
713 unsigned char *  data;
714 struct Location nameLoc;
715 struct Location insideLoc;
716 unsigned int built;
717 } __attribute__ ((gcc_struct));
718
719 extern struct Instantiation * MkInstantiation(struct Specifier * _class, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
720
721 extern struct Expression * MkExpInstance(struct Instantiation * inst);
722
723 struct Declaration
724 {
725 struct Declaration * prev;
726 struct Declaration * next;
727 struct Location loc;
728 int type;
729 union
730 {
731 struct
732 {
733 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
734 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
735 } __attribute__ ((gcc_struct)) __anon1;
736 struct Instantiation * inst;
737 struct
738 {
739 struct Identifier * id;
740 struct Expression * exp;
741 } __attribute__ ((gcc_struct)) __anon2;
742 } __attribute__ ((gcc_struct)) __anon1;
743 struct Specifier * extStorage;
744 struct Symbol * symbol;
745 int declMode;
746 } __attribute__ ((gcc_struct));
747
748 struct TypeName;
749
750 struct Expression
751 {
752 struct Expression * prev;
753 struct Expression * next;
754 struct Location loc;
755 int type;
756 union
757 {
758 struct
759 {
760 char *  constant;
761 struct Identifier * identifier;
762 } __attribute__ ((gcc_struct)) __anon1;
763 struct Statement * compound;
764 struct Instantiation * instance;
765 struct
766 {
767 char *  string;
768 unsigned int intlString;
769 unsigned int wideString;
770 } __attribute__ ((gcc_struct)) __anon2;
771 struct __ecereNameSpace__ecere__sys__OldList *  list;
772 struct
773 {
774 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
775 struct Declarator * decl;
776 } __attribute__ ((gcc_struct)) _classExp;
777 struct
778 {
779 struct Identifier * id;
780 } __attribute__ ((gcc_struct)) classData;
781 struct
782 {
783 struct Expression * exp;
784 struct __ecereNameSpace__ecere__sys__OldList * arguments;
785 struct Location argLoc;
786 } __attribute__ ((gcc_struct)) call;
787 struct
788 {
789 struct Expression * exp;
790 struct __ecereNameSpace__ecere__sys__OldList * index;
791 } __attribute__ ((gcc_struct)) index;
792 struct
793 {
794 struct Expression * exp;
795 struct Identifier * member;
796 int memberType;
797 unsigned int thisPtr;
798 } __attribute__ ((gcc_struct)) member;
799 struct
800 {
801 int op;
802 struct Expression * exp1;
803 struct Expression * exp2;
804 } __attribute__ ((gcc_struct)) op;
805 struct TypeName * typeName;
806 struct Specifier * _class;
807 struct
808 {
809 struct TypeName * typeName;
810 struct Expression * exp;
811 } __attribute__ ((gcc_struct)) cast;
812 struct
813 {
814 struct Expression * cond;
815 struct __ecereNameSpace__ecere__sys__OldList * exp;
816 struct Expression * elseExp;
817 } __attribute__ ((gcc_struct)) cond;
818 struct
819 {
820 struct TypeName * typeName;
821 struct Expression * size;
822 } __attribute__ ((gcc_struct)) _new;
823 struct
824 {
825 struct TypeName * typeName;
826 struct Expression * size;
827 struct Expression * exp;
828 } __attribute__ ((gcc_struct)) _renew;
829 struct
830 {
831 char * table;
832 struct Identifier * id;
833 } __attribute__ ((gcc_struct)) db;
834 struct
835 {
836 struct Expression * ds;
837 struct Expression * name;
838 } __attribute__ ((gcc_struct)) dbopen;
839 struct
840 {
841 struct TypeName * typeName;
842 struct Initializer * initializer;
843 } __attribute__ ((gcc_struct)) initializer;
844 struct
845 {
846 struct Expression * exp;
847 struct TypeName * typeName;
848 } __attribute__ ((gcc_struct)) vaArg;
849 } __attribute__ ((gcc_struct)) __anon1;
850 unsigned int debugValue;
851 struct __ecereNameSpace__ecere__com__DataValue val;
852 uint64 address;
853 unsigned int hasAddress;
854 struct Type * expType;
855 struct Type * destType;
856 unsigned int usage;
857 int tempCount;
858 unsigned int byReference;
859 unsigned int isConstant;
860 unsigned int addedThis;
861 unsigned int needCast;
862 unsigned int thisPtr;
863 unsigned int opDestType;
864 unsigned int needTemplateCast;
865 } __attribute__ ((gcc_struct));
866
867 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
868
869 extern struct Expression * MkExpTypeAlign(struct TypeName * typeName);
870
871 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
872
873 extern struct Expression * MkExpVaArg(struct Expression * exp, struct TypeName * type);
874
875 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
876
877 struct TypeName
878 {
879 struct TypeName * prev;
880 struct TypeName * next;
881 struct Location loc;
882 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
883 struct Declarator * declarator;
884 int classObjectType;
885 struct Expression * bitCount;
886 } __attribute__ ((gcc_struct));
887
888 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
889
890 struct Enumerator;
891
892 extern struct Enumerator * MkEnumerator(struct Identifier * id, struct Expression * exp);
893
894 struct Enumerator
895 {
896 struct Enumerator * prev;
897 struct Enumerator * next;
898 struct Location loc;
899 struct Identifier * id;
900 struct Expression * exp;
901 } __attribute__ ((gcc_struct));
902
903 struct Attribute;
904
905 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
906
907 struct Attribute
908 {
909 struct Attribute * prev;
910 struct Attribute * next;
911 struct Location loc;
912 char * attr;
913 struct Expression * exp;
914 } __attribute__ ((gcc_struct));
915
916 struct ClassDef;
917
918 struct ClassDef
919 {
920 struct ClassDef * prev;
921 struct ClassDef * next;
922 struct Location loc;
923 int type;
924 union
925 {
926 struct Declaration * decl;
927 struct ClassFunction * function;
928 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
929 struct PropertyDef * propertyDef;
930 struct PropertyWatch * propertyWatch;
931 char *  designer;
932 struct Identifier * defaultProperty;
933 struct
934 {
935 struct Identifier * id;
936 struct Initializer * initializer;
937 } __attribute__ ((gcc_struct)) __anon1;
938 } __attribute__ ((gcc_struct)) __anon1;
939 int memberAccess;
940 void *  object;
941 } __attribute__ ((gcc_struct));
942
943 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
944
945 struct Specifier *  CopySpecifier(struct Specifier *  spec);
946
947 struct Identifier * CopyIdentifier(struct Identifier * id)
948 {
949 if(id)
950 {
951 struct Identifier * copy = MkIdentifier(id->string);
952
953 copy->_class = id->_class ? CopySpecifier(id->_class) : (((void *)0));
954 copy->classSym = id->classSym;
955 return copy;
956 }
957 return (((void *)0));
958 }
959
960 static struct Pointer * CopyPointer(struct Pointer * ptr)
961 {
962 if(ptr)
963 {
964 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
965 struct Specifier * spec;
966
967 if(ptr->qualifiers)
968 {
969 for(spec = (*ptr->qualifiers).first; spec; spec = spec->next)
970 ListAdd(list, CopySpecifier(spec));
971 }
972 return MkPointer(list, CopyPointer(ptr->pointer));
973 }
974 return (((void *)0));
975 }
976
977 struct Attribute *  CopyAttribute(struct Attribute *  attrib);
978
979 struct Attrib * CopyAttrib(struct Attrib * attrib)
980 {
981 if(attrib)
982 return MkAttrib(attrib->type, CopyList(attrib->attribs, (void *)(CopyAttribute)));
983 return (((void *)0));
984 }
985
986 struct MemberInit;
987
988 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
989
990 struct MemberInit
991 {
992 struct MemberInit * prev;
993 struct MemberInit * next;
994 struct Location loc;
995 struct Location realLoc;
996 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
997 struct Initializer * initializer;
998 unsigned int used;
999 unsigned int variable;
1000 unsigned int takeOutExp;
1001 } __attribute__ ((gcc_struct));
1002
1003 struct InitDeclarator;
1004
1005 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1006
1007 struct InitDeclarator
1008 {
1009 struct InitDeclarator * prev;
1010 struct InitDeclarator * next;
1011 struct Location loc;
1012 struct Declarator * declarator;
1013 struct Initializer * initializer;
1014 } __attribute__ ((gcc_struct));
1015
1016 struct __ecereNameSpace__ecere__com__NameSpace;
1017
1018 struct __ecereNameSpace__ecere__com__NameSpace
1019 {
1020 const char *  name;
1021 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
1022 struct __ecereNameSpace__ecere__com__NameSpace *  left;
1023 struct __ecereNameSpace__ecere__com__NameSpace *  right;
1024 int depth;
1025 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
1026 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1027 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1028 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1029 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1030 } __attribute__ ((gcc_struct));
1031
1032 struct __ecereNameSpace__ecere__com__Application
1033 {
1034 int argc;
1035 const char * *  argv;
1036 int exitCode;
1037 unsigned int isGUIApp;
1038 struct __ecereNameSpace__ecere__sys__OldList allModules;
1039 char *  parsedCommand;
1040 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1041 } __attribute__ ((gcc_struct));
1042
1043 struct __ecereNameSpace__ecere__com__Module
1044 {
1045 struct __ecereNameSpace__ecere__com__Instance * application;
1046 struct __ecereNameSpace__ecere__sys__OldList classes;
1047 struct __ecereNameSpace__ecere__sys__OldList defines;
1048 struct __ecereNameSpace__ecere__sys__OldList functions;
1049 struct __ecereNameSpace__ecere__sys__OldList modules;
1050 struct __ecereNameSpace__ecere__com__Instance * prev;
1051 struct __ecereNameSpace__ecere__com__Instance * next;
1052 const char *  name;
1053 void *  library;
1054 void *  Unload;
1055 int importType;
1056 int origImportType;
1057 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1058 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1059 } __attribute__ ((gcc_struct));
1060
1061 void __ecereUnregisterModule_copy(struct __ecereNameSpace__ecere__com__Instance * module)
1062 {
1063
1064 }
1065
1066 struct __ecereNameSpace__ecere__com__DataMember;
1067
1068 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1069 {
1070 union
1071 {
1072 struct
1073 {
1074 const char *  dataTypeString;
1075 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1076 } __attribute__ ((gcc_struct)) __anon1;
1077 struct __ecereNameSpace__ecere__com__DataValue expression;
1078 struct
1079 {
1080 const char *  memberString;
1081 union
1082 {
1083 struct __ecereNameSpace__ecere__com__DataMember * member;
1084 struct __ecereNameSpace__ecere__com__Property * prop;
1085 struct __ecereNameSpace__ecere__com__Method * method;
1086 } __attribute__ ((gcc_struct)) __anon1;
1087 } __attribute__ ((gcc_struct)) __anon2;
1088 } __attribute__ ((gcc_struct)) __anon1;
1089 } __attribute__ ((gcc_struct));
1090
1091 struct __ecereNameSpace__ecere__com__DataMember
1092 {
1093 struct __ecereNameSpace__ecere__com__DataMember * prev;
1094 struct __ecereNameSpace__ecere__com__DataMember * next;
1095 const char *  name;
1096 unsigned int isProperty;
1097 int memberAccess;
1098 int id;
1099 struct __ecereNameSpace__ecere__com__Class * _class;
1100 const char *  dataTypeString;
1101 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1102 struct Type * dataType;
1103 int type;
1104 int offset;
1105 int memberID;
1106 struct __ecereNameSpace__ecere__sys__OldList members;
1107 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
1108 int memberOffset;
1109 short structAlignment;
1110 short pointerAlignment;
1111 } __attribute__ ((gcc_struct));
1112
1113 struct __ecereNameSpace__ecere__com__Class
1114 {
1115 struct __ecereNameSpace__ecere__com__Class * prev;
1116 struct __ecereNameSpace__ecere__com__Class * next;
1117 const char *  name;
1118 int offset;
1119 int structSize;
1120 void * *  _vTbl;
1121 int vTblSize;
1122 unsigned int (*  Constructor)(void * );
1123 void (*  Destructor)(void * );
1124 int offsetClass;
1125 int sizeClass;
1126 struct __ecereNameSpace__ecere__com__Class * base;
1127 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1128 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1129 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1130 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1131 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1132 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1133 int memberID;
1134 int startMemberID;
1135 int type;
1136 struct __ecereNameSpace__ecere__com__Instance * module;
1137 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
1138 const char *  dataTypeString;
1139 struct Type * dataType;
1140 int typeSize;
1141 int defaultAlignment;
1142 void (*  Initialize)();
1143 int memberOffset;
1144 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1145 const char *  designerClass;
1146 unsigned int noExpansion;
1147 const char *  defaultProperty;
1148 unsigned int comRedefinition;
1149 int count;
1150 int isRemote;
1151 unsigned int internalDecl;
1152 void *  data;
1153 unsigned int computeSize;
1154 short structAlignment;
1155 short pointerAlignment;
1156 int destructionWatchOffset;
1157 unsigned int fixed;
1158 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1159 int inheritanceAccess;
1160 const char *  fullName;
1161 void *  symbol;
1162 struct __ecereNameSpace__ecere__sys__OldList conversions;
1163 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1164 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
1165 struct __ecereNameSpace__ecere__com__Class * templateClass;
1166 struct __ecereNameSpace__ecere__sys__OldList templatized;
1167 int numParams;
1168 unsigned int isInstanceClass;
1169 unsigned int byValueSystemClass;
1170 } __attribute__ ((gcc_struct));
1171
1172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
1173
1174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
1175
1176 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
1177
1178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
1179
1180 struct Expression * MoveExpContents(struct Expression * exp)
1181 {
1182 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
1183
1184 *newExp = *exp;
1185 newExp->prev = (((void *)0));
1186 newExp->next = (((void *)0));
1187 newExp->destType = (((void *)0));
1188 if(exp->expType)
1189 exp->expType->refCount++;
1190 return newExp;
1191 }
1192
1193 struct Expression *  CopyExpression(struct Expression *  exp);
1194
1195 static struct Initializer * CopyInitializer(struct Initializer * initializer)
1196 {
1197 struct Initializer * copy = (((void *)0));
1198
1199 ;
1200 if(initializer->type == 0)
1201 copy = MkInitializerAssignment(CopyExpression(initializer->__anon1.exp));
1202 else if(initializer->type == 1)
1203 copy = MkInitializerList(CopyList(initializer->__anon1.list, (void *)(CopyInitializer)));
1204 if(copy)
1205 {
1206 copy->loc = initializer->loc;
1207 if(initializer->id)
1208 copy->id = CopyIdentifier(initializer->id);
1209 copy->isConstant = initializer->isConstant;
1210 }
1211 return copy;
1212 }
1213
1214 static struct Enumerator * CopyEnumerator(struct Enumerator * enumerator)
1215 {
1216 return MkEnumerator(CopyIdentifier(enumerator->id), CopyExpression(enumerator->exp));
1217 }
1218
1219 struct Attribute * CopyAttribute(struct Attribute * attrib)
1220 {
1221 if(attrib)
1222 return MkAttribute(__ecereNameSpace__ecere__sys__CopyString(attrib->attr), CopyExpression(attrib->exp));
1223 return (((void *)0));
1224 }
1225
1226 static struct MemberInit * CopyMemberInit(struct MemberInit * member)
1227 {
1228 return MkMemberInit(CopyList(member->identifiers, (void *)(CopyIdentifier)), CopyInitializer(member->initializer));
1229 }
1230
1231 static struct MembersInit * CopyMembersInit(struct MembersInit * members)
1232 {
1233 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1234
1235 switch(members->type)
1236 {
1237 case 0:
1238 {
1239 if(members)
1240 {
1241 struct MemberInit * member;
1242
1243 list = MkList();
1244 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1245 ListAdd(list, CopyMemberInit(member));
1246 }
1247 }
1248 }
1249 return MkMembersInitList(list);
1250 }
1251
1252 static struct Instantiation * CopyInstantiation(struct Instantiation * inst)
1253 {
1254 struct Instantiation * copy;
1255 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1256 struct MembersInit * member;
1257
1258 if(inst->members)
1259 {
1260 for(member = (*inst->members).first; member; member = member->next)
1261 ListAdd(list, CopyMembersInit(member));
1262 }
1263 copy = MkInstantiation(CopySpecifier(inst->_class), CopyExpression(inst->exp), list);
1264 copy->data = inst->data;
1265 if(inst->data)
1266 {
1267 struct Symbol * classSym = FindClass(inst->_class->__anon1.__anon1.name);
1268 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
1269
1270 if(_class)
1271 {
1272 if(_class->type == 0)
1273 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)copy->data))->_refCount++;
1274 }
1275 }
1276 copy->loc = inst->loc;
1277 copy->isConstant = inst->isConstant;
1278 return copy;
1279 }
1280
1281 struct Declaration *  CopyDeclaration(struct Declaration *  decl);
1282
1283 static struct Statement * CopyStatement(struct Statement * stmt)
1284 {
1285 struct Statement * result = (((void *)0));
1286
1287 if(stmt)
1288 {
1289 switch(stmt->type)
1290 {
1291 case 2:
1292 result = MkCompoundStmt(CopyList(stmt->__anon1.compound.declarations, (void *)(CopyDeclaration)), CopyList(stmt->__anon1.compound.statements, (void *)(CopyStatement)));
1293 result->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1294 break;
1295 case 3:
1296 result = MkExpressionStmt(CopyList(stmt->__anon1.expressions, (void *)(CopyExpression)));
1297 break;
1298 case 14:
1299 result = MkBadDeclStmt(CopyDeclaration(stmt->__anon1.decl));
1300 break;
1301 }
1302 }
1303 if(result)
1304 {
1305 result->loc = stmt->loc;
1306 }
1307 return result;
1308 }
1309
1310 struct ClassDef * CopyClassDef(struct ClassDef * def)
1311 {
1312 switch(def->type)
1313 {
1314 case 0:
1315 return (((void *)0));
1316 case 1:
1317 return (((void *)0));
1318 case 2:
1319 return MkClassDefDeclaration(CopyDeclaration(def->__anon1.decl));
1320 case 3:
1321 return (((void *)0));
1322 }
1323 return (((void *)0));
1324 }
1325
1326 struct Specifier * CopySpecifier(struct Specifier * spec)
1327 {
1328 if(spec)
1329 switch(spec->type)
1330 {
1331 case 0:
1332 return MkSpecifier(spec->__anon1.specifier);
1333 case 2:
1334 {
1335 struct Identifier * id = CopyIdentifier(spec->__anon1.__anon2.id);
1336 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1337 struct Enumerator * enumerator;
1338
1339 if(spec->__anon1.__anon2.list)
1340 {
1341 for(enumerator = (*spec->__anon1.__anon2.list).first; enumerator; enumerator = enumerator->next)
1342 ListAdd(list, CopyEnumerator(enumerator));
1343 }
1344 return MkEnum(id, list);
1345 }
1346 case 3:
1347 case 4:
1348 {
1349 struct Identifier * id = CopyIdentifier(spec->__anon1.__anon2.id);
1350 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1351 struct ClassDef * def;
1352 struct Specifier * s;
1353
1354 if(spec->__anon1.__anon2.definitions)
1355 {
1356 list = MkList();
1357 if(spec->__anon1.__anon2.list)
1358 {
1359 for(def = (*spec->__anon1.__anon2.list).first; def; def = def->next)
1360 ListAdd(list, CopyClassDef(def));
1361 }
1362 }
1363 s = MkStructOrUnion(spec->type, id, list);
1364 s->__anon1.__anon2.extDeclStruct = CopyExtDecl(spec->__anon1.__anon2.extDeclStruct);
1365 return s;
1366 }
1367 case 1:
1368 {
1369 struct Specifier * copy = (copy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier), copy->type = 1, copy->__anon1.__anon1.name = __ecereNameSpace__ecere__sys__CopyString(spec->__anon1.__anon1.name), copy->__anon1.__anon1.symbol = spec->__anon1.__anon1.symbol, copy->__anon1.__anon1.templateArgs = (((void *)0)), copy);
1370
1371 return copy;
1372 }
1373 case 7:
1374 return MkSpecifierSubClass(CopySpecifier(spec->__anon1._class));
1375 case 8:
1376 return __extension__ ({
1377 struct Specifier * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier);
1378
1379 __ecereInstance1->loc = spec->loc, __ecereInstance1->type = 8, __ecereInstance1->__anon1.templateParameter = spec->__anon1.templateParameter, __ecereInstance1;
1380 });
1381 case 5:
1382 return MkSpecifierExtended(CopyExtDecl(spec->__anon1.__anon1.extDecl));
1383 }
1384 return (((void *)0));
1385 }
1386
1387 struct Declarator *  CopyDeclarator(struct Declarator *  declarator);
1388
1389 struct TypeName * CopyTypeName(struct TypeName * typeName)
1390 {
1391 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1392 struct TypeName * copy;
1393
1394 if(typeName->qualifiers)
1395 {
1396 struct Specifier * spec;
1397
1398 list = MkList();
1399 for(spec = (*typeName->qualifiers).first; spec; spec = spec->next)
1400 ListAdd(list, CopySpecifier(spec));
1401 }
1402 copy = MkTypeName(list, CopyDeclarator(typeName->declarator));
1403 copy->classObjectType = typeName->classObjectType;
1404 return copy;
1405 }
1406
1407 struct InitDeclarator * CopyInitDeclarator(struct InitDeclarator * initDecl)
1408 {
1409 return MkInitDeclarator(CopyDeclarator(initDecl->declarator), CopyInitializer(initDecl->initializer));
1410 }
1411
1412 struct Expression * CopyExpression(struct Expression * exp)
1413 {
1414 struct Expression * result = (((void *)0));
1415
1416 if(exp)
1417 switch(exp->type)
1418 {
1419 case 16:
1420 result = MkExpDummy();
1421 break;
1422 case 0:
1423 result = MkExpIdentifier(CopyIdentifier(exp->__anon1.__anon1.identifier));
1424 break;
1425 case 1:
1426 result = MkExpInstance(CopyInstantiation(exp->__anon1.instance));
1427 break;
1428 case 2:
1429 result = MkExpConstant(exp->__anon1.__anon2.string);
1430 break;
1431 case 3:
1432 result = MkExpString(exp->__anon1.__anon2.string);
1433 break;
1434 case 4:
1435 result = MkExpOp(CopyExpression(exp->__anon1.op.exp1), exp->__anon1.op.op, CopyExpression(exp->__anon1.op.exp2));
1436 break;
1437 case 5:
1438 {
1439 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1440 struct Expression * e;
1441
1442 for(e = (*exp->__anon1.list).first; e; e = e->next)
1443 ListAdd(list, CopyExpression(e));
1444 result = MkExpBrackets(list);
1445 break;
1446 }
1447 case 6:
1448 {
1449 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1450 struct Expression * e;
1451
1452 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1453 ListAdd(list, CopyExpression(e));
1454 result = MkExpIndex(CopyExpression(exp->__anon1.index.exp), list);
1455 break;
1456 }
1457 case 7:
1458 {
1459 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1460 struct Expression * arg;
1461
1462 if(exp->__anon1.call.arguments)
1463 {
1464 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1465 ListAdd(list, CopyExpression(arg));
1466 }
1467 result = MkExpCall(CopyExpression(exp->__anon1.call.exp), list);
1468 break;
1469 }
1470 case 8:
1471 result = MkExpMember(CopyExpression(exp->__anon1.member.exp), CopyIdentifier(exp->__anon1.member.member));
1472 result->__anon1.member.memberType = exp->__anon1.member.memberType;
1473 result->__anon1.member.thisPtr = exp->__anon1.member.thisPtr;
1474 break;
1475 case 9:
1476 result = MkExpPointer(CopyExpression(exp->__anon1.member.exp), CopyIdentifier(exp->__anon1.member.member));
1477 break;
1478 case 10:
1479 result = MkExpTypeSize(CopyTypeName(exp->__anon1.typeName));
1480 break;
1481 case 36:
1482 result = MkExpTypeAlign(CopyTypeName(exp->__anon1.typeName));
1483 break;
1484 case 11:
1485 result = MkExpCast(CopyTypeName(exp->__anon1.cast.typeName), CopyExpression(exp->__anon1.cast.exp));
1486 break;
1487 case 12:
1488 {
1489 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1490 struct Expression * e;
1491
1492 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1493 ListAdd(list, CopyExpression(e));
1494 result = MkExpCondition(CopyExpression(exp->__anon1.cond.cond), list, CopyExpression(exp->__anon1.cond.elseExp));
1495 break;
1496 }
1497 case 34:
1498 result = MkExpVaArg(CopyExpression(exp->__anon1.vaArg.exp), CopyTypeName(exp->__anon1.vaArg.typeName));
1499 break;
1500 case 23:
1501 result = MkExpExtensionCompound(CopyStatement(exp->__anon1.compound));
1502 break;
1503 case 33:
1504 result = MkExpExtensionInitializer(CopyTypeName(exp->__anon1.initializer.typeName), CopyInitializer(exp->__anon1.initializer.initializer));
1505 break;
1506 case 24:
1507 result = MkExpClass(CopyList(exp->__anon1._classExp.specifiers, (void *)(CopySpecifier)), CopyDeclarator(exp->__anon1._classExp.decl));
1508 break;
1509 }
1510 if(result)
1511 {
1512 result->expType = exp->expType;
1513 if(exp->expType)
1514 exp->expType->refCount++;
1515 result->destType = exp->destType;
1516 if(exp->destType)
1517 exp->destType->refCount++;
1518 result->loc = exp->loc;
1519 result->isConstant = exp->isConstant;
1520 result->byReference = exp->byReference;
1521 result->opDestType = exp->opDestType;
1522 result->needTemplateCast = exp->needTemplateCast;
1523 }
1524 return result;
1525 }
1526
1527 struct Declarator * CopyDeclarator(struct Declarator * declarator)
1528 {
1529 if(declarator)
1530 {
1531 switch(declarator->type)
1532 {
1533 case 0:
1534 {
1535 struct Declarator * decl = MkStructDeclarator(CopyDeclarator(declarator->declarator), CopyExpression(declarator->__anon1.structDecl.exp));
1536
1537 if(declarator->__anon1.structDecl.attrib)
1538 decl->__anon1.structDecl.attrib = CopyAttrib(declarator->__anon1.structDecl.attrib);
1539 return decl;
1540 }
1541 case 1:
1542 return MkDeclaratorIdentifier(CopyIdentifier(declarator->__anon1.identifier));
1543 case 2:
1544 return MkDeclaratorBrackets(CopyDeclarator(declarator->declarator));
1545 case 3:
1546 if(declarator->__anon1.array.enumClass)
1547 return MkDeclaratorEnumArray(CopyDeclarator(declarator->declarator), CopySpecifier(declarator->__anon1.array.enumClass));
1548 else
1549 return MkDeclaratorArray(CopyDeclarator(declarator->declarator), CopyExpression(declarator->__anon1.array.exp));
1550 case 4:
1551 {
1552 struct __ecereNameSpace__ecere__sys__OldList * parameters = MkList();
1553 struct TypeName * param;
1554
1555 if(declarator->__anon1.function.parameters)
1556 {
1557 for(param = (*declarator->__anon1.function.parameters).first; param; param = param->next)
1558 ListAdd(parameters, CopyTypeName(param));
1559 }
1560 return MkDeclaratorFunction(CopyDeclarator(declarator->declarator), parameters);
1561 }
1562 case 5:
1563 return MkDeclaratorPointer(CopyPointer(declarator->__anon1.pointer.pointer), CopyDeclarator(declarator->declarator));
1564 case 6:
1565 return MkDeclaratorExtended(CopyExtDecl(declarator->__anon1.extended.extended), CopyDeclarator(declarator->declarator));
1566 case 7:
1567 return MkDeclaratorExtendedEnd(CopyExtDecl(declarator->__anon1.extended.extended), CopyDeclarator(declarator->declarator));
1568 }
1569 }
1570 return (((void *)0));
1571 }
1572
1573 struct Declaration * CopyDeclaration(struct Declaration * decl)
1574 {
1575 if(decl->type == 1)
1576 {
1577 return MkDeclaration(CopyList(decl->__anon1.__anon1.specifiers, (void *)(CopySpecifier)), CopyList(decl->__anon1.__anon1.declarators, (void *)(CopyInitDeclarator)));
1578 }
1579 else
1580 {
1581 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList(), * declarators = MkList();
1582 struct Specifier * spec;
1583 struct Declarator * declarator;
1584
1585 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1586 ListAdd(specifiers, CopySpecifier(spec));
1587 if(decl->__anon1.__anon1.declarators)
1588 {
1589 for(declarator = (*decl->__anon1.__anon1.declarators).first; declarator; declarator = declarator->next)
1590 ListAdd(declarators, CopyDeclarator(declarator));
1591 }
1592 return MkDeclaration(specifiers, declarators);
1593 }
1594 }
1595
1596 void __ecereRegisterModule_copy(struct __ecereNameSpace__ecere__com__Instance * module)
1597 {
1598 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
1599
1600 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyIdentifier", "Identifier CopyIdentifier(Identifier id)", CopyIdentifier, module, 2);
1601 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MoveExpContents", "Expression MoveExpContents(Expression exp)", MoveExpContents, module, 2);
1602 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyExpression", "Expression CopyExpression(Expression exp)", CopyExpression, module, 1);
1603 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyClassDef", "ClassDef CopyClassDef(ClassDef def)", CopyClassDef, module, 2);
1604 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopySpecifier", "Specifier CopySpecifier(Specifier spec)", CopySpecifier, module, 2);
1605 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyTypeName", "TypeName CopyTypeName(TypeName typeName)", CopyTypeName, module, 2);
1606 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyExtDecl", "ExtDecl CopyExtDecl(ExtDecl extDecl)", CopyExtDecl, module, 2);
1607 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyAttribute", "Attribute CopyAttribute(Attribute attrib)", CopyAttribute, module, 2);
1608 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyAttrib", "Attrib CopyAttrib(Attrib attrib)", CopyAttrib, module, 2);
1609 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyDeclarator", "Declarator CopyDeclarator(Declarator declarator)", CopyDeclarator, module, 2);
1610 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyInitDeclarator", "InitDeclarator CopyInitDeclarator(InitDeclarator initDecl)", CopyInitDeclarator, module, 2);
1611 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyDeclaration", "Declaration CopyDeclaration(Declaration decl)", CopyDeclaration, module, 2);
1612 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyList", "ecere::sys::OldList * CopyList(ecere::sys::OldList * source, void * (* CopyFunction)(void *))", CopyList, module, 2);
1613 }
1614