- Timestamp:
- Feb 18, 2012, 8:02:50 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UCompilersForm.pas
r25 r31 31 31 32 32 uses 33 UMainForm, U Compiler;33 UMainForm, UTarget; 34 34 35 35 resourcestring … … 46 46 procedure TFormCompilers.ListView1Data(Sender: TObject; Item: TListItem); 47 47 begin 48 if (Item.Index >= 0) and (Item.Index < MainForm. Compilers.Count) then49 with T BrainFuckCompiler(MainForm.Compilers[Item.Index]) do begin48 if (Item.Index >= 0) and (Item.Index < MainForm.Targets.Count) then 49 with TTarget(MainForm.Targets[Item.Index]) do begin 50 50 Item.Caption := Name; 51 Item.Data := MainForm. Compilers[Item.Index];51 Item.Data := MainForm.Targets[Item.Index]; 52 52 Item.SubItems.Add(CompilerPath); 53 53 end; … … 56 56 procedure TFormCompilers.ListView1DblClick(Sender: TObject); 57 57 begin 58 with T BrainFuckCompiler(ListView1.Selected.Data) do58 with TTarget(ListView1.Selected.Data) do 59 59 CompilerPath := InputBox(SCompilerOptions, SCompilerPath, 60 60 CompilerPath); … … 64 64 procedure TFormCompilers.ReloadList; 65 65 begin 66 ListView1.Items.Count := MainForm. Compilers.Count;66 ListView1.Items.Count := MainForm.Targets.Count; 67 67 ListView1.Refresh; 68 68 end; -
trunk/Forms/UMainForm.pas
r30 r31 7 7 uses 8 8 Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs, 9 Menus, ActnList, StdCtrls, ComCtrls, U BrainFuck, UCoolTranslator, StrUtils,10 SpecializedList, U Compiler, Registry, URegistry, ULastOpenedList, Process;9 Menus, ActnList, StdCtrls, ComCtrls, UTargetInterpretter, UCoolTranslator, StrUtils, 10 SpecializedList, UTarget, Registry, URegistry, ULastOpenedList, Process; 11 11 12 12 const … … 146 146 CompilerIndex: Integer; 147 147 ProjectFileName: string; 148 BrainFuckCompiler: T BrainFuckCompiler;149 BrainFuckInterpreter: T BrainFuckInterpretter;148 BrainFuckCompiler: TTarget; 149 BrainFuckInterpreter: TTargetInterpretter; 150 150 BreakPoints: TListInteger; 151 Compilers: TCompilerList;151 Targets: TTargetList; 152 152 LastOpenedList: TLastOpenedList; 153 153 OpenProjectOnStart: Boolean; … … 168 168 uses 169 169 UInterpretterForm, UApplicationInfo, UCompiledForm, UOptionsForm, 170 U CompilerDelphi, UCompilerPHP, UCompilerC, UCompilersForm;170 UTargetDelphi, UTargetPHP, UTargetC, UCompilersForm; 171 171 172 172 resourcestring … … 255 255 end; 256 256 LastOpenedList.LoadFromRegistry(Root, Key); 257 Compilers.LoadFromRegistry(Root, Key);257 Targets.LoadFromRegistry(Root, Key); 258 258 end; 259 259 260 260 procedure TMainForm.SaveToRegistry(Root: HKEY; Key: string); 261 261 begin 262 Compilers.SaveToRegistry(Root, Key);262 Targets.SaveToRegistry(Root, Key); 263 263 LastOpenedList.SaveToRegistry(Root, Key); 264 264 with TRegistryEx.Create do … … 308 308 begin 309 309 MenuItemTarget.Clear; 310 for I := 0 to Compilers.Count - 1 do begin310 for I := 0 to Targets.Count - 1 do begin 311 311 NewMenuItem := TMenuItem.Create(MenuItemTarget); 312 NewMenuItem.Caption := T BrainFuckCompiler(Compilers[I]).Name;312 NewMenuItem.Caption := TTarget(Targets[I]).Name; 313 313 NewMenuItem.OnClick := MenuItemTargetClick; 314 314 if I = CompilerIndex then NewMenuItem.Checked := True; … … 320 320 begin 321 321 BreakPoints := TListInteger.Create; 322 BrainFuckInterpreter := T BrainFuckInterpretter.Create;322 BrainFuckInterpreter := TTargetInterpretter.Create; 323 323 BrainFuckInterpreter.OnChangeState := BrainFuckInterpreterChangeState; 324 BrainFuckCompiler := TBrainFuckCompiler.Create; 325 Compilers := TCompilerList.Create; 326 Compilers.Add(TBrainFuckCompilerDelphi.Create); 327 Compilers.Add(TBrainFuckCompilerPHP.Create); 328 Compilers.Add(TBrainFuckCompilerC.Create); 324 BrainFuckCompiler := TTarget.Create; 325 Targets := TTargetList.Create; 326 Targets.Add(TTargetInterpretter.Create); 327 Targets.Add(TTargetDelphi.Create); 328 Targets.Add(TTargetPHP.Create); 329 Targets.Add(TTargetC.Create); 329 330 UpdateTargetList; 330 331 LastOpenedList := TLastOpenedList.Create; … … 338 339 SaveToRegistry(RegistryRoot, ApplicationInfo.RegistryKey); 339 340 LastOpenedList.Free; 340 Compilers.Free;341 Targets.Free; 341 342 BrainFuckCompiler.Free; 342 343 BrainFuckInterpreter.Free; … … 449 450 procedure TMainForm.ACompileExecute(Sender: TObject); 450 451 begin 451 with T BrainFuckCompiler(Compilers[CompilerIndex]) do begin452 with TTarget(Targets[CompilerIndex]) do begin 452 453 Optimization := coNormal; 453 454 Source := MemoSource.Text; … … 466 467 procedure TMainForm.ACompileAndRunExecute(Sender: TObject); 467 468 begin 468 with T BrainFuckCompiler(Compilers[CompilerIndex]) do begin469 with TTarget(Targets[CompilerIndex]) do begin 469 470 Optimization := coNormal; 470 471 Source := MemoSource.Text; -
trunk/Forms/UOptionsForm.pas
r25 r31 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Spin, ComCtrls, U BrainFuck;9 Spin, ComCtrls, UTargetInterpretter; 10 10 11 11 type … … 28 28 { private declarations } 29 29 public 30 procedure LoadFromInterpretter(Interpretter: T BrainFuckInterpretter);31 procedure SaveToInterpretter(Interpretter: T BrainFuckInterpretter);30 procedure LoadFromInterpretter(Interpretter: TTargetInterpretter); 31 procedure SaveToInterpretter(Interpretter: TTargetInterpretter); 32 32 end; 33 33 … … 59 59 end; 60 60 61 procedure TOptionsForm.LoadFromInterpretter(Interpretter: T BrainFuckInterpretter61 procedure TOptionsForm.LoadFromInterpretter(Interpretter: TTargetInterpretter 62 62 ); 63 63 begin … … 66 66 end; 67 67 68 procedure TOptionsForm.SaveToInterpretter(Interpretter: T BrainFuckInterpretter);68 procedure TOptionsForm.SaveToInterpretter(Interpretter: TTargetInterpretter); 69 69 begin 70 70 Interpretter.CellSize := SpinEditCellSize.Value; -
trunk/Target/UTarget.pas
r30 r31 11 11 type 12 12 TCompilerOptimization = (coNone, coNormal); 13 14 TTargetCapability = (tcRun, tcPause, tcStop, tcStepOut, tsStepOver, tsStepInto, 15 tsRunToCursor, tcCompile, tcBreakpoint); 16 TTargetCapabilities = set of TTargetCapability; 13 17 14 18 { TTarget } … … 29 33 CompiledExtension: string; 30 34 ProjectFileName: string; 35 Capabilities: TTargetCapabilities; 31 36 constructor Create; virtual; 32 37 procedure OptimizeSource; … … 34 39 procedure CompileToFile; virtual; 35 40 procedure Run; virtual; 41 procedure Pause; virtual; 42 procedure Stop; virtual; 43 procedure StepOver; virtual; 44 procedure StepInto; virtual; 45 procedure StepOut; virtual; 46 procedure RunToCursor; virtual; 36 47 end; 37 48 … … 168 179 end; 169 180 170 181 procedure TTarget.Pause; 182 begin 183 184 end; 185 186 procedure TTarget.Stop; 187 begin 188 189 end; 190 191 procedure TTarget.StepOver; 192 begin 193 194 end; 195 196 procedure TTarget.StepInto; 197 begin 198 199 end; 200 201 procedure TTarget.StepOut; 202 begin 203 204 end; 205 206 procedure TTarget.RunToCursor; 207 begin 208 209 end; 171 210 172 211 end. -
trunk/Target/UTargetC.pas
r30 r31 19 19 end; 20 20 21 21 22 implementation 22 23 … … 29 30 SourceExtension := '.c'; 30 31 CompiledExtension := '.exe'; 32 Capabilities := [tcCompile, tcRun]; 31 33 {$IFDEF Windows} 32 34 CompilerPath := 'c:\Program Files\MinGW\bin\gcc.exe -o %1:s'; -
trunk/Target/UTargetDelphi.pas
r30 r31 27 27 SourceExtension := '.pas'; 28 28 CompiledExtension := '.exe'; 29 Capabilities := [tcCompile, tcRun]; 29 30 {$IFDEF Windows} 30 31 CompilerPath := 'c:\Program Files\Embarcadero\RAD Studio\9.0\bin\DCC32.EXE'; -
trunk/Target/UTargetInterpretter.pas
r30 r31 6 6 7 7 uses 8 Classes, SysUtils, Dialogs, Forms, StrUtils ;8 Classes, SysUtils, Dialogs, Forms, StrUtils, UTarget; 9 9 10 10 type … … 28 28 { TTargetInterpretter } 29 29 30 TTargetInterpretter = class 30 TTargetInterpretter = class(TTarget) 31 31 private 32 32 FCellSize: Integer; … … 64 64 procedure Reset; 65 65 procedure SingleStep; 66 procedure Run; 67 procedure Pause; 68 procedure Stop; 66 procedure Run; override; 67 procedure Pause; override; 68 procedure Stop; override; 69 69 constructor Create; 70 70 destructor Destroy; override; … … 284 284 constructor TTargetInterpretter.Create; 285 285 begin 286 Name := 'Interpretter'; 287 Capabilities := [tcRun, tcPause, tcStop]; 286 288 MemorySize := 30000; 287 289 CellSize := 256; -
trunk/Target/UTargetPHP.pas
r30 r31 28 28 Name := 'PHP'; 29 29 SourceExtension := '.php'; 30 Capabilities := [tcCompile, tcRun]; 30 31 {$IFDEF Windows} 31 32 CompilerPath := 'c:\Program Files\PHP\php.exe'; -
trunk/UApplicationInfo.pas
r23 r31 53 53 Name := 'LazFuck'; 54 54 Identification := 1; 55 ReleaseDate := EncodeDate(2012, 2, 1 2);55 ReleaseDate := EncodeDate(2012, 2, 18); 56 56 MajorVersion := 0; 57 57 MinorVersion := 1;
Note:
See TracChangeset
for help on using the changeset viewer.