summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2022-11-26 13:54:18 +0100
committerDaniel Weipert <code@drogueronin.de>2022-11-26 13:54:18 +0100
commit5b840fd4c56d835b067e4cf9a3e4af4442717d20 (patch)
tree46105003197ed4c5fdea8f90559040e45a67db54
parentbd45b72caf6de003b3b2f053cd24add1b4ddd851 (diff)
Set yyin to file
-rw-r--r--grammar.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/grammar.y b/grammar.y
index fd9da47..446b651 100644
--- a/grammar.y
+++ b/grammar.y
@@ -1,5 +1,9 @@
%{
#include <stdio.h>
+
+extern FILE *yyin;
+extern int yylex();
+extern void yyerror();
%}
%define parse.error verbose
@@ -46,8 +50,9 @@ expression: NUMBER
;
%%
-main (int argc, char **argv)
+void main (int argc, char **argv)
{
//henshin_lex();
+ yyin = fopen(argv[1], "r");
yyparse();
}