Browse Source

Version fonctionnelle processeur sécurisé

Paul Faure 2 years ago
parent
commit
725e012507
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      Lex_Yacc/as.y

+ 8
- 1
Lex_Yacc/as.y View File

@@ -4,6 +4,7 @@
4 4
 
5 5
 %{
6 6
 #include "../Tables/tables.h"
7
+#include <stdlib.h>
7 8
 %}
8 9
 
9 10
 %token tMUL tDIV tADD tSUB tINF tSUP tEQU
@@ -65,7 +66,13 @@ Instruction : tSTOP tNB        {add_instruction(STOP, $2, 0, 0);};
65 66
 
66 67
 %%
67 68
 
68
-int main(void) {
69
+int main(int argc, char * argv[]) {
70
+	if (argc != 2) {
71
+		printf("Specifiez le fichier à interpreter");
72
+		exit(2);
73
+	}
74
+	extern FILE * yyin; 
75
+	yyin = fopen(argv[1], "r");
69 76
 	yyparse();
70 77
 	execute();
71 78
 	return 0;

Loading…
Cancel
Save