summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2023-03-27 15:02:32 -0400
committerChet Ramey <chet.ramey@case.edu>2023-03-27 15:02:32 -0400
commit429bd8199cb77a35e18759d7f22164d956b122d1 (patch)
treed014f2c199d280bb1a4011f71ca7adf1e09afd8e
parent64b2b7c08d427796d75411f5d3ea46e585ad2d4b (diff)
downloadbash-429bd8199cb77a35e18759d7f22164d956b122d1.tar.gz
remove some unused files
-rw-r--r--examples/loadables/pushd.def611
-rw-r--r--examples/loadables/pushd.inc90
-rw-r--r--lib/glob/ndir.h50
-rw-r--r--lib/intl/plural.c1684
-rw-r--r--version2.c94
5 files changed, 859 insertions, 1670 deletions
diff --git a/examples/loadables/pushd.def b/examples/loadables/pushd.def
deleted file mode 100644
index 87300dca..00000000
--- a/examples/loadables/pushd.def
+++ /dev/null
@@ -1,611 +0,0 @@
-This file is pushd.def, from which is created pushd.c. It implements the
-builtins "pushd", "popd", and "dirs" in Bash.
-
-Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
-
-This file is part of GNU Bash, the Bourne Again SHell.
-
-Bash is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 1, or (at your option) any later
-version.
-
-Bash is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with Bash; see the file COPYING. If not, write to the Free Software
-Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-$PRODUCES pushd.c
-
-$BUILTIN pushd
-$FUNCTION pushd_builtin
-$DEPENDS_ON PUSHD_AND_POPD
-$SHORT_DOC pushd [dir | +N | -N] [-n]
-Adds a directory to the top of the directory stack, or rotates
-the stack, making the new top of the stack the current working
-directory. With no arguments, exchanges the top two directories.
-
-+N Rotates the stack so that the Nth directory (counting
- from the left of the list shown by `dirs', starting with
- zero) is at the top.
-
--N Rotates the stack so that the Nth directory (counting
- from the right of the list shown by `dirs', starting with
- zero) is at the top.
-
--n suppress the normal change of directory when adding directories
- to the stack, so only the stack is manipulated.
-
-dir adds DIR to the directory stack at the top, making it the
- new current working directory.
-
-You can see the directory stack with the `dirs' command.
-$END
-
-$BUILTIN popd
-$FUNCTION popd_builtin
-$DEPENDS_ON PUSHD_AND_POPD
-$SHORT_DOC popd [+N | -N] [-n]
-Removes entries from the directory stack. With no arguments,
-removes the top directory from the stack, and cd's to the new
-top directory.
-
-+N removes the Nth entry counting from the left of the list
- shown by `dirs', starting with zero. For example: `popd +0'
- removes the first directory, `popd +1' the second.
-
--N removes the Nth entry counting from the right of the list
- shown by `dirs', starting with zero. For example: `popd -0'
- removes the last directory, `popd -1' the next to last.
-
--n suppress the normal change of directory when removing directories
- from the stack, so only the stack is manipulated.
-
-You can see the directory stack with the `dirs' command.
-$END
-
-$BUILTIN dirs
-$FUNCTION dirs_builtin
-$DEPENDS_ON PUSHD_AND_POPD
-$SHORT_DOC dirs [-clpv] [+N] [-N]
-Display the list of currently remembered directories. Directories
-find their way onto the list with the `pushd' command; you can get
-back up through the list with the `popd' command.
-
-The -l flag specifies that `dirs' should not print shorthand versions
-of directories which are relative to your home directory. This means
-that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag
-causes `dirs' to print the directory stack with one entry per line,
-prepending the directory name with its position in the stack. The -p
-flag does the same thing, but the stack position is not prepended.
-The -c flag clears the directory stack by deleting all of the elements.
-
-+N displays the Nth entry counting from the left of the list shown by
- dirs when invoked without options, starting with zero.
-
--N displays the Nth entry counting from the right of the list shown by
- dirs when invoked without options, starting with zero.
-$END
-
-#include <config.h>
-
-#if defined (PUSHD_AND_POPD)
-#include <stdio.h>
-#include <sys/param.h>
-
-#if defined (HAVE_UNISTD_H)
-# include <unistd.h>
-#endif
-
-#include "../bashansi.h"
-
-#include <errno.h>
-
-#include <tilde/tilde.h>
-
-#include "../shell.h"
-#include "../maxpath.h"
-#include "common.h"
-#include "builtext.h"
-
-#if !defined (errno)
-extern int errno;
-#endif /* !errno */
-
-static char *m_badarg = "%s: bad argument";
-
-/* The list of remembered directories. */
-static char **pushd_directory_list = (char **)NULL;
-
-/* Number of existing slots in this list. */
-static int directory_list_size;
-
-/* Offset to the end of the list. */
-static int directory_list_offset;
-
-static void pushd_error ();
-static void clear_directory_stack ();
-static int cd_to_string ();
-static int change_to_temp ();
-static int get_dirstack_index ();
-static void add_dirstack_element ();
-
-#define NOCD 0x01
-#define ROTATE 0x02
-#define LONGFORM 0x04
-#define CLEARSTAK 0x08
-
-int
-pushd_builtin (list)
- WORD_LIST *list;
-{
- char *temp, *current_directory, *top;
- int j, flags;
- long num;
- char direction;
-
- /* If there is no argument list then switch current and
- top of list. */
- if (list == 0)
- {
- if (directory_list_offset == 0)
- {
- builtin_error ("no other directory");
- return (EXECUTION_FAILURE);
- }
-
- current_directory = get_working_directory ("pushd");
- if (current_directory == 0)
- return (EXECUTION_FAILURE);
-
- j = directory_list_offset - 1;
- temp = pushd_directory_list[j];
- pushd_directory_list[j] = current_directory;
- j = change_to_temp (temp);
- free (temp);
- return j;
- }
-
- for (flags = 0; list; list = list->next)
- {
- if (ISOPTION (list->word->word, 'n'))
- {
- flags |= NOCD;
- }
- else if (ISOPTION (list->word->word, '-'))
- {
- list = list->next;
- break;
- }
- else if (list->word->word[0] == '-' && list->word->word[1] == '\0')
- /* Let `pushd -' work like it used to. */
- break;
- else if (((direction = list->word->word[0]) == '+') || direction == '-')
- {
- if (legal_number (list->word->word + 1, &num) == 0)
- {
- builtin_error (m_badarg, list->word->word);
- builtin_usage ();
- return (EXECUTION_FAILURE);
- }
-
- if (direction == '-')
- num = directory_list_offset - num;
-
- if (num > directory_list_offset || num < 0)
- {
- pushd_error (directory_list_offset, list->word->word);
- return (EXECUTION_FAILURE);
- }
- flags |= ROTATE;
- }
- else if (*list->word->word == '-')
- {
- bad_option (list->word->word);
- builtin_usage ();
- return (EXECUTION_FAILURE);
- }
- else
- break;
- }
-
- if (flags & ROTATE)
- {
- /* Rotate the stack num times. Remember, the current
- directory acts like it is part of the stack. */
- temp = get_working_directory ("pushd");
-
- if (num == 0)
- {
- j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS;
- free (temp);
- return j;
- }
-
- do
- {
- top = pushd_directory_list[directory_list_offset - 1];
-
- for (j = directory_list_offset - 2; j > -1; j--)
- pushd_directory_list[j + 1] = pushd_directory_list[j];
-
- pushd_directory_list[j + 1] = temp;
-
- temp = top;
- num--;
- }
- while (num);
-
- j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS;
- free (temp);
- return j;
- }
-
- if (list == 0)
- return (EXECUTION_SUCCESS);
-
- /* Change to the directory in list->word->word. Save the current
- directory on the top of the stack. */
- current_directory = get_working_directory ("pushd");
- if (current_directory == 0)
- return (EXECUTION_FAILURE);
-
- j = ((flags & NOCD) == 0) ? cd_builtin (list) : EXECUTION_SUCCESS;
- if (j == EXECUTION_SUCCESS)
- {
- add_dirstack_element ((flags & NOCD) ? savestring (list->word->word) : current_directory);
- dirs_builtin ((WORD_LIST *)NULL);
- if (flags & NOCD)
- free (current_directory);
- return (EXECUTION_SUCCESS);
- }
- else
- {
- free (current_directory);
- return (EXECUTION_FAILURE);
- }
-}
-
-/* Pop the directory stack, and then change to the new top of the stack.
- If LIST is non-null it should consist of a word +N or -N, which says
- what element to delete from the stack. The default is the top one. */
-int
-popd_builtin (list)
- WORD_LIST *list;
-{
- register int i;
- long which;
- int flags;
- char direction;
- char *which_word;
-
- which_word = (char *)NULL;
- for (flags = 0, which = 0L, direction = '+'; list; list = list->next)
- {
- if (ISOPTION (list->word->word, 'n'))
- {
- flags |= NOCD;
- }
- else if (ISOPTION (list->word->word, '-'))
- {
- list = list->next;
- break;
- }
- else if (((direction = list->word->word[0]) == '+') || direction == '-')
- {
- if (legal_number (list->word->word + 1, &which) == 0)
- {
- builtin_error (m_badarg, list->word->word);
- builtin_usage ();
- return (EXECUTION_FAILURE);
- }
- which_word = list->word->word;
- }
- else if (*list->word->word == '-')
- {
- bad_option (list->word->word);
- builtin_usage ();
- return (EXECUTION_FAILURE);
- }
- else
- break;
- }
-
- if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
- {
- pushd_error (directory_list_offset, which_word ? which_word : "");
- return (EXECUTION_FAILURE);
- }
-
- /* Handle case of no specification, or top of stack specification. */
- if ((direction == '+' && which == 0) ||
- (direction == '-' && which == directory_list_offset))
- {
- i = ((flags & NOCD) == 0) ? cd_to_string (pushd_directory_list[directory_list_offset - 1])
- : EXECUTION_SUCCESS;
- if (i != EXECUTION_SUCCESS)
- return (i);
- free (pushd_directory_list[--directory_list_offset]);
- }
- else
- {
- /* Since an offset other than the top directory was specified,
- remove that directory from the list and shift the remainder
- of the list into place. */
- i = (direction == '+') ? directory_list_offset - which : which;
- free (pushd_directory_list[i]);
- directory_list_offset--;
-
- /* Shift the remainder of the list into place. */
- for (; i < directory_list_offset; i++)
- pushd_directory_list[i] = pushd_directory_list[i + 1];
- }
-
- dirs_builtin ((WORD_LIST *)NULL);
- return (EXECUTION_SUCCESS);
-}
-
-/* Print the current list of directories on the directory stack. */
-int
-dirs_builtin (list)
- WORD_LIST *list;
-{
- int flags, desired_index, index_flag, vflag;
- long i;
- char *temp, *w;
-
- for (flags = vflag = index_flag = 0, desired_index = -1, w = ""; list; list = list->next)
- {
- if (ISOPTION (list->word->word, 'l'))
- {
- flags |= LONGFORM;
- }
- else if (ISOPTION (list->word->word, 'c'))
- {
- flags |= CLEARSTAK;
- }
- else if (ISOPTION (list->word->word, 'v'))
- {
- vflag |= 2;
- }
- else if (ISOPTION (list->word->word, 'p'))
- {
- vflag |= 1;
- }
- else if (ISOPTION (list->word->word, '-'))
- {
- list = list->next;
- break;
- }
- else if (*list->word->word == '+' || *list->word->word == '-')
- {
- int sign;
- if (legal_number (w = list->word->word + 1, &i) == 0)
- {
- builtin_error (m_badarg, list->word->word);
- builtin_usage ();
- return (EXECUTION_FAILURE);
- }
- sign = (*list->word->word == '+') ? 1 : -1;
- desired_index = get_dirstack_index (i, sign, &index_flag);
- }
- else
- {
- bad_option (list->word->word);
- builtin_usage ();
- return (EXECUTION_FAILURE);
- }
- }
-
- if (flags & CLEARSTAK)
- {
- clear_directory_stack ();
- return (EXECUTION_SUCCESS);
- }
-
- if (index_flag && (desired_index < 0 || desired_index > directory_list_offset))
- {
- pushd_error (directory_list_offset, w);
- return (EXECUTION_FAILURE);
- }
-
-#define DIRSTACK_FORMAT(temp) \
- (flags & LONGFORM) ? temp : polite_directory_format (temp)
-
- /* The first directory printed is always the current working directory. */
- if (index_flag == 0 || (index_flag == 1 && desired_index == 0))
- {
- temp = get_working_directory ("dirs");
- if (temp == 0)
- temp = savestring ("<no current directory>");
- if (vflag & 2)
- printf ("%2d %s", 0, DIRSTACK_FORMAT (temp));
- else
- printf ("%s", DIRSTACK_FORMAT (temp));
- free (temp);
- if (index_flag)
- {
- putchar ('\n');
- return EXECUTION_SUCCESS;
- }
- }
-
-#define DIRSTACK_ENTRY(i) \
- (flags & LONGFORM) ? pushd_directory_list[i] \
- : polite_directory_format (pushd_directory_list[i])
-
- /* Now print the requested directory stack entries. */
- if (index_flag)
- {
- if (vflag & 2)
- printf ("%2d %s", directory_list_offset - desired_index,
- DIRSTACK_ENTRY (desired_index));
- else
- printf ("%s", DIRSTACK_ENTRY (desired_index));
- }
- else
- for (i = directory_list_offset - 1; i >= 0; i--)
- if (vflag >= 2)
- printf ("\n%2d %s", directory_list_offset - (int)i, DIRSTACK_ENTRY (i));
- else
- printf ("%s%s", (vflag & 1) ? "\n" : " ", DIRSTACK_ENTRY (i));
-
- putchar ('\n');
- fflush (stdout);
- return (EXECUTION_SUCCESS);
-}
-
-static void
-pushd_error (offset, arg)
- int offset;
- char *arg;
-{
- if (offset == 0)
- builtin_error ("directory stack empty");
- else if (arg)
- builtin_error ("%s: bad directory stack index", arg);
- else
- builtin_error ("bad directory stack index");
-}
-
-static void
-clear_directory_stack ()
-{
- register int i;
-
- for (i = 0; i < directory_list_offset; i++)
- free (pushd_directory_list[i]);
- directory_list_offset = 0;
-}
-
-/* Switch to the directory in NAME. This uses the cd_builtin to do the work,
- so if the result is EXECUTION_FAILURE then an error message has already
- been printed. */
-static int
-cd_to_string (name)
- char *name;
-{
- WORD_LIST *tlist;
- int result;
-
- tlist = make_word_list (make_word (name), NULL);
- result = cd_builtin (tlist);
- dispose_words (tlist);
- return (result);
-}
-
-static int
-change_to_temp (temp)
- char *temp;
-{
- int tt;
-
- tt = temp ? cd_to_string (temp) : EXECUTION_FAILURE;
-
- if (tt == EXECUTION_SUCCESS)
- dirs_builtin ((WORD_LIST *)NULL);
-
- return (tt);
-}
-
-static void
-add_dirstack_element (dir)
- char *dir;
-{
- int j;
-
- if (directory_list_offset == directory_list_size)
- {
- j = (directory_list_size += 10) * sizeof (char *);
- pushd_directory_list = (char **)xrealloc (pushd_directory_list, j);
- }
- pushd_directory_list[directory_list_offset++] = dir;
-}
-
-static int
-get_dirstack_index (ind, sign, indexp)
- int ind, sign, *indexp;
-{
- if (indexp)
- *indexp = sign > 0 ? 1 : 2;
-
- /* dirs +0 prints the current working directory. */
- /* dirs -0 prints last element in directory stack */
- if (ind == 0 && sign > 0)
- return 0;
- else if (ind == directory_list_offset)
- {
- if (indexp)
- *indexp = sign > 0 ? 2 : 1;
- return 0;
- }
- else
- return (sign > 0 ? directory_list_offset - ind : ind);
-}
-
-char *
-get_dirstack_element (ind, sign)
- int ind, sign;
-{
- int i;
-
- i = get_dirstack_index (ind, sign, (int *)NULL);
- return (i < 0 || i > directory_list_offset) ? (char *)NULL
- : pushd_directory_list[i];
-}
-
-void
-set_dirstack_element (ind, sign, value)
- int ind, sign;
- char *value;
-{
- int i;
-
- i = get_dirstack_index (ind, sign, (int *)NULL);
- if (ind == 0 || i < 0 || i > directory_list_offset)
- return;
- free (pushd_directory_list[i]);
- pushd_directory_list[i] = savestring (value);
-}
-
-WORD_LIST *
-get_directory_stack ()
-{
- register int i;
- WORD_LIST *ret;
- char *d, *t;
-
- for (ret = (WORD_LIST *)NULL, i = 0; i < directory_list_offset; i++)
- {
- d = polite_directory_format (pushd_directory_list[i]);
- ret = make_word_list (make_word (d), ret);
- }
- /* Now the current directory. */
- d = get_working_directory ("dirstack");
- i = 0; /* sentinel to decide whether or not to free d */
- if (d == 0)
- d = ".";
- else
- {
- t = polite_directory_format (d);
- /* polite_directory_format sometimes returns its argument unchanged.
- If it does not, we can free d right away. If it does, we need to
- mark d to be deleted later. */
- if (t != d)
- {
- free (d);
- d = t;
- }
- else /* t == d, so d is what we want */
- i = 1;
- }
- ret = make_word_list (make_word (d), ret);
- if (i)
- free (d);
- return ret; /* was (REVERSE_LIST (ret, (WORD_LIST *)); */
-}
-#endif /* PUSHD_AND_POPD */
diff --git a/examples/loadables/pushd.inc b/examples/loadables/pushd.inc
deleted file mode 100644
index 768dae1a..00000000
--- a/examples/loadables/pushd.inc
+++ /dev/null
@@ -1,90 +0,0 @@
-static char *dirs_doc[] = {
- "Display the list of currently remembered directories. Directories",
- "find their way onto the list with the `pushd' command; you can get",
- "back up through the list with the `popd' command.",
- "",
- "The -l flag specifies that `dirs' should not print shorthand versions",
- "of directories which are relative to your home directory. This means",
- "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag",
- "causes `dirs' to print the directory stack with one entry per line,",
- "prepending the directory name with its position in the stack. The -p",
- "flag does the same thing, but the stack position is not prepended.",
- "The -c flag clears the directory stack by deleting all of the elements.",
- "",
- "+N displays the Nth entry counting from the left of the list shown by",
- " dirs when invoked without options, starting with zero.",
- "",
- "-N displays the Nth entry counting from the right of the list shown by",
- " dirs when invoked without options, starting with zero.",
- (char *)NULL
-};
-
-static char *pushd_doc[] = {
- "Adds a directory to the top of the directory stack, or rotates",
- "the stack, making the new top of the stack the current working",
- "directory. With no arguments, exchanges the top two directories.",
- "",
- "+N Rotates the stack so that the Nth directory (counting",
- " from the left of the list shown by `dirs', starting with"
- " zero) is at the top.",
- "",
- "-N Rotates the stack so that the Nth directory (counting",
- " from the right of the list shown by `dirs', starting with"
- " zero) is at the top.",
- "",
- "-n suppress the normal change of directory when adding directories",
- " to the stack, so only the stack is manipulated.",
- "",
- "dir adds DIR to the directory stack at the top, making it the",
- " new current working directory.",
- "",
- "You can see the directory stack with the `dirs' command.",
- (char *)NULL
-};
-
-static char *popd_doc[] = {
- "Removes entries from the directory stack. With no arguments,",
- "removes the top directory from the stack, and cd's to the new",
- "top directory.",
- "",
- "+N removes the Nth entry counting from the left of the list",
- " shown by `dirs', starting with zero. For example: `popd +0'",
- " removes the first directory, `popd +1' the second.",
- "",
- "-N removes the Nth entry counting from the right of the list",
- " shown by `dirs', starting with zero. For example: `popd -0'",
- " removes the last directory, `popd -1' the next to last.",
- "",
- "-n suppress the normal change of directory when removing directories",
- " from the stack, so only the stack is manipulated.",
- "",
- "You can see the directory stack with the `dirs' command.",
- (char *)NULL
-};
-
-struct builtin pushd_struct = {
- "pushd",
- pushd_builtin,
- BUILTIN_ENABLED,
- pushd_doc,
- "pushd [+N | -N] [-n] [dir]",
- 0
-};
-
-struct builtin popd_struct = {
- "popd",
- popd_builtin,
- BUILTIN_ENABLED,
- popd_doc,
- "popd [+N | -N] [-n]",
- 0
-};
-
-struct builtin dirs_struct = {
- "dirs",
- dirs_builtin,
- BUILTIN_ENABLED,
- dirs_doc,
- "dirs [-clpv] [+N] [-N]",
- 0
-};
diff --git a/lib/glob/ndir.h b/lib/glob/ndir.h
deleted file mode 100644
index 31261eb0..00000000
--- a/lib/glob/ndir.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* <dir.h> -- definitions for 4.2BSD-compatible directory access.
- last edit: 09-Jul-1983 D A Gwyn. */
-
-#if defined (VMS)
-# if !defined (FAB$C_BID)
-# include <fab.h>
-# endif
-# if !defined (NAM$C_BID)
-# include <nam.h>
-# endif
-# if !defined (RMS$_SUC)
-# include <rmsdef.h>
-# endif
-# include "dir.h"
-#endif /* VMS */
-
-/* Size of directory block. */
-#define DIRBLKSIZ 512
-
-/* NOTE: MAXNAMLEN must be one less than a multiple of 4 */
-
-#if defined (VMS)
-# define MAXNAMLEN (DIR$S_NAME + 7) /* 80 plus room for version #. */
-# define MAXFULLSPEC NAM$C_MAXRSS /* Maximum full spec */
-#else
-# define MAXNAMLEN 15 /* Maximum filename length. */
-#endif /* VMS */
-
-/* Data from readdir (). */
-struct direct {
- long d_ino; /* Inode number of entry. */
- unsigned short d_reclen; /* Length of this record. */
- unsigned short d_namlen; /* Length of string in d_name. */
- char d_name[MAXNAMLEN + 1]; /* Name of file. */
-};
-
-/* Stream data from opendir (). */
-typedef struct {
- int dd_fd; /* File descriptor. */
- int dd_loc; /* Offset in block. */
- int dd_size; /* Amount of valid data. */
- char dd_buf[DIRBLKSIZ]; /* Directory block. */
-} DIR;
-
-extern DIR *opendir ();
-extern struct direct *readdir ();
-extern long telldir ();
-extern void seekdir (), closedir ();
-
-#define rewinddir(dirp) seekdir (dirp, 0L)
diff --git a/lib/intl/plural.c b/lib/intl/plural.c
index 4a8ea39a..8b907364 100644
--- a/lib/intl/plural.c
+++ b/lib/intl/plural.c
@@ -1,31 +1,42 @@
-/* A Bison parser, made by GNU Bison 2.0. */
+/* A Bison parser, made by GNU Bison 3.8.2. */
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2022 Free Software Foundation, Inc.
+/* Bison implementation for Yacc-like parsers in C
- This file is part of GNU Bash.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
- Bash is free software: you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
- Bash is distributed in the hope that it will be useful,
+ This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with Bash. If not, see <http://www.gnu.org/licenses/>.
-*/
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
+
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
@@ -34,8 +45,11 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-/* Identify Bison output. */
-#define YYBISON 1
+/* Identify Bison output, and Bison version. */
+#define YYBISON 30802
+
+/* Bison version string. */
+#define YYBISON_VERSION "3.8.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -43,47 +57,26 @@
/* Pure parsers. */
#define YYPURE 1
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names. */
-#define yyparse __gettextparse
-#define yylex __gettextlex
-#define yyerror __gettexterror
-#define yylval __gettextlval
-#define yychar __gettextchar
-#define yydebug __gettextdebug
-#define yynerrs __gettextnerrs
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- EQUOP2 = 258,
- CMPOP2 = 259,
- ADDOP2 = 260,
- MULOP2 = 261,
- NUMBER = 262
- };
-#endif
-#define EQUOP2 258
-#define CMPOP2 259
-#define ADDOP2 260
-#define MULOP2 261
-#define NUMBER 262
+/* Push parsers. */
+#define YYPUSH 0
+/* Pull parsers. */
+#define YYPULL 1
+/* Substitute the variable and function names. */
+#define yyparse __gettextparse
+#define yylex __gettextlex
+#define yyerror __gettexterror
+#define yydebug __gettextdebug
+#define yynerrs __gettextnerrs
-/* Copy the first part of user declarations. */
-#line 1 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
+/* First part of user prologue. */
+#line 1 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
/* plural.y - Expression parsing for plural form selection. */
-/* Copyright (C) 2000, 2001, 2005-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2005-2009, 2022 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
This file is part of GNU Bash.
@@ -127,38 +120,59 @@
#define YYLEX_PARAM &((struct parse_args *) arg)->cp
#define YYPARSE_PARAM arg
+#line 124 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 51 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
-typedef union YYSTYPE {
- unsigned long int num;
- enum operator op;
- struct expression *exp;
-} YYSTYPE;
-/* Line 190 of yacc.c. */
-#line 152 "/usr/src/local/bash/bash-20080814/lib/intl/plural.c"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast<Type> (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
+# else
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
+# ifndef YY_NULLPTR
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# else
+# define YY_NULLPTR ((void*)0)
+# endif
+# endif
+#include "plural.h"
+/* Symbol kind. */
+enum yysymbol_kind_t
+{
+ YYSYMBOL_YYEMPTY = -2,
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
+ YYSYMBOL_YYerror = 1, /* error */
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
+ YYSYMBOL_3_ = 3, /* '?' */
+ YYSYMBOL_4_ = 4, /* '|' */
+ YYSYMBOL_5_ = 5, /* '&' */
+ YYSYMBOL_6_ = 6, /* '!' */
+ YYSYMBOL_EQUOP2 = 7, /* EQUOP2 */
+ YYSYMBOL_CMPOP2 = 8, /* CMPOP2 */
+ YYSYMBOL_ADDOP2 = 9, /* ADDOP2 */
+ YYSYMBOL_MULOP2 = 10, /* MULOP2 */
+ YYSYMBOL_NUMBER = 11, /* NUMBER */
+ YYSYMBOL_12_ = 12, /* ':' */
+ YYSYMBOL_13_n_ = 13, /* 'n' */
+ YYSYMBOL_14_ = 14, /* '(' */
+ YYSYMBOL_15_ = 15, /* ')' */
+ YYSYMBOL_YYACCEPT = 16, /* $accept */
+ YYSYMBOL_start = 17, /* start */
+ YYSYMBOL_exp = 18 /* exp */
+};
+typedef enum yysymbol_kind_t yysymbol_kind_t;
-/* Copy the second part of user declarations. */
-#line 57 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
+/* Second part of user prologue. */
+#line 57 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
/* Prototypes for local functions. */
static struct expression *new_exp (int nargs, enum operator op,
@@ -257,18 +271,201 @@ new_exp_3 (op, bexp, tbranch, fbranch)
}
+#line 275 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
+
+
+#ifdef short
+# undef short
+#endif
+
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ <limits.h> and (if available) <stdint.h> are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include <limits.h> /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
+#endif
+
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
+
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
+#else
+typedef signed char yytype_int8;
+#endif
+
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
+#else
+typedef short yytype_int16;
+#endif
+
+/* Work around bug in HP-UX 11.23, which defines these macros
+ incorrectly for preprocessor constants. This workaround can likely
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
+ <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
+#ifdef __hpux
+# undef UINT_LEAST8_MAX
+# undef UINT_LEAST16_MAX
+# define UINT_LEAST8_MAX 255
+# define UINT_LEAST16_MAX 65535
+#endif
+
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
+#else
+typedef short yytype_uint8;
+#endif
+
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
+#else
+typedef int yytype_uint16;
+#endif
-/* Line 213 of yacc.c. */
-#line 262 "/usr/src/local/bash/bash-20080814/lib/intl/plural.c"
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
-# ifndef YYFREE
-# define YYFREE free
+/* Stored state numbers (used for stacks). */
+typedef yytype_int8 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
+# endif
# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
+# ifndef YY_
+# define YY_(Msgid) Msgid
# endif
+#endif
+
+
+#ifndef YY_ATTRIBUTE_PURE
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define YY_ATTRIBUTE_PURE
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# else
+# define YY_ATTRIBUTE_UNUSED
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YY_USE(E) ((void) (E))
+#else
+# define YY_USE(E) /* empty */
+#endif
+
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
+# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
+# else
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# endif
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
+
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
+#if !defined yyoverflow
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -276,116 +473,158 @@ new_exp_3 (op, bexp, tbranch, fbranch)
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
+# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
+ /* Pacify GCC's 'empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
+# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if ! defined malloc && ! defined EXIT_SUCCESS
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if ! defined free && ! defined EXIT_SUCCESS
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
-
+#endif /* !defined yyoverflow */
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short int yyss;
- YYSTYPE yyvs;
- };
+ yy_state_t yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- register YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
+# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYPTRDIFF_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
+ } \
while (0)
#endif
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short int yysigned_char;
-#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYPTRDIFF_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state. */
#define YYFINAL 9
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 54
+#define YYLAST 56
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 16
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 3
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules. */
#define YYNRULES 13
-/* YYNRULES -- Number of states. */
+/* YYNSTATES -- Number of states. */
#define YYNSTATES 27
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
+/* YYMAXUTOK -- Last valid token kind. */
#define YYMAXUTOK 262
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
+#define YYTRANSLATE(YYX) \
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
+ : YYSYMBOL_YYUNDEF)
+
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex. */
+static const yytype_int8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 10, 2, 2, 2, 2, 5, 2,
+ 2, 2, 2, 6, 2, 2, 2, 2, 5, 2,
14, 15, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
2, 2, 2, 3, 2, 2, 2, 2, 2, 2,
@@ -407,244 +646,166 @@ static const unsigned char yytranslate[] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 6, 7,
- 8, 9, 11
+ 2, 2, 2, 2, 2, 2, 1, 2, 7, 8,
+ 9, 10, 11
};
#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const unsigned char yyprhs[] =
-{
- 0, 0, 3, 5, 11, 15, 19, 23, 27, 31,
- 35, 38, 40, 42
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
-{
- 17, 0, -1, 18, -1, 18, 3, 18, 12, 18,
- -1, 18, 4, 18, -1, 18, 5, 18, -1, 18,
- 6, 18, -1, 18, 7, 18, -1, 18, 8, 18,
- -1, 18, 9, 18, -1, 10, 18, -1, 13, -1,
- 11, -1, 14, 18, 15, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned char yyrline[] =
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+static const yytype_uint8 yyrline[] =
{
0, 176, 176, 184, 188, 192, 196, 200, 204, 208,
212, 216, 220, 225
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+/** Accessing symbol of state STATE. */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
+
+#if YYDEBUG || 0
+/* The user-facing name of the symbol whose (internal) number is
+ YYSYMBOL. No bounds checking. */
+static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
+
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
- "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
- "$accept", "start", "exp", 0
+ "\"end of file\"", "error", "\"invalid token\"", "'?'", "'|'", "'&'",
+ "'!'", "EQUOP2", "CMPOP2", "ADDOP2", "MULOP2", "NUMBER", "':'", "'n'",
+ "'('", "')'", "$accept", "start", "exp", YY_NULLPTR
};
-#endif
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const unsigned short int yytoknum[] =
+static const char *
+yysymbol_name (yysymbol_kind_t yysymbol)
{
- 0, 256, 257, 63, 124, 38, 258, 259, 260, 261,
- 33, 262, 58, 110, 40, 41
-};
-# endif
+ return yytname[yysymbol];
+}
+#endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
-{
- 0, 16, 17, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18
-};
+#define YYPACT_NINF (-4)
+
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
+#define YYTABLE_NINF (-1)
+
+#define yytable_value_is_error(Yyn) \
+ 0
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+static const yytype_int8 yypact[] =
{
- 0, 2, 1, 5, 3, 3, 3, 3, 3, 3,
- 2, 1, 1, 3
+ 27, 27, -4, -4, 27, 1, 39, -4, 13, -4,
+ 27, 27, 27, 27, 27, 27, 27, -4, 22, -3,
+ 43, 46, 26, -2, -4, 27, 39
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
-static const unsigned char yydefact[] =
+static const yytype_int8 yydefact[] =
{
0, 0, 12, 11, 0, 0, 2, 10, 0, 1,
0, 0, 0, 0, 0, 0, 0, 13, 0, 4,
5, 6, 7, 8, 9, 0, 3
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYPGOTO[NTERM-NUM]. */
+static const yytype_int8 yypgoto[] =
{
- -1, 5, 6
+ -4, -4, -1
};
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -10
-static const yysigned_char yypact[] =
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
- -9, -9, -10, -10, -9, 8, 36, -10, 13, -10,
- -9, -9, -9, -9, -9, -9, -9, -10, 26, 41,
- 45, 18, -2, 14, -10, -9, 36
+ 0, 5, 6
};
-/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
+/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
+static const yytype_int8 yytable[] =
{
- -10, -10, -1
+ 7, 9, 12, 8, 13, 14, 15, 16, 16, 18,
+ 19, 20, 21, 22, 23, 24, 10, 11, 12, 0,
+ 13, 14, 15, 16, 26, 10, 11, 12, 17, 13,
+ 14, 15, 16, 1, 25, 15, 16, 0, 2, 0,
+ 3, 4, 10, 11, 12, 0, 13, 14, 15, 16,
+ 13, 14, 15, 16, 14, 15, 16
};
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_int8 yycheck[] =
{
- 7, 1, 2, 8, 3, 4, 15, 16, 9, 18,
- 19, 20, 21, 22, 23, 24, 10, 11, 12, 13,
- 14, 15, 16, 16, 26, 14, 15, 16, 17, 10,
- 11, 12, 13, 14, 15, 16, 0, 0, 25, 10,
- 11, 12, 13, 14, 15, 16, 12, 13, 14, 15,
- 16, 13, 14, 15, 16
+ 1, 0, 5, 4, 7, 8, 9, 10, 10, 10,
+ 11, 12, 13, 14, 15, 16, 3, 4, 5, -1,
+ 7, 8, 9, 10, 25, 3, 4, 5, 15, 7,
+ 8, 9, 10, 6, 12, 9, 10, -1, 11, -1,
+ 13, 14, 3, 4, 5, -1, 7, 8, 9, 10,
+ 7, 8, 9, 10, 8, 9, 10
};
-static const yysigned_char yycheck[] =
+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
+ state STATE-NUM. */
+static const yytype_int8 yystos[] =
{
- 1, 10, 11, 4, 13, 14, 8, 9, 0, 10,
- 11, 12, 13, 14, 15, 16, 3, 4, 5, 6,
- 7, 8, 9, 9, 25, 7, 8, 9, 15, 3,
- 4, 5, 6, 7, 8, 9, -1, -1, 12, 3,
- 4, 5, 6, 7, 8, 9, 5, 6, 7, 8,
- 9, 6, 7, 8, 9
+ 0, 6, 11, 13, 14, 17, 18, 18, 18, 0,
+ 3, 4, 5, 7, 8, 9, 10, 15, 18, 18,
+ 18, 18, 18, 18, 18, 12, 18
};
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
+static const yytype_int8 yyr1[] =
{
- 0, 10, 11, 13, 14, 17, 18, 18, 18, 0,
- 3, 4, 5, 6, 7, 8, 9, 15, 18, 18,
- 18, 18, 18, 18, 18, 12, 18
+ 0, 16, 17, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18
};
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
+static const yytype_int8 yyr2[] =
+{
+ 0, 2, 1, 5, 3, 3, 3, 3, 3, 3,
+ 2, 1, 1, 3
+};
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
+enum { YYENOMEM = -2 };
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+#define YYNOMEM goto yyexhaustedlab
-#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror ("syntax error: cannot back up");\
- YYERROR; \
- } \
-while (0)
-
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (N) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (0)
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
-#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
+
+/* Backward compatibility with an undocumented macro.
+ Use YYerror or YYUNDEF. */
+#define YYERRCODE YYUNDEF
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval)
-#endif
-
/* Enable debugging if requested. */
#if YYDEBUG
@@ -653,48 +814,81 @@ while (0)
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
} while (0)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
+
+
+
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Kind, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
} while (0)
+
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
+
+static void
+yy_symbol_value_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
+{
+ FILE *yyoutput = yyo;
+ YY_USE (yyoutput);
+ if (!yyvaluep)
+ return;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YY_USE (yykind);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+}
+
+
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
+
+static void
+yy_symbol_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
+{
+ YYFPRINTF (yyo, "%s %s (",
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
+
+ yy_symbol_value_print (yyo, yykind, yyvaluep);
+ YYFPRINTF (yyo, ")");
+}
+
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included). |
`------------------------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
static void
-yy_stack_print (short int *bottom, short int *top)
-#else
-static void
-yy_stack_print (bottom, top)
- short int *bottom;
- short int *top;
-#endif
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
YYFPRINTF (stderr, "\n");
}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
} while (0)
@@ -702,44 +896,45 @@ do { \
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
- int yyrule;
-#endif
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
+ int yyrule)
{
+ int yylno = yyrline[yyrule];
+ int yynrhs = yyr2[yyrule];
int yyi;
- unsigned int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr,
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
+ &yyvsp[(yyi + 1) - (yynrhs)]);
+ YYFPRINTF (stderr, "\n");
+ }
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (Rule); \
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, Rule); \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YYDPRINTF(Args) ((void) 0)
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
@@ -747,154 +942,35 @@ int yydebug;
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
-{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
- continue;
-
- return yys - yystr - 1;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- register char *yyd = yydest;
- register const char *yys = yysrc;
- while ((*yyd++ = *yys++) != '\0')
- continue;
- return yyd - 1;
-}
-# endif
-# endif
-#endif /* !YYERROR_VERBOSE */
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
- YYFPRINTF (yyoutput, ")");
-}
-
-#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+yydestruct (const char *yymsg,
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
+ YY_USE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
- switch (yytype)
- {
-
- default:
- break;
- }
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YY_USE (yykind);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-
-
-/* Prevent warnings from -Wmissing-prototypes. */
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
-# else
-int yyparse ();
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
@@ -905,204 +981,193 @@ int yyparse ();
| yyparse. |
`----------*/
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
{
- /* The look-ahead symbol. */
+/* Lookahead token kind. */
int yychar;
-/* The semantic value of the look-ahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
-
- register int yystate;
- register int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
+/* The semantic value of the lookahead symbol. */
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
- /* The state stack. */
- short int yyssa[YYINITDEPTH];
- short int *yyss = yyssa;
- register short int *yyssp;
+ /* Number of syntax errors so far. */
+ int yynerrs = 0;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
+ yy_state_fast_t yystate = 0;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus = 0;
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+ /* Their size. */
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
-#define YYPOPSTACK (yyvsp--, yyssp--)
+ /* The state stack: array, bottom, top. */
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss = yyssa;
+ yy_state_t *yyssp = yyss;
- YYSIZE_T yystacksize = YYINITDEPTH;
+ /* The semantic value stack: array, bottom, top. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp = yyvs;
+ int yyn;
+ /* The return value of yyparse. */
+ int yyresult;
+ /* Lookahead symbol kind. */
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
+ YYDPRINTF ((stderr, "Starting parse\n"));
- yyvsp[0] = yylval;
+ yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
+ have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
+ YY_STACK_PRINT (yyss, yyssp);
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ YYNOMEM;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
-#ifdef yyoverflow
+# if defined yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- short int *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ yy_state_t *yyss1 = yyss;
+ YYSTYPE *yyvs1 = yyvs;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
+ &yystacksize);
+ yyss = yyss1;
+ yyvs = yyvs1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyoverflowlab;
+ YYNOMEM;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ yystacksize = YYMAXDEPTH;
{
- short int *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyoverflowlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
+ yy_state_t *yyss1 = yyss;
+ union yyalloc *yyptr =
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
+ if (! yyptr)
+ YYNOMEM;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ if (yystate == YYFINAL)
+ YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
+ /* Do appropriate processing given the current state. Read a
+ lookahead token if we need one and don't already have one. */
-/* Do appropriate processing given the current state. */
-/* Read a look-ahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to look-ahead token. */
-
+ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ YYDPRINTF ((stderr, "Reading a token\n"));
+ yychar = yylex (&yylval);
}
if (yychar <= YYEOF)
{
- yychar = yytoken = YYEOF;
+ yychar = YYEOF;
+ yytoken = YYSYMBOL_YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
+ else if (yychar == YYerror)
+ {
+ /* The scanner already issued an error message, process directly
+ to error recovery. But do not keep the error token as
+ lookahead, it is too special and may lead us to an endless
+ loop in error recovery. */
+ yychar = YYUNDEF;
+ yytoken = YYSYMBOL_YYerror;
+ goto yyerrlab1;
+ }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -1117,31 +1182,26 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
+ /* Shift the lookahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
goto yynewstate;
@@ -1156,14 +1216,14 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+ '$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
@@ -1176,223 +1236,176 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 2:
-#line 177 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 2: /* start: exp */
+#line 177 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
if ((yyvsp[0].exp) == NULL)
YYABORT;
((struct parse_args *) arg)->res = (yyvsp[0].exp);
}
+#line 1247 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 3:
-#line 185 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 3: /* exp: exp '?' exp ':' exp */
+#line 185 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_3 (qmop, (yyvsp[-4].exp), (yyvsp[-2].exp), (yyvsp[0].exp));
}
+#line 1255 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 4:
-#line 189 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 4: /* exp: exp '|' exp */
+#line 189 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_2 (lor, (yyvsp[-2].exp), (yyvsp[0].exp));
}
+#line 1263 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 5:
-#line 193 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 5: /* exp: exp '&' exp */
+#line 193 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_2 (land, (yyvsp[-2].exp), (yyvsp[0].exp));
}
+#line 1271 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 6:
-#line 197 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 6: /* exp: exp EQUOP2 exp */
+#line 197 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
}
+#line 1279 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 7:
-#line 201 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 7: /* exp: exp CMPOP2 exp */
+#line 201 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
}
+#line 1287 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 8:
-#line 205 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 8: /* exp: exp ADDOP2 exp */
+#line 205 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
}
+#line 1295 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 9:
-#line 209 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 9: /* exp: exp MULOP2 exp */
+#line 209 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
}
+#line 1303 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 10:
-#line 213 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 10: /* exp: '!' exp */
+#line 213 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_1 (lnot, (yyvsp[0].exp));
}
+#line 1311 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 11:
-#line 217 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 11: /* exp: 'n' */
+#line 217 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = new_exp_0 (var);
}
+#line 1319 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 12:
-#line 221 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 12: /* exp: NUMBER */
+#line 221 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
if (((yyval.exp) = new_exp_0 (num)) != NULL)
(yyval.exp)->val.num = (yyvsp[0].num);
}
+#line 1328 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- case 13:
-#line 226 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
- {
+ case 13: /* exp: '(' exp ')' */
+#line 226 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
+ {
(yyval.exp) = (yyvsp[-1].exp);
}
+#line 1336 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
break;
- }
+#line 1340 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.c"
-/* Line 1037 of yacc.c. */
-#line 1270 "/usr/src/local/bash/bash-20080814/lib/intl/plural.c"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
- YY_STACK_PRINT (yyss, yyssp);
+ default: break;
+ }
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
+
+ YYPOPSTACK (yylen);
+ yylen = 0;
*++yyvsp = yyval;
-
- /* Now `shift' the result of the reduction. Determine what state
+ /* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- const char* yyprefix;
- char *yymsg;
- int yyx;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 0;
-
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
- yycount += 1;
- if (yycount == 5)
- {
- yysize = 0;
- break;
- }
- }
- yysize += (sizeof ("syntax error, unexpected ")
- + yystrlen (yytname[yytype]));
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
-
- if (yycount < 5)
- {
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yyp = yystpcpy (yyp, yyprefix);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yyprefix = " or ";
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
+ yyerror (YY_("syntax error"));
}
-
-
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
if (yychar <= YYEOF)
{
- /* If at end of input, pop the error token,
- then the rest of the stack, then return failure. */
- if (yychar == YYEOF)
- for (;;)
- {
-
- YYPOPSTACK;
- if (yyssp == yyss)
- YYABORT;
- yydestruct ("Error: popping",
- yystos[*yyssp], yyvsp);
- }
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
}
else
- {
- yydestruct ("Error: discarding", yytoken, &yylval);
- yychar = YYEMPTY;
- }
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
+ yychar = YYEMPTY;
+ }
}
- /* Else will try to reuse look-ahead token after shifting the error
+ /* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
@@ -1401,16 +1414,17 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
-
-#ifdef __GNUC__
- /* Pacify GCC when the user code never invokes YYERROR and the label
- yyerrorlab therefore never appears in user code. */
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
if (0)
- goto yyerrorlab;
-#endif
+ YYERROR;
+ ++yynerrs;
-yyvsp -= yylen;
- yyssp -= yylen;
+ /* Do not reclaim the symbols of the rule whose action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
@@ -1419,41 +1433,42 @@ yyvsp -= yylen;
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+ /* Pop stack until we find a state that shifts the error token. */
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ if (!yypact_value_is_default (yyn))
+ {
+ yyn += YYSYMBOL_YYerror;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
- YYABORT;
+ YYABORT;
- yydestruct ("Error: popping", yystos[yystate], yyvsp);
- YYPOPSTACK;
+ yydestruct ("Error: popping",
+ YY_ACCESSING_SYMBOL (yystate), yyvsp);
+ YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
@@ -1464,38 +1479,57 @@ yyerrlab1:
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
- goto yyreturn;
+ goto yyreturnlab;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
- yydestruct ("Error: discarding lookahead",
- yytoken, &yylval);
- yychar = YYEMPTY;
yyresult = 1;
- goto yyreturn;
+ goto yyreturnlab;
-#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here. |
-`----------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
+
+/*-----------------------------------------------------------.
+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
+`-----------------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (YY_("memory exhausted"));
yyresult = 2;
- /* Fall through. */
-#endif
+ goto yyreturnlab;
+
-yyreturn:
+/*----------------------------------------------------------.
+| yyreturnlab -- parsing is finished, clean up and return. |
+`----------------------------------------------------------*/
+yyreturnlab:
+ if (yychar != YYEMPTY)
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
+ }
+ /* Do not reclaim the symbols of the rule whose action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
+ while (yyssp != yyss)
+ {
+ yydestruct ("Cleanup: popping",
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
+ YYPOPSTACK (1);
+ }
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
+
return yyresult;
}
-
-#line 231 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y"
+#line 231 "/fs2/chet/bash/bash-git/bash/lib/intl/plural.y"
inline void
diff --git a/version2.c b/version2.c
deleted file mode 100644
index 5bb456ac..00000000
--- a/version2.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* version.c -- distribution and version numbers. */
-
-/* Copyright (C) 1989-2022 Free Software Foundation, Inc.
-
- This file is part of GNU Bash, the Bourne Again SHell.
-
- Bash is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Bash is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Bash. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include "stdc.h"
-
-#include "version.h"
-#include "patchlevel.h"
-#include "conftypes.h"
-
-#include "bashintl.h"
-
-extern char *shell_name;
-
-/* Defines from version.h */
-const char * const dist_version = DISTVERSION;
-const int patch_level = PATCHLEVEL;
-const int build_version = BUILDVERSION;
-#ifdef RELSTATUS
-const char * const release_status = RELSTATUS;
-#else
-const char * const release_status = (char *)0;
-#endif
-const char * const sccs_version = SCCSVERSION;
-
-const char * const bash_copyright = N_("Copyright (C) 2022 Free Software Foundation, Inc.");
-const char * const bash_license = N_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
-
-/* If == 31, shell compatible with bash-3.1, == 32 with bash-3.2, and so on */
-int shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
-
-/* Functions for getting, setting, and displaying the shell version. */
-
-/* Forward declarations so we don't have to include externs.h */
-extern char *shell_version_string (void);
-extern void show_shell_version (int);
-
-/* Give version information about this shell. */
-char *
-shell_version_string ()
-{
- static char tt[32] = { '\0' };
-
- if (tt[0] == '\0')
- {
- if (release_status)
-#if HAVE_SNPRINTF
- snprintf (tt, sizeof (tt), "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
-#else
- sprintf (tt, "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
-#endif
- else
-#if HAVE_SNPRINTF
- snprintf (tt, sizeof (tt), "%s.%d(%d)", dist_version, patch_level, build_version);
-#else
- sprintf (tt, "%s.%d(%d)", dist_version, patch_level, build_version);
-#endif
- }
- return tt;
-}
-
-void
-show_shell_version (extended)
- int extended;
-{
- printf (_("GNU bash, version %s (%s)\n"), shell_version_string (), MACHTYPE);
- if (extended)
- {
- printf ("%s\n", _(bash_copyright));
- printf ("%s\n", _(bash_license));
- printf ("%s\n", _("This is free software; you are free to change and redistribute it."));
- printf ("%s\n", _("There is NO WARRANTY, to the extent permitted by law."));
- }
-}