Курсовая работа: Построение распознавателя для заданной грамматики и реализация его в виде программы которая проверяет
if ListBox1. Items. Count=0 then
begin
MessageDlg ('Не введены правила грамматики. '+#13+'Введите правила. ',mtError, [mbOk],0);
exit;
end;
mn: = [] ;
for i: =0 to ListBox1. Items. Count-1 do
begin
flag: =True;
for j: =5 to length (ListBox1. Items. Strings [i]) do
if not (ord (ListBox1. Items. Strings [i] [j]) in Terminal) then flag: =False;
if flag then mn: =mn+ [ListBox1. Items. Strings [i] [1]] ;
end;
Again:
for i: =0 to ListBox1. Items. Count-1 do
begin
flag: =False;
for j: =5 to length (ListBox1. Items. Strings [i]) do
begin
if (ord (ListBox1. Items. Strings [i] [j]) in Neterminal) and
(ListBox1. Items. Strings [i] [j] in mn) and
(not (ListBox1. Items. Strings [i] [1] in mn)) then flag: =True;
end;
if flag then
begin
mn: =mn+ [ListBox1. Items. Strings [i] [1]] ;
goto Again;
end;
end;