Changeset 41
- Timestamp:
- Feb 28, 2012, 8:34:31 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/TranspascalCompiler.lpk
r38 r41 9 9 <PathDelim Value="\"/> 10 10 <SearchPaths> 11 <OtherUnitFiles Value=" Produce;Analyze"/>11 <OtherUnitFiles Value="Target;Target\Interpretter;Target\ASM8051;Target\Java;Target\GCC;Target\PHP;Target\Delphi;Target\Dynamic C"/> 12 12 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 13 13 </SearchPaths> 14 <Parsing> 15 <SyntaxOptions> 16 <SyntaxMode Value="Delphi"/> 17 </SyntaxOptions> 18 </Parsing> 14 19 <Other> 15 20 <CompilerMessages> … … 21 26 </CompilerOptions> 22 27 <Version Minor="1"/> 23 <Files Count="1 2">28 <Files Count="13"> 24 29 <Item1> 25 30 <Filename Value="UCompiler.pas"/> … … 31 36 </Item2> 32 37 <Item3> 33 <Filename Value=" Produce\UProducerTreeView.pas"/>34 <UnitName Value="UProducer TreeView"/>38 <Filename Value="UProducer.pas"/> 39 <UnitName Value="UProducer"/> 35 40 </Item3> 36 41 <Item4> 37 <Filename Value=" Produce\UProducer.pas"/>38 <UnitName Value="UProducer "/>42 <Filename Value="Target\ASM8051\UProducerASM8051.pas"/> 43 <UnitName Value="UProducerAsm8051"/> 39 44 </Item4> 40 45 <Item5> 41 <Filename Value=" Produce\UProducers.pas"/>42 <UnitName Value="UProducer s"/>46 <Filename Value="Target\Dynamic C\UProducerDynamicc.pas"/> 47 <UnitName Value="UProducerDynamicC"/> 43 48 </Item5> 44 49 <Item6> 45 <Filename Value=" Produce\UProducerAsm8051.pas"/>46 <UnitName Value="UProducer Asm8051"/>50 <Filename Value="Target\Delphi\UProducerPascal.pas"/> 51 <UnitName Value="UProducerPascal"/> 47 52 </Item6> 48 53 <Item7> 49 <Filename Value=" Produce\UProducerDynamicC.pas"/>50 <UnitName Value="UProducer DynamicC"/>54 <Filename Value="Target\GCC\UProducerGCC.pas"/> 55 <UnitName Value="UProducerGCC"/> 51 56 </Item7> 52 57 <Item8> 53 <Filename Value=" Produce\UProducerPascal.pas"/>54 <UnitName Value="U ProducerPascal"/>58 <Filename Value="UAnalyzer.pas"/> 59 <UnitName Value="UAnalyzer"/> 55 60 </Item8> 56 61 <Item9> 57 <Filename Value=" Produce\UProducerGCCC.pas"/>58 <UnitName Value="U ProducerGCCC"/>62 <Filename Value="Analyze\UAnalyzerPascal.pas"/> 63 <UnitName Value="UAnalyzerPascal"/> 59 64 </Item9> 60 65 <Item10> 61 <Filename Value=" Analyze\UAnalyzer.pas"/>62 <UnitName Value="U Analyzer"/>66 <Filename Value="UTarget.pas"/> 67 <UnitName Value="UTarget"/> 63 68 </Item10> 64 69 <Item11> 65 <Filename Value=" Analyze\UAnalyzers.pas"/>66 <UnitName Value="U Analyzers"/>70 <Filename Value="UExecutor.pas"/> 71 <UnitName Value="UExecutor"/> 67 72 </Item11> 68 73 <Item12> 69 <Filename Value=" Analyze\UAnalyzerPascal.pas"/>70 <UnitName Value="U AnalyzerPascal"/>74 <Filename Value="Target\UTargets.pas"/> 75 <UnitName Value="UTargets"/> 71 76 </Item12> 77 <Item13> 78 <Filename Value="Target\Interpretter\UTargetInterpretter.pas"/> 79 <UnitName Value="UTargetInterpretter"/> 80 </Item13> 72 81 </Files> 73 82 <Type Value="RunAndDesignTime"/> -
trunk/Compiler/TranspascalCompiler.pas
r38 r41 8 8 9 9 uses 10 UCompiler, USourceCode, UProducer TreeView, UProducer, UProducers,11 UProducer Asm8051, UProducerDynamicC, UProducerPascal, UProducerGCCC,12 U Analyzer, UAnalyzers, UAnalyzerPascal, LazarusPackageIntf;10 UCompiler, USourceCode, UProducer, UProducerASM8051, UProducerDynamicc, 11 UProducerPascal, UProducerGCC, UAnalyzer, UAnalyzerPascal, UTarget, 12 UExecutor, UTargets, UTargetInterpretter, LazarusPackageIntf; 13 13 14 14 implementation -
trunk/Compiler/UCompiler.pas
r38 r41 6 6 7 7 uses 8 SysUtils, Variants, Classes, Contnrs, UAnalyzers, UProducers,FileUtil,9 Dialogs, USourceCode, UProducer, UAnalyzer, SpecializedList ;8 SysUtils, Variants, Classes, Contnrs, FileUtil, 9 Dialogs, USourceCode, UProducer, UAnalyzer, SpecializedList, UTarget; 10 10 11 11 type 12 TProducerType = (ptGCCC, ptDynamicC, ptPascal, ptAssembler, ptXML);13 TAnalyzerType = (ptCustomPascal, ptDelphi);14 15 12 TErrorMessage = class 16 13 Text: string; … … 19 16 end; 20 17 21 TCompilerTarget = class22 Vendor: string;23 Model: string;24 Architecture: string;25 end;26 27 18 { TCompilerList } 28 29 TCompilerTargetList = class(TObjectList)30 procedure Add(Vendor, Model, Architecture: string);31 end;32 19 33 20 TCompiler = class … … 35 22 FAnalyzer: TAnalyzer; 36 23 FOnErrorMessage: TErrorMessageEvent; 37 FProducerType: TProducerType;38 FProducer: TProducer;39 24 function GetSource(Name: string; var SourceCode: string): Boolean; 40 25 procedure ErrorMessage(Text: string; Position: TPoint; FileName: string); 41 26 procedure SetAnalyzer(const AValue: TAnalyzer); 42 procedure SetProducer(AValue: TProducer);43 27 procedure AnalyzeAll; 44 28 procedure ProduceAll; … … 47 31 ErrorMessages: TListObject; 48 32 CompiledFolder: string; 49 SupportedTargets: TCompilerTargetList; 50 Target: TCompilerTarget; 33 Target: TTarget; 51 34 TargetFolder: string; 52 Producers: TListProducer; 53 Analyzers: TListAnalyzer; 35 Targets: TListTarget; 54 36 SourceFiles: TListString; 55 37 constructor Create; … … 60 42 write FOnErrorMessage; 61 43 property Analyzer: TAnalyzer read FAnalyzer write SetAnalyzer; 62 property Producer: TProducer read FProducer write SetProducer;63 44 end; 64 45 46 65 47 implementation 48 49 uses 50 UTargets; 66 51 67 52 resourcestring … … 78 63 constructor TCompiler.Create; 79 64 begin 80 Analyzers := TListAnalyzer.Create; 81 Producers := TListProducer.Create; 65 Targets := TListTarget.Create; 82 66 SourceFiles := TListString.Create; 83 67 84 RegisterAnalyzers(Self); 85 RegisterProducers(Self); 86 87 SupportedTargets := TCompilerTargetList.Create; 88 SupportedTargets.Add('AMD', 'Athlon II', 'amd64'); 89 SupportedTargets.Add('Zilog', 'Z80', 'Z80'); 90 SupportedTargets.Add('Rabbit', 'RC3000', 'Z180'); 91 SupportedTargets.Add('Atmel', 'ATmega8', 'AVR'); 92 SupportedTargets.Add('Atmel', 'UC3B0256', 'AVR32'); 93 SupportedTargets.Add('Dallas', 'DS89C450', '8052'); 68 RegisterTargets(Self); 94 69 95 70 AbstractCode := TProgram.Create; 96 Producer := nil;97 Analyzer := nil;98 71 ErrorMessages := TListObject.Create; 99 72 CompiledFolder := 'Compiled'; … … 109 82 begin 110 83 AbstractCode.Free; 111 Analyzers.Free; 112 Producers.Free; 84 Targets.Free; 113 85 ErrorMessages.Free; 114 SupportedTargets.Free;115 86 SourceFiles.Free; 116 87 end; … … 159 130 end; 160 131 161 procedure TCompiler.SetProducer(AValue: TProducer);162 begin163 if FProducer = AValue then Exit;164 FProducer := AValue;165 end;166 167 132 procedure TCompiler.AnalyzeAll; 168 133 begin … … 187 152 with AbstractCode do 188 153 for I := 0 to Modules.Count - 1 do begin 189 Producer.Produce(TModule(Modules[I]));190 Producer.AssignToStringList(ProducedCode);154 Target.Producer.Produce(TModule(Modules[I])); 155 Target.Producer.AssignToStringList(ProducedCode); 191 156 TargetFileName := TargetFolder + DirectorySeparator + 192 CompiledFolder + DirectorySeparator + Producer.Name +157 CompiledFolder + DirectorySeparator + Target.Producer.Name + 193 158 DirectorySeparator + TModule(Modules[I]).TargetFile; 194 159 ForceDirectoriesUTF8(ExtractFileDir(TargetFileName)); … … 200 165 end; 201 166 202 { TCompilerTargetList }203 204 procedure TCompilerTargetList.Add(Vendor, Model, Architecture: string);205 var206 NewItem: TCompilerTarget;207 begin208 NewItem := TCompilerTarget.Create;209 NewItem.Vendor := Vendor;210 NewItem.Model := Model;211 NewItem.Architecture := Architecture;212 inherited Add(NewItem);213 end;214 215 167 end. -
trunk/IDE/Forms/UCompilersForm.lfm
r37 r41 22 22 item 23 23 Caption = 'Execution path' 24 Width = 2 0024 Width = 247 25 25 end> 26 26 OwnerData = True -
trunk/IDE/Forms/UCompilersForm.pas
r37 r41 31 31 32 32 uses 33 UMainForm, UCompiler, UCompilerSettingsForm, UProducer ;33 UMainForm, UCompiler, UCompilerSettingsForm, UProducer, UTarget; 34 34 35 35 resourcestring … … 46 46 procedure TFormProducers.ListView1Data(Sender: TObject; Item: TListItem); 47 47 begin 48 if (Item.Index >= 0) and (Item.Index < MainForm.Compiler. Producers.Count) then49 with T Producer(MainForm.Compiler.Producers[Item.Index]) do begin48 if (Item.Index >= 0) and (Item.Index < MainForm.Compiler.Targets.Count) then 49 with TTarget(MainForm.Compiler.Targets[Item.Index]) do begin 50 50 Item.Caption := Name; 51 Item.Data := MainForm.Compiler. Producers[Item.Index];52 Item.SubItems.Add( CompilerPath);51 Item.Data := MainForm.Compiler.Targets[Item.Index]; 52 Item.SubItems.Add(Producer.CompilerPath); 53 53 end; 54 54 end; … … 66 66 procedure TFormProducers.ReloadList; 67 67 begin 68 ListView1.Items.Count := MainForm.Compiler. Producers.Count;68 ListView1.Items.Count := MainForm.Compiler.Targets.Count; 69 69 ListView1.Refresh; 70 70 end; -
trunk/IDE/Forms/UMainForm.lfm
r39 r41 472 472 0000000000000000000000000000000000000000000000000000 473 473 } 474 end475 object MenuItemAnalyzer: TMenuItem476 Caption = 'Analyzer'477 474 end 478 475 object MenuItemProducer: TMenuItem -
trunk/IDE/Forms/UMainForm.lrt
r39 r41 11 11 TMAINFORM.MENUITEM12.CAPTION=- 12 12 TMAINFORM.MENUITEM7.CAPTION=Run 13 TMAINFORM.MENUITEMANALYZER.CAPTION=Analyzer14 13 TMAINFORM.MENUITEMPRODUCER.CAPTION=Producer 15 14 TMAINFORM.MENUITEM15.CAPTION=View -
trunk/IDE/Forms/UMainForm.pas
r39 r41 11 11 UCDConjoinForm, UCDWindowList, UCDLayout, UCDCustomize, UCoolTranslator, 12 12 UCompiledForm, UCodeTreeForm, URegistry, ULastOpenedList, UApplicationInfo, 13 UDebugLog , UAnalyzer, UProducer;13 UDebugLog; 14 14 15 15 const … … 68 68 MenuItem23: TMenuItem; 69 69 MenuItem24: TMenuItem; 70 MenuItemAnalyzer: TMenuItem;71 70 MenuItemProducer: TMenuItem; 72 71 MenuItem3: TMenuItem; … … 157 156 uses 158 157 UMessagesForm, UCodeForm, UProjectManager, UCommon, UAboutForm, UFormOptions, 159 UCompilersForm ;158 UCompilersForm, UTarget, UAnalyzer, UProducer; 160 159 161 160 resourcestring … … 171 170 try 172 171 RootKey := Root; 173 for I := 0 to Producers.Count - 1 do174 with T Producer(Producers[I]) do begin175 OpenKey(Key + '\ Producers\' + Name, True);172 for I := 0 to Targets.Count - 1 do 173 with TTarget(Targets[I]) do begin 174 OpenKey(Key + '\Targets\' + Name, True); 176 175 if ValueExists('CompilerPath') then 177 CompilerPath := ReadStringWithDefault('CompilerPath',CompilerPath);176 Producer.CompilerPath := ReadStringWithDefault('CompilerPath', Producer.CompilerPath); 178 177 end; 178 if ValueExists('SelectedTarget') then 179 Target := Targets.SearchBySysName(ReadString('SelectedTarget')) 180 else Target := nil; 179 181 finally 180 182 Free; … … 189 191 try 190 192 RootKey := Root; 191 for I := 0 to Producers.Count - 1 do 192 with TProducer(Producers[I]) do begin 193 OpenKey(Key + '\Producers\' + Name, True); 194 if CompilerPath <> '' then WriteString('CompilerPath', CompilerPath) 195 else DeleteValue('CompilerPath'); 193 for I := 0 to Targets.Count - 1 do 194 with TTarget(Targets[I]) do begin 195 OpenKey(Key + '\Targets\' + Name, True); 196 if Assigned(Producer) then begin 197 if Producer.CompilerPath <> '' then WriteString('CompilerPath', Producer.CompilerPath) 198 else DeleteValue('CompilerPath'); 199 end; 196 200 end; 201 if Assigned(Target) then WriteString('SelectedTarget', Target.SysName) 202 else DeleteValue('SelectedTarget'); 197 203 finally 198 204 Free; … … 207 213 208 214 // Compile project file 209 Compiler.Producer := TProducer(Compiler.Producers[SelectedProducerIndex]);210 Compiler.Analyzer := TAnalyzer(Compiler.Analyzers[SelectedAnalyzerIndex]);211 215 Compiler.Init; 212 216 … … 434 438 NewMenuItem: TMenuItem; 435 439 begin 436 MenuItemAnalyzer.Clear;437 for I := 0 to Compiler.Analyzers.Count - 1 do begin438 NewMenuItem := TMenuItem.Create(MenuItemAnalyzer);439 NewMenuItem.Caption := TAnalyzer(Compiler.Analyzers[I]).Name;440 NewMenuItem.OnClick := MenuItemAnalyzerClick;441 if I = SelectedAnalyzerIndex then NewMenuItem.Checked := True;442 MenuItemAnalyzer.Add(NewMenuItem);443 end;444 440 MenuItemProducer.Clear; 445 for I := 0 to Compiler. Producers.Count - 1 do begin441 for I := 0 to Compiler.Targets.Count - 1 do begin 446 442 NewMenuItem := TMenuItem.Create(MenuItemProducer); 447 NewMenuItem.Caption := T Producer(Compiler.Producers[I]).Name;443 NewMenuItem.Caption := TTarget(Compiler.Targets[I]).Name; 448 444 NewMenuItem.OnClick := MenuItemProducerClick; 449 445 if I = SelectedProducerIndex then NewMenuItem.Checked := True; -
trunk/IDE/Languages/Transpascal.cs.po
r40 r41 229 229 msgstr "Nápověda" 230 230 231 #: tmainform.menuitemanalyzer.caption232 msgid "Analyzer"233 msgstr "Analyzátor"234 235 231 #: tmainform.menuitemopenrecent.caption 236 232 msgid "Open recent" -
trunk/IDE/Languages/Transpascal.po
r40 r41 221 221 msgstr "" 222 222 223 #: tmainform.menuitemanalyzer.caption224 msgid "Analyzer"225 msgstr ""226 227 223 #: tmainform.menuitemopenrecent.caption 228 224 msgid "Open recent" -
trunk/IDE/Transpascal.lpi
r40 r41 90 90 <Item3> 91 91 <PackageName Value="LCLBase"/> 92 <MinVersion Major="1" Valid="True" Release="1"/>92 <MinVersion Major="1" Release="1" Valid="True"/> 93 93 </Item3> 94 94 <Item4> -
trunk/IDE/UApplicationInfo.pas
r38 r41 2 2 3 3 {$MODE Delphi} 4 5 // Date: 2010-06-166 4 7 5 interface … … 55 53 Name := 'Transpascal IDE'; 56 54 Identification := 1; 57 ReleaseDate := EncodeDate(2012, 2, 2 5);55 ReleaseDate := EncodeDate(2012, 2, 28); 58 56 MajorVersion := 0; 59 57 MinorVersion := 1;
Note:
See TracChangeset
for help on using the changeset viewer.