Changeset 180 for trunk/Target
- Timestamp:
- Aug 26, 2024, 9:15:43 PM (3 months ago)
- Location:
- trunk/Target
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target/TargetC.pas
r161 r180 68 68 69 69 AddLine('#include <stdio.h>'); 70 AddLine ('');70 AddLine; 71 71 AddLine('int main()'); 72 72 AddLine('{'); … … 75 75 AddLine('int Pos;'); 76 76 AddLine('char ReadChar;'); 77 AddLine ('');77 AddLine; 78 78 AddLine('Pos = 0;'); 79 79 FProgramIndex := 0; -
trunk/Target/TargetDelphi.pas
r161 r180 54 54 55 55 AddLine('program ' + ProgramName + ';'); 56 AddLine ('');56 AddLine; 57 57 AddLine('{$APPTYPE CONSOLE}'); 58 AddLine ('');58 AddLine; 59 59 AddLine('var'); 60 60 AddLine(' Memory: array[0..' + IntToStr(MemorySize) + '] of Byte;'); -
trunk/Target/TargetJavascript.pas
r161 r180 56 56 AddLine('var Memory = new Array(' + IntToStr(MemorySize) + ').fill(0);'); 57 57 AddLine('var Pos = 0;'); 58 AddLine ('');58 AddLine; 59 59 FProgramIndex := 0; 60 60 while FProgramIndex < FProgram.Count do begin -
trunk/Target/TargetPHP.pas
r161 r180 59 59 60 60 AddLine('<?php // ' + ProgramName); 61 AddLine ('');61 AddLine; 62 62 AddLine('$Memory = str_repeat("\0", ' + IntToStr(MemorySize) + ');'); 63 63 AddLine('$Position = 0;'); … … 76 76 cmMultiply: AddLine(GetMemoryCell + ' = chr(ord(' + GetMemoryCell + ') + ord($Memory[$Position]) * ' + IntToStr(FProgram[FProgramIndex].Parameter) + ');'); 77 77 cmLoopStart: begin 78 AddLine('while(' + GetMemoryCell + ' != "\0") {'); 78 AddLine('while(' + GetMemoryCell + ' != "\0")'); 79 AddLine('{'); 79 80 Inc(Indent); 80 81 end; -
trunk/Target/TargetPython.pas
r161 r180 59 59 60 60 AddLine('# ' + ProgramName); 61 AddLine ('');61 AddLine; 62 62 AddLine('class _Getch:'); 63 63 AddLine(' """Gets a single character from standard input. Does not echo to the screen."""'); … … 67 67 AddLine(' except ImportError:'); 68 68 AddLine(' self.impl = _GetchUnix()'); 69 AddLine ('');69 AddLine; 70 70 AddLine(' def __call__(self): return self.impl()'); 71 AddLine ('');72 AddLine ('');71 AddLine; 72 AddLine; 73 73 AddLine('class _GetchUnix:'); 74 74 AddLine(' def __init__(self):'); 75 75 AddLine(' import tty, sys'); 76 AddLine ('');76 AddLine; 77 77 AddLine(' def __call__(self):'); 78 78 AddLine(' import sys, tty, termios'); … … 85 85 AddLine(' termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)'); 86 86 AddLine(' return ch'); 87 AddLine ('');88 AddLine ('');87 AddLine; 88 AddLine; 89 89 AddLine('class _GetchWindows:'); 90 90 AddLine(' def __init__(self):'); 91 91 AddLine(' import msvcrt'); 92 AddLine ('');92 AddLine; 93 93 AddLine(' def __call__(self):'); 94 94 AddLine(' import msvcrt'); 95 95 AddLine(' return msvcrt.getch()'); 96 AddLine ('');96 AddLine; 97 97 AddLine('getchar = _Getch()'); 98 AddLine ('');98 AddLine; 99 99 AddLine('import sys'); 100 100 AddLine('memory = [0] * ' + IntToStr(MemorySize)); -
trunk/Target/TargetRust.pas
r161 r180 75 75 AddLine('let mut memory: [u8; ' + IntToStr(MemorySize) + '] = [0; ' + IntToStr(MemorySize) + '];'); 76 76 AddLine('let mut pos = 0;'); 77 AddLine ('');77 AddLine; 78 78 FProgramIndex := 0; 79 79 while FProgramIndex < FProgram.Count do begin
Note:
See TracChangeset
for help on using the changeset viewer.