- Timestamp:
- Jul 30, 2012, 3:52:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Analyze/UAnalyzerPascal.pas
r67 r68 29 29 function ParseUses(SourceCode: TUsedModuleList; AExported: Boolean): Boolean; 30 30 function ParseUsesItem(SourceCode: TUsedModuleList; AExported: Boolean): Boolean; 31 function ParseModule(ProgramCode: TProgram): T Module; override;31 function ParseModule(ProgramCode: TProgram): TSourceModule; override; 32 32 function ParseUnit(var SourceCode: TModuleUnit; ProgramCode: TProgram): Boolean; 33 33 function ParseUnitInterface(SourceCode: TModuleUnit): Boolean; … … 106 106 var 107 107 Parser: TAnalyzerPascal; 108 NewModule: T Module;108 NewModule: TSourceModule; 109 109 begin 110 110 try … … 420 420 { TParserModule } 421 421 422 function TAnalyzerPascal.ParseModule(ProgramCode: TProgram): T Module;422 function TAnalyzerPascal.ParseModule(ProgramCode: TProgram): TSourceModule; 423 423 begin 424 424 Self.ProgramCode := ProgramCode; … … 454 454 function TAnalyzerPascal.ParseUnit(var SourceCode: TModuleUnit; ProgramCode: TProgram): Boolean; 455 455 var 456 NewModule: T Module;456 NewModule: TSourceModule; 457 457 NewCommand: TCommand; 458 458 begin -
trunk/Compiler/Target/ASM8051/UProducerASM8051.pas
r44 r68 35 35 procedure GenerateExpression(Expression: TExpression; LabelPrefix: string); 36 36 procedure GenerateProgram(ProgramBlock: TProgram); 37 procedure GenerateModule(Module: T Module);37 procedure GenerateModule(Module: TSourceModule); 38 38 public 39 39 AssemblyCode: TObjectList; // TList<TAssemblerLine> 40 40 procedure AssignToStringList(Target: TStringList); override; 41 procedure Produce(Module: T Module); override;41 procedure Produce(Module: TSourceModule); override; 42 42 constructor Create; 43 43 destructor Destroy; override; … … 189 189 // with ProgramBlock do 190 190 // for I := 0 to Modules.Count - 1 do 191 // GenerateCommonBlock(T Module(Modules[I]), '');192 end; 193 194 procedure TProducerAsm8051.GenerateModule(Module: T Module);191 // GenerateCommonBlock(TSourceModuleTSourceModule(Modules[I]), ''); 192 end; 193 194 procedure TProducerAsm8051.GenerateModule(Module: TSourceModule); 195 195 begin 196 196 Module.TargetFile := Module.Name + '.asm'; … … 207 207 end; 208 208 209 procedure TProducerAsm8051.Produce(Module: T Module);209 procedure TProducerAsm8051.Produce(Module: TSourceModule); 210 210 begin 211 211 GenerateModule(Module); -
trunk/Compiler/Target/Delphi/UProducerPascal.pas
r65 r68 16 16 private 17 17 procedure GenerateUses(UsedModules: TUsedModuleList); 18 procedure GenerateModule(Module: T Module);19 procedure GenerateUnit(Module: T Module);20 procedure GenerateLibrary(Module: T Module);21 procedure GeneratePackage(Module: T Module);18 procedure GenerateModule(Module: TSourceModule); 19 procedure GenerateUnit(Module: TSourceModule); 20 procedure GenerateLibrary(Module: TSourceModule); 21 procedure GeneratePackage(Module: TSourceModule); 22 22 procedure GenerateType(AType: TType; AssignSymbol: Char = ':'); 23 23 procedure GenerateTypes(Types: TTypeList); … … 43 43 public 44 44 procedure AssignToStringList(Target: TStringList); override; 45 procedure Produce(Module: T Module); override;45 procedure Produce(Module: TSourceModule); override; 46 46 constructor Create; 47 47 destructor Destroy; override; … … 94 94 end; 95 95 96 procedure TProducerPascal.GenerateModule(Module: T Module);96 procedure TProducerPascal.GenerateModule(Module: TSourceModule); 97 97 begin 98 98 Module.TargetFile := Module.Name + '.pas'; … … 113 113 end; 114 114 115 procedure TProducerPascal.GenerateUnit(Module: T Module);115 procedure TProducerPascal.GenerateUnit(Module: TSourceModule); 116 116 begin 117 117 EmitLn('unit ' + TModuleUnit(Module).Name + ';'); … … 127 127 end; 128 128 129 procedure TProducerPascal.GenerateLibrary(Module: T Module);130 begin 131 132 end; 133 134 procedure TProducerPascal.GeneratePackage(Module: T Module);129 procedure TProducerPascal.GenerateLibrary(Module: TSourceModule); 130 begin 131 132 end; 133 134 procedure TProducerPascal.GeneratePackage(Module: TSourceModule); 135 135 begin 136 136 … … 196 196 end; 197 197 198 procedure TProducerPascal.Produce(Module: T Module);198 procedure TProducerPascal.Produce(Module: TSourceModule); 199 199 var 200 200 I: Integer; … … 206 206 with Module.ParentProgram do 207 207 for I := 0 to Modules.Count - 1 do 208 if T Module(Modules[I]).Name = 'System' then209 T Module(Modules[I]).Name := 'System2';208 if TSourceModule(Modules[I]).Name = 'System' then 209 TSourceModule(Modules[I]).Name := 'System2'; 210 210 211 211 GenerateModule(Module); -
trunk/Compiler/Target/Dynamic C/UProducerDynamicc.pas
r44 r68 18 18 function TranslateOperator(Name: string): string; 19 19 procedure GenerateUses(UsedModules: TUsedModuleList); 20 procedure GenerateModule(Module: T Module);20 procedure GenerateModule(Module: TSourceModule); 21 21 procedure GenerateCommonBlock(CommonBlock: TCommonBlock; 22 22 LabelPrefix: string); … … 38 38 public 39 39 procedure AssignToStringList(Target: TStringList); override; 40 procedure Produce(Module: T Module); override;40 procedure Produce(Module: TSourceModule); override; 41 41 constructor Create; 42 42 destructor Destroy; override; … … 96 96 end; 97 97 98 procedure TProducerDynamicC.GenerateModule(Module: T Module);98 procedure TProducerDynamicC.GenerateModule(Module: TSourceModule); 99 99 begin 100 100 if Module is TModuleProgram then begin … … 133 133 end; 134 134 135 procedure TProducerDynamicC.Produce(Module: T Module);135 procedure TProducerDynamicC.Produce(Module: TSourceModule); 136 136 begin 137 137 inherited; … … 147 147 with ProgramBlock do 148 148 for I := 0 to Modules.Count - 1 do 149 GenerateModule(T Module(Modules[I]));149 GenerateModule(TSourceModule(Modules[I])); 150 150 end; 151 151 -
trunk/Compiler/Target/GCC/UProducerGCC.pas
r44 r68 20 20 procedure EmitLn(AText: string = ''); 21 21 procedure GenerateUses(UsedModules: TUsedModuleList); 22 procedure GenerateModule(Module: T Module);22 procedure GenerateModule(Module: TSourceModule); 23 23 procedure GenerateCommonBlock(CommonBlock: TCommonBlock; 24 24 LabelPrefix: string); … … 43 43 Indetation: Integer; 44 44 procedure AssignToStringList(Target: TStringList); override; 45 procedure Produce(Module: T Module); override;45 procedure Produce(Module: TSourceModule); override; 46 46 constructor Create; 47 47 destructor Destroy; override; … … 122 122 end; 123 123 124 procedure TProducerGCCC.GenerateModule(Module: T Module);124 procedure TProducerGCCC.GenerateModule(Module: TSourceModule); 125 125 begin 126 126 Module.TargetFile := Module.Name + '.c'; … … 138 138 end; 139 139 140 procedure TProducerGCCC.Produce(Module: T Module);140 procedure TProducerGCCC.Produce(Module: TSourceModule); 141 141 begin 142 142 inherited; … … 152 152 with ProgramBlock do 153 153 for I := 0 to Modules.Count - 1 do 154 GenerateModule(T Module(Modules[I]));154 GenerateModule(TSourceModule(Modules[I])); 155 155 end; 156 156 -
trunk/Compiler/Target/XML/UTargetXML.pas
r63 r68 20 20 TProducerXML = class(TProducer) 21 21 private 22 procedure GenerateModule(Module: T Module);23 procedure GenerateUnit(Module: T Module);24 procedure GenerateLibrary(Module: T Module);25 procedure GeneratePackage(Module: T Module);22 procedure GenerateModule(Module: TSourceModule); 23 procedure GenerateUnit(Module: TSourceModule); 24 procedure GenerateLibrary(Module: TSourceModule); 25 procedure GeneratePackage(Module: TSourceModule); 26 26 public 27 27 procedure AssignToStringList(Target: TStringList); override; 28 procedure Produce(Module: T Module); override;28 procedure Produce(Module: TSourceModule); override; 29 29 end; 30 30 … … 34 34 { TProducerXML } 35 35 36 procedure TProducerXML.GenerateModule(Module: T Module);36 procedure TProducerXML.GenerateModule(Module: TSourceModule); 37 37 begin 38 38 Module.TargetFile := Module.Name + '.xml'; … … 50 50 end; 51 51 52 procedure TProducerXML.GenerateUnit(Module: T Module);52 procedure TProducerXML.GenerateUnit(Module: TSourceModule); 53 53 begin 54 54 EmitLn('<?xml version="1.0"?>'); … … 59 59 end; 60 60 61 procedure TProducerXML.GenerateLibrary(Module: T Module);61 procedure TProducerXML.GenerateLibrary(Module: TSourceModule); 62 62 begin 63 63 EmitLn('<?xml version="1.0"?>'); … … 68 68 end; 69 69 70 procedure TProducerXML.GeneratePackage(Module: T Module);70 procedure TProducerXML.GeneratePackage(Module: TSourceModule); 71 71 begin 72 72 EmitLn('<?xml version="1.0"?>'); … … 77 77 end; 78 78 79 procedure TProducerXML.Produce(Module: T Module);79 procedure TProducerXML.Produce(Module: TSourceModule); 80 80 begin 81 81 GenerateModule(Module); -
trunk/Compiler/UAnalyzer.pas
r65 r68 77 77 procedure Process; 78 78 procedure Log(Text: string); 79 function ParseModule(ProgramCode: TProgram): T Module; virtual; abstract;79 function ParseModule(ProgramCode: TProgram): TSourceModule; virtual; abstract; 80 80 property FileName: string read FFileName write FFileName; 81 81 property OnGetSource: TGetSourceEvent read FOnGetSource -
trunk/Compiler/UCompiler.pas
r66 r68 221 221 procedure TCompiler.ProduceAll; 222 222 var 223 NewModule: T Module;223 NewModule: TSourceModule; 224 224 ProducedCode: TStringList; 225 225 I: Integer; … … 231 231 with AbstractCode do 232 232 for I := 0 to Modules.Count - 1 do begin 233 Target.Producer.Produce(T Module(Modules[I]));233 Target.Producer.Produce(TSourceModule(Modules[I])); 234 234 Target.Producer.AssignToStringList(ProducedCode); 235 TargetFileName := TargetFolder + DirectorySeparator + T Module(Modules[I]).TargetFile;235 TargetFileName := TargetFolder + DirectorySeparator + TSourceModule(Modules[I]).TargetFile; 236 236 if Assigned(Target.Producer.OnWriteTarget) then 237 237 Target.Producer.OnWriteTarget(TargetFileName, ProducedCode.Text); -
trunk/Compiler/UProducer.pas
r61 r68 30 30 procedure EmitLn(AText: string = ''); 31 31 procedure AssignToStringList(Target: TStringList); virtual; abstract; 32 procedure Produce(Module: T Module); virtual; abstract;32 procedure Produce(Module: TSourceModule); virtual; abstract; 33 33 procedure ExternalExecute(CommandLine: string); 34 34 constructor Create; -
trunk/Compiler/USourceCode.pas
r63 r68 31 31 TVariable = class; 32 32 TConstant = class; 33 T Module = class;33 TSourceModule = class; 34 34 TProgram = class; 35 35 … … 149 149 Name: string; 150 150 Parent: TCommonBlock; 151 ParentModule: T Module;151 ParentModule: TSourceModule; 152 152 Constants: TConstantList; 153 153 Types: TTypeList; … … 322 322 Name: string; 323 323 Location: string; 324 Module: T Module;324 Module: TSourceModule; 325 325 Exported: Boolean; 326 326 end; … … 330 330 331 331 TUsedModuleList = class(TListUsedModule) 332 ParentModule: T Module;333 end; 334 335 { T Module }336 337 T Module = class332 ParentModule: TSourceModule; 333 end; 334 335 { TSourceModule } 336 337 TSourceModule = class 338 338 public 339 339 ParentProgram: TProgram; … … 342 342 UsedModules: TUsedModuleList; 343 343 Body: TCommonBlock; 344 Internal: Boolean; 344 345 function SearchVariable(Name: string; Outside: Boolean): TVariable; virtual; 345 346 function SearchConstant(Name: string; Outside: Boolean): TConstant; virtual; … … 352 353 { TModuleProgram } 353 354 354 TModuleProgram = class(T Module)355 TModuleProgram = class(TSourceModule) 355 356 constructor Create; 356 357 destructor Destroy; override; … … 359 360 { TModuleUnit } 360 361 361 TModuleUnit = class(T Module)362 TModuleUnit = class(TSourceModule) 362 363 InititializeSection: TCommonBlock; 363 364 FinalalizeSection: TCommonBlock; … … 366 367 end; 367 368 368 TModulePackage = class(T Module)369 370 end; 371 372 TModuleLibrary = class(T Module)369 TModulePackage = class(TSourceModule) 370 371 end; 372 373 TModuleLibrary = class(TSourceModule) 373 374 end; 374 375 … … 379 380 380 381 TModuleList = class(TListModule) 381 function Search(Name: string): T Module;382 function Search(Name: string): TSourceModule; 382 383 end; 383 384 … … 387 388 Device: TDevice; 388 389 Modules: TModuleList; 389 MainModule: T Module;390 MainModule: TSourceModule; 390 391 procedure Clear; 391 392 constructor Create; … … 470 471 end; 471 472 472 { T Module }473 474 constructor T Module.Create;473 { TSourceModule } 474 475 constructor TSourceModule.Create; 475 476 begin 476 477 inherited; … … 481 482 end; 482 483 483 destructor T Module.Destroy;484 destructor TSourceModule.Destroy; 484 485 begin 485 486 Body.Free; … … 790 791 { TModuleList } 791 792 792 function TModuleList.Search(Name: string): T Module;793 function TModuleList.Search(Name: string): TSourceModule; 793 794 var 794 795 I: Integer; 795 796 begin 796 797 I := 0; 797 while (I < Count) and (LowerCase(T Module(Items[I]).Name) <> LowerCase(Name)) do Inc(I);798 if I < Count then Result := T Module(Items[I])798 while (I < Count) and (LowerCase(TSourceModule(Items[I]).Name) <> LowerCase(Name)) do Inc(I); 799 if I < Count then Result := TSourceModule(Items[I]) 799 800 else Result := nil; 800 801 end; … … 802 803 { TModuleProgram } 803 804 804 function T Module.SearchVariable(Name: string; Outside: Boolean): TVariable;805 function TSourceModule.SearchVariable(Name: string; Outside: Boolean): TVariable; 805 806 var 806 807 I: Integer; … … 817 818 end; 818 819 819 function T Module.SearchConstant(Name: string; Outside: Boolean): TConstant;820 begin 821 822 end; 823 824 function T Module.SearchType(AName: string; Outside: Boolean): TType;820 function TSourceModule.SearchConstant(Name: string; Outside: Boolean): TConstant; 821 begin 822 823 end; 824 825 function TSourceModule.SearchType(AName: string; Outside: Boolean): TType; 825 826 var 826 827 I: Integer; … … 840 841 end; 841 842 842 function T Module.SearchFunction(Name: string; Outside: Boolean): TFunction;843 function TSourceModule.SearchFunction(Name: string; Outside: Boolean): TFunction; 843 844 var 844 845 I: Integer; -
trunk/Demos/Simple/System.pas
r66 r68 9 9 function ReadLn: string; internal; 10 10 procedure WriteLn(Text: string); internal; 11 procedure SetPort(Index: Integer; Value: Byte); 12 function GetPort(Index: Integer): Byte; 13 property Port[Index: Integer]: Byte read GetPort write SetPort; 11 14 12 15 implementation -
trunk/IDE/Forms/UFormMain.lfm
r66 r68 5 5 Width = 695 6 6 Caption = 'Transpascal IDE' 7 ClientHeight = 4 767 ClientHeight = 482 8 8 ClientWidth = 695 9 9 Font.Height = -11 … … 20 20 Left = 0 21 21 Height = 5 22 Top = 47 122 Top = 477 23 23 Width = 695 24 24 Align = alBottom … … 89 89 object ComboBoxTarget: TComboBox 90 90 Left = 230 91 Height = 2 791 Height = 21 92 92 Top = 2 93 93 Width = 100 94 ItemHeight = 094 ItemHeight = 13 95 95 OnChange = ComboBoxTargetChange 96 96 Style = csDropDownList … … 105 105 object Splitter1: TSplitter 106 106 Left = 490 107 Height = 3 39107 Height = 345 108 108 Top = 26 109 109 Width = 5 … … 113 113 object PageControlRight: TPageControl 114 114 Left = 495 115 Height = 3 39115 Height = 345 116 116 Top = 26 117 117 Width = 200 … … 137 137 Left = 0 138 138 Height = 101 139 Top = 37 0139 Top = 376 140 140 Width = 695 141 141 ActivePage = TabSheetMessages … … 155 155 Left = 0 156 156 Height = 5 157 Top = 3 65157 Top = 371 158 158 Width = 695 159 159 Align = alBottom … … 162 162 object PageControlMain: TPageControl 163 163 Left = 0 164 Height = 3 39164 Height = 345 165 165 Top = 26 166 166 Width = 490 -
trunk/IDE/Forms/UFormMain.pas
r66 r68 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, 9 ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, 9 ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, Registry, 10 10 UProject, FileUtil, Menus, ActnList, DateUtils, 11 UFormTargetCode, UFormCodeTree, U GeneralRegistry;11 UFormTargetCode, UFormCodeTree, URegistry; 12 12 13 13 type … … 146 146 procedure ProducerProcessOutput(Text: string); 147 147 public 148 procedure LoadFromRegistry(Root: Integer; const Key: string);149 procedure SaveToRegistry(Root: Integer; const Key: string);148 procedure LoadFromRegistry(Root: HKEY; const Key: string); 149 procedure SaveToRegistry(Root: HKEY; const Key: string); 150 150 procedure OpenRecentClick(Sender: TObject); 151 151 function GetSource(Name: string; var SourceCode: string): Boolean; … … 402 402 end; 403 403 404 procedure TFormMain.LoadFromRegistry(Root: Integer; const Key: string);405 begin 406 with T GeneralRegistry.Create(nil)do404 procedure TFormMain.LoadFromRegistry(Root: HKEY; const Key: string); 405 begin 406 with TRegistryEx.Create do 407 407 try 408 CurrentRoot:= Root;408 RootKey := Root; 409 409 OpenKey(Key, True); 410 410 if ValueExists('RightPanelWidth') then … … 419 419 end; 420 420 421 procedure TFormMain.SaveToRegistry(Root: Integer; const Key: string);422 begin 423 with T GeneralRegistry.Create(nil)do421 procedure TFormMain.SaveToRegistry(Root: HKEY; const Key: string); 422 begin 423 with TRegistryEx.Create do 424 424 try 425 CurrentRoot:= Root;425 RootKey := Root; 426 426 OpenKey(Key, True); 427 427 WriteInteger('RightPanelWidth', PageControlRight.Width); … … 477 477 begin 478 478 AProjectClose.Execute; 479 Core.SaveToRegistry( Integer(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);479 Core.SaveToRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey); 480 480 end; 481 481 … … 503 503 procedure TFormMain.FormShow(Sender: TObject); 504 504 begin 505 Core.LoadFromRegistry( Integer(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);505 Core.LoadFromRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey); 506 506 DockInit; 507 507 Core.ProjectTemplatesInit; -
trunk/IDE/Transpascal.lpi
r66 r68 110 110 </Item8> 111 111 </RequiredPackages> 112 <Units Count=" 18">112 <Units Count="21"> 113 113 <Unit0> 114 114 <Filename Value="Transpascal.lpr"/> … … 240 240 <UnitName Value="UFormExternalProducerOutput"/> 241 241 </Unit17> 242 <Unit18> 243 <Filename Value="Notes.txt"/> 244 <IsPartOfProject Value="True"/> 245 </Unit18> 246 <Unit19> 247 <Filename Value="Common\UModule.pas"/> 248 <IsPartOfProject Value="True"/> 249 <UnitName Value="UModule"/> 250 </Unit19> 251 <Unit20> 252 <Filename Value="Modules\Pascal\UModulePascal.pas"/> 253 <IsPartOfProject Value="True"/> 254 <UnitName Value="UModulePascal"/> 255 </Unit20> 242 256 </Units> 243 257 </ProjectOptions> … … 250 264 <SearchPaths> 251 265 <IncludeFiles Value="$(ProjOutDir)"/> 252 <OtherUnitFiles Value="Forms "/>266 <OtherUnitFiles Value="Forms;Common;Modules\Pascal"/> 253 267 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 254 268 </SearchPaths> -
trunk/IDE/Transpascal.lpr
r61 r68 14 14 UFormAbout, UFormOptions, UFormTargets, 15 15 UFormProjectNew, UProjectTemplates, UFormTargetProject, UCore, 16 UFormTargetOptions, UFormExternalProducerOutput ;16 UFormTargetOptions, UFormExternalProducerOutput, UModule, UModulePascal; 17 17 18 18 {$R *.res} -
trunk/IDE/UCore.lfm
r66 r68 37 37 EmailContact = 'robie@centrum.cz' 38 38 AppName = 'Transpascal IDE' 39 ReleaseDate = 411 0739 ReleaseDate = 41120 40 40 RegistryKey = '\Software\Chronosoft\Transpascal' 41 RegistryRoot = rr ApplicationUser41 RegistryRoot = rrKeyCurrentUser 42 42 left = 48 43 43 top = 200 -
trunk/IDE/UCore.pas
r66 r68 7 7 uses 8 8 Classes, SysUtils, FileUtil, ULastOpenedList, UProject, UApplicationInfo, 9 UCompiler, UGeneralRegistry, UDebugLog, UCoolTranslator, UTarget; 9 UCompiler, URegistry, Registry, UDebugLog, UCoolTranslator, UTarget, 10 USourceCode, UModule; 10 11 11 12 type … … 13 14 14 15 TCustomCompiler = class(TCompiler) 16 private 17 procedure InitSystemModule; 18 public 15 19 StartTime: TDateTime; 16 20 SourceFiles: TSourceFileManager; … … 18 22 procedure Init; override; 19 23 function ElapsedTime: TDateTime; 20 procedure LoadFromRegistry(Root: Integer; const Key: string);21 procedure SaveToRegistry(Root: Integer; const Key: string);24 procedure LoadFromRegistry(Root: HKEY; const Key: string); 25 procedure SaveToRegistry(Root: HKEY; const Key: string); 22 26 constructor Create; override; 23 27 destructor Destroy; override; … … 45 49 TargetProject: TProject; 46 50 Compiler: TCustomCompiler; 51 ModuleManager: TModuleManager; 47 52 procedure ProjectTemplatesInit; 48 53 procedure ProjectOpen(FileName: string); 49 54 procedure ProjectNew; 50 55 procedure CompilerDebugLog(Text: string); 51 procedure LoadFromRegistry(Root: Integer; const Key: string);52 procedure SaveToRegistry(Root: Integer; const Key: string);56 procedure LoadFromRegistry(Root: HKEY; const Key: string); 57 procedure SaveToRegistry(Root: HKEY; const Key: string); 53 58 end; 54 59 … … 100 105 ReopenLastOpenedFile := True; 101 106 LogParsing := False; 107 108 ModuleManager := TModuleManager.Create; 102 109 end; 103 110 104 111 procedure TCore.DataModuleDestroy(Sender: TObject); 105 112 begin 113 ModuleManager.Free; 106 114 ProjectTemplates.Free; 107 115 LastOpenedFiles.Free; … … 142 150 end; 143 151 144 procedure TCore.LoadFromRegistry(Root: Integer; const Key: string);145 begin 146 with T GeneralRegistry.Create(nil)do152 procedure TCore.LoadFromRegistry(Root: HKEY; const Key: string); 153 begin 154 with TRegistryEx.Create do 147 155 try 148 CurrentRoot:= Root;156 RootKey := Root; 149 157 OpenKey(Key, True); 150 158 if ValueExists('ReopenLastOpenedFile') then … … 163 171 Free; 164 172 end; 165 LastOpenedFiles.LoadFromRegistry(Root, Key + '\LastOpenedFiles'); 173 LastOpenedFiles.LoadFromRegistry(Root, Key + '\LastOpenedFiles'); //Root, Key + '\LastOpenedFiles'); 166 174 Compiler.LoadFromRegistry(Root, Key + '\Compiler'); 167 175 FormMain.LoadFromRegistry(Root, Key); 168 176 end; 169 177 170 procedure TCore.SaveToRegistry(Root: Integer; const Key: string);171 begin 172 with T GeneralRegistry.Create(nil)do178 procedure TCore.SaveToRegistry(Root: HKEY; const Key: string); 179 begin 180 with TRegistryEx.Create do 173 181 try 174 CurrentRoot:= Root;182 RootKey := Root; 175 183 OpenKey(Key, True); 176 184 WriteBool('ReopenLastOpenedFile', ReopenLastOpenedFile); … … 192 200 { TCustomCompiler } 193 201 202 procedure TCustomCompiler.InitSystemModule; 203 var 204 SystemModule: TSourceModule; 205 begin 206 SystemModule := TSourceModule.Create; 207 with SystemModule do begin 208 Name := 'System'; 209 Internal := True; 210 with TType(Body.Types.AddNew(TType.Create)) do begin 211 Name := 'Byte'; 212 Size := 1; 213 Internal := True; 214 end; 215 with TType(Body.Types.AddNew(TType.Create)) do begin 216 Name := 'ShortInt'; 217 Size := 1; 218 Internal := True; 219 end; 220 with TType(Body.Types.AddNew(TType.Create)) do begin 221 Name := 'Word'; 222 Size := 2; 223 Internal := True; 224 end; 225 with TType(Body.Types.AddNew(TType.Create)) do begin 226 Name := 'SmallInt'; 227 Size := 2; 228 Internal := True; 229 end; 230 with TType(Body.Types.AddNew(TType.Create)) do begin 231 Name := 'Cardinal'; 232 Size := 4; 233 Internal := True; 234 end; 235 with TType(Body.Types.AddNew(TType.Create)) do begin 236 Name := 'Integer'; 237 Size := 4; 238 Internal := True; 239 end; 240 with TType(Body.Types.AddNew(TType.Create)) do begin 241 Name := 'UInt64'; 242 Size := 8; 243 Internal := True; 244 end; 245 with TType(Body.Types.AddNew(TType.Create)) do begin 246 Name := 'Int64'; 247 Size := 8; 248 Internal := True; 249 end; 250 with TFunction(Body.Functions.AddNew(TFunction.Create)) do begin 251 Name := 'WriteLn'; 252 Internal := True; 253 end; 254 ParentProgram := AbstractCode; 255 end; 256 AbstractCode.Modules.Add(SystemModule); 257 end; 258 194 259 procedure TCustomCompiler.Init; 195 260 begin 196 261 inherited; 197 262 StartTime := Now; 263 InitSystemModule; 198 264 end; 199 265 … … 203 269 end; 204 270 205 procedure TCustomCompiler.LoadFromRegistry(Root: Integer; const Key: string);271 procedure TCustomCompiler.LoadFromRegistry(Root: HKEY; const Key: string); 206 272 var 207 273 I: Integer; 208 274 begin 209 with T GeneralRegistry.Create(nil)do275 with TRegistryEx.Create do 210 276 try 211 CurrentRoot:= Root;277 RootKey := Root; 212 278 for I := 0 to Targets.Count - 1 do 213 279 with TTarget(Targets[I]) do begin … … 225 291 end; 226 292 227 procedure TCustomCompiler.SaveToRegistry(Root: Integer; const Key: string);293 procedure TCustomCompiler.SaveToRegistry(Root: HKEY; const Key: string); 228 294 var 229 295 I: Integer; 230 296 begin 231 with T GeneralRegistry.Create(nil)do297 with TRegistryEx.Create do 232 298 try 233 CurrentRoot:= Root;299 RootKey := Root; 234 300 for I := 0 to Targets.Count - 1 do 235 301 with TTarget(Targets[I]) do begin
Note:
See TracChangeset
for help on using the changeset viewer.