Changeset 25 for trunk/Compiler
- Timestamp:
- Feb 13, 2012, 9:47:18 AM (13 years ago)
- Location:
- trunk/Compiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/UCompiler.pas
r20 r25 6 6 7 7 uses 8 Classes, SysUtils, StrUtils ;8 Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList; 9 9 10 10 type … … 23 23 Output: string; 24 24 Optimization: TCompilerOptimization; 25 CompilerPath: string; 26 SourceExtension: string; 27 CompiledExtension: string; 25 28 constructor Create; virtual; 26 29 procedure OptimizeSource; … … 28 31 end; 29 32 33 { TCompilerList } 34 35 TCompilerList = class(TListObject) 36 procedure LoadFromRegistry(Root: HKEY; Key: string); 37 procedure SaveToRegistry(Root: HKEY; Key: string); 38 end; 39 30 40 31 41 implementation 42 43 { TCompilerList } 44 45 procedure TCompilerList.LoadFromRegistry(Root: HKEY; Key: string); 46 var 47 I: Integer; 48 begin 49 with TRegistryEx.Create do 50 try 51 RootKey := Root; 52 OpenKey(Key + '\Compiler', True); 53 for I := 0 to Count - 1 do 54 with TBrainFuckCompiler(Items[I]) do 55 if ValueExists(Name) then CompilerPath := ReadString(Name); 56 finally 57 Free; 58 end; 59 end; 60 61 procedure TCompilerList.SaveToRegistry(Root: HKEY; Key: string); 62 var 63 I: Integer; 64 begin 65 with TRegistryEx.Create do 66 try 67 RootKey := Root; 68 OpenKey(Key + '\Compiler', True); 69 for I := 0 to Count - 1 do 70 with TBrainFuckCompiler(Items[I]) do 71 if CompilerPath <> '' then WriteString(Name, CompilerPath) 72 else DeleteValue(Name); 73 finally 74 Free; 75 end; 76 end; 32 77 33 78 { TBrainFuckCompiler } -
trunk/Compiler/UCompilerDelphi.pas
r20 r25 25 25 inherited Create; 26 26 Name := 'Delphi'; 27 SourceExtension := '.pas'; 28 CompiledExtension := '.exe'; 27 29 end; 28 30 … … 53 55 AddLine(' Memory: array[0..30000] of Byte;'); 54 56 AddLine(' Pos: Integer;'); 57 AddLine(' ReadChar: Char;'); 55 58 AddLine('begin'); 56 59 Inc(Indent); 60 AddLine('Pos := 0;'); 57 61 I := 1; 58 62 while (I <= Length(Source)) do begin … … 75 79 end; 76 80 '.': AddLine('Write(Chr(Memory[Pos]));'); 77 ',': AddLine('Read( Chr(Memory[Pos]));');81 ',': AddLine('Read(ReadChar); Memory[Pos] := Ord(ReadChar);'); 78 82 '[': begin 79 83 AddLine('while Memory[Pos] <> 0 do begin'); -
trunk/Compiler/UCompilerPHP.pas
r20 r25 26 26 inherited Create; 27 27 Name := 'PHP'; 28 SourceExtension := '.php'; 28 29 end; 29 30
Note:
See TracChangeset
for help on using the changeset viewer.