| Line | |
|---|
| 1 | program dcomp;
|
|---|
| 2 |
|
|---|
| 3 | {$APPTYPE CONSOLE}
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 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 |
|
|---|
| 15 | type
|
|---|
| 16 | TApplication = class
|
|---|
| 17 | procedure Run;
|
|---|
| 18 | end;
|
|---|
| 19 |
|
|---|
| 20 | { TApplication }
|
|---|
| 21 |
|
|---|
| 22 | procedure TApplication.Run;
|
|---|
| 23 | var
|
|---|
| 24 | Compiler: TCompiler;
|
|---|
| 25 | begin
|
|---|
| 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;
|
|---|
| 32 | end;
|
|---|
| 33 |
|
|---|
| 34 | var
|
|---|
| 35 | Application: TApplication;
|
|---|
| 36 | begin
|
|---|
| 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;
|
|---|
| 47 | end.
|
|---|
| 48 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.