summaryrefslogtreecommitdiff
path: root/2003/i/buspctl/src/grammar.y
diff options
context:
space:
mode:
Diffstat (limited to '2003/i/buspctl/src/grammar.y')
-rw-r--r--2003/i/buspctl/src/grammar.y33
1 files changed, 33 insertions, 0 deletions
diff --git a/2003/i/buspctl/src/grammar.y b/2003/i/buspctl/src/grammar.y
new file mode 100644
index 0000000..0128947
--- /dev/null
+++ b/2003/i/buspctl/src/grammar.y
@@ -0,0 +1,33 @@
+%{
+#include <serial.h>
+
+#include <stdio.h>
+
+void
+yyerror (const char *s);
+
+int
+yylex (void);
+
+%}
+
+%defines
+
+%token NUM WRITE READ ERR
+
+%%
+
+input: READ NUM { printf ("read %d = %d\n", $2, serial_busp_read ($2)); }
+ | WRITE NUM NUM {
+ printf ("write %d %d\n", $2, $3);
+ serial_busp_write ($2, $3);
+ }
+;
+
+%%
+
+void
+yyerror (const char *s)
+{
+ fprintf (stderr, "buspctl: %s\n", s);
+}