From 5b840fd4c56d835b067e4cf9a3e4af4442717d20 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 26 Nov 2022 13:54:18 +0100 Subject: Set yyin to file --- grammar.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grammar.y b/grammar.y index fd9da47..446b651 100644 --- a/grammar.y +++ b/grammar.y @@ -1,5 +1,9 @@ %{ #include + +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(); } -- cgit v1.2.3