From 7d61a7584a4b6631d9f55935e165dca2355aadc3 Mon Sep 17 00:00:00 2001 From: Xawirses Date: Tue, 26 Jan 2016 14:15:09 +0100 Subject: [PATCH] Add compialteur Main --- Makefile | 2 +- compilateur-l.c | 0 src/compilateur-l.c | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 compilateur-l.c create mode 100644 src/compilateur-l.c 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; +}