aboutsummaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2022-09-22 14:40:15 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2022-09-22 14:40:15 +0200
commit61b26469a7898930fd30ab2432d25105d1a57e22 (patch)
tree4598461006248ac15e8fe622a78fa2b609bf33c1 /parser
downloadmarcus-master.tar.gz
marcus-master.zip
Initial commitHEADmaster
Diffstat (limited to 'parser')
-rw-r--r--parser/marcus.y23
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); }
+ ;