1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
64 /* Substitute the variable and function names. */
65 #define yyparse sensors_yyparse
66 #define yylex sensors_yylex
67 #define yyerror sensors_yyerror
68 #define yylval sensors_yylval
69 #define yychar sensors_yychar
70 #define yydebug sensors_yydebug
71 #define yynerrs sensors_yynerrs
74 /* Copy the first part of user declarations. */
76 /* Line 268 of yacc.c */
77 #line 1 "lib/conf-parse.y"
80 conf-parse.y - Part of libsensors, a Linux library for reading sensor data.
81 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
83 This library is free software; you can redistribute it and/or
84 modify it under the terms of the GNU Lesser General Public
85 License as published by the Free Software Foundation; either
86 version 2.1 of the License, or (at your option) any later version.
88 This library is distributed in the hope that it will be useful,
89 but WITHOUT ANY WARRANTY; without even the implied warranty of
90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 GNU Lesser General Public License for more details.
93 You should have received a copy of the GNU General Public License
94 along with this program; if not, write to the Free Software
95 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
99 #define YYERROR_VERBOSE
112 static void sensors_yyerror(const char *err);
113 static sensors_expr *malloc_expr(void);
115 static sensors_chip *current_chip = NULL;
117 #define bus_add_el(el) sensors_add_array_el(el,\
118 &sensors_config_busses,\
119 &sensors_config_busses_count,\
120 &sensors_config_busses_max,\
122 #define label_add_el(el) sensors_add_array_el(el,\
123 ¤t_chip->labels,\
124 ¤t_chip->labels_count,\
125 ¤t_chip->labels_max,\
126 sizeof(sensors_label));
127 #define set_add_el(el) sensors_add_array_el(el,\
128 ¤t_chip->sets,\
129 ¤t_chip->sets_count,\
130 ¤t_chip->sets_max,\
131 sizeof(sensors_set));
132 #define compute_add_el(el) sensors_add_array_el(el,\
133 ¤t_chip->computes,\
134 ¤t_chip->computes_count,\
135 ¤t_chip->computes_max,\
136 sizeof(sensors_compute));
137 #define ignore_add_el(el) sensors_add_array_el(el,\
138 ¤t_chip->ignores,\
139 ¤t_chip->ignores_count,\
140 ¤t_chip->ignores_max,\
141 sizeof(sensors_ignore));
142 #define chip_add_el(el) sensors_add_array_el(el,\
143 &sensors_config_chips,\
144 &sensors_config_chips_count,\
145 &sensors_config_chips_max,\
146 sizeof(sensors_chip));
148 #define fits_add_el(el,list) sensors_add_array_el(el,\
152 sizeof(sensors_chip_name));
156 /* Line 268 of yacc.c */
157 #line 158 "lib/conf-parse.c"
159 /* Enabling traces. */
164 /* Enabling verbose error messages. */
165 #ifdef YYERROR_VERBOSE
166 # undef YYERROR_VERBOSE
167 # define YYERROR_VERBOSE 1
169 # define YYERROR_VERBOSE 0
172 /* Enabling the token table. */
173 #ifndef YYTOKEN_TABLE
174 # define YYTOKEN_TABLE 0
181 /* Put the tokens into the symbol table, so that GDB and other debuggers
200 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
201 typedef union YYSTYPE
204 /* Line 293 of yacc.c */
205 #line 79 "lib/conf-parse.y"
210 sensors_chip_name_list chips;
213 sensors_chip_name chip;
214 sensors_config_line line;
218 /* Line 293 of yacc.c */
219 #line 220 "lib/conf-parse.c"
221 # define YYSTYPE_IS_TRIVIAL 1
222 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
223 # define YYSTYPE_IS_DECLARED 1
227 /* Copy the second part of user declarations. */
230 /* Line 343 of yacc.c */
231 #line 232 "lib/conf-parse.c"
238 typedef YYTYPE_UINT8 yytype_uint8;
240 typedef unsigned char yytype_uint8;
244 typedef YYTYPE_INT8 yytype_int8;
245 #elif (defined __STDC__ || defined __C99__FUNC__ \
246 || defined __cplusplus || defined _MSC_VER)
247 typedef signed char yytype_int8;
249 typedef short int yytype_int8;
253 typedef YYTYPE_UINT16 yytype_uint16;
255 typedef unsigned short int yytype_uint16;
259 typedef YYTYPE_INT16 yytype_int16;
261 typedef short int yytype_int16;
265 # ifdef __SIZE_TYPE__
266 # define YYSIZE_T __SIZE_TYPE__
267 # elif defined size_t
268 # define YYSIZE_T size_t
269 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
270 || defined __cplusplus || defined _MSC_VER)
271 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
272 # define YYSIZE_T size_t
274 # define YYSIZE_T unsigned int
278 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
281 # if defined YYENABLE_NLS && YYENABLE_NLS
283 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
284 # define YY_(msgid) dgettext ("bison-runtime", msgid)
288 # define YY_(msgid) msgid
292 /* Suppress unused-variable warnings by "using" E. */
293 #if ! defined lint || defined __GNUC__
294 # define YYUSE(e) ((void) (e))
296 # define YYUSE(e) /* empty */
299 /* Identity function, used to suppress warnings about constant conditions. */
303 #if (defined __STDC__ || defined __C99__FUNC__ \
304 || defined __cplusplus || defined _MSC_VER)
317 #if ! defined yyoverflow || YYERROR_VERBOSE
319 /* The parser invokes alloca or malloc; define the necessary symbols. */
321 # ifdef YYSTACK_USE_ALLOCA
322 # if YYSTACK_USE_ALLOCA
324 # define YYSTACK_ALLOC __builtin_alloca
325 # elif defined __BUILTIN_VA_ARG_INCR
326 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
328 # define YYSTACK_ALLOC __alloca
329 # elif defined _MSC_VER
330 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
331 # define alloca _alloca
333 # define YYSTACK_ALLOC alloca
334 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
335 || defined __cplusplus || defined _MSC_VER)
336 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
337 # ifndef EXIT_SUCCESS
338 # define EXIT_SUCCESS 0
345 # ifdef YYSTACK_ALLOC
346 /* Pacify GCC's `empty if-body' warning. */
347 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349 /* The OS might guarantee only one guard page at the bottom of the stack,
350 and a page size can be as small as 4096 bytes. So we cannot safely
351 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
352 to allow for a few compiler-allocated temporary stack slots. */
353 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
356 # define YYSTACK_ALLOC YYMALLOC
357 # define YYSTACK_FREE YYFREE
358 # ifndef YYSTACK_ALLOC_MAXIMUM
359 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
361 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
362 && ! ((defined YYMALLOC || defined malloc) \
363 && (defined YYFREE || defined free)))
364 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
365 # ifndef EXIT_SUCCESS
366 # define EXIT_SUCCESS 0
370 # define YYMALLOC malloc
371 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
372 || defined __cplusplus || defined _MSC_VER)
373 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
378 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
379 || defined __cplusplus || defined _MSC_VER)
380 void free (void *); /* INFRINGES ON USER NAME SPACE */
384 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
387 #if (! defined yyoverflow \
388 && (! defined __cplusplus \
389 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
391 /* A type that is properly aligned for any stack member. */
394 yytype_int16 yyss_alloc;
398 /* The size of the maximum gap between one aligned stack and the next. */
399 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
401 /* The size of an array large to enough to hold all stacks, each with
403 # define YYSTACK_BYTES(N) \
404 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
405 + YYSTACK_GAP_MAXIMUM)
407 # define YYCOPY_NEEDED 1
409 /* Relocate STACK from its old location to the new one. The
410 local variables YYSIZE and YYSTACKSIZE give the old and new number of
411 elements in the stack, and YYPTR gives the new location of the
412 stack. Advance YYPTR to a properly aligned location for the next
414 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
417 YYSIZE_T yynewbytes; \
418 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
419 Stack = &yyptr->Stack_alloc; \
420 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
421 yyptr += yynewbytes / sizeof (*yyptr); \
427 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
428 /* Copy COUNT objects from FROM to TO. The source and destination do
431 # if defined __GNUC__ && 1 < __GNUC__
432 # define YYCOPY(To, From, Count) \
433 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
435 # define YYCOPY(To, From, Count) \
439 for (yyi = 0; yyi < (Count); yyi++) \
440 (To)[yyi] = (From)[yyi]; \
445 #endif /* !YYCOPY_NEEDED */
447 /* YYFINAL -- State number of the termination state. */
449 /* YYLAST -- Last index in YYTABLE. */
452 /* YYNTOKENS -- Number of terminals. */
454 /* YYNNTS -- Number of nonterminals. */
456 /* YYNRULES -- Number of rules. */
458 /* YYNRULES -- Number of states. */
461 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
463 #define YYMAXUTOK 268
465 #define YYTRANSLATE(YYX) \
466 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
468 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
469 static const yytype_uint8 yytranslate[] =
471 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 22, 23, 5, 4, 10, 3, 2, 6, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 21, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 8, 2, 9, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 1, 2, 7, 11,
497 12, 13, 14, 15, 16, 17, 18, 19, 20
501 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
503 static const yytype_uint8 yyprhs[] =
505 0, 0, 3, 4, 7, 10, 13, 16, 19, 22,
506 25, 28, 32, 36, 40, 46, 49, 52, 54, 57,
507 59, 61, 63, 67, 71, 75, 79, 82, 86, 89,
511 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
512 static const yytype_int8 yyrhs[] =
514 25, 0, -1, -1, 25, 26, -1, 27, 11, -1,
515 28, 11, -1, 29, 11, -1, 32, 11, -1, 30,
516 11, -1, 31, 11, -1, 1, 11, -1, 12, 35,
517 36, -1, 13, 37, 38, -1, 14, 37, 34, -1,
518 16, 37, 34, 10, 34, -1, 17, 37, -1, 15,
519 33, -1, 39, -1, 33, 39, -1, 18, -1, 19,
520 -1, 21, -1, 34, 4, 34, -1, 34, 3, 34,
521 -1, 34, 5, 34, -1, 34, 6, 34, -1, 3,
522 34, -1, 22, 34, 23, -1, 8, 34, -1, 9,
523 34, -1, 19, -1, 19, -1, 19, -1, 19, -1,
527 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
528 static const yytype_uint16 yyrline[] =
530 0, 119, 119, 120, 123, 124, 125, 126, 127, 128,
531 129, 132, 141, 156, 171, 188, 201, 219, 225, 231,
532 236, 241, 245, 252, 259, 266, 273, 280, 282, 289,
533 298, 308, 312, 316, 320
537 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
538 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
539 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
540 static const char *const yytname[] =
542 "$end", "error", "$undefined", "'-'", "'+'", "'*'", "'/'", "NEG", "'^'",
543 "'`'", "','", "EOL", "BUS", "LABEL", "SET", "CHIP", "COMPUTE", "IGNORE",
544 "FLOAT", "NAME", "ERROR", "'@'", "'('", "')'", "$accept", "input",
545 "line", "bus_statement", "label_statement", "set_statement",
546 "compute_statement", "ignore_statement", "chip_statement",
547 "chip_name_list", "expression", "bus_id", "adapter_name",
548 "function_name", "string", "chip_name", 0
553 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
555 static const yytype_uint16 yytoknum[] =
557 0, 256, 257, 45, 43, 42, 47, 258, 94, 96,
558 44, 259, 260, 261, 262, 263, 264, 265, 266, 267,
563 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
564 static const yytype_uint8 yyr1[] =
566 0, 24, 25, 25, 26, 26, 26, 26, 26, 26,
567 26, 27, 28, 29, 30, 31, 32, 33, 33, 34,
568 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
572 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
573 static const yytype_uint8 yyr2[] =
575 0, 2, 0, 2, 2, 2, 2, 2, 2, 2,
576 2, 3, 3, 3, 5, 2, 2, 1, 2, 1,
577 1, 1, 3, 3, 3, 3, 2, 3, 2, 2,
581 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
582 Performed when YYTABLE doesn't specify something else to do. Zero
583 means the default is an error. */
584 static const yytype_uint8 yydefact[] =
586 2, 0, 1, 0, 0, 0, 0, 0, 0, 0,
587 3, 0, 0, 0, 0, 0, 0, 10, 30, 0,
588 32, 0, 0, 34, 16, 17, 0, 15, 4, 5,
589 6, 8, 9, 7, 31, 11, 33, 12, 0, 0,
590 0, 19, 20, 21, 0, 13, 18, 0, 26, 28,
591 29, 0, 0, 0, 0, 0, 0, 27, 23, 22,
595 /* YYDEFGOTO[NTERM-NUM]. */
596 static const yytype_int8 yydefgoto[] =
598 -1, 1, 10, 11, 12, 13, 14, 15, 16, 24,
599 45, 19, 35, 21, 37, 25
602 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
604 #define YYPACT_NINF -27
605 static const yytype_int8 yypact[] =
607 -27, 37, -27, -4, -3, 1, 1, 6, 1, 1,
608 -27, 8, 13, 20, 23, 32, 34, -27, -27, 29,
609 -27, 39, 14, -27, 6, -27, 14, -27, -27, -27,
610 -27, -27, -27, -27, -27, -27, -27, -27, 14, 14,
611 14, -27, -27, -27, 14, 36, -27, 5, -27, -27,
612 -27, -2, 14, 14, 14, 14, 14, -27, 0, 0,
616 /* YYPGOTO[NTERM-NUM]. */
617 static const yytype_int8 yypgoto[] =
619 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
620 -26, -27, -27, 38, -27, 31
623 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
624 positive, shift that token. If negative, reduce the rule which
625 number is the opposite. If YYTABLE_NINF, syntax error. */
626 #define YYTABLE_NINF -1
627 static const yytype_uint8 yytable[] =
629 47, 52, 53, 54, 55, 54, 55, 17, 52, 53,
630 54, 55, 48, 49, 50, 56, 18, 38, 51, 28,
631 20, 57, 39, 40, 29, 23, 58, 59, 60, 61,
632 62, 30, 41, 42, 31, 43, 44, 2, 3, 52,
633 53, 54, 55, 32, 22, 33, 26, 27, 34, 4,
634 5, 6, 7, 8, 9, 46, 0, 0, 36
637 #define yypact_value_is_default(yystate) \
640 #define yytable_value_is_error(yytable_value) \
643 static const yytype_int8 yycheck[] =
645 26, 3, 4, 5, 6, 5, 6, 11, 3, 4,
646 5, 6, 38, 39, 40, 10, 19, 3, 44, 11,
647 19, 23, 8, 9, 11, 19, 52, 53, 54, 55,
648 56, 11, 18, 19, 11, 21, 22, 0, 1, 3,
649 4, 5, 6, 11, 6, 11, 8, 9, 19, 12,
650 13, 14, 15, 16, 17, 24, -1, -1, 19
653 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
654 symbol of state STATE-NUM. */
655 static const yytype_uint8 yystos[] =
657 0, 25, 0, 1, 12, 13, 14, 15, 16, 17,
658 26, 27, 28, 29, 30, 31, 32, 11, 19, 35,
659 19, 37, 37, 19, 33, 39, 37, 37, 11, 11,
660 11, 11, 11, 11, 19, 36, 19, 38, 3, 8,
661 9, 18, 19, 21, 22, 34, 39, 34, 34, 34,
662 34, 34, 3, 4, 5, 6, 10, 23, 34, 34,
666 #define yyerrok (yyerrstatus = 0)
667 #define yyclearin (yychar = YYEMPTY)
671 #define YYACCEPT goto yyacceptlab
672 #define YYABORT goto yyabortlab
673 #define YYERROR goto yyerrorlab
676 /* Like YYERROR except do call yyerror. This remains here temporarily
677 to ease the transition to the new meaning of YYERROR, for GCC.
678 Once GCC version 2 has supplanted version 1, this can go. However,
679 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
680 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
683 #define YYFAIL goto yyerrlab
685 /* This is here to suppress warnings from the GCC cpp's
686 -Wunused-macros. Normally we don't worry about that warning, but
687 some users do, and we want to make it easy for users to remove
688 YYFAIL uses, which will produce warnings from Bison 2.5. */
691 #define YYRECOVERING() (!!yyerrstatus)
693 #define YYBACKUP(Token, Value) \
695 if (yychar == YYEMPTY && yylen == 1) \
704 yyerror (YY_("syntax error: cannot back up")); \
711 #define YYERRCODE 256
714 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
715 If N is 0, then set CURRENT to the empty location which ends
716 the previous symbol: RHS[0] (always defined). */
718 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
719 #ifndef YYLLOC_DEFAULT
720 # define YYLLOC_DEFAULT(Current, Rhs, N) \
724 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
725 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
726 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
727 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
731 (Current).first_line = (Current).last_line = \
732 YYRHSLOC (Rhs, 0).last_line; \
733 (Current).first_column = (Current).last_column = \
734 YYRHSLOC (Rhs, 0).last_column; \
740 /* This macro is provided for backward compatibility. */
742 #ifndef YY_LOCATION_PRINT
743 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
747 /* YYLEX -- calling `yylex' with the right arguments. */
750 # define YYLEX yylex (YYLEX_PARAM)
752 # define YYLEX yylex ()
755 /* Enable debugging if requested. */
759 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
760 # define YYFPRINTF fprintf
763 # define YYDPRINTF(Args) \
769 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
773 YYFPRINTF (stderr, "%s ", Title); \
774 yy_symbol_print (stderr, \
776 YYFPRINTF (stderr, "\n"); \
781 /*--------------------------------.
782 | Print this symbol on YYOUTPUT. |
783 `--------------------------------*/
786 #if (defined __STDC__ || defined __C99__FUNC__ \
787 || defined __cplusplus || defined _MSC_VER)
789 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
792 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
795 YYSTYPE const * const yyvaluep;
801 if (yytype < YYNTOKENS)
802 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
814 /*--------------------------------.
815 | Print this symbol on YYOUTPUT. |
816 `--------------------------------*/
818 #if (defined __STDC__ || defined __C99__FUNC__ \
819 || defined __cplusplus || defined _MSC_VER)
821 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
824 yy_symbol_print (yyoutput, yytype, yyvaluep)
827 YYSTYPE const * const yyvaluep;
830 if (yytype < YYNTOKENS)
831 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
833 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
835 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
836 YYFPRINTF (yyoutput, ")");
839 /*------------------------------------------------------------------.
840 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
842 `------------------------------------------------------------------*/
844 #if (defined __STDC__ || defined __C99__FUNC__ \
845 || defined __cplusplus || defined _MSC_VER)
847 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
850 yy_stack_print (yybottom, yytop)
851 yytype_int16 *yybottom;
855 YYFPRINTF (stderr, "Stack now");
856 for (; yybottom <= yytop; yybottom++)
858 int yybot = *yybottom;
859 YYFPRINTF (stderr, " %d", yybot);
861 YYFPRINTF (stderr, "\n");
864 # define YY_STACK_PRINT(Bottom, Top) \
867 yy_stack_print ((Bottom), (Top)); \
871 /*------------------------------------------------.
872 | Report that the YYRULE is going to be reduced. |
873 `------------------------------------------------*/
875 #if (defined __STDC__ || defined __C99__FUNC__ \
876 || defined __cplusplus || defined _MSC_VER)
878 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
881 yy_reduce_print (yyvsp, yyrule)
886 int yynrhs = yyr2[yyrule];
888 unsigned long int yylno = yyrline[yyrule];
889 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
891 /* The symbols being reduced. */
892 for (yyi = 0; yyi < yynrhs; yyi++)
894 YYFPRINTF (stderr, " $%d = ", yyi + 1);
895 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
896 &(yyvsp[(yyi + 1) - (yynrhs)])
898 YYFPRINTF (stderr, "\n");
902 # define YY_REDUCE_PRINT(Rule) \
905 yy_reduce_print (yyvsp, Rule); \
908 /* Nonzero means print parse trace. It is left uninitialized so that
909 multiple parsers can coexist. */
912 # define YYDPRINTF(Args)
913 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
914 # define YY_STACK_PRINT(Bottom, Top)
915 # define YY_REDUCE_PRINT(Rule)
916 #endif /* !YYDEBUG */
919 /* YYINITDEPTH -- initial size of the parser's stacks. */
921 # define YYINITDEPTH 200
924 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
925 if the built-in stack extension method is used).
927 Do not make this value too large; the results are undefined if
928 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
929 evaluated with infinite-precision integer arithmetic. */
932 # define YYMAXDEPTH 10000
939 # if defined __GLIBC__ && defined _STRING_H
940 # define yystrlen strlen
942 /* Return the length of YYSTR. */
943 #if (defined __STDC__ || defined __C99__FUNC__ \
944 || defined __cplusplus || defined _MSC_VER)
946 yystrlen (const char *yystr)
954 for (yylen = 0; yystr[yylen]; yylen++)
962 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
963 # define yystpcpy stpcpy
965 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
967 #if (defined __STDC__ || defined __C99__FUNC__ \
968 || defined __cplusplus || defined _MSC_VER)
970 yystpcpy (char *yydest, const char *yysrc)
973 yystpcpy (yydest, yysrc)
979 const char *yys = yysrc;
981 while ((*yyd++ = *yys++) != '\0')
990 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
991 quotes and backslashes, so that it's suitable for yyerror. The
992 heuristic is that double-quoting is unnecessary unless the string
993 contains an apostrophe, a comma, or backslash (other than
994 backslash-backslash). YYSTR is taken from yytname. If YYRES is
995 null, do not copy; instead, return the length of what the result
998 yytnamerr (char *yyres, const char *yystr)
1003 char const *yyp = yystr;
1010 goto do_not_strip_quotes;
1014 goto do_not_strip_quotes;
1027 do_not_strip_quotes: ;
1031 return yystrlen (yystr);
1033 return yystpcpy (yyres, yystr) - yyres;
1037 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1038 about the unexpected token YYTOKEN for the state stack whose top is
1041 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1042 not large enough to hold the message. In that case, also set
1043 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1044 required number of bytes is too large to store. */
1046 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1047 yytype_int16 *yyssp, int yytoken)
1049 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1050 YYSIZE_T yysize = yysize0;
1052 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1053 /* Internationalized format string. */
1054 const char *yyformat = 0;
1055 /* Arguments of yyformat. */
1056 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1057 /* Number of reported tokens (one for the "unexpected", one per
1061 /* There are many possibilities here to consider:
1062 - Assume YYFAIL is not used. It's too flawed to consider. See
1063 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1064 for details. YYERROR is fine as it does not invoke this
1066 - If this state is a consistent state with a default action, then
1067 the only way this function was invoked is if the default action
1068 is an error action. In that case, don't check for expected
1069 tokens because there are none.
1070 - The only way there can be no lookahead present (in yychar) is if
1071 this state is a consistent state with a default action. Thus,
1072 detecting the absence of a lookahead is sufficient to determine
1073 that there is no unexpected or expected token to report. In that
1074 case, just report a simple "syntax error".
1075 - Don't assume there isn't a lookahead just because this state is a
1076 consistent state with a default action. There might have been a
1077 previous inconsistent state, consistent state with a non-default
1078 action, or user semantic action that manipulated yychar.
1079 - Of course, the expected token list depends on states to have
1080 correct lookahead information, and it depends on the parser not
1081 to perform extra reductions after fetching a lookahead from the
1082 scanner and before detecting a syntax error. Thus, state merging
1083 (from LALR or IELR) and default reductions corrupt the expected
1084 token list. However, the list is correct for canonical LR with
1085 one exception: it will still contain any token that will not be
1086 accepted due to an error action in a later state.
1088 if (yytoken != YYEMPTY)
1090 int yyn = yypact[*yyssp];
1091 yyarg[yycount++] = yytname[yytoken];
1092 if (!yypact_value_is_default (yyn))
1094 /* Start YYX at -YYN if negative to avoid negative indexes in
1095 YYCHECK. In other words, skip the first -YYN actions for
1096 this state because they are default actions. */
1097 int yyxbegin = yyn < 0 ? -yyn : 0;
1098 /* Stay within bounds of both yycheck and yytname. */
1099 int yychecklim = YYLAST - yyn + 1;
1100 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1103 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1104 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1105 && !yytable_value_is_error (yytable[yyx + yyn]))
1107 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1113 yyarg[yycount++] = yytname[yyx];
1114 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1115 if (! (yysize <= yysize1
1116 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1125 # define YYCASE_(N, S) \
1129 YYCASE_(0, YY_("syntax error"));
1130 YYCASE_(1, YY_("syntax error, unexpected %s"));
1131 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1132 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1133 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1134 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1138 yysize1 = yysize + yystrlen (yyformat);
1139 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1143 if (*yymsg_alloc < yysize)
1145 *yymsg_alloc = 2 * yysize;
1146 if (! (yysize <= *yymsg_alloc
1147 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1148 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1152 /* Avoid sprintf, as that infringes on the user's name space.
1153 Don't have undefined behavior even if the translation
1154 produced a string with the wrong number of "%s"s. */
1158 while ((*yyp = *yyformat) != '\0')
1159 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1161 yyp += yytnamerr (yyp, yyarg[yyi++]);
1172 #endif /* YYERROR_VERBOSE */
1174 /*-----------------------------------------------.
1175 | Release the memory associated to this symbol. |
1176 `-----------------------------------------------*/
1179 #if (defined __STDC__ || defined __C99__FUNC__ \
1180 || defined __cplusplus || defined _MSC_VER)
1182 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1185 yydestruct (yymsg, yytype, yyvaluep)
1195 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1206 /* Prevent warnings from -Wmissing-prototypes. */
1207 #ifdef YYPARSE_PARAM
1208 #if defined __STDC__ || defined __cplusplus
1209 int yyparse (void *YYPARSE_PARAM);
1213 #else /* ! YYPARSE_PARAM */
1214 #if defined __STDC__ || defined __cplusplus
1219 #endif /* ! YYPARSE_PARAM */
1222 /* The lookahead symbol. */
1225 /* The semantic value of the lookahead symbol. */
1228 /* Number of syntax errors so far. */
1236 #ifdef YYPARSE_PARAM
1237 #if (defined __STDC__ || defined __C99__FUNC__ \
1238 || defined __cplusplus || defined _MSC_VER)
1240 yyparse (void *YYPARSE_PARAM)
1243 yyparse (YYPARSE_PARAM)
1244 void *YYPARSE_PARAM;
1246 #else /* ! YYPARSE_PARAM */
1247 #if (defined __STDC__ || defined __C99__FUNC__ \
1248 || defined __cplusplus || defined _MSC_VER)
1259 /* Number of tokens to shift before error messages enabled. */
1262 /* The stacks and their tools:
1263 `yyss': related to states.
1264 `yyvs': related to semantic values.
1266 Refer to the stacks thru separate pointers, to allow yyoverflow
1267 to reallocate them elsewhere. */
1269 /* The state stack. */
1270 yytype_int16 yyssa[YYINITDEPTH];
1272 yytype_int16 *yyssp;
1274 /* The semantic value stack. */
1275 YYSTYPE yyvsa[YYINITDEPTH];
1279 YYSIZE_T yystacksize;
1283 /* Lookahead token as an internal (translated) token number. */
1285 /* The variables used to return semantic value and location from the
1290 /* Buffer for error messages, and its allocated size. */
1292 char *yymsg = yymsgbuf;
1293 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1296 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1298 /* The number of symbols on the RHS of the reduced rule.
1299 Keep to zero when no symbol should be popped. */
1305 yystacksize = YYINITDEPTH;
1307 YYDPRINTF ((stderr, "Starting parse\n"));
1312 yychar = YYEMPTY; /* Cause a token to be read. */
1314 /* Initialize stack pointers.
1315 Waste one element of value and location stack
1316 so that they stay on the same level as the state stack.
1317 The wasted elements are never initialized. */
1323 /*------------------------------------------------------------.
1324 | yynewstate -- Push a new state, which is found in yystate. |
1325 `------------------------------------------------------------*/
1327 /* In all cases, when you get here, the value and location stacks
1328 have just been pushed. So pushing a state here evens the stacks. */
1334 if (yyss + yystacksize - 1 <= yyssp)
1336 /* Get the current used size of the three stacks, in elements. */
1337 YYSIZE_T yysize = yyssp - yyss + 1;
1341 /* Give user a chance to reallocate the stack. Use copies of
1342 these so that the &'s don't force the real ones into
1344 YYSTYPE *yyvs1 = yyvs;
1345 yytype_int16 *yyss1 = yyss;
1347 /* Each stack pointer address is followed by the size of the
1348 data in use in that stack, in bytes. This used to be a
1349 conditional around just the two extra args, but that might
1350 be undefined if yyoverflow is a macro. */
1351 yyoverflow (YY_("memory exhausted"),
1352 &yyss1, yysize * sizeof (*yyssp),
1353 &yyvs1, yysize * sizeof (*yyvsp),
1359 #else /* no yyoverflow */
1360 # ifndef YYSTACK_RELOCATE
1361 goto yyexhaustedlab;
1363 /* Extend the stack our own way. */
1364 if (YYMAXDEPTH <= yystacksize)
1365 goto yyexhaustedlab;
1367 if (YYMAXDEPTH < yystacksize)
1368 yystacksize = YYMAXDEPTH;
1371 yytype_int16 *yyss1 = yyss;
1372 union yyalloc *yyptr =
1373 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1375 goto yyexhaustedlab;
1376 YYSTACK_RELOCATE (yyss_alloc, yyss);
1377 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1378 # undef YYSTACK_RELOCATE
1380 YYSTACK_FREE (yyss1);
1383 #endif /* no yyoverflow */
1385 yyssp = yyss + yysize - 1;
1386 yyvsp = yyvs + yysize - 1;
1388 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1389 (unsigned long int) yystacksize));
1391 if (yyss + yystacksize - 1 <= yyssp)
1395 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1397 if (yystate == YYFINAL)
1407 /* Do appropriate processing given the current state. Read a
1408 lookahead token if we need one and don't already have one. */
1410 /* First try to decide what to do without reference to lookahead token. */
1411 yyn = yypact[yystate];
1412 if (yypact_value_is_default (yyn))
1415 /* Not known => get a lookahead token if don't already have one. */
1417 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1418 if (yychar == YYEMPTY)
1420 YYDPRINTF ((stderr, "Reading a token: "));
1424 if (yychar <= YYEOF)
1426 yychar = yytoken = YYEOF;
1427 YYDPRINTF ((stderr, "Now at end of input.\n"));
1431 yytoken = YYTRANSLATE (yychar);
1432 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1435 /* If the proper action on seeing token YYTOKEN is to reduce or to
1436 detect an error, take that action. */
1438 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1443 if (yytable_value_is_error (yyn))
1449 /* Count tokens shifted since error; after three, turn off error
1454 /* Shift the lookahead token. */
1455 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1457 /* Discard the shifted token. */
1466 /*-----------------------------------------------------------.
1467 | yydefault -- do the default action for the current state. |
1468 `-----------------------------------------------------------*/
1470 yyn = yydefact[yystate];
1476 /*-----------------------------.
1477 | yyreduce -- Do a reduction. |
1478 `-----------------------------*/
1480 /* yyn is the number of a rule to reduce with. */
1483 /* If YYLEN is nonzero, implement the default value of the action:
1486 Otherwise, the following line sets YYVAL to garbage.
1487 This behavior is undocumented and Bison
1488 users should not rely upon it. Assigning to YYVAL
1489 unconditionally makes the parser a bit smaller, and it avoids a
1490 GCC warning that YYVAL may be used uninitialized. */
1491 yyval = yyvsp[1-yylen];
1494 YY_REDUCE_PRINT (yyn);
1499 /* Line 1806 of yacc.c */
1500 #line 133 "lib/conf-parse.y"
1501 { sensors_bus new_el;
1502 new_el.line = (yyvsp[(1) - (3)].line);
1503 new_el.bus = (yyvsp[(2) - (3)].bus);
1504 new_el.adapter = (yyvsp[(3) - (3)].name);
1505 bus_add_el(&new_el);
1511 /* Line 1806 of yacc.c */
1512 #line 142 "lib/conf-parse.y"
1513 { sensors_label new_el;
1514 if (!current_chip) {
1515 sensors_yyerror("Label statement before first chip statement");
1516 free((yyvsp[(2) - (3)].name));
1517 free((yyvsp[(3) - (3)].name));
1520 new_el.line = (yyvsp[(1) - (3)].line);
1521 new_el.name = (yyvsp[(2) - (3)].name);
1522 new_el.value = (yyvsp[(3) - (3)].name);
1523 label_add_el(&new_el);
1529 /* Line 1806 of yacc.c */
1530 #line 157 "lib/conf-parse.y"
1531 { sensors_set new_el;
1532 if (!current_chip) {
1533 sensors_yyerror("Set statement before first chip statement");
1534 free((yyvsp[(2) - (3)].name));
1535 sensors_free_expr((yyvsp[(3) - (3)].expr));
1538 new_el.line = (yyvsp[(1) - (3)].line);
1539 new_el.name = (yyvsp[(2) - (3)].name);
1540 new_el.value = (yyvsp[(3) - (3)].expr);
1541 set_add_el(&new_el);
1547 /* Line 1806 of yacc.c */
1548 #line 172 "lib/conf-parse.y"
1549 { sensors_compute new_el;
1550 if (!current_chip) {
1551 sensors_yyerror("Compute statement before first chip statement");
1552 free((yyvsp[(2) - (5)].name));
1553 sensors_free_expr((yyvsp[(3) - (5)].expr));
1554 sensors_free_expr((yyvsp[(5) - (5)].expr));
1557 new_el.line = (yyvsp[(1) - (5)].line);
1558 new_el.name = (yyvsp[(2) - (5)].name);
1559 new_el.from_proc = (yyvsp[(3) - (5)].expr);
1560 new_el.to_proc = (yyvsp[(5) - (5)].expr);
1561 compute_add_el(&new_el);
1567 /* Line 1806 of yacc.c */
1568 #line 189 "lib/conf-parse.y"
1569 { sensors_ignore new_el;
1570 if (!current_chip) {
1571 sensors_yyerror("Ignore statement before first chip statement");
1572 free((yyvsp[(2) - (2)].name));
1575 new_el.line = (yyvsp[(1) - (2)].line);
1576 new_el.name = (yyvsp[(2) - (2)].name);
1577 ignore_add_el(&new_el);
1583 /* Line 1806 of yacc.c */
1584 #line 202 "lib/conf-parse.y"
1585 { sensors_chip new_el;
1586 new_el.line = (yyvsp[(1) - (2)].line);
1587 new_el.labels = NULL;
1589 new_el.computes = NULL;
1590 new_el.ignores = NULL;
1591 new_el.labels_count = new_el.labels_max = 0;
1592 new_el.sets_count = new_el.sets_max = 0;
1593 new_el.computes_count = new_el.computes_max = 0;
1594 new_el.ignores_count = new_el.ignores_max = 0;
1595 new_el.chips = (yyvsp[(2) - (2)].chips);
1596 chip_add_el(&new_el);
1597 current_chip = sensors_config_chips +
1598 sensors_config_chips_count - 1;
1604 /* Line 1806 of yacc.c */
1605 #line 220 "lib/conf-parse.y"
1607 (yyval.chips).fits = NULL;
1608 (yyval.chips).fits_count = (yyval.chips).fits_max = 0;
1609 fits_add_el(&(yyvsp[(1) - (1)].chip),(yyval.chips));
1615 /* Line 1806 of yacc.c */
1616 #line 226 "lib/conf-parse.y"
1617 { (yyval.chips) = (yyvsp[(1) - (2)].chips);
1618 fits_add_el(&(yyvsp[(2) - (2)].chip),(yyval.chips));
1624 /* Line 1806 of yacc.c */
1625 #line 232 "lib/conf-parse.y"
1626 { (yyval.expr) = malloc_expr();
1627 (yyval.expr)->data.val = (yyvsp[(1) - (1)].value);
1628 (yyval.expr)->kind = sensors_kind_val;
1634 /* Line 1806 of yacc.c */
1635 #line 237 "lib/conf-parse.y"
1636 { (yyval.expr) = malloc_expr();
1637 (yyval.expr)->data.var = (yyvsp[(1) - (1)].name);
1638 (yyval.expr)->kind = sensors_kind_var;
1644 /* Line 1806 of yacc.c */
1645 #line 242 "lib/conf-parse.y"
1646 { (yyval.expr) = malloc_expr();
1647 (yyval.expr)->kind = sensors_kind_source;
1653 /* Line 1806 of yacc.c */
1654 #line 246 "lib/conf-parse.y"
1655 { (yyval.expr) = malloc_expr();
1656 (yyval.expr)->kind = sensors_kind_sub;
1657 (yyval.expr)->data.subexpr.op = sensors_add;
1658 (yyval.expr)->data.subexpr.sub1 = (yyvsp[(1) - (3)].expr);
1659 (yyval.expr)->data.subexpr.sub2 = (yyvsp[(3) - (3)].expr);
1665 /* Line 1806 of yacc.c */
1666 #line 253 "lib/conf-parse.y"
1667 { (yyval.expr) = malloc_expr();
1668 (yyval.expr)->kind = sensors_kind_sub;
1669 (yyval.expr)->data.subexpr.op = sensors_sub;
1670 (yyval.expr)->data.subexpr.sub1 = (yyvsp[(1) - (3)].expr);
1671 (yyval.expr)->data.subexpr.sub2 = (yyvsp[(3) - (3)].expr);
1677 /* Line 1806 of yacc.c */
1678 #line 260 "lib/conf-parse.y"
1679 { (yyval.expr) = malloc_expr();
1680 (yyval.expr)->kind = sensors_kind_sub;
1681 (yyval.expr)->data.subexpr.op = sensors_multiply;
1682 (yyval.expr)->data.subexpr.sub1 = (yyvsp[(1) - (3)].expr);
1683 (yyval.expr)->data.subexpr.sub2 = (yyvsp[(3) - (3)].expr);
1689 /* Line 1806 of yacc.c */
1690 #line 267 "lib/conf-parse.y"
1691 { (yyval.expr) = malloc_expr();
1692 (yyval.expr)->kind = sensors_kind_sub;
1693 (yyval.expr)->data.subexpr.op = sensors_divide;
1694 (yyval.expr)->data.subexpr.sub1 = (yyvsp[(1) - (3)].expr);
1695 (yyval.expr)->data.subexpr.sub2 = (yyvsp[(3) - (3)].expr);
1701 /* Line 1806 of yacc.c */
1702 #line 274 "lib/conf-parse.y"
1703 { (yyval.expr) = malloc_expr();
1704 (yyval.expr)->kind = sensors_kind_sub;
1705 (yyval.expr)->data.subexpr.op = sensors_negate;
1706 (yyval.expr)->data.subexpr.sub1 = (yyvsp[(2) - (2)].expr);
1707 (yyval.expr)->data.subexpr.sub2 = NULL;
1713 /* Line 1806 of yacc.c */
1714 #line 281 "lib/conf-parse.y"
1715 { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
1720 /* Line 1806 of yacc.c */
1721 #line 283 "lib/conf-parse.y"
1722 { (yyval.expr) = malloc_expr();
1723 (yyval.expr)->kind = sensors_kind_sub;
1724 (yyval.expr)->data.subexpr.op = sensors_exp;
1725 (yyval.expr)->data.subexpr.sub1 = (yyvsp[(2) - (2)].expr);
1726 (yyval.expr)->data.subexpr.sub2 = NULL;
1732 /* Line 1806 of yacc.c */
1733 #line 290 "lib/conf-parse.y"
1734 { (yyval.expr) = malloc_expr();
1735 (yyval.expr)->kind = sensors_kind_sub;
1736 (yyval.expr)->data.subexpr.op = sensors_log;
1737 (yyval.expr)->data.subexpr.sub1 = (yyvsp[(2) - (2)].expr);
1738 (yyval.expr)->data.subexpr.sub2 = NULL;
1744 /* Line 1806 of yacc.c */
1745 #line 299 "lib/conf-parse.y"
1746 { int res = sensors_parse_bus_id((yyvsp[(1) - (1)].name),&(yyval.bus));
1747 free((yyvsp[(1) - (1)].name));
1749 sensors_yyerror("Parse error in bus id");
1757 /* Line 1806 of yacc.c */
1758 #line 309 "lib/conf-parse.y"
1759 { (yyval.name) = (yyvsp[(1) - (1)].name); }
1764 /* Line 1806 of yacc.c */
1765 #line 313 "lib/conf-parse.y"
1766 { (yyval.name) = (yyvsp[(1) - (1)].name); }
1771 /* Line 1806 of yacc.c */
1772 #line 317 "lib/conf-parse.y"
1773 { (yyval.name) = (yyvsp[(1) - (1)].name); }
1778 /* Line 1806 of yacc.c */
1779 #line 321 "lib/conf-parse.y"
1780 { int res = sensors_parse_chip_name((yyvsp[(1) - (1)].name),&(yyval.chip));
1781 free((yyvsp[(1) - (1)].name));
1783 sensors_yyerror("Parse error in chip name");
1791 /* Line 1806 of yacc.c */
1792 #line 1793 "lib/conf-parse.c"
1795 /* User semantic actions sometimes alter yychar, and that requires
1796 that yytoken be updated with the new translation. We take the
1797 approach of translating immediately before every use of yytoken.
1798 One alternative is translating here after every semantic action,
1799 but that translation would be missed if the semantic action invokes
1800 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1801 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1802 incorrect destructor might then be invoked immediately. In the
1803 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1804 to an incorrect destructor call or verbose syntax error message
1805 before the lookahead is translated. */
1806 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1810 YY_STACK_PRINT (yyss, yyssp);
1814 /* Now `shift' the result of the reduction. Determine what state
1815 that goes to, based on the state we popped back to and the rule
1816 number reduced by. */
1820 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1821 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1822 yystate = yytable[yystate];
1824 yystate = yydefgoto[yyn - YYNTOKENS];
1829 /*------------------------------------.
1830 | yyerrlab -- here on detecting error |
1831 `------------------------------------*/
1833 /* Make sure we have latest lookahead translation. See comments at
1834 user semantic actions for why this is necessary. */
1835 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1837 /* If not already recovering from an error, report this error. */
1841 #if ! YYERROR_VERBOSE
1842 yyerror (YY_("syntax error"));
1844 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1847 char const *yymsgp = YY_("syntax error");
1848 int yysyntax_error_status;
1849 yysyntax_error_status = YYSYNTAX_ERROR;
1850 if (yysyntax_error_status == 0)
1852 else if (yysyntax_error_status == 1)
1854 if (yymsg != yymsgbuf)
1855 YYSTACK_FREE (yymsg);
1856 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1860 yymsg_alloc = sizeof yymsgbuf;
1861 yysyntax_error_status = 2;
1865 yysyntax_error_status = YYSYNTAX_ERROR;
1870 if (yysyntax_error_status == 2)
1871 goto yyexhaustedlab;
1873 # undef YYSYNTAX_ERROR
1879 if (yyerrstatus == 3)
1881 /* If just tried and failed to reuse lookahead token after an
1882 error, discard it. */
1884 if (yychar <= YYEOF)
1886 /* Return failure if at end of input. */
1887 if (yychar == YYEOF)
1892 yydestruct ("Error: discarding",
1898 /* Else will try to reuse lookahead token after shifting the error
1903 /*---------------------------------------------------.
1904 | yyerrorlab -- error raised explicitly by YYERROR. |
1905 `---------------------------------------------------*/
1908 /* Pacify compilers like GCC when the user code never invokes
1909 YYERROR and the label yyerrorlab therefore never appears in user
1911 if (/*CONSTCOND*/ 0)
1914 /* Do not reclaim the symbols of the rule which action triggered
1918 YY_STACK_PRINT (yyss, yyssp);
1923 /*-------------------------------------------------------------.
1924 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1925 `-------------------------------------------------------------*/
1927 yyerrstatus = 3; /* Each real token shifted decrements this. */
1931 yyn = yypact[yystate];
1932 if (!yypact_value_is_default (yyn))
1935 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1943 /* Pop the current state because it cannot handle the error token. */
1948 yydestruct ("Error: popping",
1949 yystos[yystate], yyvsp);
1952 YY_STACK_PRINT (yyss, yyssp);
1958 /* Shift the error token. */
1959 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1965 /*-------------------------------------.
1966 | yyacceptlab -- YYACCEPT comes here. |
1967 `-------------------------------------*/
1972 /*-----------------------------------.
1973 | yyabortlab -- YYABORT comes here. |
1974 `-----------------------------------*/
1979 #if !defined(yyoverflow) || YYERROR_VERBOSE
1980 /*-------------------------------------------------.
1981 | yyexhaustedlab -- memory exhaustion comes here. |
1982 `-------------------------------------------------*/
1984 yyerror (YY_("memory exhausted"));
1990 if (yychar != YYEMPTY)
1992 /* Make sure we have latest lookahead translation. See comments at
1993 user semantic actions for why this is necessary. */
1994 yytoken = YYTRANSLATE (yychar);
1995 yydestruct ("Cleanup: discarding lookahead",
1998 /* Do not reclaim the symbols of the rule which action triggered
1999 this YYABORT or YYACCEPT. */
2001 YY_STACK_PRINT (yyss, yyssp);
2002 while (yyssp != yyss)
2004 yydestruct ("Cleanup: popping",
2005 yystos[*yyssp], yyvsp);
2010 YYSTACK_FREE (yyss);
2013 if (yymsg != yymsgbuf)
2014 YYSTACK_FREE (yymsg);
2016 /* Make sure YYID is used. */
2017 return YYID (yyresult);
2022 /* Line 2067 of yacc.c */
2023 #line 330 "lib/conf-parse.y"
2026 void sensors_yyerror(const char *err)
2028 if (sensors_lex_error[0]) {
2029 sensors_parse_error_wfn(sensors_lex_error, sensors_yyfilename, sensors_yylineno);
2030 sensors_lex_error[0] = '\0';
2032 sensors_parse_error_wfn(err, sensors_yyfilename, sensors_yylineno);
2035 sensors_expr *malloc_expr(void)
2037 sensors_expr *res = malloc(sizeof(sensors_expr));
2039 sensors_fatal_error(__func__, "Allocating a new expression");