1 /* A Bison parser, made from /home/anholt/xserver-stable/hw/dmx/config/parser.y, by GNU bison 1.75. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
42 /* Using locations. */
43 #define YYLSP_NEEDED 0
50 /* Put the tokens into the symbol table, so that GDB and other debuggers
72 #define T_DIMENSION 264
76 #define T_LINE_COMMENT 268
81 /* Copy the first part of user declarations. */
84 #ifdef HAVE_DMX_CONFIG_H
85 #include <dmx-config.h>
92 #define YYERROR_VERBOSE
95 DMXConfigEntryPtr dmxConfigEntry
= NULL
;
96 #define APPEND(type, h, t) \
99 for (pt = h; pt->next; pt = pt->next); \
104 /* Enabling traces. */
109 /* Enabling verbose error messages. */
110 #ifdef YYERROR_VERBOSE
111 # undef YYERROR_VERBOSE
112 # define YYERROR_VERBOSE 1
114 # define YYERROR_VERBOSE 0
120 DMXConfigTokenPtr token
;
121 DMXConfigStringPtr string
;
122 DMXConfigNumberPtr number
;
123 DMXConfigPairPtr pair
;
124 DMXConfigFullDimPtr fdim
;
125 DMXConfigPartDimPtr pdim
;
126 DMXConfigDisplayPtr display
;
127 DMXConfigWallPtr wall
;
128 DMXConfigOptionPtr option
;
129 DMXConfigParamPtr param
;
130 DMXConfigCommentPtr comment
;
131 DMXConfigSubPtr subentry
;
132 DMXConfigVirtualPtr
virtual;
133 DMXConfigEntryPtr entry
;
135 /* Line 188 of /usr/local/share/bison/yacc.c. */
137 # define YYSTYPE yystype
138 # define YYSTYPE_IS_TRIVIAL 1
142 typedef struct yyltype
149 # define YYLTYPE yyltype
150 # define YYLTYPE_IS_TRIVIAL 1
153 /* Copy the second part of user declarations. */
156 /* Line 213 of /usr/local/share/bison/yacc.c. */
159 #if ! defined (yyoverflow) || YYERROR_VERBOSE
161 /* The parser invokes alloca or malloc; define the necessary symbols. */
163 # if YYSTACK_USE_ALLOCA
164 # define YYSTACK_ALLOC alloca
166 # ifndef YYSTACK_USE_ALLOCA
167 # if defined (alloca) || defined (_ALLOCA_H)
168 # define YYSTACK_ALLOC alloca
171 # define YYSTACK_ALLOC __builtin_alloca
177 # ifdef YYSTACK_ALLOC
178 /* Pacify GCC's `empty if-body' warning. */
179 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
181 # if defined (__STDC__) || defined (__cplusplus)
182 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
183 # define YYSIZE_T size_t
185 # define YYSTACK_ALLOC malloc
186 # define YYSTACK_FREE free
188 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
191 #if (! defined (yyoverflow) \
192 && (! defined (__cplusplus) \
193 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
195 /* A type that is properly aligned for any stack member. */
202 /* The size of the maximum gap between one aligned stack and the next. */
203 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
205 /* The size of an array large to enough to hold all stacks, each with
207 # define YYSTACK_BYTES(N) \
208 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
211 /* Copy COUNT objects from FROM to TO. The source and destination do
215 # define YYCOPY(To, From, Count) \
216 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
218 # define YYCOPY(To, From, Count) \
221 register YYSIZE_T yyi; \
222 for (yyi = 0; yyi < (Count); yyi++) \
223 (To)[yyi] = (From)[yyi]; \
229 /* Relocate STACK from its old location to the new one. The
230 local variables YYSIZE and YYSTACKSIZE give the old and new number of
231 elements in the stack, and YYPTR gives the new location of the
232 stack. Advance YYPTR to a properly aligned location for the next
234 # define YYSTACK_RELOCATE(Stack) \
237 YYSIZE_T yynewbytes; \
238 YYCOPY (&yyptr->Stack, Stack, yysize); \
239 Stack = &yyptr->Stack; \
240 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
241 yyptr += yynewbytes / sizeof (*yyptr); \
247 #if defined (__STDC__) || defined (__cplusplus)
248 typedef signed char yysigned_char
;
250 typedef short yysigned_char
;
253 /* YYFINAL -- State number of the termination state. */
257 /* YYNTOKENS -- Number of terminals. */
259 /* YYNNTS -- Number of nonterminals. */
261 /* YYNRULES -- Number of rules. */
263 /* YYNRULES -- Number of states. */
266 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
268 #define YYMAXUTOK 268
270 #define YYTRANSLATE(X) \
271 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
273 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
274 static const unsigned char yytranslate
[] =
276 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 6, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 5,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 3, 2, 4, 2, 2, 2, 2,
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
293 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
294 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
297 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
298 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
299 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
300 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
301 2, 2, 2, 2, 2, 2, 1, 2, 7, 8,
302 9, 10, 11, 12, 13, 14, 15, 16, 17
306 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
308 static const unsigned char yyprhs
[] =
310 0, 0, 3, 5, 7, 10, 12, 14, 19, 25,
311 31, 38, 40, 43, 45, 47, 49, 51, 53, 57,
312 61, 66, 68, 71, 74, 77, 79, 81, 85, 88,
313 90, 96, 101, 106, 111, 115, 119, 122, 128, 133,
314 137, 139, 142, 144, 147, 149, 152, 154, 157, 159,
315 162, 164, 167, 169, 172, 174, 177, 179, 182, 184
318 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
319 static const yysigned_char yyrhs
[] =
321 19, 0, -1, 20, -1, 21, -1, 20, 21, -1,
322 22, -1, 17, -1, 7, 39, 23, 40, -1, 7,
323 35, 39, 23, 40, -1, 7, 34, 39, 23, 40,
324 -1, 7, 34, 35, 39, 23, 40, -1, 24, -1,
325 23, 24, -1, 17, -1, 31, -1, 32, -1, 25,
326 -1, 26, -1, 10, 42, 38, -1, 11, 42, 38,
327 -1, 11, 39, 27, 40, -1, 28, -1, 27, 28,
328 -1, 42, 38, -1, 35, 36, -1, 35, -1, 36,
329 -1, 29, 6, 29, -1, 6, 29, -1, 29, -1,
330 33, 34, 30, 37, 38, -1, 33, 30, 37, 38,
331 -1, 33, 34, 37, 38, -1, 33, 34, 30, 38,
332 -1, 33, 30, 38, -1, 33, 34, 38, -1, 33,
333 38, -1, 41, 35, 35, 42, 38, -1, 41, 35,
334 42, 38, -1, 41, 42, 38, -1, 8, -1, 8,
335 16, -1, 12, -1, 12, 16, -1, 13, -1, 13,
336 16, -1, 14, -1, 14, 16, -1, 15, -1, 15,
337 16, -1, 5, -1, 5, 16, -1, 3, -1, 3,
338 16, -1, 4, -1, 4, 16, -1, 9, -1, 9,
339 16, -1, 34, -1, 42, 34, -1
342 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
343 static const unsigned char yyrline
[] =
345 0, 95, 95, 98, 99, 102, 103, 106, 108, 110,
346 112, 116, 117, 120, 121, 122, 123, 124, 127, 131,
347 133, 139, 140, 143, 147, 149, 151, 155, 157, 159,
348 163, 165, 167, 170, 172, 174, 176, 180, 182, 184,
349 188, 189, 192, 193, 196, 197, 200, 201, 204, 205,
350 208, 209, 212, 213, 216, 217, 220, 221, 224, 225
354 #if YYDEBUG || YYERROR_VERBOSE
355 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
356 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
357 static const char *const yytname
[] =
359 "$end", "error", "$undefined", "'{'", "'}'", "';'", "'/'", "T_VIRTUAL",
360 "T_DISPLAY", "T_WALL", "T_OPTION", "T_PARAM", "T_STRING", "T_DIMENSION",
361 "T_OFFSET", "T_ORIGIN", "T_COMMENT", "T_LINE_COMMENT", "$accept",
362 "Program", "EntryList", "Entry", "Virtual", "SubList", "Sub",
363 "OptionEntry", "ParamEntry", "ParamList", "Param", "PartialDim",
364 "FullDim", "DisplayEntry", "WallEntry", "Display", "Name", "Dimension",
365 "Offset", "Origin", "Terminal", "Open", "Close", "Wall", "NameList", 0
370 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
372 static const unsigned short yytoknum
[] =
374 0, 256, 257, 123, 125, 59, 47, 258, 259, 260,
375 261, 262, 263, 264, 265, 266, 267, 268
379 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
380 static const unsigned char yyr1
[] =
382 0, 18, 19, 20, 20, 21, 21, 22, 22, 22,
383 22, 23, 23, 24, 24, 24, 24, 24, 25, 26,
384 26, 27, 27, 28, 29, 29, 29, 30, 30, 30,
385 31, 31, 31, 31, 31, 31, 31, 32, 32, 32,
386 33, 33, 34, 34, 35, 35, 36, 36, 37, 37,
387 38, 38, 39, 39, 40, 40, 41, 41, 42, 42
390 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
391 static const unsigned char yyr2
[] =
393 0, 2, 1, 1, 2, 1, 1, 4, 5, 5,
394 6, 1, 2, 1, 1, 1, 1, 1, 3, 3,
395 4, 1, 2, 2, 2, 1, 1, 3, 2, 1,
396 5, 4, 4, 4, 3, 3, 2, 5, 4, 3,
397 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
398 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
401 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
402 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
403 means the default is an error. */
404 static const unsigned char yydefact
[] =
406 0, 0, 6, 0, 2, 3, 5, 52, 42, 44,
407 0, 0, 0, 1, 4, 53, 43, 45, 0, 0,
408 0, 40, 56, 0, 0, 13, 0, 11, 16, 17,
409 14, 15, 0, 0, 0, 0, 0, 41, 57, 58,
410 0, 0, 0, 54, 12, 7, 50, 0, 46, 29,
411 0, 0, 25, 26, 36, 0, 0, 0, 9, 8,
412 59, 18, 0, 21, 0, 19, 55, 51, 28, 47,
413 0, 48, 0, 34, 0, 0, 35, 24, 0, 0,
414 39, 10, 22, 20, 23, 27, 49, 31, 0, 33,
418 /* YYDEFGOTO[NTERM-NUM]. */
419 static const yysigned_char yydefgoto
[] =
421 -1, 3, 4, 5, 6, 26, 27, 28, 29, 62,
422 63, 49, 50, 30, 31, 32, 39, 52, 53, 72,
426 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
428 #define YYPACT_NINF -32
429 static const yysigned_char yypact
[] =
431 -3, 41, -32, 22, -3, -32, -32, 12, 35, 46,
432 5, 62, 75, -32, -32, -32, -32, -32, 62, 75,
433 75, 51, 54, 59, 18, -32, 65, -32, -32, -32,
434 -32, -32, 88, 37, 75, 65, 65, -32, -32, -32,
435 86, 59, 86, 61, -32, -32, 79, -4, 80, 28,
436 31, 74, 67, -32, -32, 37, 86, 65, -32, -32,
437 -32, -32, 56, -32, 86, -32, -32, -32, -32, -32,
438 -4, 81, 94, -32, 31, 94, -32, -32, 59, 86,
439 -32, -32, -32, -32, -32, -32, -32, -32, 94, -32,
440 -32, 86, -32, -32, -32
443 /* YYPGOTO[NTERM-NUM]. */
444 static const yysigned_char yypgoto
[] =
446 -32, -32, -32, 99, -32, 6, -19, -32, -32, -32,
447 42, -28, 55, -32, -32, -32, -1, 2, 53, -31,
448 -27, 48, -30, -32, -22
451 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
452 positive, shift that token. If negative, reduce the rule which
453 number is the opposite. If zero, do what YYDEFACT says.
454 If YYTABLE_NINF, parse error. */
455 #define YYTABLE_NINF -1
456 static const unsigned char yytable
[] =
458 10, 40, 42, 11, 1, 58, 59, 44, 7, 9,
459 48, 56, 18, 61, 2, 65, 44, 44, 9, 68,
460 75, 7, 13, 73, 76, 35, 36, 81, 15, 80,
461 8, 51, 83, 79, 70, 55, 46, 84, 44, 60,
462 57, 60, 85, 88, 7, 87, 71, 89, 90, 8,
463 9, 16, 92, 8, 9, 60, 91, 78, 19, 20,
464 43, 93, 17, 60, 94, 7, 34, 37, 8, 43,
465 38, 8, 41, 21, 22, 23, 24, 66, 60, 46,
466 47, 48, 25, 21, 22, 23, 24, 9, 48, 71,
467 60, 46, 25, 46, 47, 67, 69, 86, 8, 46,
468 8, 9, 48, 14, 82, 77, 74
471 static const unsigned char yycheck
[] =
473 1, 23, 24, 1, 7, 35, 36, 26, 3, 13,
474 14, 33, 10, 40, 17, 42, 35, 36, 13, 47,
475 51, 3, 0, 50, 51, 19, 20, 57, 16, 56,
476 12, 32, 62, 55, 6, 33, 5, 64, 57, 40,
477 34, 42, 70, 74, 3, 72, 15, 74, 75, 12,
478 13, 16, 79, 12, 13, 56, 78, 55, 10, 11,
479 4, 88, 16, 64, 91, 3, 18, 16, 12, 4,
480 16, 12, 24, 8, 9, 10, 11, 16, 79, 5,
481 6, 14, 17, 8, 9, 10, 11, 13, 14, 15,
482 91, 5, 17, 5, 6, 16, 16, 16, 12, 5,
483 12, 13, 14, 4, 62, 52, 51
486 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
487 symbol of state STATE-NUM. */
488 static const unsigned char yystos
[] =
490 0, 7, 17, 19, 20, 21, 22, 3, 12, 13,
491 34, 35, 39, 0, 21, 16, 16, 16, 35, 39,
492 39, 8, 9, 10, 11, 17, 23, 24, 25, 26,
493 31, 32, 33, 41, 39, 23, 23, 16, 16, 34,
494 42, 39, 42, 4, 24, 40, 5, 6, 14, 29,
495 30, 34, 35, 36, 38, 35, 42, 23, 40, 40,
496 34, 38, 27, 28, 42, 38, 16, 16, 29, 16,
497 6, 15, 37, 38, 30, 37, 38, 36, 35, 42,
498 38, 40, 28, 40, 38, 29, 16, 38, 37, 38,
502 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
503 # define YYSIZE_T __SIZE_TYPE__
505 #if ! defined (YYSIZE_T) && defined (size_t)
506 # define YYSIZE_T size_t
508 #if ! defined (YYSIZE_T)
509 # if defined (__STDC__) || defined (__cplusplus)
510 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
511 # define YYSIZE_T size_t
514 #if ! defined (YYSIZE_T)
515 # define YYSIZE_T unsigned int
518 #define yyerrok (yyerrstatus = 0)
519 #define yyclearin (yychar = YYEMPTY)
523 #define YYACCEPT goto yyacceptlab
524 #define YYABORT goto yyabortlab
525 #define YYERROR goto yyerrlab1
527 /* Like YYERROR except do call yyerror. This remains here temporarily
528 to ease the transition to the new meaning of YYERROR, for GCC.
529 Once GCC version 2 has supplanted version 1, this can go. */
531 #define YYFAIL goto yyerrlab
533 #define YYRECOVERING() (!!yyerrstatus)
535 #define YYBACKUP(Token, Value) \
537 if (yychar == YYEMPTY && yylen == 1) \
541 yychar1 = YYTRANSLATE (yychar); \
547 yyerror ("syntax error: cannot back up"); \
553 #define YYERRCODE 256
555 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
558 #ifndef YYLLOC_DEFAULT
559 # define YYLLOC_DEFAULT(Current, Rhs, N) \
560 Current.first_line = Rhs[1].first_line; \
561 Current.first_column = Rhs[1].first_column; \
562 Current.last_line = Rhs[N].last_line; \
563 Current.last_column = Rhs[N].last_column;
566 /* YYLEX -- calling `yylex' with the right arguments. */
568 #define YYLEX yylex ()
570 /* Enable debugging if requested. */
574 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
575 # define YYFPRINTF fprintf
578 # define YYDPRINTF(Args) \
583 # define YYDSYMPRINT(Args) \
588 /* Nonzero means print parse trace. It is left uninitialized so that
589 multiple parsers can coexist. */
592 # define YYDPRINTF(Args)
593 # define YYDSYMPRINT(Args)
594 #endif /* !YYDEBUG */
596 /* YYINITDEPTH -- initial size of the parser's stacks. */
598 # define YYINITDEPTH 200
601 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
602 if the built-in stack extension method is used).
604 Do not make this value too large; the results are undefined if
605 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
606 evaluated with infinite-precision integer arithmetic. */
613 # define YYMAXDEPTH 10000
621 # if defined (__GLIBC__) && defined (_STRING_H)
622 # define yystrlen strlen
624 /* Return the length of YYSTR. */
626 # if defined (__STDC__) || defined (__cplusplus)
627 yystrlen (const char *yystr
)
633 register const char *yys
= yystr
;
635 while (*yys
++ != '\0')
638 return yys
- yystr
- 1;
644 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
645 # define yystpcpy stpcpy
647 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
650 # if defined (__STDC__) || defined (__cplusplus)
651 yystpcpy (char *yydest
, const char *yysrc
)
653 yystpcpy (yydest
, yysrc
)
658 register char *yyd
= yydest
;
659 register const char *yys
= yysrc
;
661 while ((*yyd
++ = *yys
++) != '\0')
669 #endif /* !YYERROR_VERBOSE */
674 /*-----------------------------.
675 | Print this symbol on YYOUT. |
676 `-----------------------------*/
679 #if defined (__STDC__) || defined (__cplusplus)
680 yysymprint (FILE* yyout
, int yytype
, YYSTYPE yyvalue
)
682 yysymprint (yyout
, yytype
, yyvalue
)
688 /* Pacify ``unused variable'' warnings. */
691 if (yytype
< YYNTOKENS
)
693 YYFPRINTF (yyout
, "token %s (", yytname
[yytype
]);
695 YYPRINT (yyout
, yytoknum
[yytype
], yyvalue
);
699 YYFPRINTF (yyout
, "nterm %s (", yytname
[yytype
]);
706 YYFPRINTF (yyout
, ")");
708 #endif /* YYDEBUG. */
711 /*-----------------------------------------------.
712 | Release the memory associated to this symbol. |
713 `-----------------------------------------------*/
716 #if defined (__STDC__) || defined (__cplusplus)
717 yydestruct (int yytype
, YYSTYPE yyvalue
)
719 yydestruct (yytype
, yyvalue
)
724 /* Pacify ``unused variable'' warnings. */
736 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
737 into yyparse. The argument should have type void *.
738 It should actually point to an object.
739 Grammar actions can access the variable by casting it
740 to the proper pointer type. */
743 # if defined (__STDC__) || defined (__cplusplus)
744 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
745 # define YYPARSE_PARAM_DECL
747 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
748 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
750 #else /* !YYPARSE_PARAM */
751 # define YYPARSE_PARAM_ARG
752 # define YYPARSE_PARAM_DECL
753 #endif /* !YYPARSE_PARAM */
755 /* Prevent warning if -Wstrict-prototypes. */
757 # ifdef YYPARSE_PARAM
758 int yyparse (void *);
765 /* The lookahead symbol. */
768 /* The semantic value of the lookahead symbol. */
771 /* Number of parse errors so far. */
776 yyparse (YYPARSE_PARAM_ARG
)
780 register int yystate
;
783 /* Number of tokens to shift before error messages enabled. */
785 /* Lookahead token as an internal (translated) token number. */
788 /* Three stacks and their tools:
789 `yyss': related to states,
790 `yyvs': related to semantic values,
791 `yyls': related to locations.
793 Refer to the stacks thru separate pointers, to allow yyoverflow
794 to reallocate them elsewhere. */
796 /* The state stack. */
797 short yyssa
[YYINITDEPTH
];
799 register short *yyssp
;
801 /* The semantic value stack. */
802 YYSTYPE yyvsa
[YYINITDEPTH
];
803 YYSTYPE
*yyvs
= yyvsa
;
804 register YYSTYPE
*yyvsp
;
808 #define YYPOPSTACK (yyvsp--, yyssp--)
810 YYSIZE_T yystacksize
= YYINITDEPTH
;
812 /* The variables used to return semantic value and location from the
817 /* When reducing, the number of symbols on the RHS of the reduced
821 YYDPRINTF ((stderr
, "Starting parse\n"));
826 yychar
= YYEMPTY
; /* Cause a token to be read. */
828 /* Initialize stack pointers.
829 Waste one element of value and location stack
830 so that they stay on the same level as the state stack.
831 The wasted elements are never initialized. */
838 /*------------------------------------------------------------.
839 | yynewstate -- Push a new state, which is found in yystate. |
840 `------------------------------------------------------------*/
842 /* In all cases, when you get here, the value and location stacks
843 have just been pushed. so pushing a state here evens the stacks.
850 if (yyssp
>= yyss
+ yystacksize
- 1)
852 /* Get the current used size of the three stacks, in elements. */
853 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
857 /* Give user a chance to reallocate the stack. Use copies of
858 these so that the &'s don't force the real ones into
860 YYSTYPE
*yyvs1
= yyvs
;
864 /* Each stack pointer address is followed by the size of the
865 data in use in that stack, in bytes. This used to be a
866 conditional around just the two extra args, but that might
867 be undefined if yyoverflow is a macro. */
868 yyoverflow ("parser stack overflow",
869 &yyss1
, yysize
* sizeof (*yyssp
),
870 &yyvs1
, yysize
* sizeof (*yyvsp
),
877 #else /* no yyoverflow */
878 # ifndef YYSTACK_RELOCATE
881 /* Extend the stack our own way. */
882 if (yystacksize
>= YYMAXDEPTH
)
885 if (yystacksize
> YYMAXDEPTH
)
886 yystacksize
= YYMAXDEPTH
;
890 union yyalloc
*yyptr
=
891 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
894 YYSTACK_RELOCATE (yyss
);
895 YYSTACK_RELOCATE (yyvs
);
897 # undef YYSTACK_RELOCATE
899 YYSTACK_FREE (yyss1
);
902 #endif /* no yyoverflow */
904 yyssp
= yyss
+ yysize
- 1;
905 yyvsp
= yyvs
+ yysize
- 1;
908 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
909 (unsigned long int) yystacksize
));
911 if (yyssp
>= yyss
+ yystacksize
- 1)
915 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
924 /* Do appropriate processing given the current state. */
925 /* Read a lookahead token if we need one and don't already have one. */
928 /* First try to decide what to do without reference to lookahead token. */
930 yyn
= yypact
[yystate
];
931 if (yyn
== YYPACT_NINF
)
934 /* Not known => get a lookahead token if don't already have one. */
936 /* yychar is either YYEMPTY or YYEOF
937 or a valid token in external form. */
939 if (yychar
== YYEMPTY
)
941 YYDPRINTF ((stderr
, "Reading a token: "));
945 /* Convert token to internal form (in yychar1) for indexing tables with. */
947 if (yychar
<= 0) /* This means end of input. */
950 yychar
= YYEOF
; /* Don't call YYLEX any more. */
952 YYDPRINTF ((stderr
, "Now at end of input.\n"));
956 yychar1
= YYTRANSLATE (yychar
);
958 /* We have to keep this `#if YYDEBUG', since we use variables
959 which are defined only if `YYDEBUG' is set. */
960 YYDPRINTF ((stderr
, "Next token is "));
961 YYDSYMPRINT ((stderr
, yychar1
, yylval
));
962 YYDPRINTF ((stderr
, "\n"));
965 /* If the proper action on seeing token YYCHAR1 is to reduce or to
966 detect an error, take that action. */
968 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yychar1
)
973 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
982 /* Shift the lookahead token. */
983 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
984 yychar
, yytname
[yychar1
]));
986 /* Discard the token being shifted unless it is eof. */
993 /* Count tokens shifted since error; after three, turn off error
1002 /*-----------------------------------------------------------.
1003 | yydefault -- do the default action for the current state. |
1004 `-----------------------------------------------------------*/
1006 yyn
= yydefact
[yystate
];
1012 /*-----------------------------.
1013 | yyreduce -- Do a reduction. |
1014 `-----------------------------*/
1016 /* yyn is the number of a rule to reduce with. */
1019 /* If YYLEN is nonzero, implement the default value of the action:
1022 Otherwise, the following line sets YYVAL to garbage.
1023 This behavior is undocumented and Bison
1024 users should not rely upon it. Assigning to YYVAL
1025 unconditionally makes the parser a bit smaller, and it avoids a
1026 GCC warning that YYVAL may be used uninitialized. */
1027 yyval
= yyvsp
[1-yylen
];
1032 /* We have to keep this `#if YYDEBUG', since we use variables which
1033 are defined only if `YYDEBUG' is set. */
1038 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1039 yyn
- 1, yyrline
[yyn
]);
1041 /* Print the symbols being reduced, and their result. */
1042 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] >= 0; yyi
++)
1043 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1044 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1051 { dmxConfigEntry
= yyvsp
[0].entry
; }
1056 { APPEND(DMXConfigEntryPtr
,yyvsp
[-1].entry
,yyvsp
[0].entry
); yyval
.entry
= yyvsp
[-1].entry
; }
1060 #line 102 "parser.y"
1061 { yyval
.entry
= dmxConfigEntryVirtual(yyvsp
[0].virtual); }
1065 #line 103 "parser.y"
1066 { yyval
.entry
= dmxConfigEntryComment(yyvsp
[0].comment
); }
1070 #line 107 "parser.y"
1071 { yyval
.virtual = dmxConfigCreateVirtual(yyvsp
[-3].token
, NULL
, NULL
, yyvsp
[-2].token
, yyvsp
[-1].subentry
, yyvsp
[0].token
); }
1075 #line 109 "parser.y"
1076 { yyval
.virtual = dmxConfigCreateVirtual(yyvsp
[-4].token
, NULL
, yyvsp
[-3].pair
, yyvsp
[-2].token
, yyvsp
[-1].subentry
, yyvsp
[0].token
); }
1080 #line 111 "parser.y"
1081 { yyval
.virtual = dmxConfigCreateVirtual(yyvsp
[-4].token
, yyvsp
[-3].string
, NULL
, yyvsp
[-2].token
, yyvsp
[-1].subentry
, yyvsp
[0].token
); }
1085 #line 113 "parser.y"
1086 { yyval
.virtual = dmxConfigCreateVirtual(yyvsp
[-5].token
, yyvsp
[-4].string
, yyvsp
[-3].pair
, yyvsp
[-2].token
, yyvsp
[-1].subentry
, yyvsp
[0].token
); }
1090 #line 117 "parser.y"
1091 { APPEND(DMXConfigSubPtr
,yyvsp
[-1].subentry
,yyvsp
[0].subentry
); yyval
.subentry
= yyvsp
[-1].subentry
; }
1095 #line 120 "parser.y"
1096 { yyval
.subentry
= dmxConfigSubComment(yyvsp
[0].comment
); }
1100 #line 121 "parser.y"
1101 { yyval
.subentry
= dmxConfigSubDisplay(yyvsp
[0].display
); }
1105 #line 122 "parser.y"
1106 { yyval
.subentry
= dmxConfigSubWall(yyvsp
[0].wall
); }
1110 #line 123 "parser.y"
1111 { yyval
.subentry
= dmxConfigSubOption(yyvsp
[0].option
); }
1115 #line 124 "parser.y"
1116 { yyval
.subentry
= dmxConfigSubParam(yyvsp
[0].param
); }
1120 #line 128 "parser.y"
1121 { yyval
.option
= dmxConfigCreateOption(yyvsp
[-2].token
, yyvsp
[-1].string
, yyvsp
[0].token
); }
1125 #line 132 "parser.y"
1126 { yyval
.param
= dmxConfigCreateParam(yyvsp
[-2].token
, NULL
, yyvsp
[-1].string
, NULL
, yyvsp
[0].token
); }
1130 #line 134 "parser.y"
1131 { yyval
.param
= dmxConfigCreateParam(yyvsp
[-3].token
, yyvsp
[-2].token
, NULL
, yyvsp
[0].token
, NULL
);
1132 yyval
.param
->next
= yyvsp
[-1].param
;
1137 #line 140 "parser.y"
1138 { APPEND(DMXConfigParamPtr
,yyvsp
[-1].param
,yyvsp
[0].param
); yyval
.param
= yyvsp
[-1].param
; }
1142 #line 144 "parser.y"
1143 { yyval
.param
= dmxConfigCreateParam(NULL
, NULL
, yyvsp
[-1].string
, NULL
, yyvsp
[0].token
); }
1147 #line 148 "parser.y"
1148 { yyval
.pdim
= dmxConfigCreatePartDim(yyvsp
[-1].pair
, yyvsp
[0].pair
); }
1152 #line 150 "parser.y"
1153 { yyval
.pdim
= dmxConfigCreatePartDim(yyvsp
[0].pair
, NULL
); }
1157 #line 152 "parser.y"
1158 { yyval
.pdim
= dmxConfigCreatePartDim(NULL
, yyvsp
[0].pair
); }
1162 #line 156 "parser.y"
1163 { yyval
.fdim
= dmxConfigCreateFullDim(yyvsp
[-2].pdim
, yyvsp
[0].pdim
); }
1167 #line 158 "parser.y"
1168 { yyval
.fdim
= dmxConfigCreateFullDim(NULL
, yyvsp
[0].pdim
); }
1172 #line 160 "parser.y"
1173 { yyval
.fdim
= dmxConfigCreateFullDim(yyvsp
[0].pdim
, NULL
); }
1177 #line 164 "parser.y"
1178 { yyval
.display
= dmxConfigCreateDisplay(yyvsp
[-4].token
, yyvsp
[-3].string
, yyvsp
[-2].fdim
, yyvsp
[-1].pair
, yyvsp
[0].token
); }
1182 #line 166 "parser.y"
1183 { yyval
.display
= dmxConfigCreateDisplay(yyvsp
[-3].token
, NULL
, yyvsp
[-2].fdim
, yyvsp
[-1].pair
, yyvsp
[0].token
); }
1187 #line 168 "parser.y"
1188 { yyval
.display
= dmxConfigCreateDisplay(yyvsp
[-3].token
, yyvsp
[-2].string
, NULL
, yyvsp
[-1].pair
, yyvsp
[0].token
); }
1192 #line 171 "parser.y"
1193 { yyval
.display
= dmxConfigCreateDisplay(yyvsp
[-3].token
, yyvsp
[-2].string
, yyvsp
[-1].fdim
, NULL
, yyvsp
[0].token
); }
1197 #line 173 "parser.y"
1198 { yyval
.display
= dmxConfigCreateDisplay(yyvsp
[-2].token
, NULL
, yyvsp
[-1].fdim
, NULL
, yyvsp
[0].token
); }
1202 #line 175 "parser.y"
1203 { yyval
.display
= dmxConfigCreateDisplay(yyvsp
[-2].token
, yyvsp
[-1].string
, NULL
, NULL
, yyvsp
[0].token
); }
1207 #line 177 "parser.y"
1208 { yyval
.display
= dmxConfigCreateDisplay(yyvsp
[-1].token
, NULL
, NULL
, NULL
, yyvsp
[0].token
); }
1212 #line 181 "parser.y"
1213 { yyval
.wall
= dmxConfigCreateWall(yyvsp
[-4].token
, yyvsp
[-3].pair
, yyvsp
[-2].pair
, yyvsp
[-1].string
, yyvsp
[0].token
); }
1217 #line 183 "parser.y"
1218 { yyval
.wall
= dmxConfigCreateWall(yyvsp
[-3].token
, yyvsp
[-2].pair
, NULL
, yyvsp
[-1].string
, yyvsp
[0].token
); }
1222 #line 185 "parser.y"
1223 { yyval
.wall
= dmxConfigCreateWall(yyvsp
[-2].token
, NULL
, NULL
, yyvsp
[-1].string
, yyvsp
[0].token
); }
1227 #line 189 "parser.y"
1228 { yyval
.token
= yyvsp
[-1].token
; yyval
.token
->comment
= yyvsp
[0].comment
->comment
; }
1232 #line 193 "parser.y"
1233 { yyval
.string
= yyvsp
[-1].string
; yyval
.string
->comment
= yyvsp
[0].comment
->comment
; }
1237 #line 197 "parser.y"
1238 { yyval
.pair
= yyvsp
[-1].pair
; yyval
.pair
->comment
= yyvsp
[0].comment
->comment
; }
1242 #line 201 "parser.y"
1243 { yyval
.pair
= yyvsp
[-1].pair
; yyval
.pair
->comment
= yyvsp
[0].comment
->comment
; }
1247 #line 205 "parser.y"
1248 { yyval
.pair
= yyvsp
[-1].pair
; yyval
.pair
->comment
= yyvsp
[0].comment
->comment
; }
1252 #line 209 "parser.y"
1253 { yyval
.token
= yyvsp
[-1].token
; yyval
.token
->comment
= yyvsp
[0].comment
->comment
; }
1257 #line 213 "parser.y"
1258 { yyval
.token
= yyvsp
[-1].token
; yyval
.token
->comment
= yyvsp
[0].comment
->comment
; }
1262 #line 217 "parser.y"
1263 { yyval
.token
= yyvsp
[-1].token
; yyval
.token
->comment
= yyvsp
[0].comment
->comment
; }
1267 #line 221 "parser.y"
1268 { yyval
.token
= yyvsp
[-1].token
; yyval
.token
->comment
= yyvsp
[0].comment
->comment
; }
1272 #line 225 "parser.y"
1273 { APPEND(DMXConfigStringPtr
, yyvsp
[-1].string
, yyvsp
[0].string
); yyval
.string
= yyvsp
[-1].string
; }
1279 /* Line 1016 of /usr/local/share/bison/yacc.c. */
1280 #line 1281 "parser.c"
1289 short *yyssp1
= yyss
- 1;
1290 YYFPRINTF (stderr
, "state stack now");
1291 while (yyssp1
!= yyssp
)
1292 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1293 YYFPRINTF (stderr
, "\n");
1300 /* Now `shift' the result of the reduction. Determine what state
1301 that goes to, based on the state we popped back to and the rule
1302 number reduced by. */
1306 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1307 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1308 yystate
= yytable
[yystate
];
1310 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1315 /*------------------------------------.
1316 | yyerrlab -- here on detecting error |
1317 `------------------------------------*/
1319 /* If not already recovering from an error, report this error. */
1324 yyn
= yypact
[yystate
];
1326 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
1328 YYSIZE_T yysize
= 0;
1329 int yytype
= YYTRANSLATE (yychar
);
1334 /* Start YYX at -YYN if negative to avoid negative indexes in
1336 for (yyx
= yyn
< 0 ? -yyn
: 0;
1337 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1338 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1339 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1340 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1341 yysize
+= yystrlen (yytname
[yytype
]);
1342 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1345 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1346 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
1351 for (yyx
= yyn
< 0 ? -yyn
: 0;
1352 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1354 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1356 const char *yyq
= ! yycount
? ", expecting " : " or ";
1357 yyp
= yystpcpy (yyp
, yyq
);
1358 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1363 YYSTACK_FREE (yymsg
);
1366 yyerror ("parse error; also virtual memory exhausted");
1369 #endif /* YYERROR_VERBOSE */
1370 yyerror ("parse error");
1375 /*----------------------------------------------------.
1376 | yyerrlab1 -- error raised explicitly by an action. |
1377 `----------------------------------------------------*/
1379 if (yyerrstatus
== 3)
1381 /* If just tried and failed to reuse lookahead token after an
1382 error, discard it. */
1384 /* Return failure if at end of input. */
1385 if (yychar
== YYEOF
)
1387 /* Pop the error token. */
1389 /* Pop the rest of the stack. */
1390 while (yyssp
> yyss
)
1392 YYDPRINTF ((stderr
, "Error: popping "));
1393 YYDSYMPRINT ((stderr
,
1396 YYDPRINTF ((stderr
, "\n"));
1397 yydestruct (yystos
[*yyssp
], *yyvsp
);
1403 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1404 yychar
, yytname
[yychar1
]));
1405 yydestruct (yychar1
, yylval
);
1409 /* Else will try to reuse lookahead token after shifting the error
1412 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1416 yyn
= yypact
[yystate
];
1417 if (yyn
!= YYPACT_NINF
)
1420 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1428 /* Pop the current state because it cannot handle the error token. */
1432 YYDPRINTF ((stderr
, "Error: popping "));
1433 YYDSYMPRINT ((stderr
,
1434 yystos
[*yyssp
], *yyvsp
));
1435 YYDPRINTF ((stderr
, "\n"));
1437 yydestruct (yystos
[yystate
], *yyvsp
);
1445 short *yyssp1
= yyss
- 1;
1446 YYFPRINTF (stderr
, "Error: state stack now");
1447 while (yyssp1
!= yyssp
)
1448 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1449 YYFPRINTF (stderr
, "\n");
1457 YYDPRINTF ((stderr
, "Shifting error token, "));
1466 /*-------------------------------------.
1467 | yyacceptlab -- YYACCEPT comes here. |
1468 `-------------------------------------*/
1473 /*-----------------------------------.
1474 | yyabortlab -- YYABORT comes here. |
1475 `-----------------------------------*/
1481 /*----------------------------------------------.
1482 | yyoverflowlab -- parser overflow comes here. |
1483 `----------------------------------------------*/
1485 yyerror ("parser stack overflow");
1493 YYSTACK_FREE (yyss
);