1 | unit CompilerAPI;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, ModularSystem, Analyzer, Target, SourceConvertor,
|
---|
7 | Generics.Collections, Executor;
|
---|
8 |
|
---|
9 | type
|
---|
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 |
|
---|
26 | implementation
|
---|
27 |
|
---|
28 | uses
|
---|
29 | Compiler;
|
---|
30 |
|
---|
31 |
|
---|
32 | { TCompilerAPI }
|
---|
33 |
|
---|
34 | procedure TCompilerAPI.RegisterTarget(AClass: TTargetClass);
|
---|
35 | begin
|
---|
36 | TCompiler(Compiler).Targets.Add(AClass.Create);
|
---|
37 | end;
|
---|
38 |
|
---|
39 | procedure TCompilerAPI.UnregisterTarget(AClass: TTargetClass);
|
---|
40 | begin
|
---|
41 | //TCompiler(Compiler).Targets.Remove(TObject(AClass));
|
---|
42 | end;
|
---|
43 |
|
---|
44 | procedure TCompilerAPI.RegisterConvertor(AClass: TConvertorClass);
|
---|
45 | begin
|
---|
46 | TCompiler(Compiler).Convertors.Add(TObject(AClass));
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TCompilerAPI.UnregisterConvertor(AClass: TConvertorClass);
|
---|
50 | begin
|
---|
51 | TCompiler(Compiler).Convertors.Remove(TObject(AClass));
|
---|
52 | end;
|
---|
53 |
|
---|
54 | procedure TCompilerAPI.RegisterExecutor(AClass: TExecutorClass);
|
---|
55 | begin
|
---|
56 | TCompiler(Compiler).Executors.Add(TObject(AClass));
|
---|
57 | end;
|
---|
58 |
|
---|
59 | procedure TCompilerAPI.UnregisterExecutor(AClass: TExecutorClass);
|
---|
60 | begin
|
---|
61 | TCompiler(Compiler).Executors.Remove(TObject(AClass));
|
---|
62 | end;
|
---|
63 |
|
---|
64 | constructor TCompilerAPI.Create;
|
---|
65 | begin
|
---|
66 | end;
|
---|
67 |
|
---|
68 | destructor TCompilerAPI.Destroy;
|
---|
69 | begin
|
---|
70 | inherited;
|
---|
71 | end;
|
---|
72 |
|
---|
73 | end.
|
---|
74 |
|
---|