assoc.c revision 05436638acc7c010349a69c3395f1a57c642dc62
1cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project/* Associativity information.
205436638acc7c010349a69c3395f1a57c642dc62Ying Wang
305436638acc7c010349a69c3395f1a57c642dc62Ying Wang   Copyright (C) 2002, 2005-2006, 2009-2012 Free Software Foundation,
405436638acc7c010349a69c3395f1a57c642dc62Ying Wang   Inc.
5cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
6cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project   This file is part of Bison, the GNU Compiler Compiler.
7cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
805436638acc7c010349a69c3395f1a57c642dc62Ying Wang   This program is free software: you can redistribute it and/or modify
9cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project   it under the terms of the GNU General Public License as published by
1005436638acc7c010349a69c3395f1a57c642dc62Ying Wang   the Free Software Foundation, either version 3 of the License, or
1105436638acc7c010349a69c3395f1a57c642dc62Ying Wang   (at your option) any later version.
12cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
1305436638acc7c010349a69c3395f1a57c642dc62Ying Wang   This program is distributed in the hope that it will be useful,
14cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project   but WITHOUT ANY WARRANTY; without even the implied warranty of
15cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project   GNU General Public License for more details.
17cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
18cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project   You should have received a copy of the GNU General Public License
1905436638acc7c010349a69c3395f1a57c642dc62Ying Wang   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
21cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project#include <config.h>
22cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project#include "system.h"
23cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
24cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project#include "assoc.h"
25cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
26cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
27cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Projectconst char *
28cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Projectassoc_to_string (assoc a)
29cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project{
30cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project  switch (a)
31cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project    {
32cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project    default:
33cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project      abort ();
34cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
35cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project    case undef_assoc:
36cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project      return "undefined associativity";
37cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
38cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project    case right_assoc:
39cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project      return "%right";
40cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
41cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project    case left_assoc:
42cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project      return "%left";
43cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project
44cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project    case non_assoc:
45cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project      return "%nonassoc";
46cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project    }
47cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project}
48