Курсовая работа: Проектирование компилятора
end;
result := z;
end;
//====================================
procedure TForm1.Button1Click(Sender: TObject);
var i, j, v: Integer;
c: Char;
begin
for i := 0 to Memo1.Lines.Count - 1 do
begin
StringToWords(Memo1.Lines.Strings[i], 2, ListBox1.Items);
end;
v := 1;
for i := 0 to ListBox1.Items.Count - 1 do
for j := 0 to StringGrid2.RowCount - 1 do
begin
if ListBox1.Items.Strings[i] = StringGrid2.Cells[0,j] then
begin
StringGrid1.RowCount := StringGrid1.RowCount + 1;
StringGrid1.Cells[0,v] := IntToStr(v);
StringGrid1.Cells[1,v] := StringGrid2.Cells[0,j];
StringGrid1.Cells[2,v] := StringGrid2.Cells[1,j];
v := v + 1;
Break;
end
else if j = StringGrid2.RowCount - 1 then
begin
StringGrid1.RowCount := StringGrid1.RowCount + 1;
StringGrid1.Cells[0,v] := IntToStr(v);