]> git.saurik.com Git - bison.git/blob - src/assoc.c
d8cedc15cec7f2419a668c011a7db58f9ffc7b5d
[bison.git] / src / assoc.c
1 /* Associativity information.
2 Copyright (C) 2002, 2005-2006, 2008-2010 Free Software Foundation,
3 Inc.
4
5 This file is part of Bison, the GNU Compiler Compiler.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 #include <config.h>
21 #include "system.h"
22
23 #include "assoc.h"
24
25
26 const char *
27 assoc_to_string (assoc a)
28 {
29 switch (a)
30 {
31 default:
32 abort ();
33
34 case undef_assoc:
35 return "undefined associativity";
36
37 case right_assoc:
38 return "%right";
39
40 case left_assoc:
41 return "%left";
42
43 case non_assoc:
44 return "%nonassoc";
45
46 case precedence_assoc:
47 return "%precedence";
48 }
49 }