Ignore:
Timestamp:
Feb 18, 2012, 8:02:50 PM (13 years ago)
Author:
chronos
Message:
  • Modified: Renamed classes from Compiler to Target. Interpretter registred as possible and default target.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.pas

    r30 r31  
    77uses
    88  Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs,
    9   Menus, ActnList, StdCtrls, ComCtrls, UBrainFuck, UCoolTranslator, StrUtils,
    10   SpecializedList, UCompiler, Registry, URegistry, ULastOpenedList, Process;
     9  Menus, ActnList, StdCtrls, ComCtrls, UTargetInterpretter, UCoolTranslator, StrUtils,
     10  SpecializedList, UTarget, Registry, URegistry, ULastOpenedList, Process;
    1111
    1212const
     
    146146    CompilerIndex: Integer;
    147147    ProjectFileName: string;
    148     BrainFuckCompiler: TBrainFuckCompiler;
    149     BrainFuckInterpreter: TBrainFuckInterpretter;
     148    BrainFuckCompiler: TTarget;
     149    BrainFuckInterpreter: TTargetInterpretter;
    150150    BreakPoints: TListInteger;
    151     Compilers: TCompilerList;
     151    Targets: TTargetList;
    152152    LastOpenedList: TLastOpenedList;
    153153    OpenProjectOnStart: Boolean;
     
    168168uses
    169169  UInterpretterForm, UApplicationInfo, UCompiledForm, UOptionsForm,
    170   UCompilerDelphi, UCompilerPHP, UCompilerC, UCompilersForm;
     170  UTargetDelphi, UTargetPHP, UTargetC, UCompilersForm;
    171171
    172172resourcestring
     
    255255  end;
    256256  LastOpenedList.LoadFromRegistry(Root, Key);
    257   Compilers.LoadFromRegistry(Root, Key);
     257  Targets.LoadFromRegistry(Root, Key);
    258258end;
    259259
    260260procedure TMainForm.SaveToRegistry(Root: HKEY; Key: string);
    261261begin
    262   Compilers.SaveToRegistry(Root, Key);
     262  Targets.SaveToRegistry(Root, Key);
    263263  LastOpenedList.SaveToRegistry(Root, Key);
    264264  with TRegistryEx.Create do
     
    308308begin
    309309  MenuItemTarget.Clear;
    310   for I := 0 to Compilers.Count - 1 do begin
     310  for I := 0 to Targets.Count - 1 do begin
    311311    NewMenuItem := TMenuItem.Create(MenuItemTarget);
    312     NewMenuItem.Caption := TBrainFuckCompiler(Compilers[I]).Name;
     312    NewMenuItem.Caption := TTarget(Targets[I]).Name;
    313313    NewMenuItem.OnClick := MenuItemTargetClick;
    314314    if I = CompilerIndex then NewMenuItem.Checked := True;
     
    320320begin
    321321  BreakPoints := TListInteger.Create;
    322   BrainFuckInterpreter := TBrainFuckInterpretter.Create;
     322  BrainFuckInterpreter := TTargetInterpretter.Create;
    323323  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);
    329330  UpdateTargetList;
    330331  LastOpenedList := TLastOpenedList.Create;
     
    338339  SaveToRegistry(RegistryRoot, ApplicationInfo.RegistryKey);
    339340  LastOpenedList.Free;
    340   Compilers.Free;
     341  Targets.Free;
    341342  BrainFuckCompiler.Free;
    342343  BrainFuckInterpreter.Free;
     
    449450procedure TMainForm.ACompileExecute(Sender: TObject);
    450451begin
    451   with TBrainFuckCompiler(Compilers[CompilerIndex]) do begin
     452  with TTarget(Targets[CompilerIndex]) do begin
    452453    Optimization := coNormal;
    453454    Source := MemoSource.Text;
     
    466467procedure TMainForm.ACompileAndRunExecute(Sender: TObject);
    467468begin
    468   with TBrainFuckCompiler(Compilers[CompilerIndex]) do begin
     469  with TTarget(Targets[CompilerIndex]) do begin
    469470    Optimization := coNormal;
    470471    Source := MemoSource.Text;
Note: See TracChangeset for help on using the changeset viewer.