source: trunk/Compiler/CompilerAPI.pas

Last change on this file was 75, checked in by chronos, 6 months ago
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File size: 1.6 KB
Line 
1unit CompilerAPI;
2
3interface
4
5uses
6 Classes, SysUtils, ModularSystem, Analyzer, Target, SourceConvertor,
7 Generics.Collections, Executor;
8
9type
10
11 { TCompilerAPI }
12
13 TCompilerAPI = class(TAPI)
14 Compiler: TObject; //TCompiler;
15 procedure RegisterTarget(AClass: TTargetClass);
16 procedure UnregisterTarget(AClass: TTargetClass);
17 procedure RegisterConvertor(AClass: TConvertorClass);
18 procedure UnregisterConvertor(AClass: TConvertorClass);
19 procedure RegisterExecutor(AClass: TExecutorClass);
20 procedure UnregisterExecutor(AClass: TExecutorClass);
21 constructor Create;
22 destructor Destroy; override;
23 end;
24
25
26implementation
27
28uses
29 Compiler;
30
31
32{ TCompilerAPI }
33
34procedure TCompilerAPI.RegisterTarget(AClass: TTargetClass);
35begin
36 TCompiler(Compiler).Targets.Add(AClass.Create);
37end;
38
39procedure TCompilerAPI.UnregisterTarget(AClass: TTargetClass);
40begin
41 //TCompiler(Compiler).Targets.Remove(TObject(AClass));
42end;
43
44procedure TCompilerAPI.RegisterConvertor(AClass: TConvertorClass);
45begin
46 TCompiler(Compiler).Convertors.Add(TObject(AClass));
47end;
48
49procedure TCompilerAPI.UnregisterConvertor(AClass: TConvertorClass);
50begin
51 TCompiler(Compiler).Convertors.Remove(TObject(AClass));
52end;
53
54procedure TCompilerAPI.RegisterExecutor(AClass: TExecutorClass);
55begin
56 TCompiler(Compiler).Executors.Add(TObject(AClass));
57end;
58
59procedure TCompilerAPI.UnregisterExecutor(AClass: TExecutorClass);
60begin
61 TCompiler(Compiler).Executors.Remove(TObject(AClass));
62end;
63
64constructor TCompilerAPI.Create;
65begin
66end;
67
68destructor TCompilerAPI.Destroy;
69begin
70 inherited;
71end;
72
73end.
74
Note: See TracBrowser for help on using the repository browser.