Add compialteur Main
This commit is contained in:
2
Makefile
2
Makefile
@@ -7,7 +7,7 @@ LDFLAGS=
|
|||||||
SRC=$(wildcard src/*.c)
|
SRC=$(wildcard src/*.c)
|
||||||
OBJ=$(SRC:.c=.o)
|
OBJ=$(SRC:.c=.o)
|
||||||
|
|
||||||
EXEC=test_yylex
|
EXEC=compilateur-l
|
||||||
|
|
||||||
all: $(EXEC)
|
all: $(EXEC)
|
||||||
|
|
||||||
|
|||||||
0
compilateur-l.c
Normal file
0
compilateur-l.c
Normal file
17
src/compilateur-l.c
Normal file
17
src/compilateur-l.c
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "analyseur_lexical.h"
|
||||||
|
#include "symboles.h"
|
||||||
|
|
||||||
|
char yytext[100];
|
||||||
|
FILE *yyin;
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
yyin = fopen(argv[1], "r");
|
||||||
|
if(yyin == NULL){
|
||||||
|
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[1]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
test_yylex_internal(yyin);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user