summaryrefslogtreecommitdiffstats
path: root/taccle/examples/shift_reduce.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-21 19:52:32 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-21 19:52:32 (GMT)
commit6919da64f1e15c1b0a350bb318772d05d2efe9d3 (patch)
tree897fdaa3d7fd78f72fcb2b6d83889973fd4a6d2b /taccle/examples/shift_reduce.tac
parent67f7b317d8c54c06c71a8f645129b6646de5ab5f (diff)
parent95627403093a9d1683fe4882836a0ca3adfd0a8a (diff)
downloadblt-6919da64f1e15c1b0a350bb318772d05d2efe9d3.zip
blt-6919da64f1e15c1b0a350bb318772d05d2efe9d3.tar.gz
blt-6919da64f1e15c1b0a350bb318772d05d2efe9d3.tar.bz2
Merge commit '95627403093a9d1683fe4882836a0ca3adfd0a8a' as 'taccle'
Diffstat (limited to 'taccle/examples/shift_reduce.tac')
-rw-r--r--taccle/examples/shift_reduce.tac17
1 files changed, 17 insertions, 0 deletions
diff --git a/taccle/examples/shift_reduce.tac b/taccle/examples/shift_reduce.tac
new file mode 100644
index 0000000..8905e26
--- /dev/null
+++ b/taccle/examples/shift_reduce.tac
@@ -0,0 +1,17 @@
+# $Id: shift_reduce.tac,v 1.1 2004/08/18 23:53:43 tang Exp $
+
+# This is an example of a shift/reduce conflict. Eventually I will
+# add operator precedence and associativity, but for now taccle simply
+# gives higher precedence to shifts.
+#
+# Reference:
+# lex & yacc, pages 229-230 and 236
+
+%token TERMINAL
+
+%%
+
+expr: TERMINAL
+ | expr '+' expr
+ | expr '-' expr
+ | expr '*' expr ;