-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJava.~pas
More file actions
63 lines (51 loc) · 1.32 KB
/
Java.~pas
File metadata and controls
63 lines (51 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
unit Java;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ActnList, UsesUnit,ParseAndRecognise;
type
TfrmMain = class(TForm)
memoCode: TMemo;
btnLoadText: TButton;
lbFileNameChosen: TLabel;
dlgFileOpen: TOpenDialog;
alMain: TActionList;
aLoadCode: TAction;
btnTest: TButton;
mmoTest: TMemo;
procedure aLoadCodeExecute(Sender: TObject);
procedure btnTestClick(Sender: TObject);
private
procedure CalcMetriks(const fileName: string);
{ Private declarations }
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
{$R *.dfm}
uses OtherFunctions, ConstrFunctions;
procedure TfrmMain.aLoadCodeExecute(Sender: TObject);
begin
if dlgFileOpen.Execute
then CalcMetriks(dlgFileOpen.Files[0]);
end;
procedure TfrmMain.CalcMetriks(const fileName: string);
var tempStr: string;
begin
memoCode.Lines.BeginUpdate;
memoCode.Lines.Clear;
LoadTextFromFileToMemo(fileName, memoCode);
tempStr:=memoCode.Lines.Text;
ofDeleteComments(tempStr);
memoCode.Lines.Text:=tempStr;
memoCode.Lines.EndUpdate;
end;
procedure TfrmMain.btnTestClick(Sender: TObject);
var Test : TConstructionType;
begin
Test := RecogniseOperation(mmoTest.Lines[0]);
mmoTest.Lines.Add(IntToStr(Integer(Test)));
end;
end.