');
sound(zvuk); delay(del); nosound;
readln; close(g);
halt;
End;
Procedure DAi;
Begin
writeln;
textcolor(14);
writeln(' Этап пройден успешно.');
textcolor(15);
readln; clrscr;
End;
Procedure ident;
Begin
writeln(' 4 этап- Идентификация...');
writeln('> Анализ переменных и ключевых слов:');
{изменяем регистр всех букв } sb1:=sb;
for i:=1 to dlina do sb[i]:=upcase(sb[i]); writeln(sb); s2:=sb;
{создаем массив строк- каждая из которых 1 слово}
i:=0; j:=1;
While i ' ') and (((sb1[i] in bukva) or (sb1[i] in BUKVA2)) or (sb1[i] in c)) then
ms[j]:=ms[j]+upcase(sb1[i])
else inc(j)
end;
{по очереди проверяем каждое ключевое слово на вхождение в строку Sb}
writeln(''); textcolor(11);
writeln('Ключевые слова:'); textcolor(15);
i:=1; j:=1;
while j<> length(sb) do begin
if ((ms[j]='CONST') or
(ms[j]='TRUE' ) or
(ms[j]='FALSE') or
(ms[j]='BEGIN') or
(ms[j]='END' ) or
(ms[j]='ARRAY') or
(ms[j]='SET' ) or
(ms[j]='OF') or
(ms[j]='DO') or
(ms[j]='CASE') or
(ms[j]='TO') or
(ms[j]='THEN') or
(ms[j]='WHILE') or
(ms[j]='IF') or
(ms[j]='FUNCTION') or
(ms[j]='PROCEDURE') or
(ms[j]='AND') or
(ms[j]='OR') or
( ms[j]='TYPE') or
( ms[j]='REPEAT') or
(ms[j]='VAR') or
( ms[j]='ELSE') or
( ms[j]='UNTIL')) and
(pos(ms[j],sb)>0)
then begin if length(ms[i])<>0 then begin
mk[i]:=ms[j];
writeln(ms[j]);
delete(sb,pos(mk[i],sb),length(mk[i]));
inc(kolk); end;
end;
inc(i); inc(j);
end;
{по очереди проверяем каждый тип данных на вхождение в строку Sb}
writeln(''); textcolor(11);
writeln('Типы данных:'); textcolor(15);
{создаем массив типов данных}
i:=1; j:=1;
while j<> length(sb) do begin
if ((ms[j]='INTEGER') or
(ms[j]='LONGINT') or
(ms[j]='REAL') or
(ms[j]='BYTE') or
(ms[j]='WORD') or
(ms[j]='STRING') or
(ms[j]='SHORTINT') or
(ms[j]='SINGLE') or
(ms[j]='DOUBLE') or
(ms[j]='EXTENDED') or
(ms[j]='CHAR')) and
(pos(ms[j],sb)>0)
then begin if length(ms[i])<>0 then begin
mt[i]:=ms[j];
writeln(ms[j]);
delete(sb,pos(mt[i],sb),length(mt[i]));
inc(kolt);
end; end;
inc(i);
inc(j);
end;
{отсеиваем Не ключевые слова}
writeln; textcolor(11);
writeln(''); writeln('Переменные:');
textcolor(15);
{создаём массив переменных}
j:=1; i:=1;
while j<> length(sb) do begin
if ((ms[j]<>'CONST') and
(ms[j]<>'TRUE' ) and
(ms[j]<>'FALSE') and
(ms[j]<>'BEGIN') and
(ms[j]<>'END' ) and
(ms[j]<>'ARRAY') and
(ms[j]<>'SET' ) and
(ms[j]<>'OF') and
(ms[j]<>'DO') and
( ms[j]<>'CASE') and
(ms[j]<>'TO') and
(ms[j]<>'THEN') and
(ms[j]<>'WHILE') and
(ms[j]<>'IF') and
(ms[j]<>'FUNCTION') and
(ms[j]<>'PROCEDURE') and
(ms[j]<>'AND') and
( ms[j]<>'OR') and
( ms[j]<>'TYPE') and
( ms[j]<>'REPEAT') and
(ms[j]<>'VAR') and
( ms[j]<>'ELSE') and
( ms[j]<>'UNTIL') and
(ms[j]<>'INTEGER') and
(ms[j]<>'LONGINT') and
(ms[j]<>'REAL') and
(ms[j]<>'BYTE') and
(ms[j]<>'WORD') and
(ms[j]<>'SHORTINT') and
(ms[j]<>'SINGLE') and
(ms[j]<>'DOUBLE') and
(ms[j]<>'EXTENDED') and
(ms[j]<>'CHAR')) and
(pos(ms[j],sb)>0)
then begin
if length(ms[j])<>0 then begin
mp[i]:=ms[j];
writeln(mp[i]);
delete(sb,pos(mp[i],sb),length(mp[i]));
inc(kolp); end;
end;
inc(i);
inc(j);
end;
writeln('');
DAi;
End;