]>
git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/backends/bind/bindparser.cc
2 PowerDNS Versatile Database Driven Nameserver
3 Copyright (C) 2002 PowerDNS.COM BV
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 /* A Bison parser, made from /home/ahu/programming/ahudns/backends/bind/bindparser.yy
22 #define YYBISON 1 /* Identify Bison output. */
25 # define QUOTEDWORD 258
28 # define SEMICOLON 261
31 # define OPTIONSTOK 264
32 # define DIRECTORYTOK 265
34 # define LOGGINGTOK 267
37 # define MASTERTOK 270
39 #line 1 "bindparser.yy"
42 #define DIRTY_HACK WORD
53 #include "ahuexception.hh"
57 #include "bindparser.hh"
59 #define WORD DIRTY_HACK
61 #define YYSTYPE char *
75 const char *bind_directory
;
76 extern int linenumber
;
77 static void yyerror(const char *str
)
79 extern char *current_filename
;
80 throw AhuException("Error in bind configuration '"+string(current_filename
)+"' on line "+itoa(linenumber
)+": "+str
);
84 static BindParser
*parent
;
87 void BindParser::parse(const string
&fname
)
90 yyin
=fopen(fname
.c_str(),"r");
93 throw AhuException("Unable to open '"+fname
+"': "+strerror(errno
));
97 extern char *current_filename
;
98 extern char *original_filename
;
100 current_filename
=original_filename
=(char*)fname
.c_str();
104 // cerr<<"Need to parse "<<d_zonedomains.size()<<" zone statements"<<endl;
107 void BindParser::setDirectory(const string
&dir
)
110 bind_directory
=d_dir
.c_str();
113 const string
&BindParser::getDirectory()
118 const vector
<BindDomainInfo
>& BindParser::getDomains()
120 return d_zonedomains
;
123 void BindParser::setVerbose(bool verbose
)
128 void BindParser::commit(BindDomainInfo DI
)
130 if(DI
.filename
[0]!='/')
131 DI
.filename
=d_dir
+"/"+DI
.filename
;
134 cerr
<<"Domain "<<DI
.name
<<" lives in file '"<<DI
.filename
<<"'"<<endl
;
136 d_zonedomains
.push_back(DI
);
141 # define YYSTYPE_IS_TRIVIAL 1
150 #define YYFLAG -32768
153 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
154 #define YYTRANSLATE(x) ((unsigned)(x) <= 270 ? yytranslate[x] : 41)
156 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
157 static const char yytranslate
[] =
159 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
161 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
162 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
163 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
164 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
165 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
166 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
167 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
168 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
169 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
170 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
171 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
172 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
173 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
174 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
175 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
176 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
177 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
178 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
179 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
180 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
181 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
182 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
183 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
184 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
185 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
190 static const short yyprhs
[] =
192 0, 0, 1, 5, 7, 9, 11, 13, 14, 18,
193 20, 24, 29, 34, 39, 43, 47, 51, 52, 56,
194 58, 59, 63, 65, 67, 70, 71, 74, 76, 78,
195 80, 84, 88, 89, 93, 95, 97, 99, 101, 106,
196 107, 111, 113, 116, 119, 121
198 static const short yyrhs
[] =
200 -1, 17, 18, 7, 0, 20, 0, 23, 0, 21,
201 0, 22, 0, 0, 19, 20, 7, 0, 29, 0,
202 8, 39, 32, 0, 8, 39, 3, 32, 0, 10,
203 5, 27, 6, 0, 13, 5, 27, 6, 0, 12,
204 39, 24, 0, 12, 40, 24, 0, 5, 25, 6,
205 0, 0, 26, 7, 25, 0, 3, 0, 0, 22,
206 7, 27, 0, 20, 0, 28, 0, 11, 39, 0,
207 0, 29, 30, 0, 3, 0, 31, 0, 39, 0,
208 5, 19, 6, 0, 5, 33, 6, 0, 0, 33,
209 21, 7, 0, 20, 0, 37, 0, 38, 0, 34,
210 0, 16, 5, 35, 6, 0, 0, 35, 36, 7,
211 0, 3, 0, 9, 39, 0, 15, 3, 0, 4,
218 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
219 static const short yyrline
[] =
221 0, 107, 108, 112, 112, 112, 112, 115, 116, 120,
222 124, 131, 141, 143, 147, 148, 151, 154, 155, 159,
223 163, 164, 168, 168, 171, 178, 179, 183, 183, 183,
224 185, 189, 193, 194, 198, 198, 198, 198, 201, 204,
225 205, 209, 215, 223, 232, 239
230 #if (YYDEBUG) || defined YYERROR_VERBOSE
232 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
233 static const char *const yytname
[] =
235 "$", "error", "$undefined.", "WORD", "QUOTEDWORD", "OBRACE", "EBRACE",
236 "SEMICOLON", "ZONETOK", "FILETOK", "OPTIONSTOK", "DIRECTORYTOK",
237 "ACLTOK", "LOGGINGTOK", "CLASSTOK", "TYPETOK", "MASTERTOK",
238 "root_commands", "root_command", "commands", "command", "zone_command",
239 "options_command", "acl_command", "acl_block", "acls", "acl",
240 "options_commands", "options_directory_command", "terms", "term",
241 "block", "zone_block", "zone_commands", "zone_masters_command",
242 "masters", "master", "zone_file_command", "zone_type_command",
243 "quotedname", "filename", 0
247 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
248 static const short yyr1
[] =
250 0, 17, 17, 18, 18, 18, 18, 19, 19, 20,
251 21, 21, 22, 22, 23, 23, 24, 25, 25, 26,
252 27, 27, 22, 22, 28, 29, 29, 30, 30, 30,
253 31, 32, 33, 33, 21, 21, 21, 21, 34, 35,
254 35, 36, 37, 38, 39, 40
257 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
258 static const short yyr2
[] =
260 0, 0, 3, 1, 1, 1, 1, 0, 3, 1,
261 3, 4, 4, 4, 3, 3, 3, 0, 3, 1,
262 0, 3, 1, 1, 2, 0, 2, 1, 1, 1,
263 3, 3, 0, 3, 1, 1, 1, 1, 4, 0,
267 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
268 doesn't specify something else to do. Zero means the default is an
270 static const short yydefact
[] =
272 1, 25, 0, 0, 0, 0, 0, 0, 0, 0,
273 0, 3, 5, 6, 4, 23, 9, 37, 35, 36,
274 44, 0, 42, 25, 24, 45, 0, 0, 25, 43,
275 39, 2, 27, 7, 26, 28, 29, 0, 32, 10,
276 22, 0, 0, 17, 14, 15, 0, 0, 25, 11,
277 25, 25, 12, 19, 0, 0, 13, 41, 38, 0,
278 30, 0, 31, 34, 0, 21, 16, 17, 40, 8,
282 static const short yydefgoto
[] =
284 1, 10, 48, 40, 12, 41, 14, 44, 54, 55,
285 42, 15, 16, 34, 35, 39, 50, 17, 47, 59,
289 static const short yypact
[] =
291 -32768, 2, 16, 16, 18, 16, 5, 27, 34, 33,
292 32,-32768,-32768,-32768,-32768,-32768, 31,-32768,-32768,-32768,
293 -32768, 22,-32768, 20,-32768,-32768, 35, 35, 20,-32768,
294 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 36,-32768,-32768,
295 -32768, 37, 39, 40,-32768,-32768, 42, 1, 44,-32768,
296 13, 20,-32768,-32768, 45, 46,-32768,-32768,-32768, 47,
297 -32768, 48,-32768,-32768, 49,-32768,-32768, 40,-32768,-32768,
298 -32768,-32768, 52,-32768
301 static const short yypgoto
[] =
303 -32768,-32768,-32768, -1, -8, 56,-32768, 19, -9,-32768,
304 -27,-32768,-32768,-32768,-32768, 23,-32768,-32768,-32768,-32768,
305 -32768,-32768, 0,-32768
312 static const short yytable
[] =
314 11, 46, 72, 22, 57, 24, 26, 58, 25, 20,
315 2, 3, 4, 5, 6, 7, 36, 8, 9, 62,
316 20, 2, 3, 23, 65, 37, -20, 38, 8, 9,
317 4, 5, 28, 7, 32, 20, 33, 29, 30, 31,
318 43, 38, 64, 53, 51, 52, 45, 61, 56, 63,
319 60, 66, 73, 67, 68, 69, 70, 13, 71, 0,
323 static const short yycheck
[] =
325 1, 28, 0, 3, 3, 5, 6, 6, 3, 4,
326 8, 9, 10, 11, 12, 13, 16, 15, 16, 6,
327 4, 8, 9, 5, 51, 3, 6, 5, 15, 16,
328 10, 11, 5, 13, 3, 4, 5, 3, 5, 7,
329 5, 5, 50, 3, 7, 6, 27, 48, 6, 50,
330 6, 6, 0, 7, 7, 7, 7, 1, 67, -1,
333 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
334 #line 3 "/usr/share/bison/bison.simple"
336 /* Skeleton output parser for bison,
338 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
341 This program is free software; you can redistribute it and/or modify
342 it under the terms of the GNU General Public License as published by
343 the Free Software Foundation; either version 2, or (at your option)
346 This program is distributed in the hope that it will be useful,
347 but WITHOUT ANY WARRANTY; without even the implied warranty of
348 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
349 GNU General Public License for more details.
351 You should have received a copy of the GNU General Public License
352 along with this program; if not, write to the Free Software
353 Foundation, Inc., 59 Temple Place - Suite 330,
354 Boston, MA 02111-1307, USA. */
356 /* As a special exception, when this file is copied by Bison into a
357 Bison output file, you may use that output file without restriction.
358 This special exception was added by the Free Software Foundation
359 in version 1.24 of Bison. */
361 /* This is the parser code that is written into each bison parser when
362 the %semantic_parser declaration is not specified in the grammar.
363 It was written by Richard Stallman by simplifying the hairy parser
364 used when %semantic_parser is specified. */
366 /* All symbols defined below should begin with yy or YY, to avoid
367 infringing on user name space. This should be done even for local
368 variables, as they might otherwise be expanded by user macros.
369 There are some unavoidable exceptions within include files to
370 define necessary library symbols; they are noted "INFRINGES ON
371 USER NAME SPACE" below. */
373 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
375 /* The parser invokes alloca or malloc; define the necessary symbols. */
377 # if YYSTACK_USE_ALLOCA
378 # define YYSTACK_ALLOC alloca
380 # ifndef YYSTACK_USE_ALLOCA
381 # if defined (alloca) || defined (_ALLOCA_H)
382 # define YYSTACK_ALLOC alloca
385 # define YYSTACK_ALLOC __builtin_alloca
391 # ifdef YYSTACK_ALLOC
392 /* Pacify GCC's `empty if-body' warning. */
393 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
395 # if defined (__STDC__) || defined (__cplusplus)
396 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
397 # define YYSIZE_T size_t
399 # define YYSTACK_ALLOC malloc
400 # define YYSTACK_FREE free
402 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
405 #if (! defined (yyoverflow) \
406 && (! defined (__cplusplus) \
407 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
409 /* A type that is properly aligned for any stack member. */
419 /* The size of the maximum gap between one aligned stack and the next. */
420 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
422 /* The size of an array large to enough to hold all stacks, each with
425 # define YYSTACK_BYTES(N) \
426 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
427 + 2 * YYSTACK_GAP_MAX)
429 # define YYSTACK_BYTES(N) \
430 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
434 /* Copy COUNT objects from FROM to TO. The source and destination do
438 # define YYCOPY(To, From, Count) \
439 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
441 # define YYCOPY(To, From, Count) \
444 register YYSIZE_T yyi; \
445 for (yyi = 0; yyi < (Count); yyi++) \
446 (To)[yyi] = (From)[yyi]; \
452 /* Relocate STACK from its old location to the new one. The
453 local variables YYSIZE and YYSTACKSIZE give the old and new number of
454 elements in the stack, and YYPTR gives the new location of the
455 stack. Advance YYPTR to a properly aligned location for the next
457 # define YYSTACK_RELOCATE(Stack) \
460 YYSIZE_T yynewbytes; \
461 YYCOPY (&yyptr->Stack, Stack, yysize); \
462 Stack = &yyptr->Stack; \
463 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
464 yyptr += yynewbytes / sizeof (*yyptr); \
471 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
472 # define YYSIZE_T __SIZE_TYPE__
474 #if ! defined (YYSIZE_T) && defined (size_t)
475 # define YYSIZE_T size_t
477 #if ! defined (YYSIZE_T)
478 # if defined (__STDC__) || defined (__cplusplus)
479 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
480 # define YYSIZE_T size_t
483 #if ! defined (YYSIZE_T)
484 # define YYSIZE_T unsigned int
487 #define yyerrok (yyerrstatus = 0)
488 #define yyclearin (yychar = YYEMPTY)
491 #define YYACCEPT goto yyacceptlab
492 #define YYABORT goto yyabortlab
493 #define YYERROR goto yyerrlab1
494 /* Like YYERROR except do call yyerror. This remains here temporarily
495 to ease the transition to the new meaning of YYERROR, for GCC.
496 Once GCC version 2 has supplanted version 1, this can go. */
497 #define YYFAIL goto yyerrlab
498 #define YYRECOVERING() (!!yyerrstatus)
499 #define YYBACKUP(Token, Value) \
501 if (yychar == YYEMPTY && yylen == 1) \
505 yychar1 = YYTRANSLATE (yychar); \
511 yyerror ("syntax error: cannot back up"); \
517 #define YYERRCODE 256
520 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
523 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
524 first token. By default, to implement support for ranges, extend
525 its range to the last symbol. */
527 #ifndef YYLLOC_DEFAULT
528 # define YYLLOC_DEFAULT(Current, Rhs, N) \
529 Current.last_line = Rhs[N].last_line; \
530 Current.last_column = Rhs[N].last_column;
534 /* YYLEX -- calling `yylex' with the right arguments. */
539 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
541 # define YYLEX yylex (&yylval, &yylloc)
543 # else /* !YYLSP_NEEDED */
545 # define YYLEX yylex (&yylval, YYLEX_PARAM)
547 # define YYLEX yylex (&yylval)
549 # endif /* !YYLSP_NEEDED */
551 # define YYLEX yylex ()
555 /* Enable debugging if requested. */
559 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
560 # define YYFPRINTF fprintf
563 # define YYDPRINTF(Args) \
568 /* Nonzero means print parse trace. It is left uninitialized so that
569 multiple parsers can coexist. */
572 # define YYDPRINTF(Args)
573 #endif /* !YYDEBUG */
575 /* YYINITDEPTH -- initial size of the parser's stacks. */
577 # define YYINITDEPTH 200
580 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
581 if the built-in stack extension method is used).
583 Do not make this value too large; the results are undefined if
584 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
585 evaluated with infinite-precision integer arithmetic. */
592 # define YYMAXDEPTH 10000
595 #ifdef YYERROR_VERBOSE
598 # if defined (__GLIBC__) && defined (_STRING_H)
599 # define yystrlen strlen
601 /* Return the length of YYSTR. */
603 # if defined (__STDC__) || defined (__cplusplus)
604 yystrlen (const char *yystr
)
610 register const char *yys
= yystr
;
612 while (*yys
++ != '\0')
615 return yys
- yystr
- 1;
621 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
622 # define yystpcpy stpcpy
624 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
627 # if defined (__STDC__) || defined (__cplusplus)
628 yystpcpy (char *yydest
, const char *yysrc
)
630 yystpcpy (yydest
, yysrc
)
635 register char *yyd
= yydest
;
636 register const char *yys
= yysrc
;
638 while ((*yyd
++ = *yys
++) != '\0')
647 #line 315 "/usr/share/bison/bison.simple"
650 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
651 into yyparse. The argument should have type void *.
652 It should actually point to an object.
653 Grammar actions can access the variable by casting it
654 to the proper pointer type. */
657 # if defined (__STDC__) || defined (__cplusplus)
658 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
659 # define YYPARSE_PARAM_DECL
661 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
662 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
664 #else /* !YYPARSE_PARAM */
665 # define YYPARSE_PARAM_ARG
666 # define YYPARSE_PARAM_DECL
667 #endif /* !YYPARSE_PARAM */
669 /* Prevent warning if -Wstrict-prototypes. */
671 # ifdef YYPARSE_PARAM
672 int yyparse (void *);
678 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
679 variables are global, or local to YYPARSE. */
681 #define YY_DECL_NON_LSP_VARIABLES \
682 /* The lookahead symbol. */ \
685 /* The semantic value of the lookahead symbol. */ \
688 /* Number of parse errors so far. */ \
692 # define YY_DECL_VARIABLES \
693 YY_DECL_NON_LSP_VARIABLES \
695 /* Location data for the lookahead symbol. */ \
698 # define YY_DECL_VARIABLES \
699 YY_DECL_NON_LSP_VARIABLES
703 /* If nonreentrant, generate the variables here. */
710 yyparse (YYPARSE_PARAM_ARG
)
713 /* If reentrant, generate the variables here. */
718 register int yystate
;
721 /* Number of tokens to shift before error messages enabled. */
723 /* Lookahead token as an internal (translated) token number. */
726 /* Three stacks and their tools:
727 `yyss': related to states,
728 `yyvs': related to semantic values,
729 `yyls': related to locations.
731 Refer to the stacks thru separate pointers, to allow yyoverflow
732 to reallocate them elsewhere. */
734 /* The state stack. */
735 short yyssa
[YYINITDEPTH
];
737 register short *yyssp
;
739 /* The semantic value stack. */
740 YYSTYPE yyvsa
[YYINITDEPTH
];
741 YYSTYPE
*yyvs
= yyvsa
;
742 register YYSTYPE
*yyvsp
;
745 /* The location stack. */
746 YYLTYPE yylsa
[YYINITDEPTH
];
747 YYLTYPE
*yyls
= yylsa
;
752 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
754 # define YYPOPSTACK (yyvsp--, yyssp--)
757 YYSIZE_T yystacksize
= YYINITDEPTH
;
760 /* The variables used to return semantic value and location from the
767 /* When reducing, the number of symbols on the RHS of the reduced
771 YYDPRINTF ((stderr
, "Starting parse\n"));
776 yychar
= YYEMPTY
; /* Cause a token to be read. */
778 /* Initialize stack pointers.
779 Waste one element of value and location stack
780 so that they stay on the same level as the state stack.
781 The wasted elements are never initialized. */
790 /*------------------------------------------------------------.
791 | yynewstate -- Push a new state, which is found in yystate. |
792 `------------------------------------------------------------*/
794 /* In all cases, when you get here, the value and location stacks
795 have just been pushed. so pushing a state here evens the stacks.
802 if (yyssp
>= yyss
+ yystacksize
- 1)
804 /* Get the current used size of the three stacks, in elements. */
805 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
809 /* Give user a chance to reallocate the stack. Use copies of
810 these so that the &'s don't force the real ones into
812 YYSTYPE
*yyvs1
= yyvs
;
815 /* Each stack pointer address is followed by the size of the
816 data in use in that stack, in bytes. */
818 YYLTYPE
*yyls1
= yyls
;
819 /* This used to be a conditional around just the two extra args,
820 but that might be undefined if yyoverflow is a macro. */
821 yyoverflow ("parser stack overflow",
822 &yyss1
, yysize
* sizeof (*yyssp
),
823 &yyvs1
, yysize
* sizeof (*yyvsp
),
824 &yyls1
, yysize
* sizeof (*yylsp
),
828 yyoverflow ("parser stack overflow",
829 &yyss1
, yysize
* sizeof (*yyssp
),
830 &yyvs1
, yysize
* sizeof (*yyvsp
),
836 #else /* no yyoverflow */
837 # ifndef YYSTACK_RELOCATE
840 /* Extend the stack our own way. */
841 if (yystacksize
>= YYMAXDEPTH
)
844 if (yystacksize
> YYMAXDEPTH
)
845 yystacksize
= YYMAXDEPTH
;
849 union yyalloc
*yyptr
=
850 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
853 YYSTACK_RELOCATE (yyss
);
854 YYSTACK_RELOCATE (yyvs
);
856 YYSTACK_RELOCATE (yyls
);
858 # undef YYSTACK_RELOCATE
860 YYSTACK_FREE (yyss1
);
863 #endif /* no yyoverflow */
865 yyssp
= yyss
+ yysize
- 1;
866 yyvsp
= yyvs
+ yysize
- 1;
868 yylsp
= yyls
+ yysize
- 1;
871 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
872 (unsigned long int) yystacksize
));
874 if (yyssp
>= yyss
+ yystacksize
- 1)
878 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
888 /* Do appropriate processing given the current state. */
889 /* Read a lookahead token if we need one and don't already have one. */
892 /* First try to decide what to do without reference to lookahead token. */
894 yyn
= yypact
[yystate
];
898 /* Not known => get a lookahead token if don't already have one. */
900 /* yychar is either YYEMPTY or YYEOF
901 or a valid token in external form. */
903 if (yychar
== YYEMPTY
)
905 YYDPRINTF ((stderr
, "Reading a token: "));
909 /* Convert token to internal form (in yychar1) for indexing tables with */
911 if (yychar
<= 0) /* This means end of input. */
914 yychar
= YYEOF
; /* Don't call YYLEX any more */
916 YYDPRINTF ((stderr
, "Now at end of input.\n"));
920 yychar1
= YYTRANSLATE (yychar
);
923 /* We have to keep this `#if YYDEBUG', since we use variables
924 which are defined only if `YYDEBUG' is set. */
927 YYFPRINTF (stderr
, "Next token is %d (%s",
928 yychar
, yytname
[yychar1
]);
929 /* Give the individual parser a way to print the precise
930 meaning of a token, for further debugging info. */
932 YYPRINT (stderr
, yychar
, yylval
);
934 YYFPRINTF (stderr
, ")\n");
940 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
945 /* yyn is what to do for this token type in this state.
946 Negative => reduce, -yyn is rule number.
947 Positive => shift, yyn is new state.
948 New state is final state => don't bother to shift,
950 0, or most negative number => error. */
965 /* Shift the lookahead token. */
966 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
967 yychar
, yytname
[yychar1
]));
969 /* Discard the token being shifted unless it is eof. */
978 /* Count tokens shifted since error; after three, turn off error
987 /*-----------------------------------------------------------.
988 | yydefault -- do the default action for the current state. |
989 `-----------------------------------------------------------*/
991 yyn
= yydefact
[yystate
];
997 /*-----------------------------.
998 | yyreduce -- Do a reduction. |
999 `-----------------------------*/
1001 /* yyn is the number of a rule to reduce with. */
1004 /* If YYLEN is nonzero, implement the default value of the action:
1007 Otherwise, the following line sets YYVAL to the semantic value of
1008 the lookahead token. This behavior is undocumented and Bison
1009 users should not rely upon it. Assigning to YYVAL
1010 unconditionally makes the parser a bit smaller, and it avoids a
1011 GCC warning that YYVAL may be used uninitialized. */
1012 yyval
= yyvsp
[1-yylen
];
1015 /* Similarly for the default location. Let the user run additional
1016 commands if for instance locations are ranges. */
1017 yyloc
= yylsp
[1-yylen
];
1018 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1022 /* We have to keep this `#if YYDEBUG', since we use variables which
1023 are defined only if `YYDEBUG' is set. */
1028 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1031 /* Print the symbols being reduced, and their result. */
1032 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] > 0; yyi
++)
1033 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1034 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1041 #line 126 "bindparser.yy"
1043 s_di
.name
=yyvsp
[-1];
1044 parent
->commit(s_di
);
1049 #line 133 "bindparser.yy"
1051 s_di
.name
=yyvsp
[-2];
1052 parent
->commit(s_di
);
1057 #line 172 "bindparser.yy"
1059 parent
->setDirectory(yyvsp
[0]);
1063 #line 210 "bindparser.yy"
1065 s_di
.master
=yyvsp
[0];
1069 #line 217 "bindparser.yy"
1071 // printf("Found a filename: '%s'\n",$2);
1072 s_di
.filename
=yyvsp
[0];
1076 #line 225 "bindparser.yy"
1078 // printf("Found a filename: '%s'\n",$2);
1083 #line 234 "bindparser.yy"
1090 #line 705 "/usr/share/bison/bison.simple"
1102 short *yyssp1
= yyss
- 1;
1103 YYFPRINTF (stderr
, "state stack now");
1104 while (yyssp1
!= yyssp
)
1105 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1106 YYFPRINTF (stderr
, "\n");
1115 /* Now `shift' the result of the reduction. Determine what state
1116 that goes to, based on the state we popped back to and the rule
1117 number reduced by. */
1121 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
1122 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1123 yystate
= yytable
[yystate
];
1125 yystate
= yydefgoto
[yyn
- YYNTBASE
];
1130 /*------------------------------------.
1131 | yyerrlab -- here on detecting error |
1132 `------------------------------------*/
1134 /* If not already recovering from an error, report this error. */
1139 #ifdef YYERROR_VERBOSE
1140 yyn
= yypact
[yystate
];
1142 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1144 YYSIZE_T yysize
= 0;
1149 /* Start YYX at -YYN if negative to avoid negative indexes in
1151 for (yyx
= yyn
< 0 ? -yyn
: 0;
1152 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1153 if (yycheck
[yyx
+ yyn
] == yyx
)
1154 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1155 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1156 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1157 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1160 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1161 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1166 for (yyx
= yyn
< 0 ? -yyn
: 0;
1167 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1169 if (yycheck
[yyx
+ yyn
] == yyx
)
1171 const char *yyq
= ! yycount
? ", expecting " : " or ";
1172 yyp
= yystpcpy (yyp
, yyq
);
1173 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1178 YYSTACK_FREE (yymsg
);
1181 yyerror ("parse error; also virtual memory exhausted");
1184 #endif /* defined (YYERROR_VERBOSE) */
1185 yyerror ("parse error");
1190 /*--------------------------------------------------.
1191 | yyerrlab1 -- error raised explicitly by an action |
1192 `--------------------------------------------------*/
1194 if (yyerrstatus
== 3)
1196 /* If just tried and failed to reuse lookahead token after an
1197 error, discard it. */
1199 /* return failure if at end of input */
1200 if (yychar
== YYEOF
)
1202 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1203 yychar
, yytname
[yychar1
]));
1207 /* Else will try to reuse lookahead token after shifting the error
1210 yyerrstatus
= 3; /* Each real token shifted decrements this */
1215 /*-------------------------------------------------------------------.
1216 | yyerrdefault -- current state does not do anything special for the |
1218 `-------------------------------------------------------------------*/
1221 /* This is wrong; only states that explicitly want error tokens
1222 should shift them. */
1224 /* If its default is to accept any token, ok. Otherwise pop it. */
1225 yyn
= yydefact
[yystate
];
1231 /*---------------------------------------------------------------.
1232 | yyerrpop -- pop the current state because it cannot handle the |
1234 `---------------------------------------------------------------*/
1247 short *yyssp1
= yyss
- 1;
1248 YYFPRINTF (stderr
, "Error: state stack now");
1249 while (yyssp1
!= yyssp
)
1250 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1251 YYFPRINTF (stderr
, "\n");
1259 yyn
= yypact
[yystate
];
1264 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1281 YYDPRINTF ((stderr
, "Shifting error token, "));
1292 /*-------------------------------------.
1293 | yyacceptlab -- YYACCEPT comes here. |
1294 `-------------------------------------*/
1299 /*-----------------------------------.
1300 | yyabortlab -- YYABORT comes here. |
1301 `-----------------------------------*/
1306 /*---------------------------------------------.
1307 | yyoverflowab -- parser overflow comes here. |
1308 `---------------------------------------------*/
1310 yyerror ("parser stack overflow");
1317 YYSTACK_FREE (yyss
);
1321 #line 240 "bindparser.yy"