source: branches/dcomp/CmdLine/dcomp.dpr

Last change on this file was 94, checked in by chronos, 8 years ago
  • Added: Source code class.
File size: 1.0 KB
Line 
1program dcomp;
2
3{$APPTYPE CONSOLE}
4
5uses
6 System.SysUtils,
7 UCompiler in 'Compiler\UCompiler.pas',
8 UTargetPHP in 'TargetPHP\UTargetPHP.pas',
9 UAnalyzerPascal in 'Compiler\UAnalyzerPascal.pas',
10 UAnalyzer in 'Compiler\UAnalyzer.pas',
11 UTarget in 'Compiler\UTarget.pas',
12 USourceCode in 'Compiler\USourceCode.pas',
13 USourceCodePascal in 'Compiler\USourceCodePascal.pas';
14
15type
16 TApplication = class
17 procedure Run;
18 end;
19
20{ TApplication }
21
22procedure TApplication.Run;
23var
24 Compiler: TCompiler;
25begin
26 Compiler := TCompiler.Create;
27 if ParamCount > 0 then
28 Compiler.MainSourceFile := ParamStr(1);
29 Compiler.RegisterTarget(TTargetPHP);
30 Compiler.RegisterAnalyzer(TAnalyzerPascal);
31 Compiler.Compile;
32end;
33
34var
35 Application: TApplication;
36begin
37 try
38 Application := TApplication.Create;
39 Application.Run;
40 Application.Free;
41 ReadLn;
42 { TODO -oUser -cConsole Main : Insert code here }
43 except
44 on E: Exception do
45 Writeln(E.ClassName, ': ', E.Message);
46 end;
47end.
48
Note: See TracBrowser for help on using the repository browser.