Changeset 74 for trunk/Compiler
- Timestamp:
- Jan 18, 2018, 11:54:13 PM (7 years ago)
- Location:
- trunk/Compiler
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Modules/GCC/UModuleGCC.pas
r73 r74 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, UProducerGCC, UTargetGCC ;8 Classes, SysUtils, UModularSystem, UProducerGCC, UTargetGCC, UCompilerAPI; 9 9 10 10 type … … 43 43 begin 44 44 Target := TTargetGCC.Create; 45 with TCompilerAPI(API) do begin 46 RegisterTarget(TTargetGCC); 47 end; 45 48 inherited; 46 49 end; … … 48 51 procedure TModuleGCC.DoUninstall; 49 52 begin 53 with TCompilerAPI(API) do begin 54 UnregisterTarget(TTargetGCC); 55 end; 50 56 inherited; 51 57 end; -
trunk/Compiler/Modules/Pascal/UAnalyzerPascal.pas
r72 r74 1471 1471 { TParserUsedModuleList } 1472 1472 1473 function TAnalyzerPascal.ParseUses(SourceCode: TUsedModuleList; AExported: Boolean = False): Boolean;1473 function TAnalyzerPascal.ParseUses(SourceCode: TUsedModuleList; AExported: Boolean): Boolean; 1474 1474 var 1475 1475 NewUsedModule: TUsedModule; -
trunk/Compiler/TranspascalCompiler.lpk
r72 r74 1 <?xml version="1.0" ?>1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 3 <Package Version="4"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="TranspascalCompiler"/> 6 <Type Value="RunAndDesignTime"/> 6 7 <AddToProjectUsesSection Value="True"/> 7 8 <CompilerOptions> … … 9 10 <PathDelim Value="\"/> 10 11 <SearchPaths> 11 <OtherUnitFiles Value="Analyze;Target;Target\Interpretter;Target\ASM8051;Target\Java;Target\GCC;Target\PHP;Target\Delphi;Target\Dynamic C;Target\XML;Target\NASM;Modules\Pascal;Modules\GCC;Modules\ASM8051;Modules\Brainfuck;Modules\Interpretter;Modules\Delphi "/>12 <OtherUnitFiles Value="Analyze;Target;Target\Interpretter;Target\ASM8051;Target\Java;Target\GCC;Target\PHP;Target\Delphi;Target\Dynamic C;Target\XML;Target\NASM;Modules\Pascal;Modules\GCC;Modules\ASM8051;Modules\Brainfuck;Modules\Interpretter;Modules\Delphi;Modules\PHP;Modules\Java"/> 12 13 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 13 14 </SearchPaths> … … 19 20 <Other> 20 21 <CompilerMessages> 21 <IgnoredMessages idx50 23="True" idx5024="True" idx5025="True" idx5026="True" idx5027="True" idx5028="True" idx5029="True" idx5030="True" idx5031="True"/>22 <IgnoredMessages idx5031="True" idx5030="True" idx5029="True" idx5028="True" idx5027="True" idx5026="True" idx5025="True" idx5024="True" idx5023="True"/> 22 23 </CompilerMessages> 23 <CompilerPath Value="$(CompPath)"/>24 24 </Other> 25 25 </CompilerOptions> 26 26 <Version Minor="1"/> 27 <Files Count="2 4">27 <Files Count="27"> 28 28 <Item1> 29 29 <Filename Value="UCompiler.pas"/> … … 122 122 <UnitName Value="UModuleBrainfuck"/> 123 123 </Item24> 124 <Item25> 125 <Filename Value="Modules\PHP\UModulePHP.pas"/> 126 <UnitName Value="UModulePHP"/> 127 </Item25> 128 <Item26> 129 <Filename Value="Modules\Java\UModuleJava.pas"/> 130 <UnitName Value="UModuleJava"/> 131 </Item26> 132 <Item27> 133 <Filename Value="Modules\ASM8051\UModuleASM8051.pas"/> 134 <UnitName Value="UModuleASM8051"/> 135 </Item27> 124 136 </Files> 125 <Type Value="RunAndDesignTime"/>126 137 <RequiredPkgs Count="4"> 127 138 <Item1> -
trunk/Compiler/TranspascalCompiler.pas
r72 r74 5 5 unit TranspascalCompiler; 6 6 7 {$warn 5023 off : no warning about unused units} 7 8 interface 8 9 … … 12 13 UTargetGCC, UProducerGCC, UProducerDelphi, UModuleDelphi, UTargetPHP, 13 14 UTargetJava, UTargetXML, UModuleInterpretter, UTargetNASM, UModulePascal, 14 UCompilerAPI, UModuleGCC, USourceConvertor, UModuleBrainfuck, 15 LazarusPackageIntf;15 UCompilerAPI, UModuleGCC, USourceConvertor, UModuleBrainfuck, UModulePHP, 16 UModuleJava, UModuleASM8051, LazarusPackageIntf; 16 17 17 18 implementation -
trunk/Compiler/UCompiler.pas
r72 r74 7 7 uses 8 8 SysUtils, Variants, Classes, Contnrs, FileUtil, UModularSystem, UCompilerAPI, 9 Dialogs, USourceCodePascal, UProducer, UAnalyzer, SpecializedList, UTarget; 9 Dialogs, USourceCodePascal, UProducer, UAnalyzer, SpecializedList, UTarget, 10 fgl; 10 11 11 12 type … … 44 45 public 45 46 AbstractCode: TProgram; 46 ErrorMessages: T ListObject; // TListObject<TErrorMessage>47 ErrorMessages: TFPGObjectList<TErrorMessage>; 47 48 CompiledFolder: string; 48 49 … … 76 77 resourcestring 77 78 SNothingToAnalyze = 'Nothing to analyze'; 78 SRewritingExistedTarget = 'Re qriting existing target file %s';79 SRewritingExistedTarget = 'Rewriting existing target file %s'; 79 80 80 81 { TSourceFileManager } … … 99 100 begin 100 101 try 101 ForceDirectories UTF8(ExtractFileDir(FileName));102 if FileExists UTF8(FileName) then102 ForceDirectories(ExtractFileDir(FileName)); 103 if FileExists(FileName) then 103 104 F := TFileStream.Create(UTF8Decode(FileName), fmOpenWrite) 104 105 else F := TFileStream.Create(UTF8Decode(FileName), fmCreate); … … 118 119 while (I < Files.Count) and (ExtractFileName(Files[I]) <> Name) do Inc(I); 119 120 if I < Files.Count then begin 120 if FileExists UTF8(Files[I]) then begin121 if FileExists(Files[I]) then begin 121 122 Content := LoadStringFromFile(Files[I]); 122 123 Result := True; … … 172 173 Executors := TListObject.Create; 173 174 API := TCompilerAPI.Create; 175 API.Compiler := Self; 174 176 AbstractCode := TProgram.Create; 175 ErrorMessages := T ListObject.Create;177 ErrorMessages := TFPGObjectList<TErrorMessage>.Create; 176 178 CompiledFolder := 'Compiled'; 177 179 ModuleManager := TModuleManager.Create(nil); -
trunk/Compiler/UCompilerAPI.pas
r73 r74 15 15 TCompilerAPI = class(TAPI) 16 16 Compiler: TObject; //TCompiler; 17 procedure RegisterTarget(AClass: TTargetClass); 18 procedure UnregisterTarget(AClass: TTargetClass); 17 19 procedure RegisterConvertor(AClass: TConvertorClass); 18 20 procedure UnregisterConvertor(AClass: TConvertorClass); … … 30 32 31 33 { TCompilerAPI } 34 35 procedure TCompilerAPI.RegisterTarget(AClass: TTargetClass); 36 begin 37 TCompiler(Compiler).Targets.Add(AClass.Create); 38 end; 39 40 procedure TCompilerAPI.UnregisterTarget(AClass: TTargetClass); 41 begin 42 TCompiler(Compiler).Targets.Remove(TObject(AClass)); 43 end; 32 44 33 45 procedure TCompilerAPI.RegisterConvertor(AClass: TConvertorClass); -
trunk/Compiler/UProducer.pas
r72 r74 55 55 Line: string; 56 56 begin 57 if not FileExists UTF8(CompilerPath) then Exit;57 if not FileExists(CompilerPath) then Exit; 58 58 Text := ''; 59 59 try -
trunk/Compiler/UTarget.pas
r60 r74 21 21 destructor Destroy; override; 22 22 end; 23 24 TTargetClass = class of TTarget; 23 25 24 26 { TListTarget }
Note:
See TracChangeset
for help on using the changeset viewer.