j'ai besoin d'un analyseur lexical en delphi ; voici mon code source:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 procedure TForm1.Button1Click(Sender: TObject); var p,f,i:integer; mot,str:string; begin str:= edit1.text; i:=1; while i<= length(str) do begin while (i <= length(str)) and (str[i]=' ') do i:=i+1; p:=i; while (i<=length(str)) and ((str[i]<>' ')) do i:=i+1; f:=i-1; mot:=copy(str,p,f-p+1); memo1.lines.add(mot); end;
Partager