diff --git a/Makefile b/Makefile index 8cec32a..f1a774c 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ LDFLAGS= SRC=$(wildcard src/*.c) OBJ=$(SRC:.c=.o) -EXEC=test_yylex +EXEC=compilateur-l all: $(EXEC) diff --git a/compilateur-l.c b/compilateur-l.c new file mode 100644 index 0000000..e69de29 diff --git a/src/compilateur-l.c b/src/compilateur-l.c new file mode 100644 index 0000000..13f962b --- /dev/null +++ b/src/compilateur-l.c @@ -0,0 +1,17 @@ +#include +#include +#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; +}