/* A Bison parser, made from dns-boot-check/gram.y
   by GNU bison 1.35.  */

#define gram_BISON 1  /* Identify Bison output.  */

# define	CACHE	257
# define	DIRECTORY	258
# define	DOMAIN	259
# define	EOLN	260
# define	FORWARDERS	261
# define	OPTIONS	262
# define	PRIMARY	263
# define	SECONDARY	264
# define	STRING	265

#line 20 "dns-boot-check/gram.y"


#include <ac/stddef.h>
#include <ac/stdio.h>
#include <ac/stdlib.h>

#include <check.h>
#include <gram.h>
#include <lex.h>
#include <str.h>


#line 43 "dns-boot-check/gram.y"
#ifndef gram_STYPE
typedef union {
        string_ty       *lv_string;
} gram_stype;
# define gram_STYPE gram_stype
# define gram_STYPE_IS_TRIVIAL 1
#endif
#line 49 "dns-boot-check/gram.y"


void
grammar(const char *filename)
{
        extern int gram_parse(void);

        lex_open(filename);
        gram_parse();
        lex_close();
}

#ifndef gram_DEBUG
# define gram_DEBUG 0
#endif



#define	gram_FINAL		36
#define	gram_FLAG		-32768
#define	gram_NTBASE	12

/* gram_TRANSLATE(gram_LEX) -- Bison token number corresponding to gram_LEX. */
#define gram_TRANSLATE(x) ((unsigned)(x) <= 265 ? gram_translate[x] : 24)

/* gram_TRANSLATE[gram_LEX] -- Bison token number corresponding to gram_LEX. */
static const char gram_translate[] =
{
       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,     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,     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,     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,     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,     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,     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,     2,
       2,     2,     2,     2,     2,     2,     1,     3,     4,     5,
       6,     7,     8,     9,    10,    11
};

#if gram_DEBUG
static const short gram_prhs[] =
{
       0,     0,     1,     5,     6,     8,    10,    12,    14,    16,
      18,    20,    22,    26,    29,    32,    35,    37,    40,    42,
      45,    48,    51,    53,    57
};
static const short gram_rhs[] =
{
      -1,    12,    13,     6,     0,     0,    14,     0,    15,     0,
      16,     0,    17,     0,    20,     0,    22,     0,    23,     0,
       1,     0,     3,    11,    11,     0,     4,    11,     0,     5,
      11,     0,     7,    18,     0,    19,     0,    18,    19,     0,
      11,     0,     8,    21,     0,    20,    21,     0,    20,     1,
       0,    11,     0,     9,    11,    11,     0,    10,    11,    11,
       0
};

#endif

#if gram_DEBUG
/* gram_RLINE[gram_N] -- source line where rule number gram_N was defined. */
static const short gram_rline[] =
{
       0,    66,    67,    71,    72,    73,    74,    75,    76,    77,
      78,    79,    83,    92,   100,   108,   112,   113,   117,   125,
     126,   127,   131,   139,   148
};
#endif


#if (gram_DEBUG) || defined gram_ERROR_VERBOSE

/* gram_TNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const gram_tname[] =
{
  "$", "error", "$undefined.", "CACHE", "DIRECTORY", "DOMAIN", "EOLN", 
  "FORWARDERS", "OPTIONS", "PRIMARY", "SECONDARY", "STRING", "main", 
  "directive", "cache", "directory", "domain", "forwarders", 
  "ip_address_list", "ip_address", "option", "option_string", "primary", 
  "secondary", 0
};
#endif

/* gram_R1[gram_N] -- Symbol number of symbol that rule gram_N derives. */
static const short gram_r1[] =
{
       0,    12,    12,    13,    13,    13,    13,    13,    13,    13,
      13,    13,    14,    15,    16,    17,    18,    18,    19,    20,
      20,    20,    21,    22,    23
};

/* gram_R2[gram_N] -- Number of symbols composing right hand side of rule gram_N. */
static const short gram_r2[] =
{
       0,     0,     3,     0,     1,     1,     1,     1,     1,     1,
       1,     1,     3,     2,     2,     2,     1,     2,     1,     2,
       2,     2,     1,     3,     3
};

/* gram_DEFACT[S] -- default rule to reduce with in state S when gram_TABLE
   doesn't specify something else to do.  Zero means the default is an
   error. */
static const short gram_defact[] =
{
       1,     0,    11,     0,     0,     0,     0,     0,     0,     0,
       0,     4,     5,     6,     7,     0,     9,    10,     0,    13,
      14,    18,    15,    16,    22,    19,     0,     0,     2,    21,
      20,    12,    17,    23,    24,     0,     0
};

static const short gram_defgoto[] =
{
       1,    10,    11,    12,    13,    14,    22,    23,    15,    25,
      16,    17
};

static const short gram_pact[] =
{
  -32768,     0,-32768,    -9,     1,     2,     3,     4,     6,     7,
      13,-32768,-32768,-32768,-32768,    10,-32768,-32768,     9,-32768,
  -32768,-32768,     3,-32768,-32768,-32768,    11,    12,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,    24,-32768
};

static const short gram_pgoto[] =
{
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,     5,-32768,    14,
  -32768,-32768
};


#define	gram_LAST		29


static const short gram_table[] =
{
      35,     2,    18,     3,     4,     5,    -3,     6,     7,     8,
       9,    29,    19,    20,    21,    24,    -8,    26,    27,    28,
      31,    24,    33,    34,    36,     0,     0,    32,     0,    30
};

static const short gram_check[] =
{
       0,     1,    11,     3,     4,     5,     6,     7,     8,     9,
      10,     1,    11,    11,    11,    11,     6,    11,    11,     6,
      11,    11,    11,    11,     0,    -1,    -1,    22,    -1,    15
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/local/share/bison/bison.simple"

/* Skeleton output parser for bison,

   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
   Foundation, Inc.

   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 2, or (at your option)
   any later version.

   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 this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* 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 is the parser code that is written into each bison parser when
   the %semantic_parser declaration is not specified in the grammar.
   It was written by Richard Stallman by simplifying the hairy parser
   used when %semantic_parser is specified.  */

/* All symbols defined below should begin with gram_ or gram_, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

#if ! defined (gram_overflow) || defined (gram_ERROR_VERBOSE)

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# if gram_STACK_USE_ALLOCA
#  define gram_STACK_ALLOC alloca
# else
#  ifndef gram_STACK_USE_ALLOCA
#   if defined (alloca) || defined (_ALLOCA_H)
#    define gram_STACK_ALLOC alloca
#   else
#    ifdef __GNUC__
#     define gram_STACK_ALLOC __builtin_alloca
#    endif
#   endif
#  endif
# endif

# ifdef gram_STACK_ALLOC
   /* Pacify GCC's `empty if-body' warning. */
#  define gram_STACK_FREE(Ptr) do { /* empty */; } while (0)
# else
#  if defined (__STDC__) || defined (__cplusplus)
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   define gram_SIZE_T size_t
#  endif
#  define gram_STACK_ALLOC malloc
#  define gram_STACK_FREE free
# endif
#endif /* ! defined (gram_overflow) || defined (gram_ERROR_VERBOSE) */


#if (! defined (gram_overflow) \
     && (! defined (__cplusplus) \
	 || (gram_LTYPE_IS_TRIVIAL && gram_STYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union gram_alloc
{
  short gram_ss;
  gram_STYPE gram_vs;
# if gram_LSP_NEEDED
  gram_LTYPE gram_ls;
# endif
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define gram_STACK_GAP_MAX (sizeof (union gram_alloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# if gram_LSP_NEEDED
#  define gram_STACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (gram_STYPE) + sizeof (gram_LTYPE))	\
      + 2 * gram_STACK_GAP_MAX)
# else
#  define gram_STACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (gram_STYPE))				\
      + gram_STACK_GAP_MAX)
# endif

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef gram_COPY
#  if 1 < __GNUC__
#   define gram_COPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define gram_COPY(To, From, Count)		\
      do					\
	{					\
	  register gram_SIZE_T gram_i;		\
	  for (gram_i = 0; gram_i < (Count); gram_i++)	\
	    (To)[gram_i] = (From)[gram_i];		\
	}					\
      while (0)
#  endif
# endif

/* Relocate STACK from its old location to the new one.  The
   local variables gram_SIZE and gram_STACKSIZE give the old and new number of
   elements in the stack, and gram_PTR gives the new location of the
   stack.  Advance gram_PTR to a properly aligned location for the next
   stack.  */
# define gram_STACK_RELOCATE(Stack)					\
    do									\
      {									\
	gram_SIZE_T gram_newbytes;						\
	gram_COPY (&gram_ptr->Stack, Stack, gram_size);				\
	Stack = &gram_ptr->Stack;						\
	gram_newbytes = gram_stacksize * sizeof (*Stack) + gram_STACK_GAP_MAX;	\
	gram_ptr += gram_newbytes / sizeof (*gram_ptr);				\
      }									\
    while (0)

#endif


#if ! defined (gram_SIZE_T) && defined (__SIZE_TYPE__)
# define gram_SIZE_T __SIZE_TYPE__
#endif
#if ! defined (gram_SIZE_T) && defined (size_t)
# define gram_SIZE_T size_t
#endif
#if ! defined (gram_SIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define gram_SIZE_T size_t
# endif
#endif
#if ! defined (gram_SIZE_T)
# define gram_SIZE_T unsigned int
#endif

#define gram_errok		(gram_errstatus = 0)
#define gram_clearin	(gram_char = gram_EMPTY)
#define gram_EMPTY		-2
#define gram_EOF		0
#define gram_ACCEPT	goto gram_acceptlab
#define gram_ABORT 	goto gram_abortlab
#define gram_ERROR		goto gram_errlab1
/* Like gram_ERROR except do call gram_error.  This remains here temporarily
   to ease the transition to the new meaning of gram_ERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define gram_FAIL		goto gram_errlab
#define gram_RECOVERING()  (!!gram_errstatus)
#define gram_BACKUP(Token, Value)					\
do								\
  if (gram_char == gram_EMPTY && gram_len == 1)				\
    {								\
      gram_char = (Token);						\
      gram_lval = (Value);						\
      gram_char1 = gram_TRANSLATE (gram_char);				\
      gram_POPSTACK;						\
      goto gram_backup;						\
    }								\
  else								\
    { 								\
      gram_error ("syntax error: cannot back up");			\
      gram_ERROR;							\
    }								\
while (0)

#define gram_TERROR	1
#define gram_ERRCODE	256


/* gram_LLOC_DEFAULT -- Compute the default location (before the actions
   are run).

   When gram_LLOC_DEFAULT is run, CURRENT is set the location of the
   first token.  By default, to implement support for ranges, extend
   its range to the last symbol.  */

#ifndef gram_LLOC_DEFAULT
# define gram_LLOC_DEFAULT(Current, Rhs, N)       	\
   Current.last_line   = Rhs[N].last_line;	\
   Current.last_column = Rhs[N].last_column;
#endif


/* gram_LEX -- calling `gram_lex' with the right arguments.  */

#if gram_PURE
# if gram_LSP_NEEDED
#  ifdef gram_LEX_PARAM
#   define gram_LEX		gram_lex (&gram_lval, &gram_lloc, gram_LEX_PARAM)
#  else
#   define gram_LEX		gram_lex (&gram_lval, &gram_lloc)
#  endif
# else /* !gram_LSP_NEEDED */
#  ifdef gram_LEX_PARAM
#   define gram_LEX		gram_lex (&gram_lval, gram_LEX_PARAM)
#  else
#   define gram_LEX		gram_lex (&gram_lval)
#  endif
# endif /* !gram_LSP_NEEDED */
#else /* !gram_PURE */
# define gram_LEX			gram_lex ()
#endif /* !gram_PURE */


/* Enable debugging if requested.  */
#if gram_DEBUG

# ifndef gram_FPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define gram_FPRINTF fprintf
# endif

# define gram_DPRINTF(Args)			\
do {						\
  if (gram_debug)					\
    gram_FPRINTF Args;				\
} while (0)
/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int gram_debug;
#else /* !gram_DEBUG */
# define gram_DPRINTF(Args)
#endif /* !gram_DEBUG */

/* gram_INITDEPTH -- initial size of the parser's stacks.  */
#ifndef	gram_INITDEPTH
# define gram_INITDEPTH 200
#endif

/* gram_MAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   SIZE_MAX < gram_STACK_BYTES (gram_MAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#if gram_MAXDEPTH == 0
# undef gram_MAXDEPTH
#endif

#ifndef gram_MAXDEPTH
# define gram_MAXDEPTH 10000
#endif

#ifdef gram_ERROR_VERBOSE

# ifndef gram_strlen
#  if defined (__GLIBC__) && defined (_STRING_H)
#   define gram_strlen strlen
#  else
/* Return the length of gram_STR.  */
static gram_SIZE_T
#   if defined (__STDC__) || defined (__cplusplus)
gram_strlen (const char *gram_str)
#   else
gram_strlen (gram_str)
     const char *gram_str;
#   endif
{
  register const char *gram_s = gram_str;

  while (*gram_s++ != '\0')
    continue;

  return gram_s - gram_str - 1;
}
#  endif
# endif

# ifndef gram_stpcpy
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
#   define gram_stpcpy stpcpy
#  else
/* Copy gram_SRC to gram_DEST, returning the address of the terminating '\0' in
   gram_DEST.  */
static char *
#   if defined (__STDC__) || defined (__cplusplus)
gram_stpcpy (char *gram_dest, const char *gram_src)
#   else
gram_stpcpy (gram_dest, gram_src)
     char *gram_dest;
     const char *gram_src;
#   endif
{
  register char *gram_d = gram_dest;
  register const char *gram_s = gram_src;

  while ((*gram_d++ = *gram_s++) != '\0')
    continue;

  return gram_d - 1;
}
#  endif
# endif
#endif

#line 315 "/usr/local/share/bison/bison.simple"


/* The user can define gram_PARSE_PARAM as the name of an argument to be passed
   into gram_parse.  The argument should have type void *.
   It should actually point to an object.
   Grammar actions can access the variable by casting it
   to the proper pointer type.  */

#ifdef gram_PARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
#  define gram_PARSE_PARAM_ARG void *gram_PARSE_PARAM
#  define gram_PARSE_PARAM_DECL
# else
#  define gram_PARSE_PARAM_ARG gram_PARSE_PARAM
#  define gram_PARSE_PARAM_DECL void *gram_PARSE_PARAM;
# endif
#else /* !gram_PARSE_PARAM */
# define gram_PARSE_PARAM_ARG
# define gram_PARSE_PARAM_DECL
#endif /* !gram_PARSE_PARAM */

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
# ifdef gram_PARSE_PARAM
int gram_parse (void *);
# else
int gram_parse (void);
# endif
#endif

/* gram__DECL_VARIABLES -- depending whether we use a pure parser,
   variables are global, or local to gram_PARSE.  */

#define gram__DECL_NON_LSP_VARIABLES			\
/* The lookahead symbol.  */				\
int gram_char;						\
							\
/* The semantic value of the lookahead symbol. */	\
gram_STYPE gram_lval;						\
							\
/* Number of parse errors so far.  */			\
int gram_nerrs;

#if gram_LSP_NEEDED
# define gram__DECL_VARIABLES			\
gram__DECL_NON_LSP_VARIABLES			\
						\
/* Location data for the lookahead symbol.  */	\
gram_LTYPE gram_lloc;
#else
# define gram__DECL_VARIABLES			\
gram__DECL_NON_LSP_VARIABLES
#endif


/* If nonreentrant, generate the variables here. */

#if !gram_PURE
gram__DECL_VARIABLES
#endif  /* !gram_PURE */

int
gram_parse (gram_PARSE_PARAM_ARG)
     gram_PARSE_PARAM_DECL
{
  /* If reentrant, generate the variables here. */
#if gram_PURE
  gram__DECL_VARIABLES
#endif  /* !gram_PURE */

  register int gram_state;
  register int gram_n;
  int gram_result;
  /* Number of tokens to shift before error messages enabled.  */
  int gram_errstatus;
  /* Lookahead token as an internal (translated) token number.  */
  int gram_char1 = 0;

  /* Three stacks and their tools:
     `gram_ss': related to states,
     `gram_vs': related to semantic values,
     `gram_ls': related to locations.

     Refer to the stacks thru separate pointers, to allow gram_overflow
     to reallocate them elsewhere.  */

  /* The state stack. */
  short	gram_ssa[gram_INITDEPTH];
  short *gram_ss = gram_ssa;
  register short *gram_ssp;

  /* The semantic value stack.  */
  gram_STYPE gram_vsa[gram_INITDEPTH];
  gram_STYPE *gram_vs = gram_vsa;
  register gram_STYPE *gram_vsp;

#if gram_LSP_NEEDED
  /* The location stack.  */
  gram_LTYPE gram_lsa[gram_INITDEPTH];
  gram_LTYPE *gram_ls = gram_lsa;
  gram_LTYPE *gram_lsp;
#endif

#if gram_LSP_NEEDED
# define gram_POPSTACK   (gram_vsp--, gram_ssp--, gram_lsp--)
#else
# define gram_POPSTACK   (gram_vsp--, gram_ssp--)
#endif

  gram_SIZE_T gram_stacksize = gram_INITDEPTH;


  /* The variables used to return semantic value and location from the
     action routines.  */
  gram_STYPE gram_val;
#if gram_LSP_NEEDED
  gram_LTYPE gram_loc;
#endif

  /* When reducing, the number of symbols on the RHS of the reduced
     rule. */
  int gram_len;

  gram_DPRINTF ((stderr, "Starting parse\n"));

  gram_state = 0;
  gram_errstatus = 0;
  gram_nerrs = 0;
  gram_char = gram_EMPTY;		/* Cause a token to be read.  */

  /* 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.  */

  gram_ssp = gram_ss;
  gram_vsp = gram_vs;
#if gram_LSP_NEEDED
  gram_lsp = gram_ls;
#endif
  goto gram_setstate;

/*------------------------------------------------------------.
| gram_newstate -- Push a new state, which is found in gram_state.  |
`------------------------------------------------------------*/
 gram_newstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed. so pushing a state here evens the stacks.
     */
  gram_ssp++;

 gram_setstate:
  *gram_ssp = gram_state;

  if (gram_ssp >= gram_ss + gram_stacksize - 1)
    {
      /* Get the current used size of the three stacks, in elements.  */
      gram_SIZE_T gram_size = gram_ssp - gram_ss + 1;

#ifdef gram_overflow
      {
	/* Give user a chance to reallocate the stack. Use copies of
	   these so that the &'s don't force the real ones into
	   memory.  */
	gram_STYPE *gram_vs1 = gram_vs;
	short *gram_ss1 = gram_ss;

	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  */
# if gram_LSP_NEEDED
	gram_LTYPE *gram_ls1 = gram_ls;
	/* This used to be a conditional around just the two extra args,
	   but that might be undefined if gram_overflow is a macro.  */
	gram_overflow ("parser stack overflow",
		    &gram_ss1, gram_size * sizeof (*gram_ssp),
		    &gram_vs1, gram_size * sizeof (*gram_vsp),
		    &gram_ls1, gram_size * sizeof (*gram_lsp),
		    &gram_stacksize);
	gram_ls = gram_ls1;
# else
	gram_overflow ("parser stack overflow",
		    &gram_ss1, gram_size * sizeof (*gram_ssp),
		    &gram_vs1, gram_size * sizeof (*gram_vsp),
		    &gram_stacksize);
# endif
	gram_ss = gram_ss1;
	gram_vs = gram_vs1;
      }
#else /* no gram_overflow */
# ifndef gram_STACK_RELOCATE
      goto gram_overflowlab;
# else
      /* Extend the stack our own way.  */
      if (gram_stacksize >= gram_MAXDEPTH)
	goto gram_overflowlab;
      gram_stacksize *= 2;
      if (gram_stacksize > gram_MAXDEPTH)
	gram_stacksize = gram_MAXDEPTH;

      {
	short *gram_ss1 = gram_ss;
	union gram_alloc *gram_ptr =
	  (union gram_alloc *) gram_STACK_ALLOC (gram_STACK_BYTES (gram_stacksize));
	if (! gram_ptr)
	  goto gram_overflowlab;
	gram_STACK_RELOCATE (gram_ss);
	gram_STACK_RELOCATE (gram_vs);
# if gram_LSP_NEEDED
	gram_STACK_RELOCATE (gram_ls);
# endif
# undef gram_STACK_RELOCATE
	if (gram_ss1 != gram_ssa)
	  gram_STACK_FREE (gram_ss1);
      }
# endif
#endif /* no gram_overflow */

      gram_ssp = gram_ss + gram_size - 1;
      gram_vsp = gram_vs + gram_size - 1;
#if gram_LSP_NEEDED
      gram_lsp = gram_ls + gram_size - 1;
#endif

      gram_DPRINTF ((stderr, "Stack size increased to %lu\n",
		  (unsigned long int) gram_stacksize));

      if (gram_ssp >= gram_ss + gram_stacksize - 1)
	gram_ABORT;
    }

  gram_DPRINTF ((stderr, "Entering state %d\n", gram_state));

  goto gram_backup;


/*-----------.
| gram_backup.  |
`-----------*/
gram_backup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* gram_resume: */

  /* First try to decide what to do without reference to lookahead token.  */

  gram_n = gram_pact[gram_state];
  if (gram_n == gram_FLAG)
    goto gram_default;

  /* Not known => get a lookahead token if don't already have one.  */

  /* gram_char is either gram_EMPTY or gram_EOF
     or a valid token in external form.  */

  if (gram_char == gram_EMPTY)
    {
      gram_DPRINTF ((stderr, "Reading a token: "));
      gram_char = gram_LEX;
    }

  /* Convert token to internal form (in gram_char1) for indexing tables with */

  if (gram_char <= 0)		/* This means end of input. */
    {
      gram_char1 = 0;
      gram_char = gram_EOF;		/* Don't call gram_LEX any more */

      gram_DPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      gram_char1 = gram_TRANSLATE (gram_char);

#if gram_DEBUG
     /* We have to keep this `#if gram_DEBUG', since we use variables
	which are defined only if `gram_DEBUG' is set.  */
      if (gram_debug)
	{
	  gram_FPRINTF (stderr, "Next token is %d (%s",
		     gram_char, gram_tname[gram_char1]);
	  /* Give the individual parser a way to print the precise
	     meaning of a token, for further debugging info.  */
# ifdef gram_PRINT
	  gram_PRINT (stderr, gram_char, gram_lval);
# endif
	  gram_FPRINTF (stderr, ")\n");
	}
#endif
    }

  gram_n += gram_char1;
  if (gram_n < 0 || gram_n > gram_LAST || gram_check[gram_n] != gram_char1)
    goto gram_default;

  gram_n = gram_table[gram_n];

  /* gram_n is what to do for this token type in this state.
     Negative => reduce, -gram_n is rule number.
     Positive => shift, gram_n is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (gram_n < 0)
    {
      if (gram_n == gram_FLAG)
	goto gram_errlab;
      gram_n = -gram_n;
      goto gram_reduce;
    }
  else if (gram_n == 0)
    goto gram_errlab;

  if (gram_n == gram_FINAL)
    gram_ACCEPT;

  /* Shift the lookahead token.  */
  gram_DPRINTF ((stderr, "Shifting token %d (%s), ",
	      gram_char, gram_tname[gram_char1]));

  /* Discard the token being shifted unless it is eof.  */
  if (gram_char != gram_EOF)
    gram_char = gram_EMPTY;

  *++gram_vsp = gram_lval;
#if gram_LSP_NEEDED
  *++gram_lsp = gram_lloc;
#endif

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (gram_errstatus)
    gram_errstatus--;

  gram_state = gram_n;
  goto gram_newstate;


/*-----------------------------------------------------------.
| gram_default -- do the default action for the current state.  |
`-----------------------------------------------------------*/
gram_default:
  gram_n = gram_defact[gram_state];
  if (gram_n == 0)
    goto gram_errlab;
  goto gram_reduce;


/*-----------------------------.
| gram_reduce -- Do a reduction.  |
`-----------------------------*/
gram_reduce:
  /* gram_n is the number of a rule to reduce with.  */
  gram_len = gram_r2[gram_n];

  /* If gram_LEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets gram_VAL to the semantic value of
     the lookahead token.  This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to gram_VAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that gram_VAL may be used uninitialized.  */
  gram_val = gram_vsp[1-gram_len];

#if gram_LSP_NEEDED
  /* Similarly for the default location.  Let the user run additional
     commands if for instance locations are ranges.  */
  gram_loc = gram_lsp[1-gram_len];
  gram_LLOC_DEFAULT (gram_loc, (gram_lsp - gram_len), gram_len);
#endif

#if gram_DEBUG
  /* We have to keep this `#if gram_DEBUG', since we use variables which
     are defined only if `gram_DEBUG' is set.  */
  if (gram_debug)
    {
      int gram_i;

      gram_FPRINTF (stderr, "Reducing via rule %d (line %d), ",
		 gram_n, gram_rline[gram_n]);

      /* Print the symbols being reduced, and their result.  */
      for (gram_i = gram_prhs[gram_n]; gram_rhs[gram_i] > 0; gram_i++)
	gram_FPRINTF (stderr, "%s ", gram_tname[gram_rhs[gram_i]]);
      gram_FPRINTF (stderr, " -> %s\n", gram_tname[gram_r1[gram_n]]);
    }
#endif

  switch (gram_n) {

case 12:
#line 84 "dns-boot-check/gram.y"
{
                        check_cache(gram_vsp[-1].lv_string, gram_vsp[0].lv_string);
                        str_free(gram_vsp[-1].lv_string);
                        str_free(gram_vsp[0].lv_string);
                }
    break;
case 13:
#line 93 "dns-boot-check/gram.y"
{
                        check_directory(gram_vsp[0].lv_string);
                        str_free(gram_vsp[0].lv_string);
                }
    break;
case 14:
#line 101 "dns-boot-check/gram.y"
{
                        check_domain(gram_vsp[0].lv_string);
                        str_free(gram_vsp[0].lv_string);
                }
    break;
case 18:
#line 118 "dns-boot-check/gram.y"
{
                        check_forwarder(gram_vsp[0].lv_string);
                        str_free(gram_vsp[0].lv_string);
                }
    break;
case 22:
#line 132 "dns-boot-check/gram.y"
{
                        check_option(gram_vsp[0].lv_string);
                        str_free(gram_vsp[0].lv_string);
                }
    break;
case 23:
#line 140 "dns-boot-check/gram.y"
{
                        check_primary(gram_vsp[-1].lv_string, gram_vsp[0].lv_string);
                        str_free(gram_vsp[-1].lv_string);
                        str_free(gram_vsp[0].lv_string);
                }
    break;
case 24:
#line 149 "dns-boot-check/gram.y"
{
                        check_secondary(gram_vsp[-1].lv_string, gram_vsp[0].lv_string);
                        str_free(gram_vsp[-1].lv_string);
                        str_free(gram_vsp[0].lv_string);
                }
    break;
}

#line 705 "/usr/local/share/bison/bison.simple"


  gram_vsp -= gram_len;
  gram_ssp -= gram_len;
#if gram_LSP_NEEDED
  gram_lsp -= gram_len;
#endif

#if gram_DEBUG
  if (gram_debug)
    {
      short *gram_ssp1 = gram_ss - 1;
      gram_FPRINTF (stderr, "state stack now");
      while (gram_ssp1 != gram_ssp)
	gram_FPRINTF (stderr, " %d", *++gram_ssp1);
      gram_FPRINTF (stderr, "\n");
    }
#endif

  *++gram_vsp = gram_val;
#if gram_LSP_NEEDED
  *++gram_lsp = gram_loc;
#endif

  /* 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.  */

  gram_n = gram_r1[gram_n];

  gram_state = gram_pgoto[gram_n - gram_NTBASE] + *gram_ssp;
  if (gram_state >= 0 && gram_state <= gram_LAST && gram_check[gram_state] == *gram_ssp)
    gram_state = gram_table[gram_state];
  else
    gram_state = gram_defgoto[gram_n - gram_NTBASE];

  goto gram_newstate;


/*------------------------------------.
| gram_errlab -- here on detecting error |
`------------------------------------*/
gram_errlab:
  /* If not already recovering from an error, report this error.  */
  if (!gram_errstatus)
    {
      ++gram_nerrs;

#ifdef gram_ERROR_VERBOSE
      gram_n = gram_pact[gram_state];

      if (gram_n > gram_FLAG && gram_n < gram_LAST)
	{
	  gram_SIZE_T gram_size = 0;
	  char *gram_msg;
	  int gram_x, gram_count;

	  gram_count = 0;
	  /* Start gram_X at -gram_N if negative to avoid negative indexes in
	     gram_CHECK.  */
	  for (gram_x = gram_n < 0 ? -gram_n : 0;
	       gram_x < (int) (sizeof (gram_tname) / sizeof (char *)); gram_x++)
	    if (gram_check[gram_x + gram_n] == gram_x)
	      gram_size += gram_strlen (gram_tname[gram_x]) + 15, gram_count++;
	  gram_size += gram_strlen ("parse error, unexpected ") + 1;
	  gram_size += gram_strlen (gram_tname[gram_TRANSLATE (gram_char)]);
	  gram_msg = (char *) gram_STACK_ALLOC (gram_size);
	  if (gram_msg != 0)
	    {
	      char *gram_p = gram_stpcpy (gram_msg, "parse error, unexpected ");
	      gram_p = gram_stpcpy (gram_p, gram_tname[gram_TRANSLATE (gram_char)]);

	      if (gram_count < 5)
		{
		  gram_count = 0;
		  for (gram_x = gram_n < 0 ? -gram_n : 0;
		       gram_x < (int) (sizeof (gram_tname) / sizeof (char *));
		       gram_x++)
		    if (gram_check[gram_x + gram_n] == gram_x)
		      {
			const char *gram_q = ! gram_count ? ", expecting " : " or ";
			gram_p = gram_stpcpy (gram_p, gram_q);
			gram_p = gram_stpcpy (gram_p, gram_tname[gram_x]);
			gram_count++;
		      }
		}
	      gram_error (gram_msg);
	      gram_STACK_FREE (gram_msg);
	    }
	  else
	    gram_error ("parse error; also virtual memory exhausted");
	}
      else
#endif /* defined (gram_ERROR_VERBOSE) */
	gram_error ("parse error");
    }
  goto gram_errlab1;


/*--------------------------------------------------.
| gram_errlab1 -- error raised explicitly by an action |
`--------------------------------------------------*/
gram_errlab1:
  if (gram_errstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

      /* return failure if at end of input */
      if (gram_char == gram_EOF)
	gram_ABORT;
      gram_DPRINTF ((stderr, "Discarding token %d (%s).\n",
		  gram_char, gram_tname[gram_char1]));
      gram_char = gram_EMPTY;
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */

  gram_errstatus = 3;		/* Each real token shifted decrements this */

  goto gram_errhandle;


/*-------------------------------------------------------------------.
| gram_errdefault -- current state does not do anything special for the |
| error token.                                                       |
`-------------------------------------------------------------------*/
gram_errdefault:
#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */

  /* If its default is to accept any token, ok.  Otherwise pop it.  */
  gram_n = gram_defact[gram_state];
  if (gram_n)
    goto gram_default;
#endif


/*---------------------------------------------------------------.
| gram_errpop -- pop the current state because it cannot handle the |
| error token                                                    |
`---------------------------------------------------------------*/
gram_errpop:
  if (gram_ssp == gram_ss)
    gram_ABORT;
  gram_vsp--;
  gram_state = *--gram_ssp;
#if gram_LSP_NEEDED
  gram_lsp--;
#endif

#if gram_DEBUG
  if (gram_debug)
    {
      short *gram_ssp1 = gram_ss - 1;
      gram_FPRINTF (stderr, "Error: state stack now");
      while (gram_ssp1 != gram_ssp)
	gram_FPRINTF (stderr, " %d", *++gram_ssp1);
      gram_FPRINTF (stderr, "\n");
    }
#endif

/*--------------.
| gram_errhandle.  |
`--------------*/
gram_errhandle:
  gram_n = gram_pact[gram_state];
  if (gram_n == gram_FLAG)
    goto gram_errdefault;

  gram_n += gram_TERROR;
  if (gram_n < 0 || gram_n > gram_LAST || gram_check[gram_n] != gram_TERROR)
    goto gram_errdefault;

  gram_n = gram_table[gram_n];
  if (gram_n < 0)
    {
      if (gram_n == gram_FLAG)
	goto gram_errpop;
      gram_n = -gram_n;
      goto gram_reduce;
    }
  else if (gram_n == 0)
    goto gram_errpop;

  if (gram_n == gram_FINAL)
    gram_ACCEPT;

  gram_DPRINTF ((stderr, "Shifting error token, "));

  *++gram_vsp = gram_lval;
#if gram_LSP_NEEDED
  *++gram_lsp = gram_lloc;
#endif

  gram_state = gram_n;
  goto gram_newstate;


/*-------------------------------------.
| gram_acceptlab -- gram_ACCEPT comes here.  |
`-------------------------------------*/
gram_acceptlab:
  gram_result = 0;
  goto gram_return;

/*-----------------------------------.
| gram_abortlab -- gram_ABORT comes here.  |
`-----------------------------------*/
gram_abortlab:
  gram_result = 1;
  goto gram_return;

/*---------------------------------------------.
| gram_overflowab -- parser overflow comes here.  |
`---------------------------------------------*/
gram_overflowlab:
  gram_error ("parser stack overflow");
  gram_result = 2;
  /* Fall through.  */

gram_return:
#ifndef gram_overflow
  if (gram_ss != gram_ssa)
    gram_STACK_FREE (gram_ss);
#endif
  return gram_result;
}
#line 155 "dns-boot-check/gram.y"


syntax highlighted by Code2HTML, v. 0.9.1