Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
config.h File Reference
#include "libavrdude.h"
+ Include dependency graph for config.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  value_t
 
struct  token_t
 

Macros

#define MAX_STR_CONST   1024
 
#define YYSTYPE   token_p
 

Typedefs

typedef struct value_t VALUE
 
typedef struct token_t TOKEN
 
typedef struct token_ttoken_p
 

Enumerations

enum  { V_NONE , V_NUM , V_NUM_REAL , V_STR }
 

Functions

int yyparse (void)
 
int yyerror (char *errmsg,...)
 
int yywarning (char *errmsg,...)
 
TOKENnew_token (int primary)
 
void free_token (TOKEN *tkn)
 
void free_tokens (int n,...)
 
TOKENnumber (char *text)
 
TOKENnumber_real (char *text)
 
TOKENhexnumber (char *text)
 
TOKENstring (char *text)
 
TOKENkeyword (int primary)
 
void print_token (TOKEN *tkn)
 
void pyytext (void)
 
char * dup_string (const char *str)
 

Variables

FILE * yyin = NULL
 
PROGRAMMERcurrent_prog
 
AVRPARTcurrent_part
 
AVRMEMcurrent_mem
 
int lineno
 
const char * infile
 
LISTID string_list
 
LISTID number_list
 
YYSTYPE yylval
 
char string_buf [MAX_STR_CONST]
 
char * string_buf_ptr
 

Class Documentation

◆ value_t

struct value_t
Class Members
int number
double number_real
char * string
int type

◆ token_t

struct token_t
+ Collaboration diagram for token_t:
Class Members
int primary
VALUE value

Macro Definition Documentation

◆ MAX_STR_CONST

#define MAX_STR_CONST   1024

◆ YYSTYPE

#define YYSTYPE   token_p

Typedef Documentation

◆ TOKEN

typedef struct token_t TOKEN

◆ token_p

typedef struct token_t* token_p

◆ VALUE

typedef struct value_t VALUE

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
V_NONE 
V_NUM 
V_NUM_REAL 
V_STR 
@ V_NUM
Definition config.h:31
@ V_NUM_REAL
Definition config.h:31
@ V_STR
Definition config.h:31
@ V_NONE
Definition config.h:31

Function Documentation

◆ dup_string()

char * dup_string ( const char *  str)
308{
309 char * s;
310
311 s = strdup(str);
312 if (s == NULL) {
313 yyerror("dup_string(): out of memory");
314 return NULL;
315 }
316
317 return s;
318}
int yyerror(char *errmsg,...)
Definition config.c:93

References yyerror().

Referenced by yyparse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_token()

void free_token ( TOKEN tkn)
146{
147 if (tkn) {
148 switch (tkn->value.type) {
149 case V_STR:
150 if (tkn->value.string)
151 free(tkn->value.string);
152 tkn->value.string = NULL;
153 break;
154 }
155
156 free(tkn);
157 }
158}
int type
Definition config.h:33
VALUE value
Definition config.h:44
char * string
Definition config.h:37
void free(void *)

References free(), value_t::string, value_t::type, V_STR, and token_t::value.

Referenced by assign_pin(), assign_pin_list(), cleanup_config(), free_tokens(), parse_cmdbits(), and yyparse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_tokens()

void free_tokens ( int  n,
  ... 
)
162{
163 TOKEN * t;
164 va_list ap;
165
166 va_start(ap, n);
167 while (n--) {
168 t = va_arg(ap, TOKEN *);
169 free_token(t);
170 }
171 va_end(ap);
172}
void free_token(TOKEN *tkn)
Definition config.c:145
Definition config.h:42

References free_token().

Referenced by yyparse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hexnumber()

TOKEN * hexnumber ( char *  text)
210{
211 struct token_t * tkn;
212 char * e;
213
214 tkn = new_token(TKN_NUMBER);
215 if (tkn == NULL) {
216 return NULL; /* yyerror already called */
217 }
218 tkn->value.type = V_NUM;
219 tkn->value.number = strtoul(text, &e, 16);
220 if ((e == text) || (*e != 0)) {
221 yyerror("can't scan hex number \"%s\"", text);
222 return NULL;
223 }
224
225#if DEBUG
226 avrdude_message(MSG_INFO, "HEXNUMBER(%g)\n", tkn->value.number);
227#endif
228
229 return tkn;
230}
#define MSG_INFO
Definition avrdude.h:51
int avrdude_message(const int msglvl, const char *format,...)
Definition main.c:93
TOKEN * new_token(int primary)
Definition config.c:127
int number
Definition config.h:35
#define TKN_NUMBER
Definition config_gram.c:398

References avrdude_message(), MSG_INFO, new_token(), value_t::number, TKN_NUMBER, value_t::type, V_NUM, token_t::value, and yyerror().

+ Here is the call graph for this function:

◆ keyword()

TOKEN * keyword ( int  primary)
262{
263 struct token_t * tkn;
264
265 tkn = new_token(primary);
266
267 return tkn;
268}
int primary
Definition config.h:43

References new_token(), and token_t::primary.

Referenced by Slic3r::GCode::do_export(), and Slic3r::GUI::Tab::validate_custom_gcode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ new_token()

TOKEN * new_token ( int  primary)
128{
129 TOKEN * tkn;
130
131 tkn = (TOKEN *)malloc(sizeof(TOKEN));
132 if (tkn == NULL) {
133 yyerror("new_token(): out of memory");
134 return NULL;
135 }
136
137 memset(tkn, 0, sizeof(TOKEN));
138
139 tkn->primary = primary;
140
141 return tkn;
142}
void * malloc(YYSIZE_T)

References malloc(), token_t::primary, and yyerror().

Referenced by hexnumber(), keyword(), number(), number_real(), and string().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ number()

TOKEN * number ( char *  text)
177{
178 struct token_t * tkn;
179
180 tkn = new_token(TKN_NUMBER);
181 if (tkn == NULL) {
182 return NULL; /* yyerror already called */
183 }
184 tkn->value.type = V_NUM;
185 tkn->value.number = atoi(text);
186
187#if DEBUG
188 avrdude_message(MSG_INFO, "NUMBER(%d)\n", tkn->value.number);
189#endif
190
191 return tkn;
192}

References avrdude_message(), MSG_INFO, new_token(), value_t::number, TKN_NUMBER, value_t::type, V_NUM, and token_t::value.

Referenced by Slic3r::anonymous_namespace{SL1_SVG.cpp}::decimal_from().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ number_real()

TOKEN * number_real ( char *  text)
195{
196 struct token_t * tkn;
197
198 tkn = new_token(TKN_NUMBER);
199 tkn->value.type = V_NUM_REAL;
200 tkn->value.number_real = atof(text);
201
202#if DEBUG
203 avrdude_message(MSG_INFO, "NUMBER(%g)\n", tkn->value.number_real);
204#endif
205
206 return tkn;
207}
double number_real
Definition config.h:36

References avrdude_message(), MSG_INFO, new_token(), value_t::number_real, TKN_NUMBER, value_t::type, V_NUM_REAL, and token_t::value.

+ Here is the call graph for this function:

◆ print_token()

void print_token ( TOKEN tkn)
272{
273 if (!tkn)
274 return;
275
276 avrdude_message(MSG_INFO, "token = %d = ", tkn->primary);
277 switch (tkn->value.type) {
278 case V_NUM:
279 avrdude_message(MSG_INFO, "NUMBER, value=%d", tkn->value.number);
280 break;
281
282 case V_NUM_REAL:
283 avrdude_message(MSG_INFO, "NUMBER, value=%g", tkn->value.number_real);
284 break;
285
286 case V_STR:
287 avrdude_message(MSG_INFO, "STRING, value=%s", tkn->value.string);
288 break;
289
290 default:
291 avrdude_message(MSG_INFO, "<other>");
292 break;
293 }
294
296}

References avrdude_message(), MSG_INFO, value_t::number, value_t::number_real, token_t::primary, value_t::string, value_t::type, V_NUM, V_NUM_REAL, V_STR, and token_t::value.

+ Here is the call graph for this function:

◆ pyytext()

void pyytext ( void  )
300{
301#if DEBUG
302 avrdude_message(MSG_INFO, "TOKEN: \"%s\"\n", yytext);
303#endif
304}
char * yytext
Definition lexer.c:956

◆ string()

TOKEN * string ( char *  text)
234{
235 struct token_t * tkn;
236 int len;
237
238 tkn = new_token(TKN_STRING);
239 if (tkn == NULL) {
240 return NULL; /* yyerror already called */
241 }
242
243 len = (int)strlen(text);
244
245 tkn->value.type = V_STR;
246 tkn->value.string = (char *) malloc(len+1);
247 if (tkn->value.string == NULL) {
248 yyerror("string(): out of memory");
249 return NULL;
250 }
251 strcpy(tkn->value.string, text);
252
253#if DEBUG
254 avrdude_message(MSG_INFO, "STRING(%s)\n", tkn->value.string);
255#endif
256
257 return tkn;
258}
#define TKN_STRING
Definition config_gram.c:400

References avrdude_message(), malloc(), MSG_INFO, new_token(), value_t::string, TKN_STRING, value_t::type, V_STR, token_t::value, and yyerror().

Referenced by Slic3r::client::macro_processor::macro_processor(), igl::readOFF(), and igl::readWRL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ yyerror()

int yyerror ( char *  errmsg,
  ... 
)
94{
95 va_list args;
96
97 char message[512];
98
99 va_start(args, errmsg);
100
101 vsnprintf(message, sizeof(message), errmsg, args);
102 avrdude_message(MSG_INFO, "%s: error at %s:%d: %s\n", progname, infile, lineno, message);
103
104 va_end(args);
105
106 return 0;
107}
char * progname
Definition main.c:61
const char * infile
Definition config.c:55
int lineno
Definition config.c:54

◆ yyparse()

int yyparse ( void  )
1577{
1578 int yystate;
1579 /* Number of tokens to shift before error messages enabled. */
1580 int yyerrstatus;
1581
1582 /* The stacks and their tools:
1583 'yyss': related to states.
1584 'yyvs': related to semantic values.
1585
1586 Refer to the stacks through separate pointers, to allow yyoverflow
1587 to reallocate them elsewhere. */
1588
1589 /* The state stack. */
1591 yytype_int16 *yyss;
1592 yytype_int16 *yyssp;
1593
1594 /* The semantic value stack. */
1595 YYSTYPE yyvsa[YYINITDEPTH];
1596 YYSTYPE *yyvs;
1597 YYSTYPE *yyvsp;
1598
1599 YYSIZE_T yystacksize;
1600
1601 int yyn;
1602 int yyresult;
1603 /* Lookahead token as an internal (translated) token number. */
1604 int yytoken = 0;
1605 /* The variables used to return semantic value and location from the
1606 action routines. */
1607 YYSTYPE yyval;
1608
1609#if YYERROR_VERBOSE
1610 /* Buffer for error messages, and its allocated size. */
1611 char yymsgbuf[128];
1612 char *yymsg = yymsgbuf;
1613 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1614#endif
1615
1616#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1617
1618 /* The number of symbols on the RHS of the reduced rule.
1619 Keep to zero when no symbol should be popped. */
1620 int yylen = 0;
1621
1622 yyssp = yyss = yyssa;
1623 yyvsp = yyvs = yyvsa;
1624 yystacksize = YYINITDEPTH;
1625
1626 YYDPRINTF ((stderr, "Starting parse\n"));
1627
1628 yystate = 0;
1629 yyerrstatus = 0;
1630 yynerrs = 0;
1631 yychar = YYEMPTY; /* Cause a token to be read. */
1632 goto yysetstate;
1633
1634/*------------------------------------------------------------.
1635| yynewstate -- Push a new state, which is found in yystate. |
1636`------------------------------------------------------------*/
1637 yynewstate:
1638 /* In all cases, when you get here, the value and location stacks
1639 have just been pushed. So pushing a state here evens the stacks. */
1640 yyssp++;
1641
1642 yysetstate:
1643 *yyssp = yystate;
1644
1645 if (yyss + yystacksize - 1 <= yyssp)
1646 {
1647 /* Get the current used size of the three stacks, in elements. */
1648 YYSIZE_T yysize = yyssp - yyss + 1;
1649
1650#ifdef yyoverflow
1651 {
1652 /* Give user a chance to reallocate the stack. Use copies of
1653 these so that the &'s don't force the real ones into
1654 memory. */
1655 YYSTYPE *yyvs1 = yyvs;
1656 yytype_int16 *yyss1 = yyss;
1657
1658 /* Each stack pointer address is followed by the size of the
1659 data in use in that stack, in bytes. This used to be a
1660 conditional around just the two extra args, but that might
1661 be undefined if yyoverflow is a macro. */
1662 yyoverflow (YY_("memory exhausted"),
1663 &yyss1, yysize * sizeof (*yyssp),
1664 &yyvs1, yysize * sizeof (*yyvsp),
1665 &yystacksize);
1666
1667 yyss = yyss1;
1668 yyvs = yyvs1;
1669 }
1670#else /* no yyoverflow */
1671# ifndef YYSTACK_RELOCATE
1672 goto yyexhaustedlab;
1673# else
1674 /* Extend the stack our own way. */
1675 if (YYMAXDEPTH <= yystacksize)
1676 goto yyexhaustedlab;
1677 yystacksize *= 2;
1678 if (YYMAXDEPTH < yystacksize)
1679 yystacksize = YYMAXDEPTH;
1680
1681 {
1682 yytype_int16 *yyss1 = yyss;
1683 union yyalloc *yyptr =
1684 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1685 if (! yyptr)
1686 goto yyexhaustedlab;
1689# undef YYSTACK_RELOCATE
1690 if (yyss1 != yyssa)
1691 YYSTACK_FREE (yyss1);
1692 }
1693# endif
1694#endif /* no yyoverflow */
1695
1696 yyssp = yyss + yysize - 1;
1697 yyvsp = yyvs + yysize - 1;
1698
1699 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1700 (unsigned long int) yystacksize));
1701
1702 if (yyss + yystacksize - 1 <= yyssp)
1703 YYABORT;
1704 }
1705
1706 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1707
1708 if (yystate == YYFINAL)
1709 YYACCEPT;
1710
1711 goto yybackup;
1712
1713/*-----------.
1714| yybackup. |
1715`-----------*/
1716yybackup:
1717
1718 /* Do appropriate processing given the current state. Read a
1719 lookahead token if we need one and don't already have one. */
1720
1721 /* First try to decide what to do without reference to lookahead token. */
1722 yyn = yypact[yystate];
1723 if (yypact_value_is_default (yyn))
1724 goto yydefault;
1725
1726 /* Not known => get a lookahead token if don't already have one. */
1727
1728 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1729 if (yychar == YYEMPTY)
1730 {
1731 YYDPRINTF ((stderr, "Reading a token: "));
1732 yychar = yylex ();
1733 }
1734
1735 if (yychar <= YYEOF)
1736 {
1737 yychar = yytoken = YYEOF;
1738 YYDPRINTF ((stderr, "Now at end of input.\n"));
1739 }
1740 else
1741 {
1742 yytoken = YYTRANSLATE (yychar);
1743 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1744 }
1745
1746 /* If the proper action on seeing token YYTOKEN is to reduce or to
1747 detect an error, take that action. */
1748 yyn += yytoken;
1749 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1750 goto yydefault;
1751 yyn = yytable[yyn];
1752 if (yyn <= 0)
1753 {
1754 if (yytable_value_is_error (yyn))
1755 goto yyerrlab;
1756 yyn = -yyn;
1757 goto yyreduce;
1758 }
1759
1760 /* Count tokens shifted since error; after three, turn off error
1761 status. */
1762 if (yyerrstatus)
1763 yyerrstatus--;
1764
1765 /* Shift the lookahead token. */
1766 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1767
1768 /* Discard the shifted token. */
1769 yychar = YYEMPTY;
1770
1771 yystate = yyn;
1773 *++yyvsp = yylval;
1775
1776 goto yynewstate;
1777
1778
1779/*-----------------------------------------------------------.
1780| yydefault -- do the default action for the current state. |
1781`-----------------------------------------------------------*/
1782yydefault:
1783 yyn = yydefact[yystate];
1784 if (yyn == 0)
1785 goto yyerrlab;
1786 goto yyreduce;
1787
1788
1789/*-----------------------------.
1790| yyreduce -- Do a reduction. |
1791`-----------------------------*/
1792yyreduce:
1793 /* yyn is the number of a rule to reduce with. */
1794 yylen = yyr2[yyn];
1795
1796 /* If YYLEN is nonzero, implement the default value of the action:
1797 '$$ = $1'.
1798
1799 Otherwise, the following line sets YYVAL to garbage.
1800 This behavior is undocumented and Bison
1801 users should not rely upon it. Assigning to YYVAL
1802 unconditionally makes the parser a bit smaller, and it avoids a
1803 GCC warning that YYVAL may be used uninitialized. */
1804 yyval = yyvsp[1-yylen];
1805
1806
1807 YY_REDUCE_PRINT (yyn);
1808 switch (yyn)
1809 {
1810 case 2:
1811#line 211 "config_gram.y" /* yacc.c:1646 */
1812 {
1813 (yyval) = (yyvsp[0]);
1814 /* convert value to real */
1815 (yyval)->value.number_real = (yyval)->value.number;
1816 (yyval)->value.type = V_NUM_REAL;
1817 }
1818#line 1819 "config_gram.c" /* yacc.c:1646 */
1819 break;
1820
1821 case 3:
1822#line 217 "config_gram.y" /* yacc.c:1646 */
1823 {
1824 (yyval) = (yyvsp[0]);
1825 }
1826#line 1827 "config_gram.c" /* yacc.c:1646 */
1827 break;
1828
1829 case 10:
1830#line 236 "config_gram.y" /* yacc.c:1646 */
1831 {
1832 strncpy(default_programmer, (yyvsp[-1])->value.string, MAX_STR_CONST);
1834 free_token((yyvsp[-1]));
1835 }
1836#line 1837 "config_gram.c" /* yacc.c:1646 */
1837 break;
1838
1839 case 11:
1840#line 242 "config_gram.y" /* yacc.c:1646 */
1841 {
1842 strncpy(default_parallel, (yyvsp[-1])->value.string, PATH_MAX);
1844 free_token((yyvsp[-1]));
1845 }
1846#line 1847 "config_gram.c" /* yacc.c:1646 */
1847 break;
1848
1849 case 12:
1850#line 248 "config_gram.y" /* yacc.c:1646 */
1851 {
1852 strncpy(default_serial, (yyvsp[-1])->value.string, PATH_MAX);
1853 default_serial[PATH_MAX-1] = 0;
1854 free_token((yyvsp[-1]));
1855 }
1856#line 1857 "config_gram.c" /* yacc.c:1646 */
1857 break;
1858
1859 case 13:
1860#line 254 "config_gram.y" /* yacc.c:1646 */
1861 {
1862 default_bitclock = (yyvsp[-1])->value.number_real;
1863 free_token((yyvsp[-1]));
1864 }
1865#line 1866 "config_gram.c" /* yacc.c:1646 */
1866 break;
1867
1868 case 14:
1869#line 259 "config_gram.y" /* yacc.c:1646 */
1870 {
1871 if ((yyvsp[-1])->primary == K_YES)
1872 default_safemode = 1;
1873 else if ((yyvsp[-1])->primary == K_NO)
1874 default_safemode = 0;
1875 free_token((yyvsp[-1]));
1876 }
1877#line 1878 "config_gram.c" /* yacc.c:1646 */
1878 break;
1879
1880 case 15:
1881#line 271 "config_gram.y" /* yacc.c:1646 */
1882 {
1883 PROGRAMMER * existing_prog;
1884 char * id;
1885 if (lsize(current_prog->id) == 0) {
1886 yyerror("required parameter id not specified");
1887 YYABORT;
1888 }
1889 if (current_prog->initpgm == NULL) {
1890 yyerror("programmer type not specified");
1891 YYABORT;
1892 }
1893 id = ldata(lfirst(current_prog->id));
1894 existing_prog = locate_programmer(programmers, id);
1895 if (existing_prog) {
1896 { /* temporarly set lineno to lineno of programmer start */
1897 int temp = lineno; lineno = current_prog->lineno;
1898 yywarning("programmer %s overwrites previous definition %s:%d.",
1899 id, existing_prog->config_file, existing_prog->lineno);
1900 lineno = temp;
1901 }
1902 lrmv_d(programmers, existing_prog);
1903 pgm_free(existing_prog);
1904 }
1906// pgm_fill_old_pins(current_prog); // TODO to be removed if old pin data no longer needed
1907// pgm_display_generic(current_prog, id);
1908 current_prog = NULL;
1909 }
1910#line 1911 "config_gram.c" /* yacc.c:1646 */
1911 break;
1912
1913 case 16:
1914#line 304 "config_gram.y" /* yacc.c:1646 */
1915 { current_prog = pgm_new();
1916 if (current_prog == NULL) {
1917 yyerror("could not create pgm instance");
1918 YYABORT;
1919 }
1922 }
1923#line 1924 "config_gram.c" /* yacc.c:1646 */
1924 break;
1925
1926 case 17:
1927#line 314 "config_gram.y" /* yacc.c:1646 */
1928 {
1929 struct programmer_t * pgm = locate_programmer(programmers, (yyvsp[0])->value.string);
1930 if (pgm == NULL) {
1931 yyerror("parent programmer %s not found", (yyvsp[0])->value.string);
1932 free_token((yyvsp[0]));
1933 YYABORT;
1934 }
1936 if (current_prog == NULL) {
1937 yyerror("could not duplicate pgm instance");
1938 free_token((yyvsp[0]));
1939 YYABORT;
1940 }
1943 free_token((yyvsp[0]));
1944 }
1945#line 1946 "config_gram.c" /* yacc.c:1646 */
1946 break;
1947
1948 case 18:
1949#line 336 "config_gram.y" /* yacc.c:1646 */
1950 {
1951 LNODEID ln;
1952 AVRMEM * m;
1953 AVRPART * existing_part;
1954
1955 if (current_part->id[0] == 0) {
1956 yyerror("required parameter id not specified");
1957 YYABORT;
1958 }
1959
1960 /*
1961 * perform some sanity checking, and compute the number of bits
1962 * to shift a page for constructing the page address for
1963 * page-addressed memories.
1964 */
1965 for (ln=lfirst(current_part->mem); ln; ln=lnext(ln)) {
1966 m = ldata(ln);
1967 if (m->paged) {
1968 if (m->page_size == 0) {
1969 yyerror("must specify page_size for paged memory");
1970 YYABORT;
1971 }
1972 if (m->num_pages == 0) {
1973 yyerror("must specify num_pages for paged memory");
1974 YYABORT;
1975 }
1976 if (m->size != m->page_size * m->num_pages) {
1977 yyerror("page size (%u) * num_pages (%u) = "
1978 "%u does not match memory size (%u)",
1979 m->page_size,
1980 m->num_pages,
1981 m->page_size * m->num_pages,
1982 m->size);
1983 YYABORT;
1984 }
1985
1986 }
1987 }
1988
1989 existing_part = locate_part(part_list, current_part->id);
1990 if (existing_part) {
1991 { /* temporarly set lineno to lineno of part start */
1992 int temp = lineno; lineno = current_part->lineno;
1993 yywarning("part %s overwrites previous definition %s:%d.",
1995 existing_part->config_file, existing_part->lineno);
1996 lineno = temp;
1997 }
1998 lrmv_d(part_list, existing_part);
1999 avr_free_part(existing_part);
2000 }
2002 current_part = NULL;
2003 }
2004#line 2005 "config_gram.c" /* yacc.c:1646 */
2005 break;
2006
2007 case 19:
2008#line 394 "config_gram.y" /* yacc.c:1646 */
2009 {
2011 if (current_part == NULL) {
2012 yyerror("could not create part instance");
2013 YYABORT;
2014 }
2017 }
2018#line 2019 "config_gram.c" /* yacc.c:1646 */
2019 break;
2020
2021 case 20:
2022#line 404 "config_gram.y" /* yacc.c:1646 */
2023 {
2024 AVRPART * parent_part = locate_part(part_list, (yyvsp[0])->value.string);
2025 if (parent_part == NULL) {
2026 yyerror("can't find parent part");
2027 free_token((yyvsp[0]));
2028 YYABORT;
2029 }
2030
2031 current_part = avr_dup_part(parent_part);
2032 if (current_part == NULL) {
2033 yyerror("could not duplicate part instance");
2034 free_token((yyvsp[0]));
2035 YYABORT;
2036 }
2039
2040 free_token((yyvsp[0]));
2041 }
2042#line 2043 "config_gram.c" /* yacc.c:1646 */
2043 break;
2044
2045 case 21:
2046#line 426 "config_gram.y" /* yacc.c:1646 */
2047 { ladd(string_list, (yyvsp[0])); }
2048#line 2049 "config_gram.c" /* yacc.c:1646 */
2049 break;
2050
2051 case 22:
2052#line 427 "config_gram.y" /* yacc.c:1646 */
2053 { ladd(string_list, (yyvsp[0])); }
2054#line 2055 "config_gram.c" /* yacc.c:1646 */
2055 break;
2056
2057 case 23:
2058#line 432 "config_gram.y" /* yacc.c:1646 */
2059 { ladd(number_list, (yyvsp[0])); }
2060#line 2061 "config_gram.c" /* yacc.c:1646 */
2061 break;
2062
2063 case 24:
2064#line 433 "config_gram.y" /* yacc.c:1646 */
2065 { ladd(number_list, (yyvsp[0])); }
2066#line 2067 "config_gram.c" /* yacc.c:1646 */
2067 break;
2068
2069 case 27:
2070#line 442 "config_gram.y" /* yacc.c:1646 */
2071 {
2072 {
2073 TOKEN * t;
2074 char *s;
2075 int do_yyabort = 0;
2076 while (lsize(string_list)) {
2077 t = lrmv_n(string_list, 1);
2078 if (!do_yyabort) {
2079 s = dup_string(t->value.string);
2080 if (s == NULL) {
2081 do_yyabort = 1;
2082 } else {
2083 ladd(current_prog->id, s);
2084 }
2085 }
2086 /* if do_yyabort == 1 just make the list empty */
2087 free_token(t);
2088 }
2089 if (do_yyabort) {
2090 YYABORT;
2091 }
2092 }
2093 }
2094#line 2095 "config_gram.c" /* yacc.c:1646 */
2095 break;
2096
2097 case 32:
2098#line 473 "config_gram.y" /* yacc.c:1646 */
2099 {
2100 strncpy(current_prog->desc, (yyvsp[0])->value.string, PGM_DESCLEN);
2102 free_token((yyvsp[0]));
2103 }
2104#line 2105 "config_gram.c" /* yacc.c:1646 */
2105 break;
2106
2107 case 33:
2108#line 478 "config_gram.y" /* yacc.c:1646 */
2109 {
2110 {
2111 current_prog->baudrate = (yyvsp[0])->value.number;
2112 free_token((yyvsp[0]));
2113 }
2114 }
2115#line 2116 "config_gram.c" /* yacc.c:1646 */
2116 break;
2117
2118 case 35:
2119#line 491 "config_gram.y" /* yacc.c:1646 */
2120 {
2121 const struct programmer_type_t * pgm_type = locate_programmer_type((yyvsp[0])->value.string);
2122 if (pgm_type == NULL) {
2123 yyerror("programmer type %s not found", (yyvsp[0])->value.string);
2124 free_token((yyvsp[0]));
2125 YYABORT;
2126 }
2127 current_prog->initpgm = pgm_type->initpgm;
2128 free_token((yyvsp[0]));
2129}
2130#line 2131 "config_gram.c" /* yacc.c:1646 */
2131 break;
2132
2133 case 36:
2134#line 502 "config_gram.y" /* yacc.c:1646 */
2135 {
2136 yyerror("programmer type must be written as \"id_type\"");
2137 YYABORT;
2138}
2139#line 2140 "config_gram.c" /* yacc.c:1646 */
2140 break;
2141
2142 case 38:
2143#line 513 "config_gram.y" /* yacc.c:1646 */
2145#line 2146 "config_gram.c" /* yacc.c:1646 */
2146 break;
2147
2148 case 39:
2149#line 514 "config_gram.y" /* yacc.c:1646 */
2151#line 2152 "config_gram.c" /* yacc.c:1646 */
2152 break;
2153
2154 case 40:
2155#line 515 "config_gram.y" /* yacc.c:1646 */
2157#line 2158 "config_gram.c" /* yacc.c:1646 */
2158 break;
2159
2160 case 41:
2161#line 519 "config_gram.y" /* yacc.c:1646 */
2162 {
2163 {
2164 strncpy(current_prog->usbdev, (yyvsp[0])->value.string, PGM_USBSTRINGLEN);
2166 free_token((yyvsp[0]));
2167 }
2168 }
2169#line 2170 "config_gram.c" /* yacc.c:1646 */
2170 break;
2171
2172 case 42:
2173#line 526 "config_gram.y" /* yacc.c:1646 */
2174 {
2175 {
2176 current_prog->usbvid = (yyvsp[0])->value.number;
2177 free_token((yyvsp[0]));
2178 }
2179 }
2180#line 2181 "config_gram.c" /* yacc.c:1646 */
2181 break;
2182
2183 case 44:
2184#line 533 "config_gram.y" /* yacc.c:1646 */
2185 {
2186 {
2187 strncpy(current_prog->usbsn, (yyvsp[0])->value.string, PGM_USBSTRINGLEN);
2189 free_token((yyvsp[0]));
2190 }
2191 }
2192#line 2193 "config_gram.c" /* yacc.c:1646 */
2193 break;
2194
2195 case 45:
2196#line 540 "config_gram.y" /* yacc.c:1646 */
2197 {
2198 {
2199 strncpy(current_prog->usbvendor, (yyvsp[0])->value.string, PGM_USBSTRINGLEN);
2201 free_token((yyvsp[0]));
2202 }
2203 }
2204#line 2205 "config_gram.c" /* yacc.c:1646 */
2205 break;
2206
2207 case 46:
2208#line 547 "config_gram.y" /* yacc.c:1646 */
2209 {
2210 {
2211 strncpy(current_prog->usbproduct, (yyvsp[0])->value.string, PGM_USBSTRINGLEN);
2213 free_token((yyvsp[0]));
2214 }
2215 }
2216#line 2217 "config_gram.c" /* yacc.c:1646 */
2217 break;
2218
2219 case 47:
2220#line 557 "config_gram.y" /* yacc.c:1646 */
2221 {
2222 {
2223 /* overwrite pids, so clear the existing entries */
2225 current_prog->usbpid = lcreat(NULL, 0);
2226 }
2227 {
2228 int *ip = malloc(sizeof(int));
2229 if (ip) {
2230 *ip = (yyvsp[0])->value.number;
2231 ladd(current_prog->usbpid, ip);
2232 }
2233 free_token((yyvsp[0]));
2234 }
2235 }
2236#line 2237 "config_gram.c" /* yacc.c:1646 */
2237 break;
2238
2239 case 48:
2240#line 572 "config_gram.y" /* yacc.c:1646 */
2241 {
2242 {
2243 int *ip = malloc(sizeof(int));
2244 if (ip) {
2245 *ip = (yyvsp[0])->value.number;
2246 ladd(current_prog->usbpid, ip);
2247 }
2248 free_token((yyvsp[0]));
2249 }
2250 }
2251#line 2252 "config_gram.c" /* yacc.c:1646 */
2252 break;
2253
2254 case 49:
2255#line 585 "config_gram.y" /* yacc.c:1646 */
2256 { if(0 != assign_pin(pin_name, (yyvsp[0]), 0)) YYABORT; }
2257#line 2258 "config_gram.c" /* yacc.c:1646 */
2258 break;
2259
2260 case 50:
2261#line 587 "config_gram.y" /* yacc.c:1646 */
2262 { if(0 != assign_pin(pin_name, (yyvsp[0]), 1)) YYABORT; }
2263#line 2264 "config_gram.c" /* yacc.c:1646 */
2264 break;
2265
2266 case 52:
2267#line 593 "config_gram.y" /* yacc.c:1646 */
2269#line 2270 "config_gram.c" /* yacc.c:1646 */
2270 break;
2271
2272 case 54:
2273#line 599 "config_gram.y" /* yacc.c:1646 */
2274 { if(0 != assign_pin_list(1)) YYABORT; }
2275#line 2276 "config_gram.c" /* yacc.c:1646 */
2276 break;
2277
2278 case 58:
2279#line 612 "config_gram.y" /* yacc.c:1646 */
2281#line 2282 "config_gram.c" /* yacc.c:1646 */
2282 break;
2283
2284 case 59:
2285#line 616 "config_gram.y" /* yacc.c:1646 */
2286 {pin_name = PPI_AVR_VCC; }
2287#line 2288 "config_gram.c" /* yacc.c:1646 */
2288 break;
2289
2290 case 61:
2291#line 617 "config_gram.y" /* yacc.c:1646 */
2293#line 2294 "config_gram.c" /* yacc.c:1646 */
2294 break;
2295
2296 case 63:
2297#line 618 "config_gram.y" /* yacc.c:1646 */
2299#line 2300 "config_gram.c" /* yacc.c:1646 */
2300 break;
2301
2302 case 64:
2303#line 618 "config_gram.y" /* yacc.c:1646 */
2304 { free_token((yyvsp[-3])); }
2305#line 2306 "config_gram.c" /* yacc.c:1646 */
2306 break;
2307
2308 case 65:
2309#line 619 "config_gram.y" /* yacc.c:1646 */
2310 {pin_name = PIN_AVR_SCK; }
2311#line 2312 "config_gram.c" /* yacc.c:1646 */
2312 break;
2313
2314 case 66:
2315#line 619 "config_gram.y" /* yacc.c:1646 */
2316 { free_token((yyvsp[-3])); }
2317#line 2318 "config_gram.c" /* yacc.c:1646 */
2318 break;
2319
2320 case 67:
2321#line 620 "config_gram.y" /* yacc.c:1646 */
2323#line 2324 "config_gram.c" /* yacc.c:1646 */
2324 break;
2325
2326 case 69:
2327#line 621 "config_gram.y" /* yacc.c:1646 */
2329#line 2330 "config_gram.c" /* yacc.c:1646 */
2330 break;
2331
2332 case 71:
2333#line 622 "config_gram.y" /* yacc.c:1646 */
2334 {pin_name = PIN_LED_ERR; }
2335#line 2336 "config_gram.c" /* yacc.c:1646 */
2336 break;
2337
2338 case 73:
2339#line 623 "config_gram.y" /* yacc.c:1646 */
2340 {pin_name = PIN_LED_RDY; }
2341#line 2342 "config_gram.c" /* yacc.c:1646 */
2342 break;
2343
2344 case 75:
2345#line 624 "config_gram.y" /* yacc.c:1646 */
2346 {pin_name = PIN_LED_PGM; }
2347#line 2348 "config_gram.c" /* yacc.c:1646 */
2348 break;
2349
2350 case 77:
2351#line 625 "config_gram.y" /* yacc.c:1646 */
2352 {pin_name = PIN_LED_VFY; }
2353#line 2354 "config_gram.c" /* yacc.c:1646 */
2354 break;
2355
2356 case 99:
2357#line 664 "config_gram.y" /* yacc.c:1646 */
2358 {
2359 strncpy(current_part->id, (yyvsp[0])->value.string, AVR_IDLEN);
2360 current_part->id[AVR_IDLEN-1] = 0;
2361 free_token((yyvsp[0]));
2362 }
2363#line 2364 "config_gram.c" /* yacc.c:1646 */
2364 break;
2365
2366 case 100:
2367#line 671 "config_gram.y" /* yacc.c:1646 */
2368 {
2369 strncpy(current_part->desc, (yyvsp[0])->value.string, AVR_DESCLEN);
2371 free_token((yyvsp[0]));
2372 }
2373#line 2374 "config_gram.c" /* yacc.c:1646 */
2374 break;
2375
2376 case 101:
2377#line 677 "config_gram.y" /* yacc.c:1646 */
2378 {
2379 {
2380 yyerror("devicecode is deprecated, use "
2381 "stk500_devcode instead");
2382 YYABORT;
2383 }
2384 }
2385#line 2386 "config_gram.c" /* yacc.c:1646 */
2386 break;
2387
2388 case 102:
2389#line 685 "config_gram.y" /* yacc.c:1646 */
2390 {
2391 {
2392 current_part->stk500_devcode = (yyvsp[0])->value.number;
2393 free_token((yyvsp[0]));
2394 }
2395 }
2396#line 2397 "config_gram.c" /* yacc.c:1646 */
2397 break;
2398
2399 case 103:
2400#line 692 "config_gram.y" /* yacc.c:1646 */
2401 {
2402 {
2403 current_part->avr910_devcode = (yyvsp[0])->value.number;
2404 free_token((yyvsp[0]));
2405 }
2406 }
2407#line 2408 "config_gram.c" /* yacc.c:1646 */
2408 break;
2409
2410 case 104:
2411#line 699 "config_gram.y" /* yacc.c:1646 */
2412 {
2413 {
2414 current_part->signature[0] = (yyvsp[-2])->value.number;
2415 current_part->signature[1] = (yyvsp[-1])->value.number;
2416 current_part->signature[2] = (yyvsp[0])->value.number;
2417 free_token((yyvsp[-2]));
2418 free_token((yyvsp[-1]));
2419 free_token((yyvsp[0]));
2420 }
2421 }
2422#line 2423 "config_gram.c" /* yacc.c:1646 */
2423 break;
2424
2425 case 105:
2426#line 710 "config_gram.y" /* yacc.c:1646 */
2427 {
2428 {
2429 current_part->usbpid = (yyvsp[0])->value.number;
2430 free_token((yyvsp[0]));
2431 }
2432 }
2433#line 2434 "config_gram.c" /* yacc.c:1646 */
2434 break;
2435
2436 case 106:
2437#line 717 "config_gram.y" /* yacc.c:1646 */
2438 {
2439 {
2440 TOKEN * t;
2441 unsigned nbytes;
2442 int ok;
2443
2445 nbytes = 0;
2446 ok = 1;
2447
2449 while (lsize(number_list)) {
2450 t = lrmv_n(number_list, 1);
2451 if (nbytes < CTL_STACK_SIZE)
2452 {
2453 current_part->controlstack[nbytes] = t->value.number;
2454 nbytes++;
2455 }
2456 else
2457 {
2458 ok = 0;
2459 }
2460 free_token(t);
2461 }
2462 if (!ok)
2463 {
2464 yywarning("too many bytes in control stack");
2465 }
2466 }
2467 }
2468#line 2469 "config_gram.c" /* yacc.c:1646 */
2469 break;
2470
2471 case 107:
2472#line 748 "config_gram.y" /* yacc.c:1646 */
2473 {
2474 {
2475 TOKEN * t;
2476 unsigned nbytes;
2477 int ok;
2478
2480 nbytes = 0;
2481 ok = 1;
2482
2484 while (lsize(number_list)) {
2485 t = lrmv_n(number_list, 1);
2486 if (nbytes < CTL_STACK_SIZE)
2487 {
2488 current_part->controlstack[nbytes] = t->value.number;
2489 nbytes++;
2490 }
2491 else
2492 {
2493 ok = 0;
2494 }
2495 free_token(t);
2496 }
2497 if (!ok)
2498 {
2499 yywarning("too many bytes in control stack");
2500 }
2501 }
2502 }
2503#line 2504 "config_gram.c" /* yacc.c:1646 */
2504 break;
2505
2506 case 108:
2507#line 779 "config_gram.y" /* yacc.c:1646 */
2508 {
2509 {
2510 TOKEN * t;
2511 unsigned nbytes;
2512 int ok;
2513
2514 nbytes = 0;
2515 ok = 1;
2516
2518 while (lsize(number_list)) {
2519 t = lrmv_n(number_list, 1);
2520 if (nbytes < FLASH_INSTR_SIZE)
2521 {
2522 current_part->flash_instr[nbytes] = t->value.number;
2523 nbytes++;
2524 }
2525 else
2526 {
2527 ok = 0;
2528 }
2529 free_token(t);
2530 }
2531 if (!ok)
2532 {
2533 yywarning("too many bytes in flash instructions");
2534 }
2535 }
2536 }
2537#line 2538 "config_gram.c" /* yacc.c:1646 */
2538 break;
2539
2540 case 109:
2541#line 809 "config_gram.y" /* yacc.c:1646 */
2542 {
2543 {
2544 TOKEN * t;
2545 unsigned nbytes;
2546 int ok;
2547
2548 nbytes = 0;
2549 ok = 1;
2550
2552 while (lsize(number_list)) {
2553 t = lrmv_n(number_list, 1);
2554 if (nbytes < EEPROM_INSTR_SIZE)
2555 {
2556 current_part->eeprom_instr[nbytes] = t->value.number;
2557 nbytes++;
2558 }
2559 else
2560 {
2561 ok = 0;
2562 }
2563 free_token(t);
2564 }
2565 if (!ok)
2566 {
2567 yywarning("too many bytes in EEPROM instructions");
2568 }
2569 }
2570 }
2571#line 2572 "config_gram.c" /* yacc.c:1646 */
2572 break;
2573
2574 case 110:
2575#line 840 "config_gram.y" /* yacc.c:1646 */
2576 {
2577 current_part->chip_erase_delay = (yyvsp[0])->value.number;
2578 free_token((yyvsp[0]));
2579 }
2580#line 2581 "config_gram.c" /* yacc.c:1646 */
2581 break;
2582
2583 case 111:
2584#line 846 "config_gram.y" /* yacc.c:1646 */
2585 {
2586 current_part->pagel = (yyvsp[0])->value.number;
2587 free_token((yyvsp[0]));
2588 }
2589#line 2590 "config_gram.c" /* yacc.c:1646 */
2590 break;
2591
2592 case 112:
2593#line 852 "config_gram.y" /* yacc.c:1646 */
2594 {
2595 current_part->bs2 = (yyvsp[0])->value.number;
2596 free_token((yyvsp[0]));
2597 }
2598#line 2599 "config_gram.c" /* yacc.c:1646 */
2599 break;
2600
2601 case 113:
2602#line 858 "config_gram.y" /* yacc.c:1646 */
2603 {
2604 if ((yyvsp[0])->primary == K_DEDICATED)
2606 else if ((yyvsp[0])->primary == K_IO)
2608
2609 free_tokens(2, (yyvsp[-2]), (yyvsp[0]));
2610 }
2611#line 2612 "config_gram.c" /* yacc.c:1646 */
2612 break;
2613
2614 case 114:
2615#line 868 "config_gram.y" /* yacc.c:1646 */
2616 {
2617 current_part->timeout = (yyvsp[0])->value.number;
2618 free_token((yyvsp[0]));
2619 }
2620#line 2621 "config_gram.c" /* yacc.c:1646 */
2621 break;
2622
2623 case 115:
2624#line 874 "config_gram.y" /* yacc.c:1646 */
2625 {
2626 current_part->stabdelay = (yyvsp[0])->value.number;
2627 free_token((yyvsp[0]));
2628 }
2629#line 2630 "config_gram.c" /* yacc.c:1646 */
2630 break;
2631
2632 case 116:
2633#line 880 "config_gram.y" /* yacc.c:1646 */
2634 {
2635 current_part->cmdexedelay = (yyvsp[0])->value.number;
2636 free_token((yyvsp[0]));
2637 }
2638#line 2639 "config_gram.c" /* yacc.c:1646 */
2639 break;
2640
2641 case 117:
2642#line 886 "config_gram.y" /* yacc.c:1646 */
2643 {
2644 current_part->hvspcmdexedelay = (yyvsp[0])->value.number;
2645 free_token((yyvsp[0]));
2646 }
2647#line 2648 "config_gram.c" /* yacc.c:1646 */
2648 break;
2649
2650 case 118:
2651#line 892 "config_gram.y" /* yacc.c:1646 */
2652 {
2653 current_part->synchloops = (yyvsp[0])->value.number;
2654 free_token((yyvsp[0]));
2655 }
2656#line 2657 "config_gram.c" /* yacc.c:1646 */
2657 break;
2658
2659 case 119:
2660#line 898 "config_gram.y" /* yacc.c:1646 */
2661 {
2662 current_part->bytedelay = (yyvsp[0])->value.number;
2663 free_token((yyvsp[0]));
2664 }
2665#line 2666 "config_gram.c" /* yacc.c:1646 */
2666 break;
2667
2668 case 120:
2669#line 904 "config_gram.y" /* yacc.c:1646 */
2670 {
2671 current_part->pollvalue = (yyvsp[0])->value.number;
2672 free_token((yyvsp[0]));
2673 }
2674#line 2675 "config_gram.c" /* yacc.c:1646 */
2675 break;
2676
2677 case 121:
2678#line 910 "config_gram.y" /* yacc.c:1646 */
2679 {
2680 current_part->pollindex = (yyvsp[0])->value.number;
2681 free_token((yyvsp[0]));
2682 }
2683#line 2684 "config_gram.c" /* yacc.c:1646 */
2684 break;
2685
2686 case 122:
2687#line 916 "config_gram.y" /* yacc.c:1646 */
2688 {
2689 current_part->predelay = (yyvsp[0])->value.number;
2690 free_token((yyvsp[0]));
2691 }
2692#line 2693 "config_gram.c" /* yacc.c:1646 */
2693 break;
2694
2695 case 123:
2696#line 922 "config_gram.y" /* yacc.c:1646 */
2697 {
2698 current_part->postdelay = (yyvsp[0])->value.number;
2699 free_token((yyvsp[0]));
2700 }
2701#line 2702 "config_gram.c" /* yacc.c:1646 */
2702 break;
2703
2704 case 124:
2705#line 928 "config_gram.y" /* yacc.c:1646 */
2706 {
2707 current_part->pollmethod = (yyvsp[0])->value.number;
2708 free_token((yyvsp[0]));
2709 }
2710#line 2711 "config_gram.c" /* yacc.c:1646 */
2711 break;
2712
2713 case 125:
2714#line 934 "config_gram.y" /* yacc.c:1646 */
2715 {
2716 current_part->hventerstabdelay = (yyvsp[0])->value.number;
2717 free_token((yyvsp[0]));
2718 }
2719#line 2720 "config_gram.c" /* yacc.c:1646 */
2720 break;
2721
2722 case 126:
2723#line 940 "config_gram.y" /* yacc.c:1646 */
2724 {
2725 current_part->progmodedelay = (yyvsp[0])->value.number;
2726 free_token((yyvsp[0]));
2727 }
2728#line 2729 "config_gram.c" /* yacc.c:1646 */
2729 break;
2730
2731 case 127:
2732#line 946 "config_gram.y" /* yacc.c:1646 */
2733 {
2734 current_part->latchcycles = (yyvsp[0])->value.number;
2735 free_token((yyvsp[0]));
2736 }
2737#line 2738 "config_gram.c" /* yacc.c:1646 */
2738 break;
2739
2740 case 128:
2741#line 952 "config_gram.y" /* yacc.c:1646 */
2742 {
2743 current_part->togglevtg = (yyvsp[0])->value.number;
2744 free_token((yyvsp[0]));
2745 }
2746#line 2747 "config_gram.c" /* yacc.c:1646 */
2747 break;
2748
2749 case 129:
2750#line 958 "config_gram.y" /* yacc.c:1646 */
2751 {
2752 current_part->poweroffdelay = (yyvsp[0])->value.number;
2753 free_token((yyvsp[0]));
2754 }
2755#line 2756 "config_gram.c" /* yacc.c:1646 */
2756 break;
2757
2758 case 130:
2759#line 964 "config_gram.y" /* yacc.c:1646 */
2760 {
2761 current_part->resetdelayms = (yyvsp[0])->value.number;
2762 free_token((yyvsp[0]));
2763 }
2764#line 2765 "config_gram.c" /* yacc.c:1646 */
2765 break;
2766
2767 case 131:
2768#line 970 "config_gram.y" /* yacc.c:1646 */
2769 {
2770 current_part->resetdelayus = (yyvsp[0])->value.number;
2771 free_token((yyvsp[0]));
2772 }
2773#line 2774 "config_gram.c" /* yacc.c:1646 */
2774 break;
2775
2776 case 132:
2777#line 976 "config_gram.y" /* yacc.c:1646 */
2778 {
2779 current_part->hvleavestabdelay = (yyvsp[0])->value.number;
2780 free_token((yyvsp[0]));
2781 }
2782#line 2783 "config_gram.c" /* yacc.c:1646 */
2783 break;
2784
2785 case 133:
2786#line 982 "config_gram.y" /* yacc.c:1646 */
2787 {
2788 current_part->resetdelay = (yyvsp[0])->value.number;
2789 free_token((yyvsp[0]));
2790 }
2791#line 2792 "config_gram.c" /* yacc.c:1646 */
2792 break;
2793
2794 case 134:
2795#line 988 "config_gram.y" /* yacc.c:1646 */
2796 {
2797 current_part->chiperasepulsewidth = (yyvsp[0])->value.number;
2798 free_token((yyvsp[0]));
2799 }
2800#line 2801 "config_gram.c" /* yacc.c:1646 */
2801 break;
2802
2803 case 135:
2804#line 994 "config_gram.y" /* yacc.c:1646 */
2805 {
2806 current_part->chiperasepolltimeout = (yyvsp[0])->value.number;
2807 free_token((yyvsp[0]));
2808 }
2809#line 2810 "config_gram.c" /* yacc.c:1646 */
2810 break;
2811
2812 case 136:
2813#line 1000 "config_gram.y" /* yacc.c:1646 */
2814 {
2815 current_part->chiperasetime = (yyvsp[0])->value.number;
2816 free_token((yyvsp[0]));
2817 }
2818#line 2819 "config_gram.c" /* yacc.c:1646 */
2819 break;
2820
2821 case 137:
2822#line 1006 "config_gram.y" /* yacc.c:1646 */
2823 {
2824 current_part->programfusepulsewidth = (yyvsp[0])->value.number;
2825 free_token((yyvsp[0]));
2826 }
2827#line 2828 "config_gram.c" /* yacc.c:1646 */
2828 break;
2829
2830 case 138:
2831#line 1012 "config_gram.y" /* yacc.c:1646 */
2832 {
2833 current_part->programfusepolltimeout = (yyvsp[0])->value.number;
2834 free_token((yyvsp[0]));
2835 }
2836#line 2837 "config_gram.c" /* yacc.c:1646 */
2837 break;
2838
2839 case 139:
2840#line 1018 "config_gram.y" /* yacc.c:1646 */
2841 {
2842 current_part->programlockpulsewidth = (yyvsp[0])->value.number;
2843 free_token((yyvsp[0]));
2844 }
2845#line 2846 "config_gram.c" /* yacc.c:1646 */
2846 break;
2847
2848 case 140:
2849#line 1024 "config_gram.y" /* yacc.c:1646 */
2850 {
2851 current_part->programlockpolltimeout = (yyvsp[0])->value.number;
2852 free_token((yyvsp[0]));
2853 }
2854#line 2855 "config_gram.c" /* yacc.c:1646 */
2855 break;
2856
2857 case 141:
2858#line 1030 "config_gram.y" /* yacc.c:1646 */
2859 {
2860 current_part->synchcycles = (yyvsp[0])->value.number;
2861 free_token((yyvsp[0]));
2862 }
2863#line 2864 "config_gram.c" /* yacc.c:1646 */
2864 break;
2865
2866 case 142:
2867#line 1036 "config_gram.y" /* yacc.c:1646 */
2868 {
2869 if ((yyvsp[0])->primary == K_YES)
2871 else if ((yyvsp[0])->primary == K_NO)
2872 current_part->flags &= ~AVRPART_HAS_JTAG;
2873
2874 free_token((yyvsp[0]));
2875 }
2876#line 2877 "config_gram.c" /* yacc.c:1646 */
2877 break;
2878
2879 case 143:
2880#line 1046 "config_gram.y" /* yacc.c:1646 */
2881 {
2882 if ((yyvsp[0])->primary == K_YES)
2884 else if ((yyvsp[0])->primary == K_NO)
2885 current_part->flags &= ~AVRPART_HAS_DW;
2886
2887 free_token((yyvsp[0]));
2888 }
2889#line 2890 "config_gram.c" /* yacc.c:1646 */
2890 break;
2891
2892 case 144:
2893#line 1056 "config_gram.y" /* yacc.c:1646 */
2894 {
2895 if ((yyvsp[0])->primary == K_YES)
2897 else if ((yyvsp[0])->primary == K_NO)
2898 current_part->flags &= ~AVRPART_HAS_PDI;
2899
2900 free_token((yyvsp[0]));
2901 }
2902#line 2903 "config_gram.c" /* yacc.c:1646 */
2903 break;
2904
2905 case 145:
2906#line 1066 "config_gram.y" /* yacc.c:1646 */
2907 {
2908 if ((yyvsp[0])->primary == K_YES)
2910 else if ((yyvsp[0])->primary == K_NO)
2911 current_part->flags &= ~AVRPART_HAS_TPI;
2912
2913 free_token((yyvsp[0]));
2914 }
2915#line 2916 "config_gram.c" /* yacc.c:1646 */
2916 break;
2917
2918 case 146:
2919#line 1076 "config_gram.y" /* yacc.c:1646 */
2920 {
2921 if ((yyvsp[0])->primary == K_YES)
2923 else if ((yyvsp[0])->primary == K_NO)
2924 current_part->flags &= ~AVRPART_IS_AT90S1200;
2925
2926 free_token((yyvsp[0]));
2927 }
2928#line 2929 "config_gram.c" /* yacc.c:1646 */
2929 break;
2930
2931 case 147:
2932#line 1086 "config_gram.y" /* yacc.c:1646 */
2933 {
2934 if ((yyvsp[0])->primary == K_YES)
2936 else if ((yyvsp[0])->primary == K_NO)
2937 current_part->flags &= ~AVRPART_AVR32;
2938
2939 free_token((yyvsp[0]));
2940 }
2941#line 2942 "config_gram.c" /* yacc.c:1646 */
2942 break;
2943
2944 case 148:
2945#line 1096 "config_gram.y" /* yacc.c:1646 */
2946 {
2947 if ((yyvsp[0])->primary == K_YES)
2949 else if ((yyvsp[0])->primary == K_NO)
2950 current_part->flags &= ~AVRPART_ALLOWFULLPAGEBITSTREAM;
2951
2952 free_token((yyvsp[0]));
2953 }
2954#line 2955 "config_gram.c" /* yacc.c:1646 */
2955 break;
2956
2957 case 149:
2958#line 1106 "config_gram.y" /* yacc.c:1646 */
2959 {
2960 if ((yyvsp[0])->primary == K_YES)
2962 else if ((yyvsp[0])->primary == K_NO)
2963 current_part->flags &= ~AVRPART_ENABLEPAGEPROGRAMMING;
2964
2965 free_token((yyvsp[0]));
2966 }
2967#line 2968 "config_gram.c" /* yacc.c:1646 */
2968 break;
2969
2970 case 150:
2971#line 1116 "config_gram.y" /* yacc.c:1646 */
2972 {
2973 current_part->idr = (yyvsp[0])->value.number;
2974 free_token((yyvsp[0]));
2975 }
2976#line 2977 "config_gram.c" /* yacc.c:1646 */
2977 break;
2978
2979 case 151:
2980#line 1122 "config_gram.y" /* yacc.c:1646 */
2981 {
2982 current_part->rampz = (yyvsp[0])->value.number;
2983 free_token((yyvsp[0]));
2984 }
2985#line 2986 "config_gram.c" /* yacc.c:1646 */
2986 break;
2987
2988 case 152:
2989#line 1128 "config_gram.y" /* yacc.c:1646 */
2990 {
2991 current_part->spmcr = (yyvsp[0])->value.number;
2992 free_token((yyvsp[0]));
2993 }
2994#line 2995 "config_gram.c" /* yacc.c:1646 */
2995 break;
2996
2997 case 153:
2998#line 1134 "config_gram.y" /* yacc.c:1646 */
2999 {
3000 current_part->eecr = (yyvsp[0])->value.number;
3001 free_token((yyvsp[0]));
3002 }
3003#line 3004 "config_gram.c" /* yacc.c:1646 */
3004 break;
3005
3006 case 154:
3007#line 1140 "config_gram.y" /* yacc.c:1646 */
3008 {
3009 current_part->mcu_base = (yyvsp[0])->value.number;
3010 free_token((yyvsp[0]));
3011 }
3012#line 3013 "config_gram.c" /* yacc.c:1646 */
3013 break;
3014
3015 case 155:
3016#line 1146 "config_gram.y" /* yacc.c:1646 */
3017 {
3018 current_part->nvm_base = (yyvsp[0])->value.number;
3019 free_token((yyvsp[0]));
3020 }
3021#line 3022 "config_gram.c" /* yacc.c:1646 */
3022 break;
3023
3024 case 156:
3025#line 1152 "config_gram.y" /* yacc.c:1646 */
3026 {
3027 current_part->ocdrev = (yyvsp[0])->value.number;
3028 free_token((yyvsp[0]));
3029 }
3030#line 3031 "config_gram.c" /* yacc.c:1646 */
3031 break;
3032
3033 case 157:
3034#line 1158 "config_gram.y" /* yacc.c:1646 */
3035 {
3036 if ((yyvsp[0])->primary == K_YES)
3038 else if ((yyvsp[0])->primary == K_NO)
3039 current_part->flags &= ~AVRPART_SERIALOK;
3040
3041 free_token((yyvsp[0]));
3042 }
3043#line 3044 "config_gram.c" /* yacc.c:1646 */
3044 break;
3045
3046 case 158:
3047#line 1168 "config_gram.y" /* yacc.c:1646 */
3048 {
3049 if ((yyvsp[0])->primary == K_YES) {
3051 current_part->flags &= ~AVRPART_PSEUDOPARALLEL;
3052 }
3053 else if ((yyvsp[0])->primary == K_NO) {
3054 current_part->flags &= ~AVRPART_PARALLELOK;
3055 current_part->flags &= ~AVRPART_PSEUDOPARALLEL;
3056 }
3057 else if ((yyvsp[0])->primary == K_PSEUDO) {
3060 }
3061
3062
3063 free_token((yyvsp[0]));
3064 }
3065#line 3066 "config_gram.c" /* yacc.c:1646 */
3066 break;
3067
3068 case 159:
3069#line 1187 "config_gram.y" /* yacc.c:1646 */
3070 {
3071 switch ((yyvsp[0])->primary) {
3072 case K_RESET :
3074 break;
3075 case K_SCK :
3077 break;
3078 }
3079
3080 free_token((yyvsp[-2]));
3081 }
3082#line 3083 "config_gram.c" /* yacc.c:1646 */
3083 break;
3084
3085 case 160:
3086#line 1210 "config_gram.y" /* yacc.c:1646 */
3087 {
3089 if (current_mem == NULL) {
3090 yyerror("could not create mem instance");
3091 free_token((yyvsp[0]));
3092 YYABORT;
3093 }
3094 strncpy(current_mem->desc, (yyvsp[0])->value.string, AVR_MEMDESCLEN);
3096 free_token((yyvsp[0]));
3097 }
3098#line 3099 "config_gram.c" /* yacc.c:1646 */
3099 break;
3100
3101 case 161:
3102#line 1222 "config_gram.y" /* yacc.c:1646 */
3103 {
3104 AVRMEM * existing_mem;
3105
3106 existing_mem = avr_locate_mem(current_part, current_mem->desc);
3107 if (existing_mem != NULL) {
3108 lrmv_d(current_part->mem, existing_mem);
3109 avr_free_mem(existing_mem);
3110 }
3112 current_mem = NULL;
3113 }
3114#line 3115 "config_gram.c" /* yacc.c:1646 */
3115 break;
3116
3117 case 162:
3118#line 1234 "config_gram.y" /* yacc.c:1646 */
3119 {
3120 {
3121 int opnum;
3122 OPCODE * op;
3123
3124 opnum = which_opcode((yyvsp[-2]));
3125 if (opnum < 0) YYABORT;
3126 op = avr_new_opcode();
3127 if (op == NULL) {
3128 yyerror("could not create opcode instance");
3129 free_token((yyvsp[-2]));
3130 YYABORT;
3131 }
3132 if(0 != parse_cmdbits(op)) YYABORT;
3133 if (current_part->op[opnum] != NULL) {
3134 /*yywarning("operation redefined");*/
3136 }
3137 current_part->op[opnum] = op;
3138
3139 free_token((yyvsp[-2]));
3140 }
3141 }
3142#line 3143 "config_gram.c" /* yacc.c:1646 */
3143 break;
3144
3145 case 167:
3146#line 1273 "config_gram.y" /* yacc.c:1646 */
3147 {
3148 current_mem->paged = (yyvsp[0])->primary == K_YES ? 1 : 0;
3149 free_token((yyvsp[0]));
3150 }
3151#line 3152 "config_gram.c" /* yacc.c:1646 */
3152 break;
3153
3154 case 168:
3155#line 1279 "config_gram.y" /* yacc.c:1646 */
3156 {
3157 current_mem->size = (yyvsp[0])->value.number;
3158 free_token((yyvsp[0]));
3159 }
3160#line 3161 "config_gram.c" /* yacc.c:1646 */
3161 break;
3162
3163 case 169:
3164#line 1286 "config_gram.y" /* yacc.c:1646 */
3165 {
3166 current_mem->page_size = (yyvsp[0])->value.number;
3167 free_token((yyvsp[0]));
3168 }
3169#line 3170 "config_gram.c" /* yacc.c:1646 */
3170 break;
3171
3172 case 170:
3173#line 1292 "config_gram.y" /* yacc.c:1646 */
3174 {
3175 current_mem->num_pages = (yyvsp[0])->value.number;
3176 free_token((yyvsp[0]));
3177 }
3178#line 3179 "config_gram.c" /* yacc.c:1646 */
3179 break;
3180
3181 case 171:
3182#line 1298 "config_gram.y" /* yacc.c:1646 */
3183 {
3184 current_mem->offset = (yyvsp[0])->value.number;
3185 free_token((yyvsp[0]));
3186 }
3187#line 3188 "config_gram.c" /* yacc.c:1646 */
3188 break;
3189
3190 case 172:
3191#line 1304 "config_gram.y" /* yacc.c:1646 */
3192 {
3193 current_mem->min_write_delay = (yyvsp[0])->value.number;
3194 free_token((yyvsp[0]));
3195 }
3196#line 3197 "config_gram.c" /* yacc.c:1646 */
3197 break;
3198
3199 case 173:
3200#line 1310 "config_gram.y" /* yacc.c:1646 */
3201 {
3202 current_mem->max_write_delay = (yyvsp[0])->value.number;
3203 free_token((yyvsp[0]));
3204 }
3205#line 3206 "config_gram.c" /* yacc.c:1646 */
3206 break;
3207
3208 case 174:
3209#line 1316 "config_gram.y" /* yacc.c:1646 */
3210 {
3211 current_mem->pwroff_after_write = (yyvsp[0])->primary == K_YES ? 1 : 0;
3212 free_token((yyvsp[0]));
3213 }
3214#line 3215 "config_gram.c" /* yacc.c:1646 */
3215 break;
3216
3217 case 175:
3218#line 1322 "config_gram.y" /* yacc.c:1646 */
3219 {
3220 current_mem->readback[0] = (yyvsp[0])->value.number;
3221 free_token((yyvsp[0]));
3222 }
3223#line 3224 "config_gram.c" /* yacc.c:1646 */
3224 break;
3225
3226 case 176:
3227#line 1328 "config_gram.y" /* yacc.c:1646 */
3228 {
3229 current_mem->readback[1] = (yyvsp[0])->value.number;
3230 free_token((yyvsp[0]));
3231 }
3232#line 3233 "config_gram.c" /* yacc.c:1646 */
3233 break;
3234
3235 case 177:
3236#line 1335 "config_gram.y" /* yacc.c:1646 */
3237 {
3238 current_mem->mode = (yyvsp[0])->value.number;
3239 free_token((yyvsp[0]));
3240 }
3241#line 3242 "config_gram.c" /* yacc.c:1646 */
3242 break;
3243
3244 case 178:
3245#line 1341 "config_gram.y" /* yacc.c:1646 */
3246 {
3247 current_mem->delay = (yyvsp[0])->value.number;
3248 free_token((yyvsp[0]));
3249 }
3250#line 3251 "config_gram.c" /* yacc.c:1646 */
3251 break;
3252
3253 case 179:
3254#line 1347 "config_gram.y" /* yacc.c:1646 */
3255 {
3256 current_mem->blocksize = (yyvsp[0])->value.number;
3257 free_token((yyvsp[0]));
3258 }
3259#line 3260 "config_gram.c" /* yacc.c:1646 */
3260 break;
3261
3262 case 180:
3263#line 1353 "config_gram.y" /* yacc.c:1646 */
3264 {
3265 current_mem->readsize = (yyvsp[0])->value.number;
3266 free_token((yyvsp[0]));
3267 }
3268#line 3269 "config_gram.c" /* yacc.c:1646 */
3269 break;
3270
3271 case 181:
3272#line 1359 "config_gram.y" /* yacc.c:1646 */
3273 {
3274 current_mem->pollindex = (yyvsp[0])->value.number;
3275 free_token((yyvsp[0]));
3276 }
3277#line 3278 "config_gram.c" /* yacc.c:1646 */
3278 break;
3279
3280 case 182:
3281#line 1365 "config_gram.y" /* yacc.c:1646 */
3282 {
3283 {
3284 int opnum;
3285 OPCODE * op;
3286
3287 opnum = which_opcode((yyvsp[-2]));
3288 if (opnum < 0) YYABORT;
3289 op = avr_new_opcode();
3290 if (op == NULL) {
3291 yyerror("could not create opcode instance");
3292 free_token((yyvsp[-2]));
3293 YYABORT;
3294 }
3295 if(0 != parse_cmdbits(op)) YYABORT;
3296 if (current_mem->op[opnum] != NULL) {
3297 /*yywarning("operation redefined");*/
3299 }
3300 current_mem->op[opnum] = op;
3301
3302 free_token((yyvsp[-2]));
3303 }
3304 }
3305#line 3306 "config_gram.c" /* yacc.c:1646 */
3306 break;
3307
3308
3309#line 3310 "config_gram.c" /* yacc.c:1646 */
3310 default: break;
3311 }
3312 /* User semantic actions sometimes alter yychar, and that requires
3313 that yytoken be updated with the new translation. We take the
3314 approach of translating immediately before every use of yytoken.
3315 One alternative is translating here after every semantic action,
3316 but that translation would be missed if the semantic action invokes
3317 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3318 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3319 incorrect destructor might then be invoked immediately. In the
3320 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3321 to an incorrect destructor call or verbose syntax error message
3322 before the lookahead is translated. */
3323 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3324
3325 YYPOPSTACK (yylen);
3326 yylen = 0;
3327 YY_STACK_PRINT (yyss, yyssp);
3328
3329 *++yyvsp = yyval;
3330
3331 /* Now 'shift' the result of the reduction. Determine what state
3332 that goes to, based on the state we popped back to and the rule
3333 number reduced by. */
3334
3335 yyn = yyr1[yyn];
3336
3337 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3338 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3339 yystate = yytable[yystate];
3340 else
3341 yystate = yydefgoto[yyn - YYNTOKENS];
3342
3343 goto yynewstate;
3344
3345
3346/*--------------------------------------.
3347| yyerrlab -- here on detecting error. |
3348`--------------------------------------*/
3349yyerrlab:
3350 /* Make sure we have latest lookahead translation. See comments at
3351 user semantic actions for why this is necessary. */
3352 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3353
3354 /* If not already recovering from an error, report this error. */
3355 if (!yyerrstatus)
3356 {
3357 ++yynerrs;
3358#if ! YYERROR_VERBOSE
3359 yyerror (YY_("syntax error"));
3360#else
3361# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3362 yyssp, yytoken)
3363 {
3364 char const *yymsgp = YY_("syntax error");
3365 int yysyntax_error_status;
3366 yysyntax_error_status = YYSYNTAX_ERROR;
3367 if (yysyntax_error_status == 0)
3368 yymsgp = yymsg;
3369 else if (yysyntax_error_status == 1)
3370 {
3371 if (yymsg != yymsgbuf)
3372 YYSTACK_FREE (yymsg);
3373 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3374 if (!yymsg)
3375 {
3376 yymsg = yymsgbuf;
3377 yymsg_alloc = sizeof yymsgbuf;
3378 yysyntax_error_status = 2;
3379 }
3380 else
3381 {
3382 yysyntax_error_status = YYSYNTAX_ERROR;
3383 yymsgp = yymsg;
3384 }
3385 }
3386 yyerror (yymsgp);
3387 if (yysyntax_error_status == 2)
3388 goto yyexhaustedlab;
3389 }
3390# undef YYSYNTAX_ERROR
3391#endif
3392 }
3393
3394
3395
3396 if (yyerrstatus == 3)
3397 {
3398 /* If just tried and failed to reuse lookahead token after an
3399 error, discard it. */
3400
3401 if (yychar <= YYEOF)
3402 {
3403 /* Return failure if at end of input. */
3404 if (yychar == YYEOF)
3405 YYABORT;
3406 }
3407 else
3408 {
3409 yydestruct ("Error: discarding",
3410 yytoken, &yylval);
3411 yychar = YYEMPTY;
3412 }
3413 }
3414
3415 /* Else will try to reuse lookahead token after shifting the error
3416 token. */
3417 goto yyerrlab1;
3418
3419
3420/*---------------------------------------------------.
3421| yyerrorlab -- error raised explicitly by YYERROR. |
3422`---------------------------------------------------*/
3423yyerrorlab:
3424
3425 /* Pacify compilers like GCC when the user code never invokes
3426 YYERROR and the label yyerrorlab therefore never appears in user
3427 code. */
3428 if (/*CONSTCOND*/ 0)
3429 goto yyerrorlab;
3430
3431 /* Do not reclaim the symbols of the rule whose action triggered
3432 this YYERROR. */
3433 YYPOPSTACK (yylen);
3434 yylen = 0;
3435 YY_STACK_PRINT (yyss, yyssp);
3436 yystate = *yyssp;
3437 goto yyerrlab1;
3438
3439
3440/*-------------------------------------------------------------.
3441| yyerrlab1 -- common code for both syntax error and YYERROR. |
3442`-------------------------------------------------------------*/
3443yyerrlab1:
3444 yyerrstatus = 3; /* Each real token shifted decrements this. */
3445
3446 for (;;)
3447 {
3448 yyn = yypact[yystate];
3449 if (!yypact_value_is_default (yyn))
3450 {
3451 yyn += YYTERROR;
3452 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3453 {
3454 yyn = yytable[yyn];
3455 if (0 < yyn)
3456 break;
3457 }
3458 }
3459
3460 /* Pop the current state because it cannot handle the error token. */
3461 if (yyssp == yyss)
3462 YYABORT;
3463
3464
3465 yydestruct ("Error: popping",
3466 yystos[yystate], yyvsp);
3467 YYPOPSTACK (1);
3468 yystate = *yyssp;
3469 YY_STACK_PRINT (yyss, yyssp);
3470 }
3471
3473 *++yyvsp = yylval;
3475
3476
3477 /* Shift the error token. */
3478 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3479
3480 yystate = yyn;
3481 goto yynewstate;
3482
3483
3484/*-------------------------------------.
3485| yyacceptlab -- YYACCEPT comes here. |
3486`-------------------------------------*/
3487yyacceptlab:
3488 yyresult = 0;
3489 goto yyreturn;
3490
3491/*-----------------------------------.
3492| yyabortlab -- YYABORT comes here. |
3493`-----------------------------------*/
3494yyabortlab:
3495 yyresult = 1;
3496 goto yyreturn;
3497
3498#if !defined yyoverflow || YYERROR_VERBOSE
3499/*-------------------------------------------------.
3500| yyexhaustedlab -- memory exhaustion comes here. |
3501`-------------------------------------------------*/
3502yyexhaustedlab:
3503 yyerror (YY_("memory exhausted"));
3504 yyresult = 2;
3505 /* Fall through. */
3506#endif
3507
3508yyreturn:
3509 if (yychar != YYEMPTY)
3510 {
3511 /* Make sure we have latest lookahead translation. See comments at
3512 user semantic actions for why this is necessary. */
3513 yytoken = YYTRANSLATE (yychar);
3514 yydestruct ("Cleanup: discarding lookahead",
3515 yytoken, &yylval);
3516 }
3517 /* Do not reclaim the symbols of the rule whose action triggered
3518 this YYABORT or YYACCEPT. */
3519 YYPOPSTACK (yylen);
3520 YY_STACK_PRINT (yyss, yyssp);
3521 while (yyssp != yyss)
3522 {
3523 yydestruct ("Cleanup: popping",
3524 yystos[*yyssp], yyvsp);
3525 YYPOPSTACK (1);
3526 }
3527#ifndef yyoverflow
3528 if (yyss != yyssa)
3529 YYSTACK_FREE (yyss);
3530#endif
3531#if YYERROR_VERBOSE
3532 if (yymsg != yymsgbuf)
3533 YYSTACK_FREE (yymsg);
3534#endif
3535 return yyresult;
3536}
OPCODE * avr_new_opcode(void)
Definition avrpart.c:33
AVRMEM * avr_new_memtype(void)
Definition avrpart.c:248
AVRPART * avr_new_part(void)
Definition avrpart.c:443
AVRPART * avr_dup_part(AVRPART *d)
Definition avrpart.c:473
AVRPART * locate_part(LISTID parts, char *partdesc)
Definition avrpart.c:514
void avr_free_mem(AVRMEM *m)
Definition avrpart.c:332
void avr_free_opcode(OPCODE *op)
Definition avrpart.c:70
AVRMEM * avr_locate_mem(AVRPART *p, char *desc)
Definition avrpart.c:354
void avr_free_part(AVRPART *d)
Definition avrpart.c:498
LISTID number_list
Definition config.c:47
AVRPART * current_part
Definition config.c:49
LISTID part_list
Definition config.c:51
char default_serial[PATH_MAX]
Definition config.c:39
double default_bitclock
Definition config.c:40
LISTID string_list
Definition config.c:46
AVRMEM * current_mem
Definition config.c:50
LISTID programmers
Definition config.c:52
PROGRAMMER * current_prog
Definition config.c:48
char * dup_string(const char *str)
Definition config.c:307
int default_safemode
Definition config.c:41
char default_programmer[MAX_STR_CONST]
Definition config.c:37
void free_tokens(int n,...)
Definition config.c:161
char default_parallel[PATH_MAX]
Definition config.c:38
#define MAX_STR_CONST
Definition config.h:29
#define K_RESET
Definition config_gram.c:325
static const yytype_uint8 yyr1[]
Definition config_gram.c:1090
#define K_DEDICATED
Definition config_gram.c:288
int yynerrs
Definition config_gram.c:1568
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition config_gram.c:521
#define YYMAXDEPTH
Definition config_gram.c:1316
#define YYSTACK_FREE
Definition config_gram.c:569
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition config_gram.c:1297
int yyerror(char *errmsg,...)
Definition config.c:93
#define K_SCK
Definition config_gram.c:328
#define YY_(Msgid)
Definition config_gram.c:471
int yywarning(char *errmsg,...)
Definition config.c:110
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition config_gram.c:522
#define YYEOF
Definition config_gram.c:1141
#define YYABORT
Definition config_gram.c:1144
#define yypact_value_is_default(Yystate)
Definition config_gram.c:823
#define YYSTACK_BYTES(N)
Definition config_gram.c:613
yytype_int16 yyss_alloc
Definition config_gram.c:604
#define K_NO
Definition config_gram.c:341
static const yytype_int16 yydefgoto[]
Definition config_gram.c:939
#define YY_REDUCE_PRINT(Rule)
Definition config_gram.c:1299
static const yytype_int16 yypact[]
Definition config_gram.c:833
YYSTYPE yylval
Definition config_gram.c:1566
static int parse_cmdbits(OPCODE *op)
Definition config_gram.c:3617
#define YYFINAL
Definition config_gram.c:658
static const yytype_int16 yypgoto[]
Definition config_gram.c:929
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Definition config_gram.c:1547
#define YYNTOKENS
Definition config_gram.c:663
#define YY_STACK_PRINT(Bottom, Top)
Definition config_gram.c:1298
static int pin_name
Definition config_gram.c:95
#define YYSIZE_T
Definition config_gram.c:455
static int assign_pin(int pinno, TOKEN *v, int invert)
Definition config_gram.c:3554
YYSTYPE yyvs_alloc
Definition config_gram.c:605
int yylex(void)
Definition lexer.l:57
int yychar
Definition config_gram.c:1563
#define K_YES
Definition config_gram.c:342
static const yytype_uint8 yyr2[]
Definition config_gram.c:1114
#define YYACCEPT
Definition config_gram.c:1143
#define YYTRANSLATE(YYX)
Definition config_gram.c:676
#define K_IO
Definition config_gram.c:302
static const yytype_uint8 yystos[]
Definition config_gram.c:1043
#define K_PSEUDO
Definition config_gram.c:319
#define YYTERROR
Definition config_gram.c:1168
#define YYPOPSTACK(N)
static int which_opcode(TOKEN *opcode)
Definition config_gram.c:3594
static int assign_pin_list(int invert)
Definition config_gram.c:3571
static const yytype_uint16 yytable[]
Definition config_gram.c:951
short int yytype_int16
Definition config_gram.c:445
#define YYEMPTY
Definition config_gram.c:1140
#define YYLAST
Definition config_gram.c:660
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition config_gram.c:624
#define YYINITDEPTH
Definition config_gram.c:1305
#define yytable_value_is_error(Yytable_value)
Definition config_gram.c:828
static const yytype_int16 yycheck[]
Definition config_gram.c:996
#define YYSTACK_ALLOC
Definition config_gram.c:568
#define YYDPRINTF(Args)
Definition config_gram.c:1296
static const yytype_uint8 yydefact[]
Definition config_gram.c:882
Definition config_gram.c:603
int YYSTYPE
Definition config_gram.h:320
int ladd(LISTID lid, void *p)
Definition lists.c:547
int poweroffdelay
Definition libavrdude.h:252
void * lrmv_d(LISTID lid, void *data_ptr)
Definition lists.c:1111
enum ctl_stack_t ctl_stack_type
Definition libavrdude.h:243
int ocdrev
Definition libavrdude.h:273
int resetdelay
Definition libavrdude.h:256
#define AVRPART_IS_AT90S1200
Definition libavrdude.h:207
int progmodedelay
Definition libavrdude.h:249
unsigned char idr
Definition libavrdude.h:267
void pin_clear_all(struct pindef_t *const pindef)
Definition pindefs.c:50
PROGRAMMER * pgm_dup(const PROGRAMMER *const src)
Definition pgm.c:155
int chiperasepulsewidth
Definition libavrdude.h:257
int resetdelayus
Definition libavrdude.h:254
unsigned char eeprom_instr[EEPROM_INSTR_SIZE]
Definition libavrdude.h:246
#define AVRPART_PSEUDOPARALLEL
Definition libavrdude.h:197
unsigned char pagel
Definition libavrdude.h:223
#define PUSH(s, d)
Definition libavrdude.h:77
#define AVRPART_ALLOWFULLPAGEBITSTREAM
Definition libavrdude.h:199
int resetdelayms
Definition libavrdude.h:253
unsigned short eecr
Definition libavrdude.h:270
unsigned short usbpid
Definition libavrdude.h:226
#define AVRPART_HAS_JTAG
Definition libavrdude.h:198
int blocksize
Definition libavrdude.h:300
int num_pages
Definition libavrdude.h:288
int hvleavestabdelay
Definition libavrdude.h:255
int programfusepolltimeout
Definition libavrdude.h:261
LISTID lcreat(void *liststruct, int poolsize)
Definition lists.c:410
char id[AVR_IDLEN]
Definition libavrdude.h:219
unsigned char readback[2]
Definition libavrdude.h:296
@ CTL_STACK_HVSP
Definition libavrdude.h:178
@ CTL_STACK_PP
Definition libavrdude.h:177
#define CTL_STACK_SIZE
Definition libavrdude.h:211
int synchcycles
Definition libavrdude.h:264
int synchloops
Definition libavrdude.h:235
void * ldata(LNODEID)
Definition lists.c:720
int chiperasepolltimeout
Definition libavrdude.h:258
#define PGM_DESCLEN
Definition libavrdude.h:587
#define AVR_IDLEN
Definition libavrdude.h:210
int stabdelay
Definition libavrdude.h:233
#define AVR_MEMDESCLEN
Definition libavrdude.h:282
#define AVRPART_AVR32
Definition libavrdude.h:203
int size
Definition libavrdude.h:286
#define AVRPART_PARALLELOK
Definition libavrdude.h:196
int pollindex
Definition libavrdude.h:302
int lsize(LISTID)
Definition lists.c:729
int max_write_delay
Definition libavrdude.h:291
int pollindex
Definition libavrdude.h:237
int paged
Definition libavrdude.h:285
unsigned char controlstack[CTL_STACK_SIZE]
Definition libavrdude.h:244
unsigned int offset
Definition libavrdude.h:289
unsigned char pollvalue
Definition libavrdude.h:238
#define EEPROM_INSTR_SIZE
Definition libavrdude.h:213
int mode
Definition libavrdude.h:298
@ CONNTYPE_PARALLEL
Definition libavrdude.h:611
@ CONNTYPE_USB
Definition libavrdude.h:613
@ CONNTYPE_SERIAL
Definition libavrdude.h:612
void * LNODEID
Definition libavrdude.h:64
int chip_erase_delay
Definition libavrdude.h:222
char desc[AVR_DESCLEN]
Definition libavrdude.h:218
int hventerstabdelay
Definition libavrdude.h:248
int programlockpulsewidth
Definition libavrdude.h:262
char config_file[PATH_MAX]
Definition libavrdude.h:278
PROGRAMMER * locate_programmer(LISTID programmers, const char *configid)
Definition pgm.c:263
int cmdexedelay
Definition libavrdude.h:234
int avr910_devcode
Definition libavrdude.h:221
void ldestroy_cb(LISTID lid, void(*ucleanup)(void *data_ptr))
Definition lists.c:480
unsigned char signature[3]
Definition libavrdude.h:225
LNODEID lnext(LNODEID)
Definition lists.c:704
unsigned char rampz
Definition libavrdude.h:268
int min_write_delay
Definition libavrdude.h:290
int bytedelay
Definition libavrdude.h:236
#define AVRPART_HAS_PDI
Definition libavrdude.h:202
int page_size
Definition libavrdude.h:287
#define AVRPART_SERIALOK
Definition libavrdude.h:195
LNODEID lfirst(LISTID)
Definition lists.c:688
int programfusepulsewidth
Definition libavrdude.h:260
int postdelay
Definition libavrdude.h:240
int lineno
Definition libavrdude.h:279
int timeout
Definition libavrdude.h:232
int togglevtg
Definition libavrdude.h:251
@ PIN_LED_VFY
Definition libavrdude.h:362
@ PIN_AVR_RESET
Definition libavrdude.h:355
@ PIN_AVR_MISO
Definition libavrdude.h:358
@ PIN_LED_RDY
Definition libavrdude.h:360
@ PIN_LED_ERR
Definition libavrdude.h:359
@ PIN_AVR_SCK
Definition libavrdude.h:356
@ PIN_LED_PGM
Definition libavrdude.h:361
@ PIN_AVR_MOSI
Definition libavrdude.h:357
@ PPI_AVR_BUFF
Definition libavrdude.h:354
@ PPI_AVR_VCC
Definition libavrdude.h:353
#define AVRPART_HAS_DW
Definition libavrdude.h:201
int delay
Definition libavrdude.h:299
void * lrmv_n(LISTID lid, unsigned int n)
Definition lists.c:1186
int chiperasetime
Definition libavrdude.h:259
void pgm_free(PROGRAMMER *const p)
Definition pgm.c:141
int reset_disposition
Definition libavrdude.h:227
@ RESET_DEDICATED
Definition libavrdude.h:171
@ RESET_IO
Definition libavrdude.h:172
int readsize
Definition libavrdude.h:301
unsigned int nvm_base
Definition libavrdude.h:272
OPCODE * op[AVR_OP_MAX]
Definition libavrdude.h:275
#define PGM_USBSTRINGLEN
Definition libavrdude.h:590
#define AVRPART_HAS_TPI
Definition libavrdude.h:206
#define FLASH_INSTR_SIZE
Definition libavrdude.h:212
unsigned char flash_instr[FLASH_INSTR_SIZE]
Definition libavrdude.h:245
int pwroff_after_write
Definition libavrdude.h:292
const PROGRAMMER_TYPE * locate_programmer_type(const char *id)
Definition pgm_type.c:99
int pollmethod
Definition libavrdude.h:241
#define AVR_DESCLEN
Definition libavrdude.h:209
int hvspcmdexedelay
Definition libavrdude.h:265
unsigned char bs2
Definition libavrdude.h:224
#define AVRPART_ENABLEPAGEPROGRAMMING
Definition libavrdude.h:200
#define PATH_MAX
Definition libavrdude.h:51
unsigned flags
Definition libavrdude.h:230
int programlockpolltimeout
Definition libavrdude.h:263
int retry_pulse
Definition libavrdude.h:228
OPCODE * op[AVR_OP_MAX]
Definition libavrdude.h:306
PROGRAMMER * pgm_new(void)
Definition pgm.c:64
unsigned char spmcr
Definition libavrdude.h:269
char desc[AVR_MEMDESCLEN]
Definition libavrdude.h:284
unsigned int mcu_base
Definition libavrdude.h:271
int stk500_devcode
Definition libavrdude.h:220
LISTID mem
Definition libavrdude.h:277
int predelay
Definition libavrdude.h:239
int latchcycles
Definition libavrdude.h:250
Definition libavrdude.h:283
Definition libavrdude.h:217
Definition libavrdude.h:190
static PROGRAMMER * pgm
Definition main.c:192
Definition libavrdude.h:616
int usbvid
Definition libavrdude.h:631
char usbdev[PGM_USBSTRINGLEN]
Definition libavrdude.h:633
char desc[PGM_DESCLEN]
Definition libavrdude.h:618
LISTID id
Definition libavrdude.h:617
char config_file[PATH_MAX]
Definition libavrdude.h:687
int baudrate
Definition libavrdude.h:630
struct pindef_t pin[N_PINS]
Definition libavrdude.h:623
void(* initpgm)(struct programmer_t *pgm)
Definition libavrdude.h:621
LISTID usbpid
Definition libavrdude.h:632
conntype_t conntype
Definition libavrdude.h:627
char usbproduct[PGM_USBSTRINGLEN]
Definition libavrdude.h:634
char usbvendor[PGM_USBSTRINGLEN]
Definition libavrdude.h:634
char usbsn[PGM_USBSTRINGLEN]
Definition libavrdude.h:633
int lineno
Definition libavrdude.h:688
Definition libavrdude.h:897
void(* initpgm)(struct programmer_t *pgm)
Definition libavrdude.h:899

References assign_pin(), assign_pin_list(), avrpart::avr910_devcode, AVR_DESCLEN, avr_dup_part(), avr_free_mem(), avr_free_opcode(), avr_free_part(), AVR_IDLEN, avr_locate_mem(), AVR_MEMDESCLEN, avr_new_memtype(), avr_new_opcode(), avr_new_part(), AVRPART_ALLOWFULLPAGEBITSTREAM, AVRPART_AVR32, AVRPART_ENABLEPAGEPROGRAMMING, AVRPART_HAS_DW, AVRPART_HAS_JTAG, AVRPART_HAS_PDI, AVRPART_HAS_TPI, AVRPART_IS_AT90S1200, AVRPART_PARALLELOK, AVRPART_PSEUDOPARALLEL, AVRPART_SERIALOK, programmer_t::baudrate, avrmem::blocksize, avrpart::bs2, avrpart::bytedelay, avrpart::chip_erase_delay, avrpart::chiperasepolltimeout, avrpart::chiperasepulsewidth, avrpart::chiperasetime, avrpart::cmdexedelay, avrpart::config_file, programmer_t::config_file, programmer_t::conntype, CONNTYPE_PARALLEL, CONNTYPE_SERIAL, CONNTYPE_USB, avrpart::controlstack, CTL_STACK_HVSP, CTL_STACK_PP, CTL_STACK_SIZE, avrpart::ctl_stack_type, current_mem, current_part, current_prog, default_bitclock, default_parallel, default_programmer, default_safemode, default_serial, avrmem::delay, avrpart::desc, avrmem::desc, programmer_t::desc, dup_string(), avrpart::eecr, avrpart::eeprom_instr, EEPROM_INSTR_SIZE, avrpart::flags, avrpart::flash_instr, FLASH_INSTR_SIZE, free(), free_token(), free_tokens(), avrpart::hventerstabdelay, avrpart::hvleavestabdelay, avrpart::hvspcmdexedelay, avrpart::id, programmer_t::id, avrpart::idr, infile, programmer_t::initpgm, programmer_type_t::initpgm, K_DEDICATED, K_IO, K_NO, K_PSEUDO, K_RESET, K_SCK, K_YES, ladd(), avrpart::latchcycles, lcreat(), ldata(), ldestroy_cb(), lfirst(), lineno, avrpart::lineno, programmer_t::lineno, lnext(), locate_part(), locate_programmer(), locate_programmer_type(), lrmv_d(), lrmv_n(), lsize(), malloc(), MAX_STR_CONST, avrmem::max_write_delay, avrpart::mcu_base, avrpart::mem, avrmem::min_write_delay, avrmem::mode, avrmem::num_pages, value_t::number, number_list, avrpart::nvm_base, avrpart::ocdrev, avrmem::offset, avrpart::op, avrmem::op, avrmem::page_size, avrmem::paged, avrpart::pagel, parse_cmdbits(), part_list, PATH_MAX, pgm, PGM_DESCLEN, pgm_dup(), pgm_free(), pgm_new(), PGM_USBSTRINGLEN, programmer_t::pin, PIN_AVR_MISO, PIN_AVR_MOSI, PIN_AVR_RESET, PIN_AVR_SCK, pin_clear_all(), PIN_LED_ERR, PIN_LED_PGM, PIN_LED_RDY, PIN_LED_VFY, pin_name, avrpart::pollindex, avrmem::pollindex, avrpart::pollmethod, avrpart::pollvalue, avrpart::postdelay, avrpart::poweroffdelay, PPI_AVR_BUFF, PPI_AVR_VCC, avrpart::predelay, avrpart::progmodedelay, avrpart::programfusepolltimeout, avrpart::programfusepulsewidth, avrpart::programlockpolltimeout, avrpart::programlockpulsewidth, programmers, PUSH, avrmem::pwroff_after_write, avrpart::rampz, avrmem::readback, avrmem::readsize, RESET_DEDICATED, avrpart::reset_disposition, RESET_IO, avrpart::resetdelay, avrpart::resetdelayms, avrpart::resetdelayus, avrpart::retry_pulse, avrpart::signature, avrmem::size, avrpart::spmcr, avrpart::stabdelay, avrpart::stk500_devcode, value_t::string, string_list, avrpart::synchcycles, avrpart::synchloops, avrpart::timeout, avrpart::togglevtg, programmer_t::usbdev, avrpart::usbpid, programmer_t::usbpid, programmer_t::usbproduct, programmer_t::usbsn, programmer_t::usbvendor, programmer_t::usbvid, V_NUM_REAL, token_t::value, which_opcode(), YY_, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yychar, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror(), YYFINAL, YYINITDEPTH, YYLAST, yylex(), yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, yypact, yypact_value_is_default, yypgoto, YYPOPSTACK, yyr1, yyr2, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystos, yytable, yytable_value_is_error, YYTERROR, YYTRANSLATE, yyalloc::yyvs_alloc, and yywarning().

Referenced by read_config(), and read_config_builtin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ yywarning()

int yywarning ( char *  errmsg,
  ... 
)
111{
112 va_list args;
113
114 char message[512];
115
116 va_start(args, errmsg);
117
118 vsnprintf(message, sizeof(message), errmsg, args);
119 avrdude_message(MSG_INFO, "%s: warning at %s:%d: %s\n", progname, infile, lineno, message);
120
121 va_end(args);
122
123 return 0;
124}

Variable Documentation

◆ current_mem

AVRMEM* current_mem
extern

Referenced by init_config(), and yyparse().

◆ current_part

AVRPART* current_part
extern

Referenced by init_config(), and yyparse().

◆ current_prog

PROGRAMMER* current_prog
extern

◆ infile

◆ lineno

◆ number_list

LISTID number_list
extern

◆ string_buf

char string_buf[MAX_STR_CONST]
extern

◆ string_buf_ptr

char* string_buf_ptr
extern

◆ string_list

LISTID string_list
extern

◆ yyin

FILE * yyin = NULL
extern

Referenced by if(), and read_config().

◆ yylval

YYSTYPE yylval
extern