Приложение в (обязательное) Код основной программы
unit Unit1;
interface
uses
Windows, Messages, SysUtils,
Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
Lexlib,YaccLib, YaccKR1, lexKRModul;
type
TForm1 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
Memo3: TMemo;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
procedure btn1Click(Sender:
TObject);
procedure
FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
j : integer;
implementation
{$R *.dfm}
procedure
TForm1.btn1Click(Sender: TObject);
begin
memo2.Clear; memo3.Clear;
entry := '';
for j := 0 to
memo1.Lines.Count-1 do
entry := entry +
memo1.Lines.Strings[j]+' ';
yymemoinit(memo1,memo2,memo2,
memo2);
yyclear;
yylineno:=0; i := 0;
yyparse;
memo3.Lines.Add(m[i-1]);
end;
procedure
TForm1.FormCreate(Sender: TObject);
begin
memo1.Text:='var a :
integer;begin read(x);end .'
end;
end.