config_gram.c

来自「这是一个非常有价值的参考代码」· C语言 代码 · 共 2,133 行 · 第 1/5 页

C
2,133
字号
/*  A Bison parser, made from ../config_gram.y    by GNU Bison version 1.28  */#define YYBISON 1  /* Identify Bison output.  */#define	K_READ	257#define	K_WRITE	258#define	K_READ_LO	259#define	K_READ_HI	260#define	K_WRITE_LO	261#define	K_WRITE_HI	262#define	K_LOADPAGE_LO	263#define	K_LOADPAGE_HI	264#define	K_WRITEPAGE	265#define	K_CHIP_ERASE	266#define	K_PGM_ENABLE	267#define	K_MEMORY	268#define	K_PAGE_SIZE	269#define	K_PAGED	270#define	K_BAUDRATE	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_STK500_DEVCODE	281#define	K_AVR910_DEVCODE	282#define	K_EEPROM	283#define	K_ERRLED	284#define	K_FLASH	285#define	K_ID	286#define	K_IO	287#define	K_JTAG_MKII	288#define	K_LOADPAGE	289#define	K_MAX_WRITE_DELAY	290#define	K_MIN_WRITE_DELAY	291#define	K_MISO	292#define	K_MOSI	293#define	K_NUM_PAGES	294#define	K_PAGEL	295#define	K_PAR	296#define	K_PARALLEL	297#define	K_PART	298#define	K_PGMLED	299#define	K_PROGRAMMER	300#define	K_PSEUDO	301#define	K_PWROFF_AFTER_WRITE	302#define	K_RDYLED	303#define	K_READBACK_P1	304#define	K_READBACK_P2	305#define	K_READMEM	306#define	K_RESET	307#define	K_RETRY_PULSE	308#define	K_SERBB	309#define	K_SERIAL	310#define	K_SCK	311#define	K_SIZE	312#define	K_STK500	313#define	K_STK500V2	314#define	K_AVR910	315#define	K_BUTTERFLY	316#define	K_TYPE	317#define	K_VCC	318#define	K_VFYLED	319#define	K_NO	320#define	K_YES	321#define	K_TIMEOUT	322#define	K_STABDELAY	323#define	K_CMDEXEDELAY	324#define	K_SYNCHLOOPS	325#define	K_BYTEDELAY	326#define	K_POLLVALUE	327#define	K_POLLINDEX	328#define	K_PREDELAY	329#define	K_POSTDELAY	330#define	K_POLLMETHOD	331#define	K_MODE	332#define	K_DELAY	333#define	K_BLOCKSIZE	334#define	K_READSIZE	335#define	K_ALLOWFULLPAGEBITSTREAM	336#define	K_ENABLEPAGEPROGRAMMING	337#define	K_HAS_JTAG	338#define	K_IDR	339#define	K_RAMPZ	340#define	K_SPMCR	341#define	K_EECR	342#define	TKN_COMMA	343#define	TKN_EQUAL	344#define	TKN_SEMI	345#define	TKN_TILDE	346#define	TKN_NUMBER	347#define	TKN_STRING	348#define	TKN_ID	349#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 "serbb.h"#include "pindefs.h"#include "ppi.h"#include "pgm.h"#include "stk500.h"#include "stk500v2.h"#include "avr910.h"#include "butterfly.h"#include "avr.h"#include "jtagmkII.h"#if defined(WIN32NATIVE)#define strtok_r( _s, _sep, _lasts ) \    ( *(_lasts) = strtok( (_s), (_sep) ) )#endifextern char * progname;int yylex(void);int yyerror(char * errmsg);static int assign_pin(int pinno, TOKEN * v, int invert);static int which_opcode(TOKEN * opcode);static int parse_cmdbits(OPCODE * op); #ifndef YYSTYPE#define YYSTYPE int#endif#include <stdio.h>#ifndef __cplusplus#ifndef __STDC__#define const#endif#endif#define	YYFINAL		268#define	YYFLAG		-32768#define	YYNTBASE	96#define YYTRANSLATE(x) ((unsigned)(x) <= 349 ? yytranslate[x] : 117)static const 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,     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,    92,    93,    94,    95};#if YYDEBUG != 0static const short yyprhs[] = {     0,     0,     1,     3,     5,     8,    11,    14,    19,    24,    29,    30,    34,    35,    39,    41,    45,    47,    51,    54,    58,    62,    66,    70,    74,    78,    82,    86,    90,    94,    98,   102,   106,   110,   114,   118,   122,   126,   130,   134,   138,   143,   148,   153,   158,   163,   168,   173,   178,   180,   182,   184,   186,   188,   190,   192,   194,   196,   198,   200,   203,   207,   209,   211,   213,   215,   217,   219,   223,   227,   231,   235,   239,   243,   247,   251,   255,   259,   263,   267,   271,   275,   279,   283,   287,   291,   295,   299,   303,   307,   311,   315,   319,   323,   327,   331,   335,   336,   341,   345,   347,   349,   352,   356,   360,   364,   368,   372,   376,   380,   384,   388,   392,   396,   400,   404,   408,   412};static const short yyrhs[] = {    -1,    97,     0,    98,     0,    97,    98,     0,    99,    91,     0,   101,    91,     0,    23,    90,    94,    91,     0,    22,    90,    94,    91,     0,    24,    90,    94,    91,     0,     0,    46,   100,   105,     0,     0,    44,   102,   108,     0,    94,     0,   103,    89,    94,     0,    93,     0,   104,    89,    93,     0,   106,    91,     0,   105,   106,    91,     0,    32,    90,   103,     0,    63,    90,    42,     0,    63,    90,    55,     0,    63,    90,    59,     0,    63,    90,    60,     0,    63,    90,    61,     0,    63,    90,    62,     0,    63,    90,    34,     0,    25,    90,    94,     0,    64,    90,   104,     0,    19,    90,   104,     0,    17,    90,    93,     0,    53,    90,    93,     0,    57,    90,    93,     0,    39,    90,    93,     0,    38,    90,    93,     0,    30,    90,    93,     0,    49,    90,    93,     0,    45,    90,    93,     0,    65,    90,    93,     0,    53,    90,    92,    93,     0,    57,    90,    92,    93,     0,    39,    90,    92,    93,     0,    38,    90,    92,    93,     0,    30,    90,    92,    93,     0,    49,    90,    92,    93,     0,    45,    90,    92,    93,     0,    65,    90,    92,    93,     0,     3,     0,     4,     0,     5,     0,     6,     0,     7,     0,     8,     0,     9,     0,    10,     0,    11,     0,    12,     0,    13,     0,   112,    91,     0,   108,   112,    91,     0,    21,     0,    33,     0,   114,     0,    47,     0,    53,     0,    57,     0,    32,    90,    94,     0,    25,    90,    94,     0,    26,    90,    93,     0,    27,    90,    93,     0,    28,    90,    93,     0,    20,    90,    93,     0,    41,    90,    93,     0,    18,    90,    93,     0,    53,    90,   109,     0,    68,    90,    93,     0,    69,    90,    93,     0,    70,    90,    93,     0,    71,    90,    93,     0,    72,    90,    93,     0,    73,    90,    93,     0,    74,    90,    93,     0,    75,    90,    93,     0,    76,    90,    93,     0,    77,    90,    93,     0,    84,    90,   114,     0,    82,    90,   114,     0,    83,    90,   114,     0,    85,    90,    93,     0,    86,    90,    93,     0,    87,    90,    93,     0,    88,    90,    93,     0,    56,    90,   114,     0,    43,    90,   110,     0,    54,    90,   111,     0,     0,    14,    94,   113,   115,     0,   107,    90,   103,     0,    67,     0,    66,     0,   116,    91,     0,   115,   116,    91,     0,    16,    90,   114,     0,    58,    90,    93,     0,    15,    90,    93,     0,    40,    90,    93,     0,    37,    90,    93,     0,    36,    90,    93,     0,    48,    90,   114,     0,    50,    90,    93,     0,    51,    90,    93,     0,    78,    90,    93,     0,    79,    90,    93,     0,    80,    90,    93,     0,    81,    90,    93,     0,    74,    90,    93,     0,   107,    90,   103,     0};#endif#if YYDEBUG != 0static const short yyrline[] = { 0,   173,   174,   177,   178,   183,   184,   186,   192,   198,   208,   215,   233,   241,   295,   296,   301,   302,   307,   308,   313,   323,   329,   335,   341,   347,   353,   359,   365,   371,   396,   421,   427,   430,   432,   433,   434,   435,   436,   437,   438,   441,   443,   444,   445,   446,   447,   448,   453,   454,   455,   456,   457,   458,   459,   460,   461,   462,   463,   468,   469,   474,   475,   478,   479,   482,   483,   486,   492,   499,   509,   516,   523,   529,   535,   541,   551,   557,   563,   569,   575,   581,   587,   593,   599,   605,   611,   621,   631,   641,   647,   653,   659,   665,   675,   694,   708,   726,   729,   747,   748,   752,   753,   758,   763,   769,   776,   782,   788,   794,   800,   806,   812,   819,   825,   831,   837,   843};#endif#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)static const char * const yytname[] = {   "$","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_BAUDRATE","K_BS2","K_BUFF","K_CHIP_ERASE_DELAY","K_DEDICATED","K_DEFAULT_PARALLEL","K_DEFAULT_PROGRAMMER","K_DEFAULT_SERIAL","K_DESC","K_DEVICECODE","K_STK500_DEVCODE","K_AVR910_DEVCODE","K_EEPROM","K_ERRLED","K_FLASH","K_ID","K_IO","K_JTAG_MKII","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_SERBB","K_SERIAL","K_SCK","K_SIZE","K_STK500","K_STK500V2","K_AVR910","K_BUTTERFLY","K_TYPE","K_VCC","K_VFYLED","K_NO","K_YES","K_TIMEOUT","K_STABDELAY","K_CMDEXEDELAY","K_SYNCHLOOPS","K_BYTEDELAY","K_POLLVALUE","K_POLLINDEX","K_PREDELAY","K_POSTDELAY","K_POLLMETHOD","K_MODE","K_DELAY","K_BLOCKSIZE","K_READSIZE","K_ALLOWFULLPAGEBITSTREAM","K_ENABLEPAGEPROGRAMMING","K_HAS_JTAG","K_IDR","K_RAMPZ","K_SPMCR","K_EECR","TKN_COMMA","TKN_EQUAL","TKN_SEMI","TKN_TILDE","TKN_NUMBER","TKN_STRING","TKN_ID","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", NULL};#endifstatic const short yyr1[] = {     0,    96,    96,    97,    97,    98,    98,    98,    98,    98,   100,    99,   102,   101,   103,   103,   104,   104,   105,   105,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   106,   107,   107,   107,   107,   107,   107,   107,   107,   107,   107,   107,   108,   108,   109,   109,   110,   110,   111,   111,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   112,   113,   112,   112,   114,   114,   115,   115,   116,   116,   116,   116,   116,   116,   116,   116,   116,   116,   116,   116,   116,   116,   116};static const short yyr2[] = {     0,     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,     3,     3,     3,     3,     3,     3,     4,     4,     4,     4,     4,     4,     4,     4,     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,     3,     3,     3,     3,     3,     3,     3,     3,     3,     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,     3,     3,     3,     3,     3};static const short yydefact[] = {     1,     0,     0,     0,    12,    10,     2,     3,     0,     0,     0,     0,     0,     0,     0,     4,     5,     6,     0,     0,     0,    48,    49,    50,    51,    52,    53,    54,    55,    56,    57,    58,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,    13,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,    11,     0,     8,     7,     9,    96,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,    59,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,    18,     0,    74,    72,    68,    69,    70,    71,    67,    73,    64,   100,    99,    94,    63,    61,    62,    75,    65,    66,    95,    93,    76,    77,    78,    79,    80,    81,    82,    83,    84,    85,    87,    88,    86,    89,    90,    91,    92,    14,    98,    60,    31,    16,    30,    28,     0,    36,    20,     0,    35,     0,    34,     0,    38,     0,    37,     0,    32,     0,    33,    27,    21,    22,    23,    24,    25,    26,    29,     0,    39,    19,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,    97,     0,     0,     0,    44,    43,    42,    46,    45,    40,    41,    47,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,   101,    15,    17,   105,   103,   108,   107,   106,   109,   110,   111,   104,   116,   112,   113,   114,   115,   117,   102,     0,     0,     0};static const short yydefgoto[] = {   266,     6,     7,     8,    14,     9,    13,   172,   176,    79,    80,    62,    63,   149,   145,   152,    64,   133,   146,   219,   220};static const short yypact[] = {    -8,   -53,   -50,   -47,-32768,-32768,    -8,-32768,   -31,   -30,   -29,   -28,   -23,    21,   144,-32768,-32768,-32768,   -19,   -18,   -15,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -14,   -12,   -11,    -9,    -7,    -6,    -5,    -4,    -3,     9,    10,    11,    12,    31,    34,    36,    37,    38,    39,    40,    41,    42,    43,    44,    45,    47,    48,    49,    51,    52,    55,    21,    57,    56,    59,    60,    61,    62,    63,    64,    66,    69,    70,    72,    74,    76,    77,   144,    79,-32768,-32768,-32768,-32768,    75,    78,    81,    80,    84,    85,    86,    91,   -44,   -16,   -49,   -60,    97,    98,    99,   101,   102,   103,   105,   106,   109,   110,   -60,   -60,   -60,   111,   112,   113,   117,   118,    88,-32768,   120,   121,   122,   -83,   118,   -74,   -72,   -48,   -41,   -38,   -36,     8,   121,   -34,   124,-32768,   107,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,    83,-32768,-32768,-32768,   128,-32768,   125,-32768,    83,   126,-32768,   127,-32768,   129,-32768,   130,-32768,   131,-32768,   132,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   128,   133,-32768,-32768,   137,   138,   139,   140,   141,   142,   143,   145,   146,   147,   148,   149,   150,   151,   152,   107,   153,   154,   156,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   157,   -60,   158,   159,   160,   -60,   161,   162,   163,   164,   165,   166,   167,   168,   118,   155,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,    83,-32768,    82,   200,-32768};static const short yypgoto[] = {-32768,-32768,   205,-32768,-32768,-32768,-32768,  -120,    92,-32768,   183,  -131,-32768,-32768,-32768,-32768,   171,-32768,   -96,-32768,    24};#define	YYLAST		262static const short yytable[] = {   153,   180,   218,   142,   150,   147,   143,   144,   151,   178,   179,   164,   165,   166,     1,     2,     3,   148,   181,   182,   183,   184,   143,   144,    21,    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,    32,     4,    10,     5,    33,    11,    34,   193,    12,   185,   186,    35,    36,    37,    38,   194,   187,   188,    39,   189,   190,   191,   192,   201,   202,    16,    17,    40,   195,    41,    18,    19,   196,   197,   198,   199,    20,    81,    82,    42,    43,    83,    44,    85,    86,    84,    87,   267,    88,    89,    90,    91,    92,   218,    45,    46,    47,    48,    49,    50,    51,    52,    53,    54,    93,    94,    95,    96,    55,    56,    57,    58,    59,    60,    61,    21,    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,    97,   204,   205,    98,   264,    99,   100,   101,   102,   103,   104,   105,   106,   107,   108,   251,   109,   110,   111,   255,   112,   113,   206,   207,   114,   117,   208,   116,   118,   119,   120,   121,   122,   123,   209,   124,   210,   211,   125,   126,    65,   127,    66,   128,   212,   129,   130,   134,    67,   132,   135,   221,   137,    68,   136,    69,   138,   139,   173,   140,   213,    70,    71,   141,   214,   215,   216,   217,    72,   154,   155,   156,    73,   157,   158,   159,    74,   160,   161,   268,    75,   162,   163,   167,   168,   169,    76,    77,    78,   170,    15,   171,   174,   175,   203,   177,   222,   223,   224,   225,   200,   226,   227,   228,   229,   230,   231,   232,   233,   234,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?