Changeset 152
- Timestamp:
- Jun 6, 2024, 9:10:15 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.pas
r150 r152 72 72 LazFileUtils, FormMain, FormEx, 73 73 // Targets 74 TargetInterpret ter, TargetFPC, TargetJava, TargetDelphi, TargetJavascript,74 TargetInterpreter, TargetFPC, TargetJava, TargetDelphi, TargetJavascript, 75 75 TargetPHP, TargetC, TargetPython, TargetCSharp, TargetRust; 76 76 … … 146 146 with Targets do begin 147 147 Clear; 148 Add(TTargetInterpret ter.Create);148 Add(TTargetInterpreter.Create); 149 149 Add(TTargetDelphi.Create); 150 150 Add(TTargetFPC.Create); … … 187 187 ThemeManager.Theme := ThemeManager.Themes.FindByName(ReadStringWithDefault('Theme', 'System')); 188 188 189 TargetName := ReadStringWithDefault('TargetName', 'Interpret ter');189 TargetName := ReadStringWithDefault('TargetName', 'Interpreter'); 190 190 CurrentTarget := Targets.FindByName(TargetName); 191 191 if not Assigned(CurrentTarget) then -
trunk/Forms/FormCPU.pas
r149 r152 32 32 33 33 uses 34 Core, TargetInterpret ter;34 Core, TargetInterpreter; 35 35 36 36 {$R *.lfm} … … 43 43 procedure TFormCPU.Reload; 44 44 begin 45 if Core.Core.CurrentTarget is TTargetInterpret ter then46 with TTargetInterpret ter(Core.Core.CurrentTarget) do begin45 if Core.Core.CurrentTarget is TTargetInterpreter then 46 with TTargetInterpreter(Core.Core.CurrentTarget) do begin 47 47 LabelProgramPointer.Caption := IntToStr(ProgramIndex); 48 48 LabelMemoryPointer.Caption := IntToStr(MemoryPosition); -
trunk/Forms/FormInput.pas
r149 r152 23 23 24 24 uses 25 Core, TargetInterpret ter;25 Core, TargetInterpreter; 26 26 27 27 procedure TFormInput.MemoInputKeyPress(Sender: TObject; var Key: char); 28 28 begin 29 if Core.Core.CurrentTarget is TTargetInterpret ter then30 with TTargetInterpret ter(Core.Core.CurrentTarget) do29 if Core.Core.CurrentTarget is TTargetInterpreter then 30 with TTargetInterpreter(Core.Core.CurrentTarget) do 31 31 Input := Input + Key; 32 32 end; -
trunk/Forms/FormMain.pas
r149 r152 136 136 procedure AShowTargetPositionExecute(Sender: TObject); 137 137 procedure AViewCompilersExecute(Sender: TObject); 138 procedure AViewInterpret terExecute(Sender: TObject);138 procedure AViewInterpreterExecute(Sender: TObject); 139 139 procedure AViewLogExecute(Sender: TObject); 140 140 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); … … 176 176 177 177 uses 178 Core, TargetInterpret ter, BFTarget, Common, FormAbout;178 Core, TargetInterpreter, BFTarget, Common, FormAbout; 179 179 180 180 resourcestring … … 403 403 procedure TFormMain.AProgramRunExecute(Sender: TObject); 404 404 begin 405 if Core.Core.CurrentTarget is TTargetInterpret ter then406 TTargetInterpret ter(Core.Core.CurrentTarget).Input := FormInput.MemoInput.Lines.Text;405 if Core.Core.CurrentTarget is TTargetInterpreter then 406 TTargetInterpreter(Core.Core.CurrentTarget).Input := FormInput.MemoInput.Lines.Text; 407 407 if not Core.Core.CurrentTarget.Compiled then AProgramCompile.Execute; 408 408 Core.Core.CurrentTarget.Run; … … 442 442 end; 443 443 444 procedure TFormMain.AViewInterpret terExecute(Sender: TObject);444 procedure TFormMain.AViewInterpreterExecute(Sender: TObject); 445 445 begin 446 446 FormCPU.Show; -
trunk/Forms/FormMemory.pas
r149 r152 28 28 29 29 uses 30 Core, TargetInterpret ter;30 Core, TargetInterpreter; 31 31 32 32 { TFormMemory } … … 34 34 procedure TFormMemory.Reload; 35 35 begin 36 if Core.Core.CurrentTarget is TTargetInterpret ter then37 with TTargetInterpret ter(Core.Core.CurrentTarget) do begin36 if Core.Core.CurrentTarget is TTargetInterpreter then 37 with TTargetInterpreter(Core.Core.CurrentTarget) do begin 38 38 if MemoryChanged then begin 39 39 MemoryChanged := False; … … 51 51 Address: Integer; 52 52 begin 53 if Core.Core.CurrentTarget is TTargetInterpret ter then54 with TTargetInterpret ter(Core.Core.CurrentTarget) do53 if Core.Core.CurrentTarget is TTargetInterpreter then 54 with TTargetInterpreter(Core.Core.CurrentTarget) do 55 55 if (Item.Index >= 0) and (Item.Index <= Trunc((MemoryMaxUsedAddr + 1) / RowSize)) then begin 56 56 Item.Caption := IntToHex(Item.Index * RowSize, 8); -
trunk/Forms/FormOutput.pas
r149 r152 24 24 25 25 uses 26 Core, TargetInterpret ter;26 Core, TargetInterpreter; 27 27 28 28 { TFormOutput } … … 30 30 procedure TFormOutput.Reload; 31 31 begin 32 if Core.Core.CurrentTarget is TTargetInterpret ter then33 with TTargetInterpret ter(Core.Core.CurrentTarget) do begin32 if Core.Core.CurrentTarget is TTargetInterpreter then 33 with TTargetInterpreter(Core.Core.CurrentTarget) do begin 34 34 if OutputChanged then begin 35 35 OutputChanged := False; -
trunk/Languages/LazFuck.cs.po
r150 r152 168 168 msgstr "Zastaveno" 169 169 170 #: targetinterpret ter.sbreakpointindexerror170 #: targetinterpreter.sbreakpointindexerror 171 171 #, object-pascal-format 172 msgctxt "targetinterpret ter.sbreakpointindexerror"172 msgctxt "targetinterpreter.sbreakpointindexerror" 173 173 msgid "Break point index error: %d" 174 174 msgstr "Chyba indexu bodu pÅeruÅ¡enÃ: %d" 175 175 176 #: targetinterpret ter.sjumptablecollision177 msgctxt "targetinterpret ter.sjumptablecollision"176 #: targetinterpreter.sjumptablecollision 177 msgctxt "targetinterpreter.sjumptablecollision" 178 178 msgid "Jump table collision" 179 179 msgstr "Kolize v tabulce skoků" 180 180 181 #: targetinterpret ter.sjumptableinconsistent182 msgctxt "targetinterpret ter.sjumptableinconsistent"181 #: targetinterpreter.sjumptableinconsistent 182 msgctxt "targetinterpreter.sjumptableinconsistent" 183 183 msgid "Jump table is inconsistent" 184 184 msgstr "Nekonzistentnà skoková tabulka" 185 185 186 #: targetinterpret ter.sprogramlowermemorylimit187 msgctxt "targetinterpret ter.sprogramlowermemorylimit"186 #: targetinterpreter.sprogramlowermemorylimit 187 msgctxt "targetinterpreter.sprogramlowermemorylimit" 188 188 msgid "Program run over lower memory limit" 189 189 msgstr "Program pÅekroÄil dolnà rozsah pamÄti" 190 190 191 #: targetinterpret ter.sprogramnotrunning192 msgctxt "targetinterpret ter.sprogramnotrunning"191 #: targetinterpreter.sprogramnotrunning 192 msgctxt "targetinterpreter.sprogramnotrunning" 193 193 msgid "Program not running" 194 194 msgstr "Program nebÄÅŸÃ" 195 195 196 #: targetinterpret ter.sprogramuppermemorylimit197 msgctxt "targetinterpret ter.sprogramuppermemorylimit"196 #: targetinterpreter.sprogramuppermemorylimit 197 msgctxt "targetinterpreter.sprogramuppermemorylimit" 198 198 msgid "Program run over upper memory limit" 199 199 msgstr "Program pÅekroÄil hornà rozsah pamÄti" 200 200 201 #: targetinterpret ter.sunsupportedcommand202 msgctxt "targetinterpret ter.sunsupportedcommand"201 #: targetinterpreter.sunsupportedcommand 202 msgctxt "targetinterpreter.sunsupportedcommand" 203 203 msgid "Unsupported command" 204 204 msgstr "NepodporovanÃœ pÅÃkaz" -
trunk/Languages/LazFuck.pot
r150 r152 158 158 msgstr "" 159 159 160 #: targetinterpret ter.sbreakpointindexerror160 #: targetinterpreter.sbreakpointindexerror 161 161 #, object-pascal-format 162 msgctxt "targetinterpret ter.sbreakpointindexerror"162 msgctxt "targetinterpreter.sbreakpointindexerror" 163 163 msgid "Break point index error: %d" 164 164 msgstr "" 165 165 166 #: targetinterpret ter.sjumptablecollision167 msgctxt "targetinterpret ter.sjumptablecollision"166 #: targetinterpreter.sjumptablecollision 167 msgctxt "targetinterpreter.sjumptablecollision" 168 168 msgid "Jump table collision" 169 169 msgstr "" 170 170 171 #: targetinterpret ter.sjumptableinconsistent172 msgctxt "targetinterpret ter.sjumptableinconsistent"171 #: targetinterpreter.sjumptableinconsistent 172 msgctxt "targetinterpreter.sjumptableinconsistent" 173 173 msgid "Jump table is inconsistent" 174 174 msgstr "" 175 175 176 #: targetinterpret ter.sprogramlowermemorylimit177 msgctxt "targetinterpret ter.sprogramlowermemorylimit"176 #: targetinterpreter.sprogramlowermemorylimit 177 msgctxt "targetinterpreter.sprogramlowermemorylimit" 178 178 msgid "Program run over lower memory limit" 179 179 msgstr "" 180 180 181 #: targetinterpret ter.sprogramnotrunning182 msgctxt "targetinterpret ter.sprogramnotrunning"181 #: targetinterpreter.sprogramnotrunning 182 msgctxt "targetinterpreter.sprogramnotrunning" 183 183 msgid "Program not running" 184 184 msgstr "" 185 185 186 #: targetinterpret ter.sprogramuppermemorylimit187 msgctxt "targetinterpret ter.sprogramuppermemorylimit"186 #: targetinterpreter.sprogramuppermemorylimit 187 msgctxt "targetinterpreter.sprogramuppermemorylimit" 188 188 msgid "Program run over upper memory limit" 189 189 msgstr "" 190 190 191 #: targetinterpret ter.sunsupportedcommand192 msgctxt "targetinterpret ter.sunsupportedcommand"191 #: targetinterpreter.sunsupportedcommand 192 msgctxt "targetinterpreter.sunsupportedcommand" 193 193 msgid "Unsupported command" 194 194 msgstr "" -
trunk/LazFuck.lpi
r151 r152 143 143 </Unit7> 144 144 <Unit8> 145 <Filename Value="Target\TargetInterpret ter.pas"/>145 <Filename Value="Target\TargetInterpreter.pas"/> 146 146 <IsPartOfProject Value="True"/> 147 147 </Unit8> -
trunk/Read Me.txt
r122 r152 3 3 ==Features== 4 4 * Graphical code editor with color syntax highlighting 5 * Cross-compilation to Delphi, Free Pascal, Python, Java, C, C#, PHP, and JavaScript6 * Interpreter with debugger 5 * Cross-compilation to Delphi, Free Pascal, Python, Java, C, C#, PHP, Rust and JavaScript 6 * Interpreter with debugger 7 7 * Translations: English, Czech 8 8 … … 11 11 * Home page: https://app.zdechov.net/LazFuck/ 12 12 * Source code: https://svn.zdechov.net/LazFuck/ 13 * Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 2.2.013 * Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 3.4.0 14 14 * To build new Windows installer run Install/build.bat. InnoSetup (http://www.jrsoftware.org/isdl.php) needs to be installed). -
trunk/Target/TargetInterpreter.pas
r151 r152 1 unit TargetInterpret ter;1 unit TargetInterpreter; 2 2 3 3 interface … … 7 7 8 8 type 9 TTargetInterpret ter = class;10 11 { TTargetInterpret terThread }12 13 TTargetInterpret terThread = class(TThread)9 TTargetInterpreter = class; 10 11 { TTargetInterpreterThread } 12 13 TTargetInterpreterThread = class(TThread) 14 14 private 15 15 FNewState: TRunState; … … 19 19 procedure SetStateSafe(State: TRunState); 20 20 public 21 Parent: TTargetInterpret ter;21 Parent: TTargetInterpreter; 22 22 procedure Execute; override; 23 23 end; … … 25 25 TCommandHandler = procedure of object; 26 26 27 { TTargetInterpret ter }28 29 TTargetInterpret ter = class(TBFTarget)27 { TTargetInterpreter } 28 29 TTargetInterpreter = class(TBFTarget) 30 30 private 31 31 FThreadState: Boolean; 32 FThread: TTargetInterpret terThread;32 FThread: TTargetInterpreterThread; 33 33 FStepCount: Integer; 34 34 FCommandTable: array[TMachineCommand] of TCommandHandler; … … 89 89 SBreakPointIndexError = 'Break point index error: %d'; 90 90 91 { TTargetInterpret terThread }92 93 procedure TTargetInterpret terThread.Execute;91 { TTargetInterpreterThread } 92 93 procedure TTargetInterpreterThread.Execute; 94 94 var 95 95 BreakPoint: TBreakPoint; … … 130 130 end; 131 131 132 procedure TTargetInterpret terThread.DoMessage;132 procedure TTargetInterpreterThread.DoMessage; 133 133 begin 134 134 Parent.SendMessage(FMessage); 135 135 end; 136 136 137 procedure TTargetInterpret terThread.DoSetState;137 procedure TTargetInterpreterThread.DoSetState; 138 138 begin 139 139 Parent.State := FNewState; 140 140 end; 141 141 142 procedure TTargetInterpret terThread.SetStateSafe(State: TRunState);142 procedure TTargetInterpreterThread.SetStateSafe(State: TRunState); 143 143 begin 144 144 if Parent.State = State then Exit; … … 147 147 end; 148 148 149 { TTargetInterpret ter }150 151 procedure TTargetInterpret ter.SetState(AValue: TRunState);149 { TTargetInterpreter } 150 151 procedure TTargetInterpreter.SetState(AValue: TRunState); 152 152 begin 153 153 if FState = AValue then Exit; … … 156 156 end; 157 157 158 procedure TTargetInterpret ter.SetThread(State: Boolean);158 procedure TTargetInterpreter.SetThread(State: Boolean); 159 159 begin 160 160 if FThreadState = State then Exit; 161 161 FThreadState := State; 162 162 if State then begin 163 FThread := TTargetInterpret terThread.Create(True);163 FThread := TTargetInterpreterThread.Create(True); 164 164 FThread.Parent := Self; 165 165 FThread.FreeOnTerminate := False; … … 170 170 end; 171 171 172 procedure TTargetInterpret ter.PrepareJumpTable;172 procedure TTargetInterpreter.PrepareJumpTable; 173 173 type 174 174 TArrayOfInteger = array of Integer; … … 205 205 end; 206 206 207 procedure TTargetInterpret ter.CommandInput;207 procedure TTargetInterpreter.CommandInput; 208 208 var 209 209 Addr: Integer; … … 221 221 end; 222 222 223 procedure TTargetInterpret ter.CommandOutput;223 procedure TTargetInterpreter.CommandOutput; 224 224 begin 225 225 if OutputPosition > Length(Output) then … … 231 231 end; 232 232 233 procedure TTargetInterpret ter.CommandLoopStart;233 procedure TTargetInterpreter.CommandLoopStart; 234 234 begin 235 235 if Memory[MemoryPosition + FProgram[FProgramIndex].RelIndex] = 0 then … … 237 237 end; 238 238 239 procedure TTargetInterpret ter.CommandLoopEnd;239 procedure TTargetInterpreter.CommandLoopEnd; 240 240 begin 241 241 if Memory[MemoryPosition + FProgram[FProgramIndex].RelIndex] > 0 then … … 243 243 end; 244 244 245 procedure TTargetInterpret ter.CommandInc;245 procedure TTargetInterpreter.CommandInc; 246 246 var 247 247 Addr: Integer; … … 253 253 end; 254 254 255 procedure TTargetInterpret ter.CommandDec;255 procedure TTargetInterpreter.CommandDec; 256 256 var 257 257 Addr: Integer; … … 263 263 end; 264 264 265 procedure TTargetInterpret ter.CommandPointerInc;265 procedure TTargetInterpreter.CommandPointerInc; 266 266 begin 267 267 if MemoryPosition < MemorySize then … … 270 270 end; 271 271 272 procedure TTargetInterpret ter.CommandPointerDec;272 procedure TTargetInterpreter.CommandPointerDec; 273 273 begin 274 274 if MemoryPosition > 0 then … … 277 277 end; 278 278 279 procedure TTargetInterpret ter.CommandSet;279 procedure TTargetInterpreter.CommandSet; 280 280 var 281 281 Addr: Integer; … … 288 288 end; 289 289 290 procedure TTargetInterpret ter.CommandMultiply;290 procedure TTargetInterpreter.CommandMultiply; 291 291 var 292 292 Addr: Integer; … … 300 300 end; 301 301 302 procedure TTargetInterpret ter.Reset;302 procedure TTargetInterpreter.Reset; 303 303 var 304 304 I: Integer; … … 322 322 end; 323 323 324 procedure TTargetInterpret ter.Compile;324 procedure TTargetInterpreter.Compile; 325 325 begin 326 326 inherited; … … 328 328 end; 329 329 330 procedure TTargetInterpret ter.PrepareBreakPoints;330 procedure TTargetInterpreter.PrepareBreakPoints; 331 331 var 332 332 I: Integer; … … 340 340 end; 341 341 342 procedure TTargetInterpret ter.CheckMemoryBounds(Address: Integer);342 procedure TTargetInterpreter.CheckMemoryBounds(Address: Integer); 343 343 begin 344 344 if Address < 0 then raise Exception.Create(SProgramLowerMemoryLimit); … … 346 346 end; 347 347 348 procedure TTargetInterpret ter.EmitTargetCode;348 procedure TTargetInterpreter.EmitTargetCode; 349 349 var 350 350 I: Integer; … … 369 369 end; 370 370 371 function TTargetInterpret ter.GetExecutionPosition: Integer;371 function TTargetInterpreter.GetExecutionPosition: Integer; 372 372 begin 373 373 Result := FProgramIndex; 374 374 end; 375 375 376 procedure TTargetInterpret ter.OptimizeSource;376 procedure TTargetInterpreter.OptimizeSource; 377 377 begin 378 378 inherited; 379 379 end; 380 380 381 procedure TTargetInterpret ter.Run;381 procedure TTargetInterpreter.Run; 382 382 begin 383 383 PrepareBreakPoints; … … 390 390 end; 391 391 392 procedure TTargetInterpret ter.Pause;392 procedure TTargetInterpreter.Pause; 393 393 begin 394 394 if State = rsRunning then State := rsPaused; 395 395 end; 396 396 397 procedure TTargetInterpret ter.Stop;397 procedure TTargetInterpreter.Stop; 398 398 begin 399 399 State := rsStopped; … … 401 401 end; 402 402 403 procedure TTargetInterpret ter.StepInto;403 procedure TTargetInterpreter.StepInto; 404 404 var 405 405 Step: TDebugStep; … … 421 421 end; 422 422 423 procedure TTargetInterpret ter.StepOver;423 procedure TTargetInterpreter.StepOver; 424 424 var 425 425 Step: TDebugStep; … … 440 440 end; 441 441 442 procedure TTargetInterpret ter.StepOut;442 procedure TTargetInterpreter.StepOut; 443 443 var 444 444 Step: TDebugStep; … … 462 462 end; 463 463 464 procedure TTargetInterpret ter.RunToCursor(Pos: Integer);464 procedure TTargetInterpreter.RunToCursor(Pos: Integer); 465 465 begin 466 466 Breakpoints.SetSystem(Pos); … … 468 468 end; 469 469 470 constructor TTargetInterpret ter.Create;470 constructor TTargetInterpreter.Create; 471 471 begin 472 472 inherited; 473 FName := 'Interpret ter';473 FName := 'Interpreter'; 474 474 FImageIndex := 25; 475 475 FCapabilities := [tcRun, tcPause, tcStop, tcCompile, tcStepOut, tcStepInto, … … 489 489 end; 490 490 491 destructor TTargetInterpret ter.Destroy;491 destructor TTargetInterpreter.Destroy; 492 492 begin 493 493 FState := rsStopped;
Note:
See TracChangeset
for help on using the changeset viewer.