From 725e0125079b6bde8ad032a3be21910980900ec4 Mon Sep 17 00:00:00 2001 From: pfaure Date: Mon, 21 Jun 2021 14:01:17 +0200 Subject: [PATCH] =?UTF-8?q?Version=20fonctionnelle=20processeur=20s=C3=A9c?= =?UTF-8?q?uris=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lex_Yacc/as.y | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lex_Yacc/as.y b/Lex_Yacc/as.y index 6f9f51c..290fb93 100644 --- a/Lex_Yacc/as.y +++ b/Lex_Yacc/as.y @@ -4,6 +4,7 @@ %{ #include "../Tables/tables.h" +#include %} %token tMUL tDIV tADD tSUB tINF tSUP tEQU @@ -65,7 +66,13 @@ Instruction : tSTOP tNB {add_instruction(STOP, $2, 0, 0);}; %% -int main(void) { +int main(int argc, char * argv[]) { + if (argc != 2) { + printf("Specifiez le fichier à interpreter"); + exit(2); + } + extern FILE * yyin; + yyin = fopen(argv[1], "r"); yyparse(); execute(); return 0;