]> git.saurik.com Git - bison.git/blame - src/assoc.c
portability: fix several issues with M4 subprocess.
[bison.git] / src / assoc.c
CommitLineData
a945ec39 1/* Associativity information.
e141f4d4 2 Copyright (C) 2002, 2005-2006, 2008-2010 Free Software Foundation,
401b73af 3 Inc.
a945ec39
AD
4
5 This file is part of Bison, the GNU Compiler Compiler.
6
f16b0819 7 This program is free software: you can redistribute it and/or modify
a945ec39 8 it under the terms of the GNU General Public License as published by
f16b0819
PE
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
a945ec39 11
f16b0819 12 This program is distributed in the hope that it will be useful,
a945ec39
AD
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
f16b0819 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
a945ec39 19
2cec9080 20#include <config.h>
a945ec39 21#include "system.h"
c134bfbe 22
a945ec39
AD
23#include "assoc.h"
24
25
26const char *
c134bfbe 27assoc_to_string (assoc a)
a945ec39 28{
c134bfbe 29 switch (a)
a945ec39 30 {
06f01bc4
PE
31 default:
32 abort ();
33
a945ec39 34 case undef_assoc:
427c0dda 35 return "undefined associativity";
a945ec39
AD
36
37 case right_assoc:
38 return "%right";
39
40 case left_assoc:
41 return "%left";
42
43 case non_assoc:
44 return "%nonassoc";
d78f0ac9
AD
45
46 case precedence_assoc:
47 return "%precedence";
a945ec39 48 }
a945ec39 49}