source: branches/virtualcpu4/Forms/UFormCompilerPascal.pas

Last change on this file was 186, checked in by chronos, 6 years ago
  • Added: Partial implementation of compiler to Pascal source.
File size: 1.1 KB
Line 
1unit UFormCompilerPascal;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
9 SynHighlighterPas, SynEdit, UCompilerPascal;
10
11type
12
13 { TFormCompilerPascal }
14
15 TFormCompilerPascal = class(TForm)
16 ButtonCompile: TButton;
17 SynEdit1: TSynEdit;
18 SynPasSyn1: TSynPasSyn;
19 procedure ButtonCompileClick(Sender: TObject);
20 procedure FormCreate(Sender: TObject);
21 procedure FormDestroy(Sender: TObject);
22 procedure FormShow(Sender: TObject);
23 private
24
25 public
26 CompilerPascal: TCompilerPascal;
27 end;
28
29var
30 FormCompilerPascal: TFormCompilerPascal;
31
32implementation
33
34{$R *.lfm}
35
36{ TFormCompilerPascal }
37
38procedure TFormCompilerPascal.ButtonCompileClick(Sender: TObject);
39begin
40 CompilerPascal.Compile;
41 SynEdit1.Lines.Text := CompilerPascal.Output;
42end;
43
44procedure TFormCompilerPascal.FormCreate(Sender: TObject);
45begin
46 CompilerPascal := TCompilerPascal.Create;
47end;
48
49procedure TFormCompilerPascal.FormDestroy(Sender: TObject);
50begin
51 FreeAndNil(CompilerPascal);
52end;
53
54procedure TFormCompilerPascal.FormShow(Sender: TObject);
55begin
56 ButtonCompile.Click;
57end;
58
59end.
60
Note: See TracBrowser for help on using the repository browser.