source: trunk/Compiler/Modules/Pascal/SourceCodePascal.pas

Last change on this file was 75, checked in by chronos, 6 months ago
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File size: 19.6 KB
Line 
1unit SourceCodePascal;
2
3interface
4
5uses
6 SysUtils, Variants, Classes, Dialogs, Generics.Collections, SourceConvertor;
7
8type
9 TMemoryType = (mtProgram, mtData, mtEEPROM);
10
11 TModuleType = (mdProgram, mdUnit, mdLibrary, mdPackage);
12
13 TNodeType = (ntNone, ntVariable, ntFunction, ntConstant, ntOperator,
14 ntValue, ntTypecast, ntType);
15
16 TTypeVisibility = (tvPublic, tvPublished, tvPrivate, tvProtected);
17
18 TValue = Variant; //array of Byte;
19
20 TCommonBlock = class;
21 TTypes = class;
22 TConstants = class;
23 TVariables = class;
24 TFunctions = class;
25 TExpressions = class;
26 TExpression = class;
27 TFunction = class;
28 TVariable = class;
29 TConstant = class;
30 TSourceModule = class;
31 TProgram = class;
32
33 TDevice = class
34 Family: string;
35 Memory: array[TMemoryType] of Integer;
36 end;
37
38 TContext = class
39 end;
40
41 TCommands = class;
42
43 TCommand = class
44 Parent: TObject;
45 CommonBlock: TCommonBlock;
46 end;
47
48 TAssignment = class(TCommand)
49 Target: TVariable;
50 Source: TExpression;
51 constructor Create;
52 destructor Destroy; override;
53 end;
54
55 { TExpressions }
56
57 TExpressions = class(TObjectList<TExpression>)
58 procedure Assign(Source: TExpressions);
59 end;
60
61 { TFunctionCall }
62
63 TFunctionCall = class(TCommand)
64 FunctionRef: TFunction;
65 ParameterExpression: TExpressions;
66 constructor Create;
67 destructor Destroy; override;
68 end;
69
70 TBeginEnd = class(TCommand)
71 Commands: TCommands;
72 CommonBlock: TCommonBlock;
73 procedure Clear;
74 constructor Create;
75 destructor Destroy; override;
76 end;
77
78 TWhileDo = class(TCommand)
79 Condition: TExpression;
80 Command: TCommand;
81 constructor Create;
82 destructor Destroy; override;
83 end;
84
85 TWithDo = class(TCommand)
86 Context: TContext;
87 Command: TCommand;
88 end;
89
90 TRepeatUntil = class(TCommand)
91 Block: TCommands;
92 Condition: TExpression;
93 end;
94
95 { TForToDo }
96
97 TForToDo = class(TCommand)
98 ControlVariable: TVariable;
99 Start: TExpression;
100 Stop: TExpression;
101 Command: TCommand;
102 constructor Create;
103 destructor Destroy; override;
104 end;
105
106 { TIfThenElse }
107
108 TIfThenElse = class(TCommand)
109 Condition: TExpression;
110 Command: TCommand;
111 ElseCommand: TCommand;
112 constructor Create;
113 destructor Destroy; override;
114 end;
115
116 TCaseOfEndBranche = class
117 Constant: TConstant;
118 Command: TCommand;
119 end;
120
121 TListCaseOfEndBranche = class(TObjectList<TCaseOfEndBranche>);
122
123 TCaseOfEnd = class(TCommand)
124 Expression: TExpression;
125 Branches: TListCaseOfEndBranche;
126 ElseCommand: TCommand;
127 constructor Create;
128 destructor Destroy; override;
129 end;
130
131 TTryFinally = class(TCommand)
132 Block: TCommands;
133 FinallyBlock: TCommands;
134 end;
135
136 TTryExcept = class(TCommand)
137 Block: TCommands;
138 ExceptBlock: TCommands;
139 end;
140
141 TCommands = class(TObjectList<TCommand>);
142
143 TCommonBlockSection = (cbsVariable, cbsType, cbsConstant);
144
145 TCommonBlock = class
146 Name: string;
147 Parent: TCommonBlock;
148 ParentModule: TSourceModule;
149 Constants: TConstants;
150 Types: TTypes;
151 Variables: TVariables;
152 Functions: TFunctions;
153 Order: TObjectList<TObject>;
154 Code: TBeginEnd;
155 constructor Create; virtual;
156 destructor Destroy; override;
157// procedure CheckReferences;
158 end;
159
160 { TType }
161
162 TType = class
163 ForwardDeclared: Boolean;
164 Internal: Boolean;
165 Parent: TTypes;
166 Name: string;
167 Size: Integer;
168 UsedType: TType;
169 Exported: Boolean;
170 Visibility: TTypeVisibility;
171 Parameters: TTypes;
172 procedure Assign(Source: TType);
173 constructor Create;
174 destructor Destroy; override;
175 end;
176
177 { TTypes }
178
179 TTypes = class(TObjectList<TType>)
180 Parent: TCommonBlock;
181 function Search(Name: string; Exported: Boolean = False): TType;
182 destructor Destroy; override;
183 function AddNew: TType;
184 end;
185
186 TTypeInherited = class(TType)
187 end;
188
189 TTypeRecord = class(TType)
190 CommonBlock: TCommonBlock;
191 constructor Create;
192 destructor Destroy; override;
193 end;
194
195 TTypeSubRange = class(TType)
196 Bottom: Variant;
197 Top: Variant;
198 end;
199
200 TTypeArray = class(TType)
201 IndexType: TType;
202 ItemType: TType;
203 end;
204
205 TTypePointer = class(TType)
206 end;
207
208 TEnumItem = class
209 Name: string;
210 Index: Integer;
211 end;
212
213 TEnumItems = class(TObjectList<TEnumItem>);
214
215 TTypeEnumeration = class(TType)
216 Items: TEnumItems;
217 constructor Create;
218 destructor Destroy; override;
219 end;
220
221 { TTypeClass }
222
223 TTypeClass = class(TType)
224 CommonBlock: TCommonBlock;
225 constructor Create;
226 destructor Destroy; override;
227 end;
228
229 TConstant = class
230 System: Boolean;
231 Name: string;
232 ValueType: TType;
233 Value: TValue;
234 Exported: Boolean;
235 end;
236
237 TConstants = class(TObjectList<TConstant>)
238 Parent: TCommonBlock;
239 function Search(Name: string): TConstant;
240 destructor Destroy; override;
241 end;
242
243 TVariable = class
244 Name: string;
245 ValueType: TType;
246 DefaultValue: TValue;
247 Exported: Boolean;
248 Value: TValue; // runtime
249 end;
250
251 TVariables = class(TObjectList<TVariable>)
252 Parent: TCommonBlock;
253 function Search(Name: string; Exported: Boolean = False): TVariable;
254 destructor Destroy; override;
255 end;
256
257 TParameter = class(TVariable)
258 end;
259
260 TParameters = class(TObjectList<TParameter>)
261 Parent: TFunction;
262 function Search(Name: string): TParameter;
263 destructor Destroy; override;
264 end;
265
266 { TExpression }
267
268 TExpression = class
269 CommonBlock: TCommonBlock;
270 NodeType: TNodeType;
271 Variable: TVariable;
272 Constant: TConstant;
273 UseType: TType;
274 FunctionCall: TFunctionCall;
275 Value: TValue;
276 OperatorName: string;
277 SubItems: TExpressions;
278 Associated: Boolean;
279 Braces: Boolean;
280 constructor Create;
281 destructor Destroy; override;
282 procedure Assign(Source: TExpression);
283 end;
284
285 TFunctionType = (ftFunction, ftProcedure, ftConstructor, ftDestructor);
286
287 TFunction = class(TCommonBlock)
288 public
289 Internal: Boolean;
290 FunctionType: TFunctionType;
291 Parameters: TParameters;
292 ResultType: TType;
293 Exported: Boolean;
294 BodyLoaded: Boolean;
295 constructor Create; override;
296 destructor Destroy; override;
297 end;
298
299 { TFunctions }
300
301 TFunctions = class(TObjectList<TFunction>)
302 Parent: TCommonBlock;
303 function Search(Name: string; Exported: Boolean = False): TFunction;
304 destructor Destroy; override;
305 function AddNew: TFunction;
306 end;
307
308 TUsedModule = class
309 Name: string;
310 Location: string;
311 Module: TSourceModule;
312 Exported: Boolean;
313 end;
314
315 TUsedModules = class(TObjectList<TUsedModule>)
316 ParentModule: TSourceModule;
317 end;
318
319 { TSourceModule }
320
321 TSourceModule = class
322 public
323 ParentProgram: TProgram;
324 Name: string;
325 TargetFile: string;
326 UsedModules: TUsedModules;
327 Body: TCommonBlock;
328 Internal: Boolean;
329 function SearchVariable(Name: string; Outside: Boolean): TVariable; virtual;
330 function SearchConstant(Name: string; Outside: Boolean): TConstant; virtual;
331 function SearchType(AName: string; Outside: Boolean): TType; virtual;
332 function SearchFunction(Name: string; Outside: Boolean): TFunction; virtual;
333 constructor Create;
334 destructor Destroy; override;
335 end;
336
337 { TModuleProgram }
338
339 TModuleProgram = class(TSourceModule)
340 constructor Create;
341 destructor Destroy; override;
342 end;
343
344 { TModuleUnit }
345
346 TModuleUnit = class(TSourceModule)
347 InititializeSection: TCommonBlock;
348 FinalalizeSection: TCommonBlock;
349 constructor Create;
350 destructor Destroy; override;
351 end;
352
353 TModulePackage = class(TSourceModule)
354
355 end;
356
357 TModuleLibrary = class(TSourceModule)
358 end;
359
360 { TModules }
361
362 TModules = class(TObjectList<TSourceModule>)
363 function Search(Name: string): TSourceModule;
364 end;
365
366 { TProgram }
367
368 TProgram = class(TSource)
369 Device: TDevice;
370 Modules: TModules;
371 MainModule: TSourceModule;
372 procedure Clear;
373 constructor Create;
374 destructor Destroy; override;
375 end;
376
377const
378 KeyWords: array[0..37] of string = ('program', 'unit', 'uses', 'begin', 'end',
379 'type', 'const', 'var', 'array', 'record', 'absolute', 'virtual', 'class',
380 'set', 'private', 'public', 'interface', 'implementation', 'finalization',
381 'initialization', 'for', 'while', 'if', 'case', 'of', 'pointer',
382 'object', 'packed', 'procedure', 'function', 'to', 'do', 'downto', 'repeat',
383 'until', 'then', 'asm', 'else');
384 Operators: array[0..22] of string = ('@', 'not', '*', 'and', '/', 'shl',
385 'shr', 'as', 'div', 'mod', 'or', 'xor', '-', '+', '=', '>', '<', '<>', '<=',
386 '>=', 'is', 'in', ':=');
387
388resourcestring
389 SAssignmentError = 'Assignment error';
390
391
392implementation
393
394{ TFunction }
395
396constructor TFunction.Create;
397begin
398 inherited;
399 Parameters := TParameters.Create;
400 Parameters.Parent := Self;
401 //ResultType := TType.Create;
402end;
403
404destructor TFunction.Destroy;
405begin
406 FreeAndNil(Parameters);
407// FreeAndNil(ResultType);
408 inherited;
409end;
410
411{ TProgram }
412
413procedure TProgram.Clear;
414begin
415 Modules.Clear;
416 MainModule := nil;
417end;
418
419constructor TProgram.Create;
420begin
421 Device := TDevice.Create;
422 Modules := TModules.Create;
423end;
424
425destructor TProgram.Destroy;
426begin
427 FreeAndNil(Modules);
428 FreeAndNil(Device);
429end;
430
431{ TConstants }
432
433destructor TConstants.Destroy;
434begin
435 inherited;
436end;
437
438function TConstants.Search(Name: string): TConstant;
439var
440 I: Integer;
441begin
442 I := 0;
443 while (I < Count) and (LowerCase(TConstant(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
444 if I < Count then Result := TConstant(Items[I]) else begin
445 if Assigned(Parent.Parent) then Result := Parent.Parent.Constants.Search(Name)
446 else begin
447 Result := nil;
448 end;
449 end;
450end;
451
452{ TSourceModule }
453
454constructor TSourceModule.Create;
455begin
456 inherited;
457 UsedModules := TUsedModules.Create;
458 UsedModules.ParentModule := Self;
459 Body := TCommonBlock.Create;
460 Body.ParentModule := Self;
461end;
462
463destructor TSourceModule.Destroy;
464begin
465 FreeAndNil(Body);
466 FreeAndNil(UsedModules);
467 inherited;
468end;
469
470(*
471procedure TCommonBlock.CheckReferences;
472var
473 I: Integer;
474begin
475 for I := 0 to Operations.Count - 1 do
476 with TOperation(Operations[I]) do begin
477 if (Instruction = inJump) or (Instruction = inConditionalJump) then
478 TOperation(Operations[GotoAddress]).Referenced := True;
479 end;
480end;
481*)
482
483constructor TCommonBlock.Create;
484begin
485 Constants := TConstants.Create;
486 Constants.Parent := Self;
487 Types := TTypes.Create;
488 Types.Parent := Self;
489 Variables := TVariables.Create;
490 Variables.Parent := Self;
491 Functions := TFunctions.Create;
492 Functions.Parent := Self;
493 Code := TBeginEnd.Create;
494 Code.Parent := Self;
495 Code.CommonBlock := Self;
496 Order := TObjectList<TObject>.Create;
497 Order.OwnsObjects := False;
498end;
499
500destructor TCommonBlock.Destroy;
501begin
502 FreeAndNil(Constants);
503 FreeAndNil(Types);
504 FreeAndNil(Variables);
505 FreeAndNil(Functions);
506 FreeAndNil(Code);
507 FreeAndNil(Order);
508 inherited;
509end;
510
511{ TTypes }
512
513destructor TTypes.Destroy;
514begin
515 inherited;
516end;
517
518function TTypes.AddNew: TType;
519begin
520 Result := TType.Create;
521 Add(Result);
522end;
523
524function TTypes.Search(Name: string; Exported: Boolean = False): TType;
525var
526 I: Integer;
527begin
528 // Search in own list
529 I := 0;
530 while (I < Count) and (LowerCase(TType(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
531 if I < Count then Result := TType(Items[I])
532 else Result := nil;
533
534 // Search in parent
535 if not Assigned(Result) and Assigned(Parent.Parent) then
536 Result := Parent.Parent.Types.Search(Name);
537
538 // Search global variables
539 if not Assigned(Result) and Assigned(Parent.ParentModule) and (not Exported) then begin
540 Result := Parent.ParentModule.SearchType(Name, True);
541 end;
542end;
543
544{ TVariables }
545
546destructor TVariables.Destroy;
547begin
548 inherited;
549end;
550
551function TVariables.Search(Name: string; Exported: Boolean = False): TVariable;
552var
553 I: Integer;
554begin
555 // Search in own list
556 I := 0;
557 while (I < Count) and (LowerCase(TVariable(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
558 if I < Count then Result := TVariable(Items[I]) else Result := nil;
559
560 if not Exported then begin
561 // Search parent block variables
562 if not Assigned(Result) then begin
563 if Assigned(Parent.Parent) then
564 Result := Parent.Parent.Variables.Search(Name)
565 else Result := nil;
566 end;
567
568 // Search parent function parameters
569 if not Assigned(Result) then begin
570 if Assigned(Parent) and (Parent is TFunction) then
571 Result := TFunction(Parent).Parameters.Search(Name)
572 else Result := nil;
573 end;
574
575 if not Assigned(Result) then begin
576 if Assigned(Parent.Parent) and (Parent.Parent is TFunction) then
577 Result := TFunction(Parent.Parent).Parameters.Search(Name)
578 else Result := nil;
579 end;
580
581 // Search global variables
582 //if not Assigned(Result) then begin
583 // if Assigned(Parent.ParentModule) then
584 // Result := Parent.ParentModule.SearchVariable(Name, True);
585 //end;
586 end;
587end;
588
589{ TFunctions }
590
591destructor TFunctions.Destroy;
592begin
593 inherited;
594end;
595
596function TFunctions.AddNew: TFunction;
597begin
598 Result := TFunction.Create;
599 Add(Result);
600end;
601
602function TFunctions.Search(Name: string; Exported: Boolean): TFunction;
603var
604 I: Integer;
605begin
606 // Search in own list
607 I := 0;
608 while (I < Count) and (LowerCase(TFunction(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
609 if I < Count then Result := TFunction(Items[I]) else Result := nil;
610
611 // Search parent block list
612 if not Assigned(Result) and Assigned(Parent.Parent) then
613 Result := Parent.Parent.Functions.Search(Name, Exported);
614
615 // Search global variables
616 if not Assigned(Result) and Assigned(Parent.ParentModule) and (not Exported) then
617 Result := Parent.ParentModule.SearchFunction(Name, True);
618end;
619
620{ TExpression }
621
622constructor TExpression.Create;
623begin
624 SubItems := TExpressions.Create;
625 SubItems.Count := 2;
626 SubItems.OwnsObjects := False;
627end;
628
629destructor TExpression.Destroy;
630begin
631 FreeAndNil(SubItems);
632 inherited;
633end;
634
635procedure TExpression.Assign(Source: TExpression);
636begin
637 CommonBlock := Source.CommonBlock;
638 NodeType := Source.NodeType;
639 FunctionCall := Source.FunctionCall;
640 Value := Source.Value;
641 Associated := Source.Associated;
642 OperatorName := Source.OperatorName;
643 Variable := Source.Variable;
644 SubItems.Assign(Source.SubItems);
645end;
646
647{ TParameters }
648
649destructor TParameters.Destroy;
650begin
651 inherited;
652end;
653
654function TParameters.Search(Name: string): TParameter;
655var
656 I: Integer;
657begin
658 I := 0;
659 while (I < Count) and (LowerCase(TParameter(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
660 if I < Count then Result := TParameter(Items[I])
661 else Result := nil;
662end;
663
664{ TBeginEnd }
665
666procedure TBeginEnd.Clear;
667begin
668end;
669
670constructor TBeginEnd.Create;
671begin
672 inherited;
673 Commands := TCommands.Create;
674end;
675
676destructor TBeginEnd.Destroy;
677begin
678 FreeAndNil(Commands);
679 inherited;
680end;
681
682{ TAssignment }
683
684constructor TAssignment.Create;
685begin
686// Source := TExpression.Create;
687end;
688
689destructor TAssignment.Destroy;
690begin
691 FreeAndNil(Source);
692 inherited;
693end;
694
695{ TExpressions }
696
697procedure TExpressions.Assign(Source: TExpressions);
698var
699 I: Integer;
700begin
701 while Count > Source.Count do Delete(Count - 1);
702 while Count < Source.Count do Add(TExpression.Create);
703 for I := 0 to Count - 1 do
704 Items[I].Assign(Source[I]);
705end;
706
707{ TWhileDo }
708
709constructor TWhileDo.Create;
710begin
711 Condition := TExpression.Create;
712 Command := TCommand.Create;
713end;
714
715destructor TWhileDo.Destroy;
716begin
717 FreeAndNil(Condition);
718 FreeAndNil(Command);
719 inherited;
720end;
721
722{ TCaseOfEnd }
723
724constructor TCaseOfEnd.Create;
725begin
726 inherited;
727 Branches := TListCaseOfEndBranche.Create
728end;
729
730destructor TCaseOfEnd.Destroy;
731begin
732 FreeAndNil(Branches);
733 inherited;
734end;
735
736{ TIfThenElse }
737
738constructor TIfThenElse.Create;
739begin
740 Condition := TExpression.Create;
741end;
742
743destructor TIfThenElse.Destroy;
744begin
745 FreeAndNil(Condition);
746 inherited;
747end;
748
749{ TFunctionCall }
750
751constructor TFunctionCall.Create;
752begin
753 inherited;
754 ParameterExpression := TExpressions.Create;
755end;
756
757destructor TFunctionCall.Destroy;
758begin
759 FreeAndNil(ParameterExpression);
760 inherited;
761end;
762
763{ TForToDo }
764
765constructor TForToDo.Create;
766begin
767 inherited;
768 Start := TExpression.Create;
769 Stop := TExpression.Create;
770end;
771
772destructor TForToDo.Destroy;
773begin
774 FreeAndNil(Start);
775 FreeAndNil(Stop);
776 inherited;
777end;
778
779{ TTypeRecord }
780
781constructor TTypeRecord.Create;
782begin
783 inherited;
784 CommonBlock := TCommonBlock.Create;
785end;
786
787destructor TTypeRecord.Destroy;
788begin
789 FreeAndNil(CommonBlock);
790 inherited;
791end;
792
793{ TModules }
794
795function TModules.Search(Name: string): TSourceModule;
796var
797 I: Integer;
798begin
799 I := 0;
800 while (I < Count) and (LowerCase(TSourceModule(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
801 if I < Count then Result := TSourceModule(Items[I])
802 else Result := nil;
803end;
804
805{ TModuleProgram }
806
807function TSourceModule.SearchVariable(Name: string; Outside: Boolean): TVariable;
808var
809 I: Integer;
810begin
811 Result := Body.Variables.Search(Name, Outside);
812
813 if not Assigned(Result) and Outside then begin
814 I := 0;
815 while (I < UsedModules.Count) and (not Assigned(Result)) do begin
816 Result := TUsedModule(UsedModules[I]).Module.SearchVariable(Name, False);
817 Inc(I);
818 end;
819 end;
820end;
821
822function TSourceModule.SearchConstant(Name: string; Outside: Boolean): TConstant;
823begin
824end;
825
826function TSourceModule.SearchType(AName: string; Outside: Boolean): TType;
827var
828 I: Integer;
829begin
830 Result := Body.Types.Search(AName, Outside);
831
832 if not Assigned(Result) and Outside then begin
833 I := 0;
834 while (I < UsedModules.Count) and (not Assigned(Result)) do begin
835 with TUsedModule(UsedModules[I]) do
836 if Assigned(Module) then
837 with Module do
838 Result := SearchType(AName, False);
839 Inc(I);
840 end;
841 end;
842end;
843
844function TSourceModule.SearchFunction(Name: string; Outside: Boolean): TFunction;
845var
846 I: Integer;
847begin
848 Result := Body.Functions.Search(Name, Outside);
849
850 if not Assigned(Result) and Outside then begin
851 I := 0;
852 while (I < UsedModules.Count) and (not Assigned(Result)) do begin
853 if Assigned(TUsedModule(UsedModules[I]).Module) then
854 Result := TUsedModule(UsedModules[I]).Module.SearchFunction(Name, False);
855 Inc(I);
856 end;
857 end;
858end;
859
860constructor TModuleProgram.Create;
861begin
862 inherited;
863end;
864
865destructor TModuleProgram.Destroy;
866begin
867 inherited;
868end;
869
870{ TModuleUnit }
871
872
873constructor TModuleUnit.Create;
874begin
875 inherited;
876 InititializeSection := TCommonBlock.Create;
877 InititializeSection.ParentModule := Self;
878 FinalalizeSection := TCommonBlock.Create;
879 FinalalizeSection.ParentModule := Self;
880end;
881
882destructor TModuleUnit.Destroy;
883begin
884 FreeAndNil(InititializeSection);
885 FreeAndNil(FinalalizeSection);
886 inherited;
887end;
888
889{ TTypeEnumeration }
890
891constructor TTypeEnumeration.Create;
892begin
893 inherited;
894 Items := TEnumItems.Create;
895end;
896
897destructor TTypeEnumeration.Destroy;
898begin
899 FreeAndNil(Items);
900 inherited;
901end;
902
903{ TTypeClass }
904
905constructor TTypeClass.Create;
906begin
907 inherited;
908 CommonBlock := TCommonBlock.Create;
909end;
910
911destructor TTypeClass.Destroy;
912begin
913 FreeAndNil(CommonBlock);
914 inherited;
915end;
916
917{ TType }
918
919procedure TType.Assign(Source: TType);
920var
921 I: Integer;
922 NewType: TType;
923begin
924 if Assigned(Source) then begin
925 Name := Source.Name;
926 Parameters.Clear;
927 for I := 0 to Source.Parameters.Count - 1 do begin
928 NewType := TType.Create;
929 //NewType := TType(Source.Parameters[I].ClassType.Create);
930 NewType.Assign(TType(Source.Parameters[I]));
931 Parameters.Add(NewType);
932 end;
933 Visibility := Source.Visibility;
934 Parent := Source.Parent;
935 Internal := Source.Internal;
936 ForwardDeclared := Source.ForwardDeclared;
937 Exported := Source.Exported;
938 Size := Source.Size;
939 UsedType := Source.UsedType;
940 end else raise Exception.Create(SAssignmentError);
941end;
942
943constructor TType.Create;
944begin
945 Parameters := TTypes.Create;
946 //Parameters.Parent := Parent.Parent;
947end;
948
949destructor TType.Destroy;
950begin
951 FreeAndNil(Parameters);
952 inherited;
953end;
954
955end.
956
Note: See TracBrowser for help on using the repository browser.