/* A Bison parser, made by GNU Bison 3.8.2.  */

/* Bison implementation for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, 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, 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.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

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

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

/* Pure parsers.  */
#define YYPURE 0

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1




/* First part of user prologue.  */
#line 21 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"


#include <ac_cfg.h>

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <errno.h>

#include "avrdude.h"
#include "libavrdude.h"
#include "config.h"
#include "developer_opts.h"

#if defined(WIN32)
#define strtok_r( _s, _sep, _lasts ) ( *(_lasts) = strtok( (_s), (_sep) ) )
#endif

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)

int yylex(void);
int yyerror(char *errmsg, ...);
int yywarning(char *errmsg, ...);

static int clear_pin(int pinfunc);
static int assign_pin(int pinfunc, TOKEN *v, int invert);
static int assign_pin_list(int invert);
static int which_opcode(TOKEN *opcode);
static int parse_cmdbits(OPCODE *op, int opnum);

#define pin_name (cx->cfgy_pin_name)

#line 105 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"

# 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 "config_gram.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_K_NULL = 3,                     /* K_NULL  */
  YYSYMBOL_K_READ = 4,                     /* K_READ  */
  YYSYMBOL_K_WRITE = 5,                    /* K_WRITE  */
  YYSYMBOL_K_READ_LO = 6,                  /* K_READ_LO  */
  YYSYMBOL_K_READ_HI = 7,                  /* K_READ_HI  */
  YYSYMBOL_K_WRITE_LO = 8,                 /* K_WRITE_LO  */
  YYSYMBOL_K_WRITE_HI = 9,                 /* K_WRITE_HI  */
  YYSYMBOL_K_LOADPAGE_LO = 10,             /* K_LOADPAGE_LO  */
  YYSYMBOL_K_LOADPAGE_HI = 11,             /* K_LOADPAGE_HI  */
  YYSYMBOL_K_LOAD_EXT_ADDR = 12,           /* K_LOAD_EXT_ADDR  */
  YYSYMBOL_K_WRITEPAGE = 13,               /* K_WRITEPAGE  */
  YYSYMBOL_K_CHIP_ERASE = 14,              /* K_CHIP_ERASE  */
  YYSYMBOL_K_PGM_ENABLE = 15,              /* K_PGM_ENABLE  */
  YYSYMBOL_K_MEMORY = 16,                  /* K_MEMORY  */
  YYSYMBOL_K_PAGE_SIZE = 17,               /* K_PAGE_SIZE  */
  YYSYMBOL_K_ALIAS = 18,                   /* K_ALIAS  */
  YYSYMBOL_K_ALLOW_SUBSHELLS = 19,         /* K_ALLOW_SUBSHELLS  */
  YYSYMBOL_K_AVRDUDE_CONF_VERSION = 20,    /* K_AVRDUDE_CONF_VERSION  */
  YYSYMBOL_K_BUFF = 21,                    /* K_BUFF  */
  YYSYMBOL_K_CONNTYPE = 22,                /* K_CONNTYPE  */
  YYSYMBOL_K_DEDICATED = 23,               /* K_DEDICATED  */
  YYSYMBOL_K_DEFAULT_BAUDRATE = 24,        /* K_DEFAULT_BAUDRATE  */
  YYSYMBOL_K_DEFAULT_BITCLOCK = 25,        /* K_DEFAULT_BITCLOCK  */
  YYSYMBOL_K_DEFAULT_PARALLEL = 26,        /* K_DEFAULT_PARALLEL  */
  YYSYMBOL_K_DEFAULT_PROGRAMMER = 27,      /* K_DEFAULT_PROGRAMMER  */
  YYSYMBOL_K_DEFAULT_SERIAL = 28,          /* K_DEFAULT_SERIAL  */
  YYSYMBOL_K_DEFAULT_SPI = 29,             /* K_DEFAULT_SPI  */
  YYSYMBOL_K_DEFAULT_LINUXGPIO = 30,       /* K_DEFAULT_LINUXGPIO  */
  YYSYMBOL_K_HVUPDI_SUPPORT = 31,          /* K_HVUPDI_SUPPORT  */
  YYSYMBOL_K_EEPROM = 32,                  /* K_EEPROM  */
  YYSYMBOL_K_ERRLED = 33,                  /* K_ERRLED  */
  YYSYMBOL_K_FLASH = 34,                   /* K_FLASH  */
  YYSYMBOL_K_ID = 35,                      /* K_ID  */
  YYSYMBOL_K_IO = 36,                      /* K_IO  */
  YYSYMBOL_K_LINUXGPIO = 37,               /* K_LINUXGPIO  */
  YYSYMBOL_K_LOADPAGE = 38,                /* K_LOADPAGE  */
  YYSYMBOL_K_SDI = 39,                     /* K_SDI  */
  YYSYMBOL_K_SDO = 40,                     /* K_SDO  */
  YYSYMBOL_K_PARALLEL = 41,                /* K_PARALLEL  */
  YYSYMBOL_K_PARENT = 42,                  /* K_PARENT  */
  YYSYMBOL_K_PART = 43,                    /* K_PART  */
  YYSYMBOL_K_PGMLED = 44,                  /* K_PGMLED  */
  YYSYMBOL_K_PROGRAMMER = 45,              /* K_PROGRAMMER  */
  YYSYMBOL_K_RDYLED = 46,                  /* K_RDYLED  */
  YYSYMBOL_K_READBACK = 47,                /* K_READBACK  */
  YYSYMBOL_K_READMEM = 48,                 /* K_READMEM  */
  YYSYMBOL_K_RESET = 49,                   /* K_RESET  */
  YYSYMBOL_K_RETRY_PULSE = 50,             /* K_RETRY_PULSE  */
  YYSYMBOL_K_SERIAL = 51,                  /* K_SERIAL  */
  YYSYMBOL_K_SPI = 52,                     /* K_SPI  */
  YYSYMBOL_K_SCK = 53,                     /* K_SCK  */
  YYSYMBOL_K_SIGNATURE = 54,               /* K_SIGNATURE  */
  YYSYMBOL_K_SIZE = 55,                    /* K_SIZE  */
  YYSYMBOL_K_TCK = 56,                     /* K_TCK  */
  YYSYMBOL_K_TDI = 57,                     /* K_TDI  */
  YYSYMBOL_K_TDO = 58,                     /* K_TDO  */
  YYSYMBOL_K_TMS = 59,                     /* K_TMS  */
  YYSYMBOL_K_USB = 60,                     /* K_USB  */
  YYSYMBOL_K_USBPID = 61,                  /* K_USBPID  */
  YYSYMBOL_K_TYPE = 62,                    /* K_TYPE  */
  YYSYMBOL_K_VARIANTS = 63,                /* K_VARIANTS  */
  YYSYMBOL_K_VCC = 64,                     /* K_VCC  */
  YYSYMBOL_K_VFYLED = 65,                  /* K_VFYLED  */
  YYSYMBOL_K_PP_CONTROLSTACK = 66,         /* K_PP_CONTROLSTACK  */
  YYSYMBOL_K_HVSP_CONTROLSTACK = 67,       /* K_HVSP_CONTROLSTACK  */
  YYSYMBOL_K_ALLOWFULLPAGEBITSTREAM = 68,  /* K_ALLOWFULLPAGEBITSTREAM  */
  YYSYMBOL_K_ENABLEPAGEPROGRAMMING = 69,   /* K_ENABLEPAGEPROGRAMMING  */
  YYSYMBOL_K_IS_AT90S1200 = 70,            /* K_IS_AT90S1200  */
  YYSYMBOL_K_FLASH_INSTR = 71,             /* K_FLASH_INSTR  */
  YYSYMBOL_K_EEPROM_INSTR = 72,            /* K_EEPROM_INSTR  */
  YYSYMBOL_TKN_COMMA = 73,                 /* TKN_COMMA  */
  YYSYMBOL_TKN_EQUAL = 74,                 /* TKN_EQUAL  */
  YYSYMBOL_TKN_SEMI = 75,                  /* TKN_SEMI  */
  YYSYMBOL_TKN_LEFT_PAREN = 76,            /* TKN_LEFT_PAREN  */
  YYSYMBOL_TKN_RIGHT_PAREN = 77,           /* TKN_RIGHT_PAREN  */
  YYSYMBOL_TKN_NUMBER = 78,                /* TKN_NUMBER  */
  YYSYMBOL_TKN_NUMBER_REAL = 79,           /* TKN_NUMBER_REAL  */
  YYSYMBOL_TKN_STRING = 80,                /* TKN_STRING  */
  YYSYMBOL_TKN_COMPONENT = 81,             /* TKN_COMPONENT  */
  YYSYMBOL_OP_OR = 82,                     /* OP_OR  */
  YYSYMBOL_OP_XOR = 83,                    /* OP_XOR  */
  YYSYMBOL_OP_AND = 84,                    /* OP_AND  */
  YYSYMBOL_OP_PLUS = 85,                   /* OP_PLUS  */
  YYSYMBOL_OP_MINUS = 86,                  /* OP_MINUS  */
  YYSYMBOL_OP_TIMES = 87,                  /* OP_TIMES  */
  YYSYMBOL_OP_DIVIDE = 88,                 /* OP_DIVIDE  */
  YYSYMBOL_OP_MODULO = 89,                 /* OP_MODULO  */
  YYSYMBOL_OP_TILDE = 90,                  /* OP_TILDE  */
  YYSYMBOL_UNARY = 91,                     /* UNARY  */
  YYSYMBOL_YYACCEPT = 92,                  /* $accept  */
  YYSYMBOL_number_real = 93,               /* number_real  */
  YYSYMBOL_expr = 94,                      /* expr  */
  YYSYMBOL_numexpr = 95,                   /* numexpr  */
  YYSYMBOL_configuration = 96,             /* configuration  */
  YYSYMBOL_config = 97,                    /* config  */
  YYSYMBOL_def = 98,                       /* def  */
  YYSYMBOL_prog_def = 99,                  /* prog_def  */
  YYSYMBOL_prog_decl = 100,                /* prog_decl  */
  YYSYMBOL_part_def = 101,                 /* part_def  */
  YYSYMBOL_part_decl = 102,                /* part_decl  */
  YYSYMBOL_string_list = 103,              /* string_list  */
  YYSYMBOL_num_list = 104,                 /* num_list  */
  YYSYMBOL_prog_parms = 105,               /* prog_parms  */
  YYSYMBOL_prog_parm = 106,                /* prog_parm  */
  YYSYMBOL_prog_parm_type = 107,           /* prog_parm_type  */
  YYSYMBOL_prog_parm_type_id = 108,        /* prog_parm_type_id  */
  YYSYMBOL_prog_parm_conntype = 109,       /* prog_parm_conntype  */
  YYSYMBOL_prog_parm_conntype_id = 110,    /* prog_parm_conntype_id  */
  YYSYMBOL_usb_pid_list = 111,             /* usb_pid_list  */
  YYSYMBOL_prog_parm_updi = 112,           /* prog_parm_updi  */
  YYSYMBOL_hvupdi_support_list = 113,      /* hvupdi_support_list  */
  YYSYMBOL_pin_number_non_empty = 114,     /* pin_number_non_empty  */
  YYSYMBOL_pin_number = 115,               /* pin_number  */
  YYSYMBOL_pin_list_element = 116,         /* pin_list_element  */
  YYSYMBOL_pin_list_non_empty = 117,       /* pin_list_non_empty  */
  YYSYMBOL_pin_list = 118,                 /* pin_list  */
  YYSYMBOL_prog_parm_pins = 119,           /* prog_parm_pins  */
  YYSYMBOL_120_1 = 120,                    /* $@1  */
  YYSYMBOL_121_2 = 121,                    /* $@2  */
  YYSYMBOL_122_3 = 122,                    /* $@3  */
  YYSYMBOL_123_4 = 123,                    /* $@4  */
  YYSYMBOL_124_5 = 124,                    /* $@5  */
  YYSYMBOL_125_6 = 125,                    /* $@6  */
  YYSYMBOL_126_7 = 126,                    /* $@7  */
  YYSYMBOL_127_8 = 127,                    /* $@8  */
  YYSYMBOL_128_9 = 128,                    /* $@9  */
  YYSYMBOL_129_10 = 129,                   /* $@10  */
  YYSYMBOL_130_11 = 130,                   /* $@11  */
  YYSYMBOL_131_12 = 131,                   /* $@12  */
  YYSYMBOL_132_13 = 132,                   /* $@13  */
  YYSYMBOL_133_14 = 133,                   /* $@14  */
  YYSYMBOL_opcode = 134,                   /* opcode  */
  YYSYMBOL_part_parms = 135,               /* part_parms  */
  YYSYMBOL_reset_disposition = 136,        /* reset_disposition  */
  YYSYMBOL_retry_lines = 137,              /* retry_lines  */
  YYSYMBOL_part_parm = 138,                /* part_parm  */
  YYSYMBOL_139_15 = 139,                   /* $@15  */
  YYSYMBOL_mem_specs = 140,                /* mem_specs  */
  YYSYMBOL_mem_spec = 141,                 /* mem_spec  */
  YYSYMBOL_mem_alias = 142                 /* mem_alias  */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;




#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

#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))


/* Stored state numbers (used for stacks). */
typedef yytype_int16 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 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.  */

# ifdef YYSTACK_USE_ALLOCA
#  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.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  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 */

#if (! defined yyoverflow \
     && (! defined __cplusplus \
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  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 (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) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

# 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_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 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.  */
#define YYFINAL  30
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   362

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  92
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  51
/* YYNRULES -- Number of rules.  */
#define YYNRULES  157
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  307

/* YYMAXUTOK -- Last valid token kind.  */
#define YYMAXUTOK   346


/* 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,     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,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91
};

#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_int16 yyrline[] =
{
       0,   164,   164,   170,   176,   176,   179,   180,   181,   182,
     183,   184,   185,   186,   187,   188,   189,   190,   191,   195,
     196,   200,   201,   206,   208,   210,   215,   220,   225,   230,
     235,   240,   245,   250,   258,   295,   301,   320,   402,   408,
     428,   429,   434,   435,   439,   440,   444,   448,   457,   459,
     461,   463,   465,   469,   473,   483,   491,   495,   496,   497,
     498,   499,   503,   517,   528,   532,   546,   557,   559,   563,
     565,   572,   574,   578,   580,   585,   587,   594,   594,   595,
     595,   596,   596,   597,   597,   598,   598,   599,   599,   600,
     600,   601,   601,   602,   602,   603,   603,   604,   604,   605,
     605,   606,   606,   607,   607,   611,   612,   613,   614,   615,
     616,   617,   618,   619,   620,   621,   622,   627,   628,   633,
     633,   637,   637,   641,   645,   651,   658,   676,   687,   694,
     720,   727,   753,   760,   785,   791,   816,   822,   832,   847,
     862,   877,   892,   916,   932,   931,   965,   977,   998,  1014,
    1015,  1016,  1021,  1026,  1036,  1044,  1064,  1079
};
#endif

/** 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 of file\"", "error", "\"invalid token\"", "K_NULL", "K_READ",
  "K_WRITE", "K_READ_LO", "K_READ_HI", "K_WRITE_LO", "K_WRITE_HI",
  "K_LOADPAGE_LO", "K_LOADPAGE_HI", "K_LOAD_EXT_ADDR", "K_WRITEPAGE",
  "K_CHIP_ERASE", "K_PGM_ENABLE", "K_MEMORY", "K_PAGE_SIZE", "K_ALIAS",
  "K_ALLOW_SUBSHELLS", "K_AVRDUDE_CONF_VERSION", "K_BUFF", "K_CONNTYPE",
  "K_DEDICATED", "K_DEFAULT_BAUDRATE", "K_DEFAULT_BITCLOCK",
  "K_DEFAULT_PARALLEL", "K_DEFAULT_PROGRAMMER", "K_DEFAULT_SERIAL",
  "K_DEFAULT_SPI", "K_DEFAULT_LINUXGPIO", "K_HVUPDI_SUPPORT", "K_EEPROM",
  "K_ERRLED", "K_FLASH", "K_ID", "K_IO", "K_LINUXGPIO", "K_LOADPAGE",
  "K_SDI", "K_SDO", "K_PARALLEL", "K_PARENT", "K_PART", "K_PGMLED",
  "K_PROGRAMMER", "K_RDYLED", "K_READBACK", "K_READMEM", "K_RESET",
  "K_RETRY_PULSE", "K_SERIAL", "K_SPI", "K_SCK", "K_SIGNATURE", "K_SIZE",
  "K_TCK", "K_TDI", "K_TDO", "K_TMS", "K_USB", "K_USBPID", "K_TYPE",
  "K_VARIANTS", "K_VCC", "K_VFYLED", "K_PP_CONTROLSTACK",
  "K_HVSP_CONTROLSTACK", "K_ALLOWFULLPAGEBITSTREAM",
  "K_ENABLEPAGEPROGRAMMING", "K_IS_AT90S1200", "K_FLASH_INSTR",
  "K_EEPROM_INSTR", "TKN_COMMA", "TKN_EQUAL", "TKN_SEMI", "TKN_LEFT_PAREN",
  "TKN_RIGHT_PAREN", "TKN_NUMBER", "TKN_NUMBER_REAL", "TKN_STRING",
  "TKN_COMPONENT", "OP_OR", "OP_XOR", "OP_AND", "OP_PLUS", "OP_MINUS",
  "OP_TIMES", "OP_DIVIDE", "OP_MODULO", "OP_TILDE", "UNARY", "$accept",
  "number_real", "expr", "numexpr", "configuration", "config", "def",
  "prog_def", "prog_decl", "part_def", "part_decl", "string_list",
  "num_list", "prog_parms", "prog_parm", "prog_parm_type",
  "prog_parm_type_id", "prog_parm_conntype", "prog_parm_conntype_id",
  "usb_pid_list", "prog_parm_updi", "hvupdi_support_list",
  "pin_number_non_empty", "pin_number", "pin_list_element",
  "pin_list_non_empty", "pin_list", "prog_parm_pins", "$@1", "$@2", "$@3",
  "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "$@12", "$@13",
  "$@14", "opcode", "part_parms", "reset_disposition", "retry_lines",
  "part_parm", "$@15", "mem_specs", "mem_spec", "mem_alias", YY_NULLPTR
};

static const char *
yysymbol_name (yysymbol_kind_t yysymbol)
{
  return yytname[yysymbol];
}
#endif

#define YYPACT_NINF (-194)

#define yypact_value_is_default(Yyn) \
  ((Yyn) == YYPACT_NINF)

#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_int16 yypact[] =
{
     148,   -54,   -48,   -46,   -28,   -25,   -24,   -11,    -9,    -8,
      26,    28,    69,   148,  -194,    -3,   201,    25,   149,   153,
      -1,    23,   116,    22,    31,    33,    34,    36,    37,    39,
    -194,  -194,  -194,    48,    53,    58,    59,    60,    62,    63,
      77,    92,    95,    96,    97,   111,   112,   113,   114,   115,
     122,   123,   130,   201,    32,  -194,  -194,  -194,  -194,  -194,
    -194,  -194,  -194,  -194,  -194,  -194,  -194,  -194,  -194,  -194,
    -194,  -194,   125,   133,   134,   135,   137,   139,   140,   150,
     151,   152,   154,   161,   163,   175,   179,   181,   190,   193,
     149,   194,   153,  -194,   153,   153,   153,   208,   195,   209,
    -194,   210,   229,   211,   212,   214,   224,   225,  -194,  -194,
    -194,    30,   153,  -194,   147,  -194,  -194,  -194,  -194,  -194,
    -194,  -194,  -194,  -194,  -194,   153,     5,  -194,  -194,   166,
     226,  -194,   228,   252,   153,   -12,   -32,   153,   255,   153,
       4,     2,    13,   153,   153,   153,    19,    45,   166,     6,
     259,  -194,   221,  -194,  -194,  -194,  -194,   153,   153,   153,
     153,   153,   153,   153,   153,  -194,  -194,  -194,  -194,  -194,
    -194,  -194,  -194,   -63,  -194,  -194,  -194,  -194,  -194,  -194,
     229,   262,   -60,  -194,   263,   -60,   -60,   -60,   -60,   -60,
     -60,   -60,   -60,   -60,   -60,   229,   264,  -194,  -194,  -194,
     -63,   -60,  -194,  -194,   229,  -194,   335,    27,  -194,   229,
    -194,  -194,  -194,  -194,  -194,  -194,   229,   261,   229,  -194,
     263,  -194,   229,   267,  -194,   267,   229,   229,   229,  -194,
     267,  -194,   267,  -194,  -194,   263,  -194,  -194,   236,   242,
      94,    61,    61,  -194,  -194,  -194,  -194,   -53,  -194,  -194,
     268,  -194,   153,   265,  -194,  -194,   266,  -194,  -194,  -194,
    -194,  -194,  -194,  -194,  -194,  -194,  -194,   153,  -194,  -194,
    -194,   270,   269,   271,   273,   274,    47,   275,   276,   277,
     153,   153,  -194,   -63,   229,  -194,   229,   153,  -194,   278,
     166,    16,   279,  -194,  -194,  -194,   229,   -30,  -194,   229,
     280,  -194,  -194,   263,  -194,  -194,  -194
};

/* 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 yytype_uint8 yydefact[] =
{
      19,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      38,    35,     0,    20,    21,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       1,    22,    23,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    34,     0,    48,    51,    52,    49,    24,
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      37,     0,     0,     6,     0,     0,     0,     0,     0,     0,
       3,     0,     2,     0,     0,     0,     0,     0,    39,    36,
      79,     0,     0,    97,     0,    87,    85,   101,    99,    81,
      83,    89,    91,    93,    95,     0,     0,    77,   103,     0,
       0,    44,   144,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   117,     0,    15,    16,    17,    32,     0,     0,     0,
       0,     0,     0,     0,     0,    25,    30,    31,    27,    26,
      28,    29,    33,    76,    57,    58,    59,    61,    60,    56,
      65,    64,    70,    40,    47,    70,    70,    70,    70,    70,
      70,    70,    70,    70,    70,    62,    50,    55,    54,    53,
      76,    70,     5,    46,     4,    45,     0,     0,   124,   142,
     119,   120,   137,   121,   122,   143,   141,     0,   128,   125,
     126,   130,    42,   129,   132,   131,   139,   140,   138,   134,
     133,   136,   135,   123,   148,   147,   118,    18,     7,     8,
       9,    10,    11,    12,    13,    14,    67,     0,    71,    73,
      75,    80,     0,     0,    69,    98,     0,    88,    86,   102,
     100,    82,    84,    90,    92,    94,    96,     0,    78,   104,
     146,     0,     0,     0,     0,     0,   145,     0,     0,     0,
       0,     0,    68,     0,    66,    41,    63,     0,   157,     0,
       0,     0,     0,   149,   150,   127,    43,     0,    74,   153,
       0,   152,   156,   155,   151,    72,   154
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -194,  -194,  -144,   -19,  -194,  -194,   329,  -194,  -194,  -194,
    -194,  -139,  -134,  -194,   299,  -194,  -194,  -194,  -194,  -194,
    -194,  -194,  -171,    87,    70,  -194,   157,  -194,  -194,  -194,
    -194,  -194,  -194,  -194,  -194,  -194,  -194,  -194,  -194,  -194,
    -194,  -194,  -193,  -194,  -194,  -194,   272,  -194,  -194,    83,
    -194
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
       0,   101,   203,   222,    12,    13,    14,    15,    16,    17,
      18,   184,   223,    53,    54,    55,   199,    56,   179,   196,
      57,   181,   254,   255,   249,   250,   251,    58,   200,   173,
     189,   190,   186,   185,   191,   192,   193,   194,   182,   188,
     187,   201,    89,    90,   212,   215,    91,   207,   276,   277,
     278
};

/* 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_int16 yytable[] =
{
      97,   220,   248,   102,   233,   221,   197,   219,   225,   234,
     235,   210,   230,   232,   275,   246,   224,   213,   246,   302,
      19,   214,   229,   281,   211,   282,    20,   247,    21,   248,
     253,    60,    61,    62,    63,    64,    65,    66,    67,    68,
      69,    70,    71,   280,   271,   272,    22,   305,   231,    23,
      24,    60,    61,    62,    63,    64,    65,    66,    67,    68,
      69,    70,    71,    25,   271,    26,    27,   174,    28,    30,
      29,   175,    32,   152,   273,   153,   154,   155,    92,    98,
      93,   176,   177,   275,   183,   198,   183,    94,    95,    92,
     178,    93,    96,   180,   273,    92,   183,    93,    94,    95,
      59,    99,   103,    96,    94,    95,   195,   131,   274,    96,
     204,   104,   248,   105,   106,   209,   107,   108,   216,   109,
     218,    92,   110,    93,   226,   227,   228,   111,   274,   204,
      94,    95,   112,   113,   114,    96,   115,   116,   238,   239,
     240,   241,   242,   243,   244,   245,   301,   297,   162,   163,
     164,   117,   303,    60,    61,    62,    63,    64,    65,    66,
      67,    68,    69,    70,    71,    72,   118,     1,     2,   119,
     120,   121,     3,     4,     5,     6,     7,     8,     9,   160,
     161,   162,   163,   164,    73,   122,   123,   124,   125,   126,
      74,    10,    92,    11,    93,   100,   127,   128,    75,    76,
      77,    94,    95,    78,   129,   132,    96,   133,   134,   135,
      79,   136,    80,   137,   138,    81,    82,    83,    84,    85,
      86,    87,    33,    34,   139,   140,   141,   183,   142,    92,
      88,    93,    35,   284,    36,   143,    37,   144,    94,    95,
      38,    39,    92,    96,    93,    40,   202,    41,   286,   145,
      42,    94,    95,   146,    43,   147,    96,    44,    45,    46,
      47,   296,    48,    49,   148,    50,    51,   149,   299,   151,
     165,   204,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,    52,   156,   166,   167,   168,   169,   269,   170,
     157,   158,   159,   160,   161,   162,   163,   164,   237,   171,
     172,   205,   206,   157,   158,   159,   160,   161,   162,   163,
     164,   157,   158,   159,   160,   161,   162,   163,   164,   158,
     159,   160,   161,   162,   163,   164,   159,   160,   161,   162,
     163,   164,   208,   217,   236,   252,   256,   267,   270,   279,
     280,   283,    31,   282,   287,   289,   285,   290,   291,   288,
     293,   294,   130,   298,   304,   295,   300,   268,   306,   292,
       0,     0,   150
};

static const yytype_int16 yycheck[] =
{
      19,   140,   173,    22,   148,     3,     1,     3,   142,     3,
     149,    23,   146,   147,   207,    78,     3,    49,    78,     3,
      74,    53,     3,    76,    36,    78,    74,    90,    74,   200,
      90,     4,     5,     6,     7,     8,     9,    10,    11,    12,
      13,    14,    15,    73,    17,    18,    74,    77,     3,    74,
      74,     4,     5,     6,     7,     8,     9,    10,    11,    12,
      13,    14,    15,    74,    17,    74,    74,    37,    42,     0,
      42,    41,    75,    92,    47,    94,    95,    96,    76,    80,
      78,    51,    52,   276,    80,    80,    80,    85,    86,    76,
      60,    78,    90,   112,    47,    76,    80,    78,    85,    86,
      75,    78,    80,    90,    85,    86,   125,    75,    81,    90,
     129,    80,   283,    80,    80,   134,    80,    80,   137,    80,
     139,    76,    74,    78,   143,   144,   145,    74,    81,   148,
      85,    86,    74,    74,    74,    90,    74,    74,   157,   158,
     159,   160,   161,   162,   163,   164,   290,   281,    87,    88,
      89,    74,   291,     4,     5,     6,     7,     8,     9,    10,
      11,    12,    13,    14,    15,    16,    74,    19,    20,    74,
      74,    74,    24,    25,    26,    27,    28,    29,    30,    85,
      86,    87,    88,    89,    35,    74,    74,    74,    74,    74,
      41,    43,    76,    45,    78,    79,    74,    74,    49,    50,
      51,    85,    86,    54,    74,    80,    90,    74,    74,    74,
      61,    74,    63,    74,    74,    66,    67,    68,    69,    70,
      71,    72,    21,    22,    74,    74,    74,    80,    74,    76,
      81,    78,    31,   252,    33,    74,    35,    74,    85,    86,
      39,    40,    76,    90,    78,    44,    80,    46,   267,    74,
      49,    85,    86,    74,    53,    74,    90,    56,    57,    58,
      59,   280,    61,    62,    74,    64,    65,    74,   287,    75,
      75,   290,   185,   186,   187,   188,   189,   190,   191,   192,
     193,   194,    81,    75,    75,    75,    75,    75,   201,    75,
      82,    83,    84,    85,    86,    87,    88,    89,    77,    75,
      75,    75,    74,    82,    83,    84,    85,    86,    87,    88,
      89,    82,    83,    84,    85,    86,    87,    88,    89,    83,
      84,    85,    86,    87,    88,    89,    84,    85,    86,    87,
      88,    89,    80,    78,    75,    73,    73,    73,     3,    78,
      73,    73,    13,    78,    74,    74,    80,    74,    74,    80,
      75,    75,    53,   283,    75,    78,    78,   200,    78,   276,
      -1,    -1,    90
};

/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
   state STATE-NUM.  */
static const yytype_uint8 yystos[] =
{
       0,    19,    20,    24,    25,    26,    27,    28,    29,    30,
      43,    45,    96,    97,    98,    99,   100,   101,   102,    74,
      74,    74,    74,    74,    74,    74,    74,    74,    42,    42,
       0,    98,    75,    21,    22,    31,    33,    35,    39,    40,
      44,    46,    49,    53,    56,    57,    58,    59,    61,    62,
      64,    65,    81,   105,   106,   107,   109,   112,   119,    75,
       4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
      14,    15,    16,    35,    41,    49,    50,    51,    54,    61,
      63,    66,    67,    68,    69,    70,    71,    72,    81,   134,
     135,   138,    76,    78,    85,    86,    90,    95,    80,    78,
      79,    93,    95,    80,    80,    80,    80,    80,    80,    80,
      74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
      74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
     106,    75,    80,    74,    74,    74,    74,    74,    74,    74,
      74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
     138,    75,    95,    95,    95,    95,    75,    82,    83,    84,
      85,    86,    87,    88,    89,    75,    75,    75,    75,    75,
      75,    75,    75,   121,    37,    41,    51,    52,    60,   110,
      95,   113,   130,    80,   103,   125,   124,   132,   131,   122,
     123,   126,   127,   128,   129,    95,   111,     1,    80,   108,
     120,   133,    80,    94,    95,    75,    74,   139,    80,    95,
      23,    36,   136,    49,    53,   137,    95,    78,    95,     3,
     103,     3,    95,   104,     3,   104,    95,    95,    95,     3,
     104,     3,   104,    94,     3,   103,    75,    77,    95,    95,
      95,    95,    95,    95,    95,    95,    78,    90,   114,   116,
     117,   118,    73,    90,   114,   115,    73,   115,   115,   115,
     115,   115,   115,   115,   115,   115,   115,    73,   118,   115,
       3,    17,    18,    47,    81,   134,   140,   141,   142,    78,
      73,    76,    78,    73,    95,    80,    95,    74,    80,    74,
      74,    74,   141,    75,    75,    78,    95,   104,   116,    95,
      78,    94,     3,   103,    75,    77,    78
};

/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
static const yytype_uint8 yyr1[] =
{
       0,    92,    93,    93,    94,    94,    95,    95,    95,    95,
      95,    95,    95,    95,    95,    95,    95,    95,    95,    96,
      96,    97,    97,    98,    98,    98,    98,    98,    98,    98,
      98,    98,    98,    98,    99,   100,   100,   101,   102,   102,
     103,   103,   104,   104,   105,   105,   106,   106,   106,   106,
     106,   106,   106,   107,   108,   108,   109,   110,   110,   110,
     110,   110,   111,   111,   112,   113,   113,   114,   114,   115,
     115,   116,   116,   117,   117,   118,   118,   120,   119,   121,
     119,   122,   119,   123,   119,   124,   119,   125,   119,   126,
     119,   127,   119,   128,   119,   129,   119,   130,   119,   131,
     119,   132,   119,   133,   119,   134,   134,   134,   134,   134,
     134,   134,   134,   134,   134,   134,   134,   135,   135,   136,
     136,   137,   137,   138,   138,   138,   138,   138,   138,   138,
     138,   138,   138,   138,   138,   138,   138,   138,   138,   138,
     138,   138,   138,   138,   139,   138,   138,   138,   138,   140,
     140,   140,   141,   141,   141,   141,   141,   142
};

/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
static const yytype_int8 yyr2[] =
{
       0,     2,     1,     1,     1,     1,     1,     3,     3,     3,
       3,     3,     3,     3,     3,     2,     2,     2,     3,     0,
       1,     1,     2,     2,     2,     4,     4,     4,     4,     4,
       4,     4,     4,     4,     2,     1,     3,     2,     1,     3,
       1,     3,     1,     3,     2,     3,     3,     3,     1,     1,
       3,     1,     1,     3,     1,     1,     3,     1,     1,     1,
       1,     1,     1,     3,     3,     1,     3,     1,     2,     1,
       0,     1,     4,     1,     3,     1,     0,     0,     4,     0,
       4,     0,     4,     0,     4,     0,     4,     0,     4,     0,
       4,     0,     4,     0,     4,     0,     4,     0,     4,     0,
       4,     0,     4,     0,     4,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     2,     3,     1,
       1,     1,     1,     3,     3,     3,     3,     5,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     0,     4,     4,     3,     3,     2,
       2,     3,     3,     3,     4,     3,     3,     2
};


enum { YYENOMEM = -2 };

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYNOMEM         goto yyexhaustedlab


#define YYRECOVERING()  (!!yyerrstatus)

#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


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

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

# define YYDPRINTF(Args)                        \
do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)




# 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).                                                   |
`------------------------------------------------------------------*/

static void
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
  YYFPRINTF (stderr, "Stack now");
  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));                           \
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

static void
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
                 int yyrule)
{
  int yylno = yyrline[yyrule];
  int yynrhs = yyr2[yyrule];
  int yyi;
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
             yyrule - 1, yylno);
  /* 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 (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) ((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
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- 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
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif






/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
yydestruct (const char *yymsg,
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
  YY_USE (yyvaluep);
  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/* Lookahead token kind.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;
/* Number of syntax errors so far.  */
int yynerrs;




/*----------.
| yyparse.  |
`----------*/

int
yyparse (void)
{
    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;

    /* The state stack: array, bottom, top.  */
    yy_state_t yyssa[YYINITDEPTH];
    yy_state_t *yyss = yyssa;
    yy_state_t *yyssp = yyss;

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



#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  /* 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"));

  yychar = YYEMPTY; /* Cause a token to be read.  */

  goto yysetstate;


/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
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.  */
  yyssp++;


/*--------------------------------------------------------------------.
| 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.  */
      YYPTRDIFF_T yysize = yyssp - yyss + 1;

# 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.  */
        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 /* defined YYSTACK_RELOCATE */
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
        YYNOMEM;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
        yystacksize = YYMAXDEPTH;

      {
        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);
      }
# endif

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;

      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;
    }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */


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

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

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

  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token\n"));
      yychar = yylex ();
    }

  if (yychar <= 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);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

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


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


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

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
  case 2: /* number_real: numexpr  */
#line 164 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
         {
    yyval = yyvsp[0];
    /* convert value to real */
    yyval->value.number_real = yyval->value.number;
    yyval->value.type = V_NUM_REAL;
  }
#line 1479 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 3: /* number_real: TKN_NUMBER_REAL  */
#line 170 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                  {
    yyval = yyvsp[0];
  }
#line 1487 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 7: /* numexpr: numexpr OP_OR numexpr  */
#line 180 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number |= yyvsp[0]->value.number; }
#line 1493 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 8: /* numexpr: numexpr OP_XOR numexpr  */
#line 181 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number ^= yyvsp[0]->value.number; }
#line 1499 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 9: /* numexpr: numexpr OP_AND numexpr  */
#line 182 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number &= yyvsp[0]->value.number; }
#line 1505 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 10: /* numexpr: numexpr OP_PLUS numexpr  */
#line 183 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number += yyvsp[0]->value.number; }
#line 1511 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 11: /* numexpr: numexpr OP_MINUS numexpr  */
#line 184 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number -= yyvsp[0]->value.number; }
#line 1517 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 12: /* numexpr: numexpr OP_TIMES numexpr  */
#line 185 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number *= yyvsp[0]->value.number; }
#line 1523 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 13: /* numexpr: numexpr OP_DIVIDE numexpr  */
#line 186 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number /= yyvsp[0]->value.number; }
#line 1529 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 14: /* numexpr: numexpr OP_MODULO numexpr  */
#line 187 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            { yyval = yyvsp[-2]; yyval->value.number %= yyvsp[0]->value.number; }
#line 1535 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 15: /* numexpr: OP_PLUS numexpr  */
#line 188 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               { yyval = yyvsp[0]; }
#line 1541 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 16: /* numexpr: OP_MINUS numexpr  */
#line 189 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               { yyval = yyvsp[0]; yyval->value.number = -yyval->value.number; }
#line 1547 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 17: /* numexpr: OP_TILDE numexpr  */
#line 190 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               { yyval = yyvsp[0]; yyval->value.number = ~yyval->value.number; }
#line 1553 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 18: /* numexpr: TKN_LEFT_PAREN numexpr TKN_RIGHT_PAREN  */
#line 191 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                         { yyval = yyvsp[-1]; }
#line 1559 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 25: /* def: K_AVRDUDE_CONF_VERSION TKN_EQUAL TKN_STRING TKN_SEMI  */
#line 210 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                       {
    avrdude_conf_version = cache_string(yyvsp[-1]->value.string);
    free_token(yyvsp[-1]);
  }
#line 1568 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 26: /* def: K_DEFAULT_PROGRAMMER TKN_EQUAL TKN_STRING TKN_SEMI  */
#line 215 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                     {
    default_programmer = cache_string(yyvsp[-1]->value.string);
    free_token(yyvsp[-1]);
  }
#line 1577 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 27: /* def: K_DEFAULT_PARALLEL TKN_EQUAL TKN_STRING TKN_SEMI  */
#line 220 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                   {
    default_parallel = cache_string(yyvsp[-1]->value.string);
    free_token(yyvsp[-1]);
  }
#line 1586 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 28: /* def: K_DEFAULT_SERIAL TKN_EQUAL TKN_STRING TKN_SEMI  */
#line 225 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                 {
    default_serial = cache_string(yyvsp[-1]->value.string);
    free_token(yyvsp[-1]);
  }
#line 1595 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 29: /* def: K_DEFAULT_SPI TKN_EQUAL TKN_STRING TKN_SEMI  */
#line 230 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                              {
    default_spi = cache_string(yyvsp[-1]->value.string);
    free_token(yyvsp[-1]);
  }
#line 1604 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 30: /* def: K_DEFAULT_BAUDRATE TKN_EQUAL TKN_NUMBER TKN_SEMI  */
#line 235 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                   {
    default_baudrate = yyvsp[-1]->value.number;
    free_token(yyvsp[-1]);
  }
#line 1613 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 31: /* def: K_DEFAULT_BITCLOCK TKN_EQUAL number_real TKN_SEMI  */
#line 240 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                    {
    default_bitclock = yyvsp[-1]->value.number_real;
    free_token(yyvsp[-1]);
  }
#line 1622 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 32: /* def: K_ALLOW_SUBSHELLS TKN_EQUAL numexpr TKN_SEMI  */
#line 245 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                               {
    allow_subshells = yyvsp[-1]->value.number;
    free_token(yyvsp[-1]);
  }
#line 1631 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 33: /* def: K_DEFAULT_LINUXGPIO TKN_EQUAL TKN_STRING TKN_SEMI  */
#line 250 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                    {
    default_linuxgpio = cache_string(yyvsp[-1]->value.string);
    free_token(yyvsp[-1]);
  }
#line 1640 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 34: /* prog_def: prog_decl prog_parms  */
#line 259 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      PROGRAMMER *existing_prog;
      if(lsize(current_prog->id) == 0) {
        yyerror("required parameter id not specified");
        YYABORT;
      }
      if(current_prog->initpgm == NULL && current_prog->prog_modes) {
        yyerror("programmer type not specified");
        YYABORT;
      }
      if(!current_prog->prog_modes && cx->lex_kw_is_programmer)
        yywarning("programmer %s fails to specify prog_modes = PM_...;",
          (char *) ldata(lfirst(current_prog->id)));
      for(LNODEID ln = lfirst(current_prog->id); ln; ln = lnext(ln)) {
        char *id = ldata(ln);
        if((existing_prog = locate_programmer(programmers, id))) {
          // Temporarily set lineno to lineno of programmer start
          int temp = cfg_lineno; cfg_lineno = current_prog->lineno;
          yywarning("programmer %s overwrites previous definition %s:%d.",
            id, existing_prog->config_file, existing_prog->lineno);
          cfg_lineno = temp;
          lrmv_d(programmers, existing_prog);
          pgm_free(existing_prog);
        }
      }
      current_prog->comments = cfg_move_comments();
      LISTADD(programmers, current_prog);
//      pgm_fill_old_pins(current_prog); // TODO to be removed if old pin data no longer needed
//      pgm_display_generic(current_prog, id);
      current_prog = NULL;
      current_strct = COMP_CONFIG_MAIN;
    }
#line 1677 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 35: /* prog_decl: K_PROGRAMMER  */
#line 296 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    { current_prog = pgm_new();
      current_prog->config_file = cache_string(cfg_infile);
      current_prog->lineno = cfg_lineno;
    }
#line 1686 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 36: /* prog_decl: K_PROGRAMMER K_PARENT TKN_STRING  */
#line 302 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      PROGRAMMER *pgm = locate_programmer(programmers, yyvsp[0]->value.string);
      if(pgm == NULL) {
        yyerror("parent programmer %s not found", yyvsp[0]->value.string);
        free_token(yyvsp[0]);
        YYABORT;
      }
      current_prog = pgm_dup(pgm);
      current_prog->parent_id = cache_string(yyvsp[0]->value.string);
      current_prog->comments = NULL;
      current_prog->config_file = cache_string(cfg_infile);
      current_prog->lineno = cfg_lineno;
      free_token(yyvsp[0]);
    }
#line 1705 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 37: /* part_def: part_decl part_parms  */
#line 321 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      LNODEID ln;
      AVRMEM *m;
      AVRPART *existing_part;

      if(current_part->id[0] == 0) {
        yyerror("required parameter id not specified");
        YYABORT;
      }

      cfg_update_mcuid(current_part);

      Memtype and_mask = ~ (    // Remove in-flash/in-sigrow attributes if no respective memories
        (!avr_locate_flash(current_part)? MEM_IN_FLASH: 0) |
        (!avr_locate_sigrow(current_part)? MEM_IN_SIGROW: 0));

      // Sanity checks for memory sizes and compute/override num_pages entry
      for(ln=lfirst(current_part->mem); ln; ln=lnext(ln)) {
        m = ldata(ln);
        if(m->paged) {
          if(m->size <= 0) {
            yyerror("must specify a positive size for paged memory %s", m->desc);
            YYABORT;
          }
          if(m->page_size <= 0) {
            yyerror("must specify a positive page size for paged memory %s", m->desc);
            YYABORT;
          }
          // Code base relies on page_size being a power of 2 in some places
          if(m->page_size & (m->page_size - 1)) {
            yyerror("page size must be a power of 2 for paged memory %s", m->desc);
            YYABORT;
          }
          // Code base relies on size being a multiple of page_size
          if(m->size % m->page_size) {
            yyerror("size must be a multiple of page size for paged memory %s", m->desc);
            YYABORT;
          }
          // Warn if num_pages was specified but is inconsistent with size and page size
          if(m->num_pages && m->num_pages != m->size / m->page_size)
            yywarning("overriding num_page to be %d for memory %s", m->size/m->page_size, m->desc);

          m->num_pages = m->size / m->page_size;
        }

        m->type &= and_mask;
        // Remove MEM_IN_SIGROW attribute from classic calibration and classic/XMEGA signature mem
        if(current_part->prog_modes & PM_Classic) {
          if(mem_is_signature(m))
            m->type &= ~MEM_IN_SIGROW;
          if(mem_is_calibration(m))
            m->type &= ~MEM_IN_SIGROW;
        } else if(current_part->prog_modes & PM_PDI) {
          if(mem_is_signature(m))
            m->type &= ~MEM_IN_SIGROW;
        }
        if(fileio_mem_offset(current_part, m) == ~0U)
          yywarning("revise fileio_mem_offset(), avrdude.conf entry or memory type assignment");
      }

      existing_part = locate_part(part_list, current_part->id);
      if(existing_part) {
        { /* temporarily set lineno to lineno of part start */
          int temp = cfg_lineno; cfg_lineno = current_part->lineno;
          yywarning("part %s overwrites previous definition %s:%d.",
                current_part->id,
                existing_part->config_file, existing_part->lineno);
          cfg_lineno = temp;
        }
        lrmv_d(part_list, existing_part);
        avr_free_part(existing_part);
      }

      current_part->comments = cfg_move_comments();
      LISTADD(part_list, current_part);
      current_part = NULL;
      current_strct = COMP_CONFIG_MAIN;
    }
#line 1788 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 38: /* part_decl: K_PART  */
#line 403 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      current_part = avr_new_part();
      current_part->config_file = cache_string(cfg_infile);
      current_part->lineno = cfg_lineno;
    }
#line 1798 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 39: /* part_decl: K_PART K_PARENT TKN_STRING  */
#line 409 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      AVRPART *parent_part = locate_part(part_list, yyvsp[0]->value.string);
      if(parent_part == NULL) {
        yyerror("can't find parent part");
        free_token(yyvsp[0]);
        YYABORT;
      }

      current_part = avr_dup_part(parent_part);
      current_part->parent_id = cache_string(yyvsp[0]->value.string);
      current_part->comments = NULL;
      current_part->config_file = cache_string(cfg_infile);
      current_part->lineno = cfg_lineno;

      free_token(yyvsp[0]);
    }
#line 1819 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 40: /* string_list: TKN_STRING  */
#line 428 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
             { ladd(string_list, yyvsp[0]); }
#line 1825 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 41: /* string_list: string_list TKN_COMMA TKN_STRING  */
#line 429 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                   { ladd(string_list, yyvsp[0]); }
#line 1831 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 42: /* num_list: numexpr  */
#line 434 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
          { ladd(number_list, yyvsp[0]); }
#line 1837 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 43: /* num_list: num_list TKN_COMMA numexpr  */
#line 435 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                             { ladd(number_list, yyvsp[0]); }
#line 1843 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 46: /* prog_parm: TKN_COMPONENT TKN_EQUAL expr  */
#line 444 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               {
    cfg_assign((char *) current_prog, COMP_PROGRAMMER, yyvsp[-2]->value.comp, &yyvsp[0]->value);
    free_token(yyvsp[-2]);
  }
#line 1852 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 47: /* prog_parm: K_ID TKN_EQUAL string_list  */
#line 448 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                             {
    {
      while(lsize(string_list)) {
        TOKEN *t = lrmv_n(string_list, 1);
        ladd(current_prog->id, mmt_strdup(t->value.string));
        free_token(t);
      }
    }
  }
#line 1866 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 54: /* prog_parm_type_id: TKN_STRING  */
#line 473 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                    {
  const PROGRAMMER_TYPE *pgm_type = locate_programmer_type(yyvsp[0]->value.string);
    if(pgm_type == NULL) {
        yyerror("programmer type %s not found", yyvsp[0]->value.string);
        free_token(yyvsp[0]);
        YYABORT;
    }
    current_prog->initpgm = pgm_type->initpgm;
    free_token(yyvsp[0]);
}
#line 1881 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 55: /* prog_parm_type_id: error  */
#line 484 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
{
        yyerror("programmer type must be written as \"id_type\"");
        YYABORT;
}
#line 1890 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 57: /* prog_parm_conntype_id: K_LINUXGPIO  */
#line 495 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                    { current_prog->conntype = CONNTYPE_LINUXGPIO; }
#line 1896 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 58: /* prog_parm_conntype_id: K_PARALLEL  */
#line 496 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                    { current_prog->conntype = CONNTYPE_PARALLEL; }
#line 1902 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 59: /* prog_parm_conntype_id: K_SERIAL  */
#line 497 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                    { current_prog->conntype = CONNTYPE_SERIAL; }
#line 1908 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 60: /* prog_parm_conntype_id: K_USB  */
#line 498 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                    { current_prog->conntype = CONNTYPE_USB; }
#line 1914 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 61: /* prog_parm_conntype_id: K_SPI  */
#line 499 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                    { current_prog->conntype = CONNTYPE_SPI; }
#line 1920 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 62: /* usb_pid_list: numexpr  */
#line 503 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
          {
    {
      /* overwrite pids, so clear the existing entries */
      if(current_prog->usbpid)
        ldestroy_cb(current_prog->usbpid, mmt_f_free);
      current_prog->usbpid = lcreat(NULL, 0);
    }
    {
      int *ip = mmt_malloc(sizeof(int));
      *ip = yyvsp[0]->value.number;
      ladd(current_prog->usbpid, ip);
      free_token(yyvsp[0]);
    }
  }
#line 1939 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 63: /* usb_pid_list: usb_pid_list TKN_COMMA numexpr  */
#line 517 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                 {
    {
      int *ip = mmt_malloc(sizeof(int));
      *ip = yyvsp[0]->value.number;
      ladd(current_prog->usbpid, ip);
      free_token(yyvsp[0]);
    }
  }
#line 1952 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 65: /* hvupdi_support_list: numexpr  */
#line 532 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
          {
    {
      /* overwrite list entries, so clear the existing entries */
      if(current_prog->hvupdi_support)
        ldestroy_cb(current_prog->hvupdi_support, mmt_f_free);
      current_prog->hvupdi_support = lcreat(NULL, 0);
    }
    {
      int *ip = mmt_malloc(sizeof(int));
      *ip = yyvsp[0]->value.number;
      ladd(current_prog->hvupdi_support, ip);
      free_token(yyvsp[0]);
    }
  }
#line 1971 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 66: /* hvupdi_support_list: hvupdi_support_list TKN_COMMA numexpr  */
#line 546 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                        {
    {
      int *ip = mmt_malloc(sizeof(int));
      *ip = yyvsp[0]->value.number;
      ladd(current_prog->hvupdi_support, ip);
      free_token(yyvsp[0]);
    }
  }
#line 1984 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 67: /* pin_number_non_empty: TKN_NUMBER  */
#line 557 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
             { if(0 != assign_pin(pin_name, yyvsp[0], 0)) YYABORT;  }
#line 1990 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 68: /* pin_number_non_empty: OP_TILDE TKN_NUMBER  */
#line 559 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                      { if(0 != assign_pin(pin_name, yyvsp[0], 1)) YYABORT; }
#line 1996 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 70: /* pin_number: %empty  */
#line 565 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
              {
    if(pin_name >= 0 && pin_name < N_PINS)
      pin_clear_all(&(current_prog->pin[pin_name]));
  }
#line 2005 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 72: /* pin_list_element: OP_TILDE TKN_LEFT_PAREN num_list TKN_RIGHT_PAREN  */
#line 574 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                   { if(0 != assign_pin_list(1)) YYABORT; }
#line 2011 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 76: /* pin_list: %empty  */
#line 587 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
              {
    if(pin_name >= 0 && pin_name < N_PINS)
      pin_clear_all(&(current_prog->pin[pin_name]));
  }
#line 2020 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 77: /* $@1: %empty  */
#line 594 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PPI_AVR_VCC; clear_pin(pin_name);  }
#line 2026 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 79: /* $@2: %empty  */
#line 595 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PPI_AVR_BUFF; clear_pin(pin_name); }
#line 2032 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 81: /* $@3: %empty  */
#line 596 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_AVR_RESET; clear_pin(pin_name);}
#line 2038 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 82: /* prog_parm_pins: K_RESET TKN_EQUAL $@3 pin_number  */
#line 596 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                                                 { free_token(yyvsp[-3]); }
#line 2044 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 83: /* $@4: %empty  */
#line 597 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_AVR_SCK; clear_pin(pin_name);  }
#line 2050 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 84: /* prog_parm_pins: K_SCK TKN_EQUAL $@4 pin_number  */
#line 597 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                                                 { free_token(yyvsp[-3]); }
#line 2056 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 85: /* $@5: %empty  */
#line 598 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_AVR_SDO; clear_pin(pin_name);  }
#line 2062 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 87: /* $@6: %empty  */
#line 599 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_AVR_SDI; clear_pin(pin_name);  }
#line 2068 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 89: /* $@7: %empty  */
#line 600 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_JTAG_TCK; clear_pin(pin_name); }
#line 2074 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 91: /* $@8: %empty  */
#line 601 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_JTAG_TDI; clear_pin(pin_name); }
#line 2080 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 93: /* $@9: %empty  */
#line 602 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_JTAG_TDO; clear_pin(pin_name); }
#line 2086 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 95: /* $@10: %empty  */
#line 603 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_JTAG_TMS; clear_pin(pin_name); }
#line 2092 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 97: /* $@11: %empty  */
#line 604 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_LED_ERR; clear_pin(pin_name);  }
#line 2098 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 99: /* $@12: %empty  */
#line 605 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_LED_RDY; clear_pin(pin_name);  }
#line 2104 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 101: /* $@13: %empty  */
#line 606 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_LED_PGM; clear_pin(pin_name);  }
#line 2110 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 103: /* $@14: %empty  */
#line 607 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                     {pin_name = PIN_LED_VFY; clear_pin(pin_name);  }
#line 2116 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 123: /* part_parm: TKN_COMPONENT TKN_EQUAL expr  */
#line 641 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               {
    cfg_assign((char *) current_part, COMP_AVRPART, yyvsp[-2]->value.comp, &yyvsp[0]->value);
    free_token(yyvsp[-2]);
  }
#line 2125 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 124: /* part_parm: K_ID TKN_EQUAL TKN_STRING  */
#line 646 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      current_part->id = cache_string(yyvsp[0]->value.string);
      free_token(yyvsp[0]);
    }
#line 2134 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 125: /* part_parm: K_VARIANTS TKN_EQUAL K_NULL  */
#line 651 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                              {
    {
      ldestroy_cb(current_part->variants, mmt_f_free);
      current_part->variants = lcreat(NULL, 0);
    }
  }
#line 2145 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 126: /* part_parm: K_VARIANTS TKN_EQUAL string_list  */
#line 658 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                   {
    {
      while(lsize(string_list)) {
        TOKEN *t = lrmv_n(string_list, 1);
        int found = 0;
        for(LNODEID ln = lfirst(current_part->variants); ln; ln = lnext(ln)) {
          if(str_eq((char *) ldata(ln), t->value.string)) {
            found = 1;
            break;
          }
        }
        if(!found)
          ladd(current_part->variants, mmt_strdup(t->value.string));
        free_token(t);
      }
    }
  }
#line 2167 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 127: /* part_parm: K_SIGNATURE TKN_EQUAL TKN_NUMBER TKN_NUMBER TKN_NUMBER  */
#line 676 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                                         {
    {
      current_part->signature[0] = yyvsp[-2]->value.number;
      current_part->signature[1] = yyvsp[-1]->value.number;
      current_part->signature[2] = yyvsp[0]->value.number;
      free_token(yyvsp[-2]);
      free_token(yyvsp[-1]);
      free_token(yyvsp[0]);
    }
  }
#line 2182 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 128: /* part_parm: K_USBPID TKN_EQUAL numexpr  */
#line 687 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                            {
    {
      current_part->usbpid = yyvsp[0]->value.number;
      free_token(yyvsp[0]);
    }
  }
#line 2193 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 129: /* part_parm: K_PP_CONTROLSTACK TKN_EQUAL num_list  */
#line 694 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                       {
    {
      TOKEN *t;
      unsigned nbytes;
      int ok;

      current_part->ctl_stack_type = CTL_STACK_PP;
      nbytes = 0;
      ok = 1;

      memset(current_part->controlstack, 0, CTL_STACK_SIZE);
      while(lsize(number_list)) {
        t = lrmv_n(number_list, 1);
        if(nbytes < CTL_STACK_SIZE) {
          current_part->controlstack[nbytes] = t->value.number;
          nbytes++;
        } else {
          ok = 0;
        }
        free_token(t);
      }
      if(!ok)
        yywarning("too many bytes in control stack");
    }
  }
#line 2223 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 130: /* part_parm: K_PP_CONTROLSTACK TKN_EQUAL K_NULL  */
#line 720 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                     {
    {
      current_part->ctl_stack_type = CTL_STACK_NONE;
      memset(current_part->controlstack, 0, CTL_STACK_SIZE);
    }
  }
#line 2234 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 131: /* part_parm: K_HVSP_CONTROLSTACK TKN_EQUAL num_list  */
#line 727 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                         {
    {
      TOKEN *t;
      unsigned nbytes;
      int ok;

      current_part->ctl_stack_type = CTL_STACK_HVSP;
      nbytes = 0;
      ok = 1;

      memset(current_part->controlstack, 0, CTL_STACK_SIZE);
      while(lsize(number_list)) {
        t = lrmv_n(number_list, 1);
        if(nbytes < CTL_STACK_SIZE) {
          current_part->controlstack[nbytes] = t->value.number;
          nbytes++;
        } else {
          ok = 0;
        }
        free_token(t);
      }
      if(!ok)
        yywarning("too many bytes in control stack");
    }
  }
#line 2264 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 132: /* part_parm: K_HVSP_CONTROLSTACK TKN_EQUAL K_NULL  */
#line 753 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                       {
    {
      current_part->ctl_stack_type = CTL_STACK_NONE;
      memset(current_part->controlstack, 0, CTL_STACK_SIZE);
    }
  }
#line 2275 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 133: /* part_parm: K_FLASH_INSTR TKN_EQUAL num_list  */
#line 760 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                   {
    {
      TOKEN *t;
      unsigned nbytes;
      int ok;

      nbytes = 0;
      ok = 1;

      memset(current_part->flash_instr, 0, FLASH_INSTR_SIZE);
      while(lsize(number_list)) {
        t = lrmv_n(number_list, 1);
        if(nbytes < FLASH_INSTR_SIZE) {
          current_part->flash_instr[nbytes] = t->value.number;
          nbytes++;
        } else {
          ok = 0;
        }
        free_token(t);
      }
      if(!ok)
        yywarning("too many bytes in flash instructions");
    }
  }
#line 2304 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 134: /* part_parm: K_FLASH_INSTR TKN_EQUAL K_NULL  */
#line 785 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                 {
    {
      memset(current_part->flash_instr, 0, FLASH_INSTR_SIZE);
    }
  }
#line 2314 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 135: /* part_parm: K_EEPROM_INSTR TKN_EQUAL num_list  */
#line 791 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                    {
    {
      TOKEN *t;
      unsigned nbytes;
      int ok;

      nbytes = 0;
      ok = 1;

      memset(current_part->eeprom_instr, 0, EEPROM_INSTR_SIZE);
      while(lsize(number_list)) {
        t = lrmv_n(number_list, 1);
        if(nbytes < EEPROM_INSTR_SIZE) {
          current_part->eeprom_instr[nbytes] = t->value.number;
          nbytes++;
        } else {
          ok = 0;
        }
        free_token(t);
      }
      if(!ok)
        yywarning("too many bytes in EEPROM instructions");
    }
  }
#line 2343 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 136: /* part_parm: K_EEPROM_INSTR TKN_EQUAL K_NULL  */
#line 816 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                                  {
    {
      memset(current_part->eeprom_instr, 0, EEPROM_INSTR_SIZE);
    }
  }
#line 2353 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 137: /* part_parm: K_RESET TKN_EQUAL reset_disposition  */
#line 823 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      if(yyvsp[0]->primary == K_DEDICATED)
        current_part->reset_disposition = RESET_DEDICATED;
      else if(yyvsp[0]->primary == K_IO)
        current_part->reset_disposition = RESET_IO;

      free_tokens(2, yyvsp[-2], yyvsp[0]);
    }
#line 2366 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 138: /* part_parm: K_IS_AT90S1200 TKN_EQUAL numexpr  */
#line 833 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      if(yyvsp[0]->value.number == 1)
        current_part->flags |= AVRPART_IS_AT90S1200;
      else if(yyvsp[0]->value.number == 0)
        current_part->flags &= ~AVRPART_IS_AT90S1200;
      else {
        yyerror("is_at90s1200 not a Boolean value");
        free_token(yyvsp[0]);
        YYABORT;
      }

      free_token(yyvsp[0]);
    }
#line 2384 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 139: /* part_parm: K_ALLOWFULLPAGEBITSTREAM TKN_EQUAL numexpr  */
#line 848 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      if(yyvsp[0]->value.number == 1)
        current_part->flags |= AVRPART_ALLOWFULLPAGEBITSTREAM;
      else if(yyvsp[0]->value.number == 0)
        current_part->flags &= ~AVRPART_ALLOWFULLPAGEBITSTREAM;
      else {
        yyerror("allowfullpagebitstream not a Boolean value");
        free_token(yyvsp[0]);
        YYABORT;
      }

      free_token(yyvsp[0]);
    }
#line 2402 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 140: /* part_parm: K_ENABLEPAGEPROGRAMMING TKN_EQUAL numexpr  */
#line 863 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      if(yyvsp[0]->value.number == 1)
        current_part->flags |= AVRPART_ENABLEPAGEPROGRAMMING;
      else if(yyvsp[0]->value.number == 0)
        current_part->flags &= ~AVRPART_ENABLEPAGEPROGRAMMING;
      else {
        yyerror("enablepageprogramming not a Boolean value");
        free_token(yyvsp[0]);
        YYABORT;
      }

      free_token(yyvsp[0]);
    }
#line 2420 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 141: /* part_parm: K_SERIAL TKN_EQUAL numexpr  */
#line 878 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      if(yyvsp[0]->value.number == 1)
        current_part->flags |= AVRPART_SERIALOK;
      else if(yyvsp[0]->value.number == 0)
        current_part->flags &= ~AVRPART_SERIALOK;
      else {
        yyerror("serial not a Boolean value");
        free_token(yyvsp[0]);
        YYABORT;
      }

      free_token(yyvsp[0]);
    }
#line 2438 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 142: /* part_parm: K_PARALLEL TKN_EQUAL numexpr  */
#line 893 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      if(yyvsp[0]->value.number == 1) {
        current_part->flags |= AVRPART_PARALLELOK;
        current_part->flags &= ~AVRPART_PSEUDOPARALLEL;
      }
      else if(yyvsp[0]->value.number == 0) {
        current_part->flags &= ~AVRPART_PARALLELOK;
        current_part->flags &= ~AVRPART_PSEUDOPARALLEL;
      }
      else if(yyvsp[0]->value.number == 2) {
        current_part->flags |= AVRPART_PARALLELOK;
        current_part->flags |= AVRPART_PSEUDOPARALLEL;
      }
      else {
        yyerror("parallel outside [0, 2] (yes/no/pseudo)");
        free_token(yyvsp[0]);
        YYABORT;
      }


      free_token(yyvsp[0]);
    }
#line 2465 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 143: /* part_parm: K_RETRY_PULSE TKN_EQUAL retry_lines  */
#line 917 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      switch(yyvsp[0]->primary) {
      case K_RESET :
        current_part->retry_pulse = PIN_AVR_RESET;
        break;
      case K_SCK :
        current_part->retry_pulse = PIN_AVR_SCK;
        break;
      }

      free_token(yyvsp[-2]);
    }
#line 2482 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 144: /* $@15: %empty  */
#line 932 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    { /* select memory for extension or create if not there */
      AVRMEM *mem = avr_locate_mem_noalias(current_part, yyvsp[0]->value.string);
      if(!mem) {
        mem = avr_new_mem();
        mem->desc = cache_string(yyvsp[0]->value.string);
        ladd(current_part->mem, mem);
        mem->type = avr_get_mem_type(yyvsp[0]->value.string);
      }
      current_mem = mem;
      free_token(yyvsp[0]);
    }
#line 2498 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 145: /* part_parm: K_MEMORY TKN_STRING $@15 mem_specs  */
#line 944 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      if(is_alias) {            // alias mem has been already entered
        lrmv_d(current_part->mem, current_mem);
        avr_free_mem(current_mem);
        is_alias = false;
      } else {                  // check all opcodes re necessary address bits
        unsigned char cmd[4] = { 0, 0, 0, 0, };
        int bn;

        for(int i=0; i<AVR_OP_MAX; i++)
          if(current_mem && current_mem->op[i]) {
            if((bn = avr_set_addr_mem(current_mem, i, cmd, 0UL)) > 0)
              yywarning("%s's %s %s misses a necessary address bit a%d",
                 current_part->desc, current_mem->desc, opcodename(i), bn-1);
            }
        current_mem->comments = cfg_move_comments();
      }
      cfg_pop_comms();
      current_mem = NULL;
      current_strct = COMP_AVRPART;
    }
#line 2524 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 146: /* part_parm: K_MEMORY TKN_STRING TKN_EQUAL K_NULL  */
#line 966 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
   {
      AVRMEM *existing_mem = avr_locate_mem_noalias(current_part, yyvsp[-2]->value.string);
      if(existing_mem != NULL) {
        lrmv_d(current_part->mem, existing_mem);
        avr_free_mem(existing_mem);
      }
      free_token(yyvsp[-2]);
      cfg_pop_comms();
      current_mem = NULL;
      current_strct = COMP_AVRPART;
    }
#line 2540 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 147: /* part_parm: opcode TKN_EQUAL string_list  */
#line 977 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               {
    {
      int opnum;
      OPCODE *op;

      opnum = which_opcode(yyvsp[-2]);
      if(opnum < 0)
        YYABORT;
      op = avr_new_opcode();
      if(0 != parse_cmdbits(op, opnum))
        YYABORT;
      if(current_part->op[opnum] != NULL) {
        /*yywarning("operation redefined");*/
        avr_free_opcode(current_part->op[opnum]);
      }
      current_part->op[opnum] = op;

      free_token(yyvsp[-2]);
    }
  }
#line 2565 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 148: /* part_parm: opcode TKN_EQUAL K_NULL  */
#line 998 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                          {
    {
      int opnum = which_opcode(yyvsp[-2]);
      if(opnum < 0)
         YYABORT;
      if(current_part->op[opnum] != NULL)
        avr_free_opcode(current_part->op[opnum]);
      current_part->op[opnum] = NULL;

      free_token(yyvsp[-2]);
    }
  }
#line 2582 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 152: /* mem_spec: TKN_COMPONENT TKN_EQUAL expr  */
#line 1021 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               {
    cfg_assign((char *) current_mem, COMP_AVRMEM, yyvsp[-2]->value.comp, &yyvsp[0]->value);
    free_token(yyvsp[-2]);
  }
#line 2591 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 153: /* mem_spec: K_PAGE_SIZE TKN_EQUAL numexpr  */
#line 1027 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      int ps = yyvsp[0]->value.number;
      if(ps <= 0)
        pmsg_warning("invalid page size %d, ignored [%s:%d]\n", ps, cfg_infile, cfg_lineno);
      else
        current_mem->page_size = ps;
      free_token(yyvsp[0]);
    }
#line 2604 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 154: /* mem_spec: K_READBACK TKN_EQUAL TKN_NUMBER TKN_NUMBER  */
#line 1037 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
    {
      current_mem->readback[0] = yyvsp[-1]->value.number;
      current_mem->readback[1] = yyvsp[0]->value.number;
      free_token(yyvsp[-1]);
      free_token(yyvsp[0]);
    }
#line 2615 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 155: /* mem_spec: opcode TKN_EQUAL string_list  */
#line 1044 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                               {
    {
      int opnum;
      OPCODE *op;

      opnum = which_opcode(yyvsp[-2]);
      if(opnum < 0) YYABORT;
      op = avr_new_opcode();
      if(0 != parse_cmdbits(op, opnum))
        YYABORT;
      if(current_mem->op[opnum] != NULL) {
        /*yywarning("operation redefined");*/
        avr_free_opcode(current_mem->op[opnum]);
      }
      current_mem->op[opnum] = op;

      free_token(yyvsp[-2]);
    }
  }
#line 2639 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 156: /* mem_spec: opcode TKN_EQUAL K_NULL  */
#line 1064 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
                          {
    {
      int opnum = which_opcode(yyvsp[-2]);
      if(opnum < 0)
         YYABORT;
      if(current_mem->op[opnum] != NULL)
        avr_free_opcode(current_mem->op[opnum]);
      current_mem->op[opnum] = NULL;

      free_token(yyvsp[-2]);
    }
  }
#line 2656 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;

  case 157: /* mem_alias: K_ALIAS TKN_STRING  */
#line 1080 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"
  {
      AVRMEM *existing_mem;

      existing_mem = avr_locate_mem(current_part, yyvsp[0]->value.string);
      if(existing_mem == NULL) {
        yyerror("%s alias to non-existent memory %s", current_mem->desc, yyvsp[0]->value.string);
        free_token(yyvsp[0]);
        YYABORT;
      }

      // if this alias does already exist, drop the old one
      AVRMEM_ALIAS *alias = avr_locate_memalias(current_part, current_mem->desc);
      if(alias) {
        lrmv_d(current_part->mem_alias, alias);
        avr_free_memalias(alias);
      }

      is_alias = true;
      alias = avr_new_memalias();
      alias->desc = current_mem->desc;
      alias->aliased_mem = existing_mem;
      ladd(current_part->mem_alias, alias);

      free_token(yyvsp[0]);
  }
#line 2686 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"
    break;


#line 2690 "/build/avrdude/src/avrdude-8.2/build/config_gram.c"

      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
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */
  {
    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:
  /* 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;
      yyerror (YY_("syntax error"));
    }

  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
         error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
        }
      else
        {
          yydestruct ("Error: discarding",
                      yytoken, &yylval);
          yychar = YYEMPTY;
        }
    }

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


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:
  /* Pacify compilers when the user code never invokes YYERROR and the
     label yyerrorlab therefore never appears in user code.  */
  if (0)
    YYERROR;
  ++yynerrs;

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


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  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 (!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;


      yydestruct ("Error: popping",
                  YY_ACCESSING_SYMBOL (yystate), yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturnlab;


/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturnlab;


/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
`-----------------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  goto yyreturnlab;


/*----------------------------------------------------------.
| 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 1107 "/build/avrdude/src/avrdude-8.2/src/config_gram.y"


#if 0
static char *vtypestr(int type) {
  switch(type) {
  case V_NUM : return "INTEGER";
  case V_NUM_REAL: return "REAL";
  case V_STR : return "STRING";
  default:
    return "<UNKNOWN>";
  }
}
#endif


static int clear_pin(int pinfunc) {
  if(pinfunc < 0 || pinfunc >= N_PINS) {
    yyerror("pin function must be in the range [0, %d]", N_PINS-1);
    return -1;
  }

  pin_clear_all(&(current_prog->pin[pinfunc]));

  return 0;
}

static int assign_pin(int pinfunc, TOKEN *v, int invert) {
  if(pinfunc < 0 || pinfunc >= N_PINS) {
    yyerror("pin function must be in the range [0, %d]", N_PINS-1);
    return -1;
  }

  int value = v->value.number;
  free_token(v);

  if((value < PIN_MIN) || (value > PIN_MAX)) {
    yyerror("pin must be in the range " TOSTRING(PIN_MIN) "-"  TOSTRING(PIN_MAX));
    return -1;
  }

  pin_set_value(&(current_prog->pin[pinfunc]), value, invert);

  return 0;
}

static int assign_pin_list(int invert) {
  TOKEN *t;
  int pin;
  int rv = 0;

  if(pin_name < 0 || pin_name >= N_PINS) {
    yyerror("pin_name should be in the range [0, %d]", N_PINS-1);
    return -1;
  }

  current_prog->pinno[pin_name] = NO_PIN;
  while(lsize(number_list)) {
    t = lrmv_n(number_list, 1);
    if (rv == 0) {
      pin = t->value.number;
      if ((pin < PIN_MIN) || (pin > PIN_MAX)) {
        yyerror("pin must be in the range " TOSTRING(PIN_MIN) "-"  TOSTRING(PIN_MAX));
        rv = -1;
        /* loop clears list and frees tokens */
      }
      pin_set_value(&(current_prog->pin[pin_name]), pin, invert);
    }
    free_token(t);
  }
  return rv;
}

static int which_opcode(TOKEN *opcode) {
  switch(opcode->primary) {
  case K_READ:          return AVR_OP_READ;
  case K_WRITE:         return AVR_OP_WRITE;
  case K_READ_LO:       return AVR_OP_READ_LO;
  case K_READ_HI:       return AVR_OP_READ_HI;
  case K_WRITE_LO:      return AVR_OP_WRITE_LO;
  case K_WRITE_HI:      return AVR_OP_WRITE_HI;
  case K_LOADPAGE_LO:   return AVR_OP_LOADPAGE_LO;
  case K_LOADPAGE_HI:   return AVR_OP_LOADPAGE_HI;
  case K_LOAD_EXT_ADDR: return AVR_OP_LOAD_EXT_ADDR;
  case K_WRITEPAGE:     return AVR_OP_WRITEPAGE;
  case K_CHIP_ERASE:    return AVR_OP_CHIP_ERASE;
  case K_PGM_ENABLE:    return AVR_OP_PGM_ENABLE;
  default:
    yyerror("invalid opcode");
    return -1;
  }
}


static int parse_cmdbits(OPCODE *op, int opnum) {
  TOKEN *t;
  int bitno;
  int len;
  char *s, *brkt = NULL;
  int rv = 0;

  bitno = 32;
  while(lsize(string_list)) {

    t = lrmv_n(string_list, 1);

    char *str = t->value.string;
    // Compact alternative specification? (eg, "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii")
    char bit[2] = {0, 0}, *cc = str;
    int compact = !strchr(str, ' ') && strlen(str) > 7;

    bit[0] = *cc++;
    s = !compact? strtok_r(str, " ", &brkt): *bit? bit: NULL;
    while(rv == 0 && s != NULL) {

      // Ignore visual grouping characters in compact mode
      if(*s != '.' && *s != '-' && *s != '_' && *s !='/')
        bitno--;
      if(bitno < 0) {
        yyerror("too many opcode bits for instruction");
        rv = -1;
        break;
      }

      len = strlen(s);

      if(len == 0) {
        yyerror("invalid bit specifier \"\"");
        rv = -1;
        break;
      }

      if(len == 1) {
        switch(*s) {
        case '1':
          op->bit[bitno].type  = AVR_CMDBIT_VALUE;
          op->bit[bitno].value = 1;
          op->bit[bitno].bitno = bitno % 8;
          break;
        case '0':
          op->bit[bitno].type  = AVR_CMDBIT_VALUE;
          op->bit[bitno].value = 0;
          op->bit[bitno].bitno = bitno % 8;
          break;
        case 'x':
          op->bit[bitno].type  = AVR_CMDBIT_IGNORE;
          op->bit[bitno].value = 0;
          op->bit[bitno].bitno = bitno % 8;
          break;
        case 'a':
          op->bit[bitno].type  = AVR_CMDBIT_ADDRESS;
          op->bit[bitno].value = 0;
          op->bit[bitno].bitno = bitno < 8 || bitno > 23? 0:
            opnum == AVR_OP_LOAD_EXT_ADDR? bitno+8: bitno-8; /* correct bit number for lone 'a' */
          if(bitno < 8 || bitno > 23)
            yywarning("address bits don't normally appear in Bytes 0 or 3 of SPI commands");
          break;
        case 'i':
          op->bit[bitno].type  = AVR_CMDBIT_INPUT;
          op->bit[bitno].value = 0;
          op->bit[bitno].bitno = bitno % 8;
          break;
        case 'o':
          op->bit[bitno].type  = AVR_CMDBIT_OUTPUT;
          op->bit[bitno].value = 0;
          op->bit[bitno].bitno = bitno % 8;
          break;
        case '.':
        case '-':
        case '_':
        case '/':
          break;
        default :
          yyerror("invalid bit specifier '%c'", *s);
          rv = -1;
          break;
        }
      } else {
        const char *errstr;
        int sb, bn = str_int(s+1, STR_INT32, &errstr); // Bit number
        if(errstr) {
          yywarning("bit number from %s: %s", s, errstr);
          bn = 0;
        } else if(strchr("io", *s) && (bn < 0 || bn > 7)) {
          bn &= 7;
          yywarning("out-of-range bit number %s mapped to %d", s, bn);
        }

        switch(*s) {
        case 'a':
          sb = opnum == AVR_OP_LOAD_EXT_ADDR? bitno+8: bitno-8; // should be this number
          if(bitno < 8 || bitno > 23) {
            if(!current_mem || !mem_is_in_sigrow(current_mem)) // Known exemptions
              yywarning("address bits don't normally appear in Bytes 0 or 3 of SPI commands");
          } else if((bn & 31) != sb) {
            if(!current_part || !str_casestarts(current_part->desc, "AT89S5")) // Exempt AT89S5x
              if(!current_mem || !mem_is_in_sigrow(current_mem)) // ... and prodsig/sernum
                yywarning("a%d would normally be expected to be a%d", bn, sb);
          } else if(bn < 0 || bn > 31)
            yywarning("invalid address bit a%d, using a%d", bn, bn & 31);

          op->bit[bitno].bitno = bn & 31;
          op->bit[bitno].type = AVR_CMDBIT_ADDRESS;
          op->bit[bitno].value = 0;
          break;
        case 'o':
          op->bit[bitno].type  = AVR_CMDBIT_OUTPUT;
          op->bit[bitno].value = 0;
          op->bit[bitno].bitno = bn;
          break;
        case 'i':
          op->bit[bitno].type  = AVR_CMDBIT_INPUT;
          op->bit[bitno].value = 0;
          op->bit[bitno].bitno = bn;
          break;
        default:
          yyerror("invalid bit specifier %s", s);
          rv = -1;
          break;
        }
      }

      bit[0] = *cc++;
      s = !compact? strtok_r(NULL, " ", &brkt): *bit? bit: NULL;
    } /* while */

    free_token(t);

  }  /* while */

  if(bitno > 0)
    yywarning("too few opcode bits in instruction");

  return rv;
}
