📄 config_gram.c
字号:
/* A Bison parser, made from ../config_gram.y, by GNU bison 1.75. *//* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. *//* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. *//* 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. */#define YYBISON 1/* Pure parsers. */#define YYPURE 0/* Using locations. */#define YYLSP_NEEDED 0/* Tokens. */#ifndef YYTOKENTYPE# define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { K_READ = 258, K_WRITE = 259, K_READ_LO = 260, K_READ_HI = 261, K_WRITE_LO = 262, K_WRITE_HI = 263, K_LOADPAGE_LO = 264, K_LOADPAGE_HI = 265, K_WRITEPAGE = 266, K_CHIP_ERASE = 267, K_PGM_ENABLE = 268, K_MEMORY = 269, K_PAGE_SIZE = 270, K_PAGED = 271, K_BS2 = 272, K_BUFF = 273, K_CHIP_ERASE_DELAY = 274, K_DEDICATED = 275, K_DEFAULT_PARALLEL = 276, K_DEFAULT_PROGRAMMER = 277, K_DEFAULT_SERIAL = 278, K_DESC = 279, K_DEVICECODE = 280, K_EEPROM = 281, K_ERRLED = 282, K_FLASH = 283, K_ID = 284, K_IO = 285, K_LOADPAGE = 286, K_MAX_WRITE_DELAY = 287, K_MIN_WRITE_DELAY = 288, K_MISO = 289, K_MOSI = 290, K_NUM_PAGES = 291, K_PAGEL = 292, K_PAR = 293, K_PARALLEL = 294, K_PART = 295, K_PGMLED = 296, K_PROGRAMMER = 297, K_PSEUDO = 298, K_PWROFF_AFTER_WRITE = 299, K_RDYLED = 300, K_READBACK_P1 = 301, K_READBACK_P2 = 302, K_READMEM = 303, K_RESET = 304, K_RETRY_PULSE = 305, K_SERIAL = 306, K_SCK = 307, K_SIZE = 308, K_STK500 = 309, K_TYPE = 310, K_VCC = 311, K_VFYLED = 312, K_NO = 313, K_YES = 314, TKN_COMMA = 315, TKN_EQUAL = 316, TKN_SEMI = 317, TKN_NUMBER = 318, TKN_STRING = 319, TKN_ID = 320 };#endif#define K_READ 258#define K_WRITE 259#define K_READ_LO 260#define K_READ_HI 261#define K_WRITE_LO 262#define K_WRITE_HI 263#define K_LOADPAGE_LO 264#define K_LOADPAGE_HI 265#define K_WRITEPAGE 266#define K_CHIP_ERASE 267#define K_PGM_ENABLE 268#define K_MEMORY 269#define K_PAGE_SIZE 270#define K_PAGED 271#define K_BS2 272#define K_BUFF 273#define K_CHIP_ERASE_DELAY 274#define K_DEDICATED 275#define K_DEFAULT_PARALLEL 276#define K_DEFAULT_PROGRAMMER 277#define K_DEFAULT_SERIAL 278#define K_DESC 279#define K_DEVICECODE 280#define K_EEPROM 281#define K_ERRLED 282#define K_FLASH 283#define K_ID 284#define K_IO 285#define K_LOADPAGE 286#define K_MAX_WRITE_DELAY 287#define K_MIN_WRITE_DELAY 288#define K_MISO 289#define K_MOSI 290#define K_NUM_PAGES 291#define K_PAGEL 292#define K_PAR 293#define K_PARALLEL 294#define K_PART 295#define K_PGMLED 296#define K_PROGRAMMER 297#define K_PSEUDO 298#define K_PWROFF_AFTER_WRITE 299#define K_RDYLED 300#define K_READBACK_P1 301#define K_READBACK_P2 302#define K_READMEM 303#define K_RESET 304#define K_RETRY_PULSE 305#define K_SERIAL 306#define K_SCK 307#define K_SIZE 308#define K_STK500 309#define K_TYPE 310#define K_VCC 311#define K_VFYLED 312#define K_NO 313#define K_YES 314#define TKN_COMMA 315#define TKN_EQUAL 316#define TKN_SEMI 317#define TKN_NUMBER 318#define TKN_STRING 319#define TKN_ID 320/* Copy the first part of user declarations. */#line 21 "../config_gram.y"#include "ac_cfg.h"#include <stdlib.h>#include <string.h>#include <math.h>#include "config.h"#include "lists.h"#include "par.h"#include "pindefs.h"#include "ppi.h"#include "pgm.h"#include "stk500.h"#include "avr.h"extern char * progname;int yylex(void);int yyerror(char * errmsg);static int assign_pin(int pinno, TOKEN * v);static int which_opcode(TOKEN * opcode);static int parse_cmdbits(OPCODE * op); /* Enabling traces. */#ifndef YYDEBUG# define YYDEBUG 0#endif/* Enabling verbose error messages. */#ifdef YYERROR_VERBOSE# undef YYERROR_VERBOSE# define YYERROR_VERBOSE 1#else# define YYERROR_VERBOSE 0#endif#ifndef YYSTYPEtypedef int yystype;# define YYSTYPE yystype# define YYSTYPE_IS_TRIVIAL 1#endif#ifndef YYLTYPEtypedef struct yyltype{ int first_line; int first_column; int last_line; int last_column;} yyltype;# define YYLTYPE yyltype# define YYLTYPE_IS_TRIVIAL 1#endif/* Copy the second part of user declarations. *//* Line 213 of /usr/share/bison/yacc.c. */#line 251 "config_gram.c"#if ! defined (yyoverflow) || YYERROR_VERBOSE/* The parser invokes alloca or malloc; define the necessary symbols. */# if YYSTACK_USE_ALLOCA# define YYSTACK_ALLOC alloca# else# ifndef YYSTACK_USE_ALLOCA# if defined (alloca) || defined (_ALLOCA_H)# define YYSTACK_ALLOC alloca# else# ifdef __GNUC__# define YYSTACK_ALLOC __builtin_alloca# endif# endif# endif# endif# ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)# else# if defined (__STDC__) || defined (__cplusplus)# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */# define YYSIZE_T size_t# endif# define YYSTACK_ALLOC malloc# define YYSTACK_FREE free# endif#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */#if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member. */union yyalloc{ short yyss; YYSTYPE yyvs; };/* The size of the maximum gap between one aligned stack and the next. */# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each with N elements. */# define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX)/* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */# ifndef YYCOPY# if 1 < __GNUC__# define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))# else# define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0)# endif# endif/* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0)#endif#if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char;#else typedef short yysigned_char;#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL 16#define YYLAST 167/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS 66/* YYNNTS -- Number of nonterminals. */#define YYNNTS 22/* YYNRULES -- Number of rules. */#define YYNRULES 80/* YYNRULES -- Number of states. */#define YYNSTATES 172/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */#define YYUNDEFTOK 2#define YYMAXUTOK 320#define YYTRANSLATE(X) \ ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */static const unsigned char 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};#if YYDEBUG/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */static const unsigned char yyprhs[] ={ 0, 0, 3, 4, 6, 8, 11, 14, 17, 22, 27, 32, 33, 37, 38, 42, 44, 48, 50, 54, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 142, 146, 148, 150, 152, 154, 156, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 199, 204, 208, 210, 212, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255};/* YYRHS -- A `-1'-separated list of the rules' RHS. */static const yysigned_char yyrhs[] ={ 67, 0, -1, -1, 68, -1, 69, -1, 68, 69, -1, 70, 62, -1, 72, 62, -1, 22, 61, 64, 62, -1, 21, 61, 64, 62, -1, 23, 61, 64, 62, -1, -1, 42, 71, 76, -1, -1, 40, 73, 79, -1, 64, -1, 74, 60, 64, -1, 63, -1, 75, 60, 63, -1, 77, 62, -1, 76, 77, 62, -1, 29, 61, 74, -1, 55, 61, 38, -1, 55, 61, 54, -1, 24, 61, 64, -1, 56, 61, 75, -1, 18, 61, 75, -1, 49, 61, 63, -1, 52, 61, 63, -1, 35, 61, 63, -1, 34, 61, 63, -1, 27, 61, 63, -1, 45, 61, 63, -1, 41, 61, 63, -1, 57, 61, 63, -1, 3, -1, 4, -1, 5, -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, -1, 83, 62, -1, 79, 83, 62, -1, 20, -1, 30, -1, 85, -1, 43, -1, 49, -1, 52, -1, 29, 61, 64, -1, 24, 61, 64, -1, 25, 61, 63, -1, 19, 61, 63, -1, 37, 61, 63, -1, 17, 61, 63, -1, 49, 61, 80, -1, 51, 61, 85, -1, 39, 61, 81, -1, 50, 61, 82, -1, -1, 14, 64, 84, 86, -1, 78, 61, 74, -1, 59, -1, 58, -1, 87, 62, -1, 86, 87, 62, -1, 16, 61, 85, -1, 53, 61, 63, -1, 15, 61, 63, -1, 36, 61, 63, -1, 33, 61, 63, -1, 32, 61, 63, -1, 44, 61, 85, -1, 46, 61, 63, -1, 47, 61, 63, -1, 78, 61, 74, -1};/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const unsigned short yyrline[] ={ 0, 123, 123, 124, 127, 128, 133, 134, 136, 142, 148, 160, 158, 185, 183, 245, 246, 251, 252, 257, 258, 263, 273, 279, 285, 291, 316, 341, 344, 346, 347, 348, 349, 350, 351, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 371, 372, 377, 378, 381, 382, 385, 386, 389, 395, 402, 409, 415, 421, 427, 437, 447, 466, 492, 480, 501, 519, 520, 524, 525, 530, 535, 541, 548, 554, 560, 566, 572, 578, 584};#endif#if YYDEBUG || YYERROR_VERBOSE/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */static const char *const yytname[] ={ "$end", "error", "$undefined", "K_READ", "K_WRITE", "K_READ_LO", "K_READ_HI", "K_WRITE_LO", "K_WRITE_HI", "K_LOADPAGE_LO", "K_LOADPAGE_HI", "K_WRITEPAGE", "K_CHIP_ERASE", "K_PGM_ENABLE", "K_MEMORY", "K_PAGE_SIZE", "K_PAGED", "K_BS2", "K_BUFF", "K_CHIP_ERASE_DELAY", "K_DEDICATED", "K_DEFAULT_PARALLEL", "K_DEFAULT_PROGRAMMER", "K_DEFAULT_SERIAL", "K_DESC", "K_DEVICECODE", "K_EEPROM", "K_ERRLED", "K_FLASH", "K_ID", "K_IO", "K_LOADPAGE", "K_MAX_WRITE_DELAY", "K_MIN_WRITE_DELAY", "K_MISO", "K_MOSI", "K_NUM_PAGES", "K_PAGEL", "K_PAR", "K_PARALLEL", "K_PART", "K_PGMLED", "K_PROGRAMMER", "K_PSEUDO", "K_PWROFF_AFTER_WRITE", "K_RDYLED", "K_READBACK_P1", "K_READBACK_P2", "K_READMEM", "K_RESET", "K_RETRY_PULSE", "K_SERIAL", "K_SCK", "K_SIZE", "K_STK500", "K_TYPE", "K_VCC", "K_VFYLED", "K_NO", "K_YES", "TKN_COMMA", "TKN_EQUAL", "TKN_SEMI", "TKN_NUMBER", "TKN_STRING", "TKN_ID", "$accept", "configuration", "config", "def", "prog_def", "@1", "part_def", "@2", "string_list", "num_list", "prog_parms", "prog_parm", "opcode", "part_parms", "reset_disposition", "parallel_modes", "retry_lines", "part_parm", "@3", "yesno", "mem_specs", "mem_spec", 0};#endif# ifdef YYPRINT/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */static const unsigned short yytoknum[] ={ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320};# endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const unsigned char yyr1[] ={ 0, 66, 67, 67, 68, 68, 69, 69, 69, 69, 69, 71, 70, 73, 72, 74, 74, 75, 75, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 83, 83, 85, 85, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const unsigned char yyr2[] ={ 0, 2, 0, 1, 1, 2, 2, 2, 4, 4, 4, 0, 3, 0, 3, 1, 3, 1, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 4, 3, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -