aboutsummaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
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); }
+ ;