From 61b26469a7898930fd30ab2432d25105d1a57e22 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Thu, 22 Sep 2022 14:40:15 +0200 Subject: Initial commit --- parser/marcus.y | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 parser/marcus.y (limited to 'parser') diff --git a/parser/marcus.y b/parser/marcus.y new file mode 100644 index 0000000..3e61bba --- /dev/null +++ b/parser/marcus.y @@ -0,0 +1,23 @@ +%{ + + #include + #include + int yylex(void); + int yyerror(const char *s); + +%} + +%token HI BYE + +%% + +program: + hi bye + ; + +hi: + HI { printf("Hello World\n"); } + ; +bye: + BYE { printf("Bye World\n"); exit(0); } + ; -- cgit v1.2.3