-
Notifications
You must be signed in to change notification settings - Fork 8
/
pgm_analysor.l
50 lines (50 loc) · 1.43 KB
/
pgm_analysor.l
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
space[ ]
%%
tant{space}que ECHO; printf("\n");
Fair ECHO; printf("\n");
si ECHO; printf("\n");
alors ECHO; printf("\n");
sinon ECHO; printf("\n");
debut ECHO; printf("\n");
fin ECHO; printf("\n");
affectation ECHO; printf("\n");
\:= ECHO; printf("\n");
ET ECHO; printf("\n");
&& ECHO; printf("\n");
ou ECHO; printf("\n");
\|\| ECHO; printf("\n");
non ECHO; printf("\n");
! ECHO; printf("\n");
inferieur ECHO; printf("\n");
\< ECHO; printf("\n");
superieur ECHO; printf("\n");
\> ECHO; printf("\n");
egal ECHO; printf("\n");
= ECHO; printf("\n");
different ECHO; printf("\n");
!= ECHO; printf("\n");
Fin[ ]du[ ]programme ECHO; printf("\n");
;; ECHO; printf("\n");
\( ECHO; printf("\n");
\) ECHO; printf("\n");
.|\n
%%
int main(int argc, char** argv)
{
if (argc != 2){
printf("Usage:\t %s FolderToAnalyse\n", argv[0]);
return 1;
}
yyin=fopen(argv[1],"r");
if (yyin==NULL){
printf("Cannont open <%s>.\n", argv[1]);
return 2;
}
yylex();
printf("\n");
return 0;
}
int yywrap()
{
return 1;
}