diff options
author | 2022-09-22 14:40:15 +0200 | |
---|---|---|
committer | 2022-09-22 14:40:15 +0200 | |
commit | 61b26469a7898930fd30ab2432d25105d1a57e22 (patch) | |
tree | 4598461006248ac15e8fe622a78fa2b609bf33c1 /parser/marcus.y | |
download | marcus-61b26469a7898930fd30ab2432d25105d1a57e22.tar.gz marcus-61b26469a7898930fd30ab2432d25105d1a57e22.zip |
Diffstat (limited to 'parser/marcus.y')
-rw-r--r-- | parser/marcus.y | 23 |
1 files changed, 23 insertions, 0 deletions
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 <stdio.h> + #include <stdlib.h> + 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); } + ; |