summaryrefslogtreecommitdiffstats
path: root/taccle/examples/shift_reduce.tac
blob: 8905e2646e7d76207b58b213cb48cc0592fd148a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 ;