summaryrefslogtreecommitdiffstats
path: root/taccle/examples/if_then_else.tac
blob: eee631ae9cdf418632deaa3ea29a85ce1634408a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# $Id: if_then_else.tac,v 1.1 2004/08/18 23:53:42 tang Exp $

# The classical if/then/else ambiguity.  taccle resolves this by
# giving higher precedence to shifting else.
#
# References:
#   Dragon book, page 250
#   lex & yacc, pages 233-235

%token IF ELSE TERMINAL

%%

stmt: IF '(' cond ')' stmt
 | IF '(' cond ')' stmt ELSE stmt
 | TERMINAL;

cond: TERMINAL;