- Timestamp:
- Feb 18, 2012, 8:44:10 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UInterpretterForm.pas
r24 r32 64 64 65 65 uses 66 UMainForm ;66 UMainForm, UTargetInterpretter; 67 67 68 68 {$R *.lfm} … … 75 75 procedure TInterpreterForm.Timer1Timer(Sender: TObject); 76 76 begin 77 LabelProgramPointer.Caption := IntToStr(MainForm.BrainFuckInterpreter.SourcePosition); 78 LabelMemoryPointer.Caption := IntToStr(MainForm.BrainFuckInterpreter.MemoryPosition); 79 LabelStepCounter.Caption := IntToStr(MainForm.BrainFuckInterpreter.StepCount); 80 LabelStepSpeed.Caption := IntToStr(MainForm.BrainFuckInterpreter.StepCount - LastStepCounter) + SStepsPerSecond; 81 LastStepCounter := MainForm.BrainFuckInterpreter.StepCount; 77 if MainForm.CurrentTarget is TTargetInterpretter then 78 with TTargetInterpretter(MainForm.CurrentTarget) do begin 79 LabelProgramPointer.Caption := IntToStr(SourcePosition); 80 LabelMemoryPointer.Caption := IntToStr(MemoryPosition); 81 LabelStepCounter.Caption := IntToStr(StepCount); 82 LabelStepSpeed.Caption := IntToStr(StepCount - LastStepCounter) + SStepsPerSecond; 83 LastStepCounter := StepCount; 84 MemoOutput.Lines.Text := Output; 85 end; 82 86 RefreshListViewMemory; 83 MemoOutput.Lines.Text := MainForm.BrainFuckInterpreter.Output;84 87 end; 85 88 86 89 procedure TInterpreterForm.RefreshListViewMemory; 87 90 begin 88 ListViewMemory.Items.Count := Trunc(Length(MainForm.BrainFuckInterpreter.Memory) / RowSize); 89 ListViewMemory.Refresh; 91 if MainForm.CurrentTarget is TTargetInterpretter then 92 with TTargetInterpretter(MainForm.CurrentTarget) do begin 93 ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize); 94 ListViewMemory.Refresh; 95 end; 90 96 end; 91 97 … … 100 106 I: Integer; 101 107 begin 102 with MainForm.BrainFuckInterpreter do 108 if MainForm.CurrentTarget is TTargetInterpretter then 109 with TTargetInterpretter(MainForm.CurrentTarget) do 103 110 if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin 104 111 Item.Caption := IntToHex(Item.Index * RowSize, 8); … … 122 129 procedure TInterpreterForm.MemoInputKeyPress(Sender: TObject; var Key: char); 123 130 begin 124 with MainForm.BrainFuckInterpreter do Input := Input + Key; 131 if MainForm.CurrentTarget is TTargetInterpretter then 132 with TTargetInterpretter(MainForm.CurrentTarget) do 133 Input := Input + Key; 125 134 end; 126 135 -
trunk/Forms/UMainForm.lfm
r30 r32 92 92 Left = 126 93 93 Top = 2 94 Action = A Compile94 Action = AProgramCompile 95 95 end 96 96 object ToolButton8: TToolButton … … 394 394 Caption = 'Program' 395 395 object MenuItem11: TMenuItem 396 Action = A Compile396 Action = AProgramCompile 397 397 Bitmap.Data = { 398 398 36040000424D3604000000000000360000002800000010000000100000000100 … … 562 562 end 563 563 object MenuItem33: TMenuItem 564 Action = AProgramSt opOver564 Action = AProgramStepOver 565 565 end 566 566 object MenuItem34: TMenuItem … … 761 761 ShortCut = 32883 762 762 end 763 object A Compile: TAction763 object AProgramCompile: TAction 764 764 Category = 'Program' 765 765 Caption = 'Compile' 766 766 ImageIndex = 8 767 OnExecute = A CompileExecute767 OnExecute = AProgramCompileExecute 768 768 ShortCut = 16504 769 769 end … … 814 814 ShortCut = 118 815 815 end 816 object AProgramSt opOver: TAction816 object AProgramStepOver: TAction 817 817 Category = 'Program' 818 818 Caption = 'Step over' -
trunk/Forms/UMainForm.lrt
r30 r32 19 19 TMAINFORM.APROJECTNEW.CAPTION=New 20 20 TMAINFORM.AEXIT.CAPTION=Exit 21 TMAINFORM.A COMPILE.CAPTION=Compile21 TMAINFORM.APROGRAMCOMPILE.CAPTION=Compile 22 22 TMAINFORM.ACOMPILEANDRUN.CAPTION=Compile and run 23 23 TMAINFORM.APROGRAMRUN.CAPTION=Run … … 29 29 TMAINFORM.AVIEWCOMPILED.CAPTION=Compiled 30 30 TMAINFORM.APROGRAMSTEPINTO.CAPTION=Step into 31 TMAINFORM.APROGRAMST OPOVER.CAPTION=Step over31 TMAINFORM.APROGRAMSTEPOVER.CAPTION=Step over 32 32 TMAINFORM.APROGRAMRUNTOCURSOR.CAPTION=Run to cursor 33 33 TMAINFORM.APROGRAMSTEPOUT.CAPTION=Step out -
trunk/Forms/UMainForm.pas
r31 r32 18 18 19 19 TMainForm = class(TForm) 20 A Compile: TAction;20 AProgramCompile: TAction; 21 21 AAbout: TAction; 22 22 ABreakpointToggle: TAction; … … 29 29 AProgramStepOut: TAction; 30 30 AProgramRunToCursor: TAction; 31 AProgramSt opOver: TAction;31 AProgramStepOver: TAction; 32 32 AProgramStepInto: TAction; 33 33 AViewCompiled: TAction; … … 108 108 procedure ABreakpointToggleExecute(Sender: TObject); 109 109 procedure ACompileAndRunExecute(Sender: TObject); 110 procedure A CompileExecute(Sender: TObject);110 procedure AProgramCompileExecute(Sender: TObject); 111 111 procedure AExitExecute(Sender: TObject); 112 112 procedure AFormatSourceExecute(Sender: TObject); … … 138 138 Shift: TShiftState; X, Y: Integer); 139 139 private 140 FCurrentTarget: TTarget; 140 141 procedure AProjectOpenRecentExecute(Sender: TObject); 141 142 procedure BrainFuckInterpreterChangeState(Sender: TObject); 142 143 procedure MenuItemTargetClick(Sender: TObject); 143 144 procedure ProjectOpen(FileName: string); 145 procedure SetCurrentTarget(AValue: TTarget); 144 146 public 145 147 Modified: Boolean; 146 CompilerIndex: Integer;147 148 ProjectFileName: string; 148 BrainFuckCompiler: TTarget;149 BrainFuckInterpreter: TTargetInterpretter;150 149 BreakPoints: TListInteger; 151 150 Targets: TTargetList; … … 157 156 procedure UpdateStatusBar; 158 157 procedure UpdateTargetList; 158 property CurrentTarget: TTarget read FCurrentTarget write SetCurrentTarget; 159 159 end; 160 160 … … 222 222 begin 223 223 with TMenuItem(Sender) do begin 224 C ompilerIndex := MenuIndex;224 CurrentTarget := TTarget(Targets[MenuIndex]); 225 225 Checked := True; 226 226 for I := 0 to Parent.Count - 1 do 227 if Parent.Items[I].MenuIndex <> MenuIndex then Parent.Items[I].Checked := False 227 if Parent.Items[I].MenuIndex <> MenuIndex then Parent.Items[I].Checked := False; 228 228 end; 229 229 end; … … 238 238 end; 239 239 240 procedure TMainForm.SetCurrentTarget(AValue: TTarget); 241 var 242 I: Integer; 243 begin 244 if FCurrentTarget = AValue then Exit; 245 FCurrentTarget := AValue; 246 for I := 0 to Targets.Count - 1 do 247 TTarget(Targets[I]).OnChangeState := nil; 248 FCurrentTarget.OnChangeState := BrainFuckInterpreterChangeState; 249 end; 250 240 251 procedure TMainForm.LoadFromRegistry(Root: HKEY; Key: string); 252 var 253 TargetName: string; 241 254 begin 242 255 with TRegistryEx.Create do … … 245 258 OpenKey(Key, True); 246 259 OpenProjectOnStart := ReadBoolWithDefault('OpenProjectOnStart', True); 247 BrainFuckInterpreter.CellSize := ReadIntegerWithDefault('CellSize', 256);248 BrainFuckInterpreter.MemorySize := ReadIntegerWithDefault('MemorySize', 30000);249 260 if ValueExists('LanguageCode') then 250 261 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', '')) 251 262 else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(''); 252 CompilerIndex := ReadIntegerWithDefault('SelectedCompiler', 0); 263 TargetName := ReadStringWithDefault('TargetName', 'Interpretter'); 264 CurrentTarget := Targets.FindByName(TargetName); 265 if not Assigned(CurrentTarget) then CurrentTarget := TTarget(Targets[0]); 253 266 finally 254 267 Free; … … 267 280 OpenKey(Key, True); 268 281 WriteBool('OpenProjectOnStart', OpenProjectOnStart); 269 WriteInteger('CellSize', BrainFuckInterpreter.CellSize);270 WriteInteger('MemorySize', BrainFuckInterpreter.MemorySize);271 282 if Assigned(CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then 272 283 WriteString('LanguageCode', CoolTranslator1.Language.Code) 273 284 else DeleteValue('LanguageCode'); 274 Write Integer('SelectedCompiler', CompilerIndex);285 WriteString('TargetName', CurrentTarget.Name); 275 286 finally 276 287 Free; … … 289 300 MemoSource.Enabled := ProjectFileName <> ''; 290 301 AProjectClose.Enabled := ProjectFileName <> ''; 291 AProgramRun.Enabled := (ProjectFileName <> '') and (BrainFuckInterpreter.State = rsStopped); 292 AProgramPause.Enabled := (ProjectFileName <> '') and (BrainFuckInterpreter.State = rsRunning); 293 AProgramStop.Enabled := (ProjectFileName <> '') and (BrainFuckInterpreter.State <> rsStopped); 294 ACompile.Enabled := ProjectFileName <> ''; 302 AProgramRun.Enabled := (tcRun in CurrentTarget.Capabilities) and 303 (ProjectFileName <> '') and (CurrentTarget.State = rsStopped); 304 AProgramPause.Enabled := (tcPause in CurrentTarget.Capabilities) and 305 (ProjectFileName <> '') and (CurrentTarget.State = rsRunning); 306 AProgramStop.Enabled := (tcStop in CurrentTarget.Capabilities) and 307 (ProjectFileName <> '') and (CurrentTarget.State <> rsStopped); 308 AProgramCompile.Enabled := (tcCompile in CurrentTarget.Capabilities) and (ProjectFileName <> ''); 309 AProgramStepInto.Enabled := (tcStepInto in CurrentTarget.Capabilities) and (ProjectFileName <> ''); 310 AProgramStepOut.Enabled := (tcStepOut in CurrentTarget.Capabilities) and (ProjectFileName <> ''); 311 AProgramRunToCursor.Enabled := (tcRunToCursor in CurrentTarget.Capabilities) and (ProjectFileName <> ''); 312 AProgramStepOver.Enabled := (tcStepOver in CurrentTarget.Capabilities) and (ProjectFileName <> ''); 295 313 UpdateStatusBar; 296 314 UpdateTargetList; … … 312 330 NewMenuItem.Caption := TTarget(Targets[I]).Name; 313 331 NewMenuItem.OnClick := MenuItemTargetClick; 314 if I = CompilerIndexthen NewMenuItem.Checked := True;332 if TTarget(Targets[I]) = CurrentTarget then NewMenuItem.Checked := True; 315 333 MenuItemTarget.Add(NewMenuItem); 316 334 end; … … 320 338 begin 321 339 BreakPoints := TListInteger.Create; 322 BrainFuckInterpreter := TTargetInterpretter.Create;323 BrainFuckInterpreter.OnChangeState := BrainFuckInterpreterChangeState;324 BrainFuckCompiler := TTarget.Create;325 340 Targets := TTargetList.Create; 326 341 Targets.Add(TTargetInterpretter.Create); … … 340 355 LastOpenedList.Free; 341 356 Targets.Free; 342 BrainFuckCompiler.Free;343 BrainFuckInterpreter.Free;344 357 BreakPoints.Free; 345 358 end; … … 349 362 InterpreterForm.LastStepCounter := 0; 350 363 InterpreterForm.Show; 351 BrainFuckInterpreter.Input := InterpreterForm.MemoInput.Lines.Text; 352 BrainFuckInterpreter.Source := MemoSource.Text; 353 BrainFuckInterpreter.Run; 364 if CurrentTarget is TTargetInterpretter then 365 TTargetInterpretter(CurrentTarget).Input := InterpreterForm.MemoInput.Lines.Text; 366 CurrentTarget.Source := MemoSource.Text; 367 CurrentTarget.Run; 354 368 end; 355 369 … … 442 456 procedure TMainForm.AOptionsExecute(Sender: TObject); 443 457 begin 444 OptionsForm.LoadFromInterpretter(BrainFuckInterpreter);458 //OptionsForm.LoadFromInterpretter(CurrentTarget); 445 459 if OptionsForm.ShowModal = mrOK then begin 446 OptionsForm.SaveToInterpretter(BrainFuckInterpreter);447 end; 448 end; 449 450 procedure TMainForm.A CompileExecute(Sender: TObject);451 begin 452 with TTarget(Targets[CompilerIndex])do begin460 //OptionsForm.SaveToInterpretter(CurrentTarget); 461 end; 462 end; 463 464 procedure TMainForm.AProgramCompileExecute(Sender: TObject); 465 begin 466 with CurrentTarget do begin 453 467 Optimization := coNormal; 454 468 Source := MemoSource.Text; … … 467 481 procedure TMainForm.ACompileAndRunExecute(Sender: TObject); 468 482 begin 469 with TTarget(Targets[CompilerIndex])do begin483 with CurrentTarget do begin 470 484 Optimization := coNormal; 471 485 Source := MemoSource.Text; … … 480 494 procedure TMainForm.AProgramPauseExecute(Sender: TObject); 481 495 begin 482 MainForm.BrainFuckInterpreter.Pause496 CurrentTarget.Pause 483 497 end; 484 498 485 499 procedure TMainForm.AProgramStopExecute(Sender: TObject); 486 500 begin 487 MainForm.BrainFuckInterpreter.Stop;501 CurrentTarget.Stop; 488 502 end; 489 503 -
trunk/Languages/LazFuckIDE.cs.po
r30 r32 5 5 "POT-Creation-Date: \n" 6 6 "PO-Revision-Date: \n" 7 "Last-Translator: JiÅà Hajda<robie@centrum.cz>\n"7 "Last-Translator: Chronos <robie@centrum.cz>\n" 8 8 "Language-Team: \n" 9 9 "MIME-Version: 1.0\n" … … 97 97 msgstr "PÅepnout bod zastavenÃ" 98 98 99 #: tmainform.acompile.caption100 msgid "Compile"101 msgstr "PÅeloÅŸit"102 103 99 #: tmainform.acompileandrun.caption 104 100 msgid "Compile and run" … … 127 123 msgstr "Volby" 128 124 125 #: tmainform.aprogramcompile.caption 126 msgctxt "tmainform.aprogramcompile.caption" 127 msgid "Compile" 128 msgstr "PÅeloÅŸit" 129 129 130 #: tmainform.aprogrampause.caption 130 131 msgid "Pause" … … 150 151 msgstr "Vystoupit z" 151 152 153 #: tmainform.aprogramstepover.caption 154 msgctxt "tmainform.aprogramstepover.caption" 155 msgid "Step over" 156 msgstr "PÅejÃt pÅes" 157 152 158 #: tmainform.aprogramstop.caption 153 159 msgid "Stop" 154 160 msgstr "Zastavit" 155 156 #: tmainform.aprogramstopover.caption157 msgctxt "tmainform.aprogramstopover.caption"158 msgid "Step over"159 msgstr "PÅejÃt pÅes"160 161 161 162 #: tmainform.aprojectclose.caption … … 319 320 msgctxt "ucompiler.scompiledfilenotfound" 320 321 msgid "Program compiled file \"%s\" not found" 321 msgstr " "322 msgstr "Nenalezen sestavenÃœ soubor programu \"%s\"" 322 323 323 324 #: ucompiler.scompilernotfound 324 325 msgctxt "ucompiler.scompilernotfound" 325 326 msgid "Compiler \"%s\" not found" 326 msgstr " "327 msgstr "Nenalezen pÅekladaÄ \"%s\"" 327 328 328 329 #: ucompilersform.scompileroptions … … 359 360 msgctxt "utarget.scompiledfilenotfound" 360 361 msgid "Program compiled file \"%s\" not found" 361 msgstr " "362 msgstr "Nenalezen sestavenÃœ soubor programu \"%s\"" 362 363 363 364 #: utarget.scompilernotfound 364 365 msgctxt "utarget.scompilernotfound" 365 366 msgid "Compiler \"%s\" not found" 366 msgstr " "367 msgstr "Nenalezen pÅekladaÄ \"%s\"" 367 368 368 369 #: utargetinterpretter.sjumptablecolision -
trunk/Languages/LazFuckIDE.po
r30 r32 88 88 msgstr "" 89 89 90 #: tmainform.acompile.caption91 msgid "Compile"92 msgstr ""93 94 90 #: tmainform.acompileandrun.caption 95 91 msgid "Compile and run" … … 118 114 msgstr "" 119 115 116 #: tmainform.aprogramcompile.caption 117 msgctxt "TMAINFORM.APROGRAMCOMPILE.CAPTION" 118 msgid "Compile" 119 msgstr "" 120 120 121 #: tmainform.aprogrampause.caption 121 122 msgid "Pause" … … 141 142 msgstr "" 142 143 144 #: tmainform.aprogramstepover.caption 145 msgctxt "TMAINFORM.APROGRAMSTEPOVER.CAPTION" 146 msgid "Step over" 147 msgstr "" 148 143 149 #: tmainform.aprogramstop.caption 144 150 msgid "Stop" 145 msgstr ""146 147 #: tmainform.aprogramstopover.caption148 msgctxt "TMAINFORM.APROGRAMSTOPOVER.CAPTION"149 msgid "Step over"150 151 msgstr "" 151 152 -
trunk/LazFuckIDE.lpi
r30 r32 85 85 </Item5> 86 86 </RequiredPackages> 87 <Units Count="1 4">87 <Units Count="12"> 88 88 <Unit0> 89 89 <Filename Value="LazFuckIDE.lpr"/> … … 97 97 </Unit1> 98 98 <Unit2> 99 <Filename Value="Common\ULastOpenedList.pas"/> 100 <IsPartOfProject Value="True"/> 101 <UnitName Value="ULastOpenedList"/> 99 <Filename Value="Forms\UCompiledForm.pas"/> 100 <IsPartOfProject Value="True"/> 101 <ComponentName Value="CompiledForm"/> 102 <HasResources Value="True"/> 103 <ResourceBaseClass Value="Form"/> 104 <UnitName Value="UCompiledForm"/> 102 105 </Unit2> 103 106 <Unit3> 104 <Filename Value="Common\URegistry.pas"/> 105 <IsPartOfProject Value="True"/> 106 <UnitName Value="URegistry"/> 107 <Filename Value="Forms\UMainForm.pas"/> 108 <IsPartOfProject Value="True"/> 109 <ComponentName Value="MainForm"/> 110 <HasResources Value="True"/> 111 <ResourceBaseClass Value="Form"/> 112 <UnitName Value="UMainForm"/> 107 113 </Unit3> 108 114 <Unit4> 109 <Filename Value="Forms\U CompiledForm.pas"/>110 <IsPartOfProject Value="True"/> 111 <ComponentName Value=" CompiledForm"/>112 <HasResources Value="True"/> 113 <ResourceBaseClass Value="Form"/> 114 <UnitName Value="U CompiledForm"/>115 <Filename Value="Forms\UOptionsForm.pas"/> 116 <IsPartOfProject Value="True"/> 117 <ComponentName Value="OptionsForm"/> 118 <HasResources Value="True"/> 119 <ResourceBaseClass Value="Form"/> 120 <UnitName Value="UOptionsForm"/> 115 121 </Unit4> 116 122 <Unit5> 117 <Filename Value="Forms\U MainForm.pas"/>118 <IsPartOfProject Value="True"/> 119 <ComponentName Value=" MainForm"/>120 <HasResources Value="True"/> 121 <ResourceBaseClass Value="Form"/> 122 <UnitName Value="U MainForm"/>123 <Filename Value="Forms\UInterpretterForm.pas"/> 124 <IsPartOfProject Value="True"/> 125 <ComponentName Value="InterpreterForm"/> 126 <HasResources Value="True"/> 127 <ResourceBaseClass Value="Form"/> 128 <UnitName Value="UInterpretterForm"/> 123 129 </Unit5> 124 130 <Unit6> 125 <Filename Value="Forms\UOptionsForm.pas"/> 126 <IsPartOfProject Value="True"/> 127 <ComponentName Value="OptionsForm"/> 128 <HasResources Value="True"/> 129 <ResourceBaseClass Value="Form"/> 130 <UnitName Value="UOptionsForm"/> 131 <Filename Value="Forms\UCompilersForm.pas"/> 132 <IsPartOfProject Value="True"/> 133 <ComponentName Value="FormCompilers"/> 134 <ResourceBaseClass Value="Form"/> 135 <UnitName Value="UCompilersForm"/> 131 136 </Unit6> 132 137 <Unit7> 133 <Filename Value="Forms\UInterpretterForm.pas"/> 134 <IsPartOfProject Value="True"/> 135 <ComponentName Value="InterpreterForm"/> 136 <HasResources Value="True"/> 137 <ResourceBaseClass Value="Form"/> 138 <UnitName Value="UInterpretterForm"/> 138 <Filename Value="Target\UTarget.pas"/> 139 <IsPartOfProject Value="True"/> 140 <UnitName Value="UTarget"/> 139 141 </Unit7> 140 142 <Unit8> 141 <Filename Value="Forms\UCompilersForm.pas"/> 142 <IsPartOfProject Value="True"/> 143 <ComponentName Value="FormCompilers"/> 144 <ResourceBaseClass Value="Form"/> 145 <UnitName Value="UCompilersForm"/> 143 <Filename Value="Target\UTargetC.pas"/> 144 <IsPartOfProject Value="True"/> 145 <UnitName Value="UTargetC"/> 146 146 </Unit8> 147 147 <Unit9> 148 <Filename Value="Target\UTarget .pas"/>149 <IsPartOfProject Value="True"/> 150 <UnitName Value="UTarget "/>148 <Filename Value="Target\UTargetDelphi.pas"/> 149 <IsPartOfProject Value="True"/> 150 <UnitName Value="UTargetDelphi"/> 151 151 </Unit9> 152 152 <Unit10> 153 <Filename Value="Target\UTarget C.pas"/>154 <IsPartOfProject Value="True"/> 155 <UnitName Value="UTarget C"/>153 <Filename Value="Target\UTargetInterpretter.pas"/> 154 <IsPartOfProject Value="True"/> 155 <UnitName Value="UTargetInterpretter"/> 156 156 </Unit10> 157 157 <Unit11> 158 <Filename Value="Target\UTarget Delphi.pas"/>159 <IsPartOfProject Value="True"/> 160 <UnitName Value="UTarget Delphi"/>158 <Filename Value="Target\UTargetPHP.pas"/> 159 <IsPartOfProject Value="True"/> 160 <UnitName Value="UTargetPHP"/> 161 161 </Unit11> 162 <Unit12>163 <Filename Value="Target\UTargetInterpretter.pas"/>164 <IsPartOfProject Value="True"/>165 <UnitName Value="UTargetInterpretter"/>166 </Unit12>167 <Unit13>168 <Filename Value="Target\UTargetPHP.pas"/>169 <IsPartOfProject Value="True"/>170 <UnitName Value="UTargetPHP"/>171 </Unit13>172 162 </Units> 173 163 </ProjectOptions> … … 180 170 <SearchPaths> 181 171 <IncludeFiles Value="$(ProjOutDir)"/> 182 <OtherUnitFiles Value=" Common;Forms;Target"/>172 <OtherUnitFiles Value="Forms;Target"/> 183 173 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 184 174 </SearchPaths> -
trunk/LazFuckIDE.lpr
r30 r32 11 11 Forms, UApplicationInfo, UTarget, UTargetC, UTargetDelphi, 12 12 UTargetInterpretter, UTargetPHP, UCompiledForm, UInterpretterForm, UMainForm, 13 UOptionsForm, ULastOpenedList, URegistry,CoolTranslator, Common,13 UOptionsForm, CoolTranslator, Common, 14 14 TemplateGenerics, UCompilersForm; 15 15 -
trunk/Target/UTarget.pas
r31 r32 12 12 TCompilerOptimization = (coNone, coNormal); 13 13 14 TTargetCapability = (tcRun, tcPause, tcStop, tcStepOut, t sStepOver, tsStepInto,15 t sRunToCursor, tcCompile, tcBreakpoint);14 TTargetCapability = (tcRun, tcPause, tcStop, tcStepOut, tcStepOver, tcStepInto, 15 tcRunToCursor, tcCompile, tcBreakpoint); 16 16 TTargetCapabilities = set of TTargetCapability; 17 17 18 TRunState = (rsStopped, rsPaused, rsRunning); 19 18 20 { TTarget } 19 21 20 22 TTarget = class 23 private 21 24 protected 25 FSource: string; 22 26 Indent: Integer; 27 FState: TRunState; 28 FOnChangeState: TNotifyEvent; 29 procedure SetSource(AValue: string); virtual; 23 30 procedure AddLine(Text: string); 24 31 function LongFileName(FileName: string): string; … … 26 33 Name: string; 27 34 ProgramName: string; 28 Source: string;29 35 Output: string; 30 36 Optimization: TCompilerOptimization; … … 45 51 procedure StepOut; virtual; 46 52 procedure RunToCursor; virtual; 53 procedure LoadFromRegistry(Root: HKEY; Key: string); virtual; 54 procedure SaveToRegistry(Root: HKEY; Key: string); virtual; 55 property State: TRunState read FState; 56 property OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState; 57 property Source: string write SetSource; 47 58 end; 48 59 … … 52 63 procedure LoadFromRegistry(Root: HKEY; Key: string); 53 64 procedure SaveToRegistry(Root: HKEY; Key: string); 65 function FindByName(Name: string): TTarget; 54 66 end; 55 67 … … 98 110 end; 99 111 112 function TTargetList.FindByName(Name: string): TTarget; 113 var 114 I: Integer; 115 begin 116 I := 0; 117 while (I < Count) and (TTarget(Items[I]).Name <> Name) do Inc(I); 118 if I < Count then Result := TTarget(Items[I]) 119 else Result := nil; 120 end; 121 100 122 { TTarget } 123 124 procedure TTarget.SetSource(AValue: string); 125 begin 126 FSource := AValue; 127 end; 101 128 102 129 procedure TTarget.AddLine(Text: string); … … 209 236 end; 210 237 238 procedure TTarget.LoadFromRegistry(Root: HKEY; Key: string); 239 begin 240 241 end; 242 243 procedure TTarget.SaveToRegistry(Root: HKEY; Key: string); 244 begin 245 246 end; 247 211 248 end. 212 249 -
trunk/Target/UTargetC.pas
r31 r32 13 13 14 14 TTargetC = class(TTarget) 15 private 16 public 15 17 constructor Create; override; 16 18 procedure Compile; override; … … 48 50 Result := 1; 49 51 if Optimization = coNormal then 50 while ((I + 1) <= Length( Source)) and (Source[I + 1] = C) do begin52 while ((I + 1) <= Length(FSource)) and (FSource[I + 1] = C) do begin 51 53 Inc(Result); 52 54 Inc(I) … … 69 71 AddLine('Pos = 0;'); 70 72 I := 1; 71 while (I <= Length( Source)) do begin72 case Source[I] of73 while (I <= Length(FSource)) do begin 74 case FSource[I] of 73 75 '>': begin 74 76 Sum := CheckOccurence('>'); -
trunk/Target/UTargetDelphi.pas
r31 r32 13 13 14 14 TTargetDelphi = class(TTarget) 15 private 16 public 15 17 constructor Create; override; 16 18 procedure Compile; override; … … 42 44 Result := 1; 43 45 if Optimization = coNormal then 44 while ((I + 1) <= Length( Source)) and (Source[I + 1] = C) do begin46 while ((I + 1) <= Length(FSource)) and (FSource[I + 1] = C) do begin 45 47 Inc(Result); 46 48 Inc(I) … … 64 66 AddLine('Pos := 0;'); 65 67 I := 1; 66 while (I <= Length( Source)) do begin67 case Source[I] of68 while (I <= Length(FSource)) do begin 69 case FSource[I] of 68 70 '>': begin 69 71 Sum := CheckOccurence('>'); -
trunk/Target/UTargetInterpretter.pas
r31 r32 6 6 7 7 uses 8 Classes, SysUtils, Dialogs, Forms, StrUtils, UTarget ;8 Classes, SysUtils, Dialogs, Forms, StrUtils, UTarget, Registry, URegistry; 9 9 10 10 type 11 11 TTargetInterpretter = class; 12 13 14 TRunState = (rsStopped, rsPaused, rsRunning);15 12 16 13 { TTargetInterpretterThread } … … 31 28 private 32 29 FCellSize: Integer; 33 FOnChangeState: TNotifyEvent;34 FState: TRunState;35 30 FThreadState: Boolean; 36 31 FThread: TTargetInterpretterThread; … … 39 34 function GetMemorySize: Integer; 40 35 procedure SetMemorySize(AValue: Integer); 41 procedure SetSource(AValue: string);42 36 procedure SetState(AValue: TRunState); 43 37 procedure SetThread(State: Boolean); … … 51 45 procedure CommandLoopStart; 52 46 procedure CommandLoopEnd; 47 protected 48 procedure SetSource(AValue: string); override; 53 49 public 54 50 FSource: array of TBrainFuckCommand; … … 67 63 procedure Pause; override; 68 64 procedure Stop; override; 69 constructor Create; 65 constructor Create; override; 70 66 destructor Destroy; override; 71 pro perty State: TRunState read FState;72 pro perty OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState;67 procedure LoadFromRegistry(Root: HKEY; Key: string); override; 68 procedure SaveToRegistry(Root: HKEY; Key: string); override; 73 69 property StepCount: Integer read FStepCount; 74 property Source: string write SetSource;75 70 property MemorySize: Integer read GetMemorySize write SetMemorySize; 76 71 property CellSize: Integer read FCellSize write FCellSize; … … 284 279 constructor TTargetInterpretter.Create; 285 280 begin 281 inherited; 286 282 Name := 'Interpretter'; 287 283 Capabilities := [tcRun, tcPause, tcStop]; … … 305 301 end; 306 302 303 procedure TTargetInterpretter.LoadFromRegistry(Root: HKEY; Key: string); 304 begin 305 inherited LoadFromRegistry(Root, Key); 306 with TRegistryEx.Create do 307 try 308 RootKey := Root; 309 OpenKey(Key, True); 310 CellSize := ReadIntegerWithDefault('CellSize', 256); 311 MemorySize := ReadIntegerWithDefault('MemorySize', 30000); 312 finally 313 Free; 314 end; 315 end; 316 317 procedure TTargetInterpretter.SaveToRegistry(Root: HKEY; Key: string); 318 begin 319 inherited SaveToRegistry(Root, Key); 320 with TRegistryEx.Create do 321 try 322 RootKey := Root; 323 OpenKey(Key, True); 324 WriteInteger('CellSize', CellSize); 325 WriteInteger('MemorySize', MemorySize); 326 finally 327 Free; 328 end; 329 end; 330 307 331 end. 308 332 -
trunk/Target/UTargetPHP.pas
r31 r32 13 13 14 14 TTargetPHP = class(TTarget) 15 private 16 public 15 17 constructor Create; override; 16 18 procedure Compile; override; … … 46 48 Result := 1; 47 49 if Optimization = coNormal then 48 while ((I + 1) <= Length( Source)) and (Source[I + 1] = C) do begin50 while ((I + 1) <= Length(FSource)) and (FSource[I + 1] = C) do begin 49 51 Inc(Result); 50 52 Inc(I) … … 60 62 AddLine('$Memory = str_repeat("\0", 30000);'); 61 63 AddLine('$Position = 0;'); 62 for I := 1 to Length( Source) do begin63 case Source[I] of64 for I := 1 to Length(FSource) do begin 65 case FSource[I] of 64 66 '>': begin 65 67 Sum := CheckOccurence('>');
Note:
See TracChangeset
for help on using the changeset viewer.