root/trunk/pdns/pdns/backends/bind/bindparser.cc @ 141

Revision 141, 34.7 KB (checked in by ahu, 10 years ago)

working up to 2.9.5

  • Property svn:eol-style set to native
  • Property svn:keywords set to author date id revision
Line 
1/* A Bison parser, made from /home/ahu/programming/pdns/pdns/backends/bind/bindparser.yy
2   by GNU bison 1.35.  */
3
4#define YYBISON 1  /* Identify Bison output.  */
5
6# define        AWORD   257
7# define        QUOTEDWORD      258
8# define        OBRACE  259
9# define        EBRACE  260
10# define        SEMICOLON       261
11# define        ZONETOK 262
12# define        FILETOK 263
13# define        OPTIONSTOK      264
14# define        DIRECTORYTOK    265
15# define        ACLTOK  266
16# define        LOGGINGTOK      267
17# define        CLASSTOK        268
18# define        TYPETOK 269
19# define        MASTERTOK       270
20
21#line 1 "bindparser.yy"
22
23
24#include <stdio.h>
25#include <string.h>
26#include <stdlib.h>
27#include <string>
28#include <iostream>
29#include <utility>
30#include <errno.h>
31#include "misc.hh"
32#include "ahuexception.hh"
33using namespace std;
34#define YYDEBUG 1
35extern int yydebug;
36#include "bindparser.hh"
37
38#define YYSTYPE char *
39
40
41#ifndef WIN32
42extern "C" 
43{
44#endif // WIN32
45        int yyparse(void);
46        int yylex(void);
47        void yyrestart(FILE *);
48        int yywrap()
49        {
50                return 1;
51        }
52#ifndef WIN32
53}
54#endif // WIN32
55
56
57extern int yydebug;
58const char *bind_directory;
59extern int linenumber;
60static void yyerror(const char *str)
61{
62  extern char *current_filename;       
63  throw AhuException("Error in bind configuration '"+string(current_filename)+"' on line "+itoa(linenumber)+": "+str);
64}
65
66extern FILE *yyin;
67static BindParser *parent;
68BindDomainInfo s_di;
69
70void BindParser::parse(const string &fname)
71{       
72        yydebug=0;
73        yyin=fopen(fname.c_str(),"r");
74        yyrestart(yyin);
75        if(!yyin)
76                throw AhuException("Unable to open '"+fname+"': "+strerror(errno));
77
78        linenumber=1;
79        parent=this;
80        extern char *current_filename;
81        extern char *original_filename;
82
83        current_filename=original_filename=(char*)fname.c_str();
84
85        yyparse();
86
87//      cerr<<"Need to parse "<<d_zonedomains.size()<<" zone statements"<<endl;
88}
89
90void BindParser::setDirectory(const string &dir)
91{
92        d_dir=dir;
93        bind_directory=d_dir.c_str();
94}
95
96const string &BindParser::getDirectory()
97{
98        return d_dir;
99}
100
101const vector<BindDomainInfo>& BindParser::getDomains()
102{
103        return d_zonedomains;
104}
105
106void BindParser::setVerbose(bool verbose)
107{
108  d_verbose=verbose;
109}
110
111void BindParser::commit(BindDomainInfo DI)
112{
113  if(DI.filename[0]!='/')
114    DI.filename=d_dir+"/"+DI.filename;
115
116  if(d_verbose)
117    cerr<<"Domain "<<DI.name<<" lives in file '"<<DI.filename<<"'"<<endl;
118
119  d_zonedomains.push_back(DI);
120}
121
122#ifndef YYSTYPE
123# define YYSTYPE int
124# define YYSTYPE_IS_TRIVIAL 1
125#endif
126#ifndef YYDEBUG
127# define YYDEBUG 1
128#endif
129
130
131
132#define YYFINAL         73
133#define YYFLAG          -32768
134#define YYNTBASE        17
135
136/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
137#define YYTRANSLATE(x) ((unsigned)(x) <= 270 ? yytranslate[x] : 41)
138
139/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
140static const char yytranslate[] =
141{
142       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
143       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
144       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
145       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
146       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
147       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
148       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
149       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
150       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
151       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
152       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
153       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
154       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
155       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
156       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
157       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
158       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
159       2,     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,     1,     3,     4,     5,
168       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
169      16
170};
171
172#if YYDEBUG
173static const short yyprhs[] =
174{
175       0,     0,     1,     5,     7,     9,    11,    13,    14,    18,
176      20,    24,    29,    34,    39,    43,    47,    51,    52,    56,
177      58,    59,    63,    65,    67,    70,    71,    74,    76,    78,
178      80,    84,    88,    89,    93,    95,    97,    99,   101,   106,
179     107,   111,   113,   116,   119,   121
180};
181static const short yyrhs[] =
182{
183      -1,    17,    18,     7,     0,    20,     0,    23,     0,    21,
184       0,    22,     0,     0,    19,    20,     7,     0,    29,     0,
185       8,    39,    32,     0,     8,    39,     3,    32,     0,    10,
186       5,    27,     6,     0,    13,     5,    27,     6,     0,    12,
187      39,    24,     0,    12,    40,    24,     0,     5,    25,     6,
188       0,     0,    26,     7,    25,     0,     3,     0,     0,    22,
189       7,    27,     0,    20,     0,    28,     0,    11,    39,     0,
190       0,    29,    30,     0,     3,     0,    31,     0,    39,     0,
191       5,    19,     6,     0,     5,    33,     6,     0,     0,    33,
192      21,     7,     0,    20,     0,    37,     0,    38,     0,    34,
193       0,    16,     5,    35,     6,     0,     0,    35,    36,     7,
194       0,     3,     0,     9,    39,     0,    15,     3,     0,     4,
195       0,     3,     0
196};
197
198#endif
199
200#if YYDEBUG
201/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
202static const short yyrline[] =
203{
204       0,   108,   109,   113,   113,   113,   113,   116,   117,   121,
205     125,   132,   142,   144,   148,   149,   152,   155,   156,   160,
206     164,   165,   169,   169,   172,   179,   180,   184,   184,   184,
207     186,   190,   194,   195,   199,   199,   199,   199,   202,   205,
208     206,   210,   216,   224,   232,   239
209};
210#endif
211
212
213#if (YYDEBUG) || defined YYERROR_VERBOSE
214
215/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
216static const char *const yytname[] =
217{
218  "$", "error", "$undefined.", "AWORD", "QUOTEDWORD", "OBRACE", "EBRACE", 
219  "SEMICOLON", "ZONETOK", "FILETOK", "OPTIONSTOK", "DIRECTORYTOK", 
220  "ACLTOK", "LOGGINGTOK", "CLASSTOK", "TYPETOK", "MASTERTOK", 
221  "root_commands", "root_command", "commands", "command", "zone_command", 
222  "options_command", "acl_command", "acl_block", "acls", "acl", 
223  "options_commands", "options_directory_command", "terms", "term", 
224  "block", "zone_block", "zone_commands", "zone_masters_command", 
225  "masters", "master", "zone_file_command", "zone_type_command", 
226  "quotedname", "filename", 0
227};
228#endif
229
230/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
231static const short yyr1[] =
232{
233       0,    17,    17,    18,    18,    18,    18,    19,    19,    20,
234      21,    21,    22,    22,    23,    23,    24,    25,    25,    26,
235      27,    27,    22,    22,    28,    29,    29,    30,    30,    30,
236      31,    32,    33,    33,    21,    21,    21,    21,    34,    35,
237      35,    36,    37,    38,    39,    40
238};
239
240/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
241static const short yyr2[] =
242{
243       0,     0,     3,     1,     1,     1,     1,     0,     3,     1,
244       3,     4,     4,     4,     3,     3,     3,     0,     3,     1,
245       0,     3,     1,     1,     2,     0,     2,     1,     1,     1,
246       3,     3,     0,     3,     1,     1,     1,     1,     4,     0,
247       3,     1,     2,     2,     1,     1
248};
249
250/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
251   doesn't specify something else to do.  Zero means the default is an
252   error. */
253static const short yydefact[] =
254{
255       1,    25,     0,     0,     0,     0,     0,     0,     0,     0,
256       0,     3,     5,     6,     4,    23,     9,    37,    35,    36,
257      44,     0,    42,    25,    24,    45,     0,     0,    25,    43,
258      39,     2,    27,     7,    26,    28,    29,     0,    32,    10,
259      22,     0,     0,    17,    14,    15,     0,     0,    25,    11,
260      25,    25,    12,    19,     0,     0,    13,    41,    38,     0,
261      30,     0,    31,    34,     0,    21,    16,    17,    40,     8,
262      33,    18,     0,     0
263};
264
265static const short yydefgoto[] =
266{
267       1,    10,    48,    40,    12,    41,    14,    44,    54,    55,
268      42,    15,    16,    34,    35,    39,    50,    17,    47,    59,
269      18,    19,    21,    27
270};
271
272static const short yypact[] =
273{
274  -32768,     2,    16,    16,    18,    16,     5,    27,    34,    33,
275      32,-32768,-32768,-32768,-32768,-32768,    31,-32768,-32768,-32768,
276  -32768,    22,-32768,    20,-32768,-32768,    35,    35,    20,-32768,
277  -32768,-32768,-32768,-32768,-32768,-32768,-32768,    36,-32768,-32768,
278  -32768,    37,    39,    40,-32768,-32768,    42,     1,    44,-32768,
279      13,    20,-32768,-32768,    45,    46,-32768,-32768,-32768,    47,
280  -32768,    48,-32768,-32768,    49,-32768,-32768,    40,-32768,-32768,
281  -32768,-32768,    52,-32768
282};
283
284static const short yypgoto[] =
285{
286  -32768,-32768,-32768,    -1,    -8,    56,-32768,    19,    -9,-32768,
287     -27,-32768,-32768,-32768,-32768,    23,-32768,-32768,-32768,-32768,
288  -32768,-32768,     0,-32768
289};
290
291
292#define YYLAST          60
293
294
295static const short yytable[] =
296{
297      11,    46,    72,    22,    57,    24,    26,    58,    25,    20,
298       2,     3,     4,     5,     6,     7,    36,     8,     9,    62,
299      20,     2,     3,    23,    65,    37,   -20,    38,     8,     9,
300       4,     5,    28,     7,    32,    20,    33,    29,    30,    31,
301      43,    38,    64,    53,    51,    52,    45,    61,    56,    63,
302      60,    66,    73,    67,    68,    69,    70,    13,    71,     0,
303      49
304};
305
306static const short yycheck[] =
307{
308       1,    28,     0,     3,     3,     5,     6,     6,     3,     4,
309       8,     9,    10,    11,    12,    13,    16,    15,    16,     6,
310       4,     8,     9,     5,    51,     3,     6,     5,    15,    16,
311      10,    11,     5,    13,     3,     4,     5,     3,     5,     7,
312       5,     5,    50,     3,     7,     6,    27,    48,     6,    50,
313       6,     6,     0,     7,     7,     7,     7,     1,    67,    -1,
314      37
315};
316/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
317#line 3 "/usr/share/bison/bison.simple"
318
319/* Skeleton output parser for bison,
320
321   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
322   Foundation, Inc.
323
324   This program is free software; you can redistribute it and/or modify
325   it under the terms of the GNU General Public License as published by
326   the Free Software Foundation; either version 2, or (at your option)
327   any later version.
328
329   This program is distributed in the hope that it will be useful,
330   but WITHOUT ANY WARRANTY; without even the implied warranty of
331   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
332   GNU General Public License for more details.
333
334   You should have received a copy of the GNU General Public License
335   along with this program; if not, write to the Free Software
336   Foundation, Inc., 59 Temple Place - Suite 330,
337   Boston, MA 02111-1307, USA.  */
338
339/* As a special exception, when this file is copied by Bison into a
340   Bison output file, you may use that output file without restriction.
341   This special exception was added by the Free Software Foundation
342   in version 1.24 of Bison.  */
343
344/* This is the parser code that is written into each bison parser when
345   the %semantic_parser declaration is not specified in the grammar.
346   It was written by Richard Stallman by simplifying the hairy parser
347   used when %semantic_parser is specified.  */
348
349/* All symbols defined below should begin with yy or YY, to avoid
350   infringing on user name space.  This should be done even for local
351   variables, as they might otherwise be expanded by user macros.
352   There are some unavoidable exceptions within include files to
353   define necessary library symbols; they are noted "INFRINGES ON
354   USER NAME SPACE" below.  */
355
356#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
357
358/* The parser invokes alloca or malloc; define the necessary symbols.  */
359
360# if YYSTACK_USE_ALLOCA
361#  define YYSTACK_ALLOC alloca
362# else
363#  ifndef YYSTACK_USE_ALLOCA
364#   if defined (alloca) || defined (_ALLOCA_H)
365#    define YYSTACK_ALLOC alloca
366#   else
367#    ifdef __GNUC__
368#     define YYSTACK_ALLOC __builtin_alloca
369#    endif
370#   endif
371#  endif
372# endif
373
374# ifdef YYSTACK_ALLOC
375   /* Pacify GCC's `empty if-body' warning. */
376#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
377# else
378#  if defined (__STDC__) || defined (__cplusplus)
379#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
380#   define YYSIZE_T size_t
381#  endif
382#  define YYSTACK_ALLOC malloc
383#  define YYSTACK_FREE free
384# endif
385#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
386
387
388#if (! defined (yyoverflow) \
389     && (! defined (__cplusplus) \
390         || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
391
392/* A type that is properly aligned for any stack member.  */
393union yyalloc
394{
395  short yyss;
396  YYSTYPE yyvs;
397# if YYLSP_NEEDED
398  YYLTYPE yyls;
399# endif
400};
401
402/* The size of the maximum gap between one aligned stack and the next.  */
403# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
404
405/* The size of an array large to enough to hold all stacks, each with
406   N elements.  */
407# if YYLSP_NEEDED
408#  define YYSTACK_BYTES(N) \
409     ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))      \
410      + 2 * YYSTACK_GAP_MAX)
411# else
412#  define YYSTACK_BYTES(N) \
413     ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
414      + YYSTACK_GAP_MAX)
415# endif
416
417/* Copy COUNT objects from FROM to TO.  The source and destination do
418   not overlap.  */
419# ifndef YYCOPY
420#  if 1 < __GNUC__
421#   define YYCOPY(To, From, Count) \
422      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
423#  else
424#   define YYCOPY(To, From, Count)              \
425      do                                        \
426        {                                       \
427          register YYSIZE_T yyi;                \
428          for (yyi = 0; yyi < (Count); yyi++)   \
429            (To)[yyi] = (From)[yyi];            \
430        }                                       \
431      while (0)
432#  endif
433# endif
434
435/* Relocate STACK from its old location to the new one.  The
436   local variables YYSIZE and YYSTACKSIZE give the old and new number of
437   elements in the stack, and YYPTR gives the new location of the
438   stack.  Advance YYPTR to a properly aligned location for the next
439   stack.  */
440# define YYSTACK_RELOCATE(Stack)                                        \
441    do                                                                  \
442      {                                                                 \
443        YYSIZE_T yynewbytes;                                            \
444        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
445        Stack = &yyptr->Stack;                                          \
446        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;   \
447        yyptr += yynewbytes / sizeof (*yyptr);                          \
448      }                                                                 \
449    while (0)
450
451#endif
452
453
454#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
455# define YYSIZE_T __SIZE_TYPE__
456#endif
457#if ! defined (YYSIZE_T) && defined (size_t)
458# define YYSIZE_T size_t
459#endif
460#if ! defined (YYSIZE_T)
461# if defined (__STDC__) || defined (__cplusplus)
462#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
463#  define YYSIZE_T size_t
464# endif
465#endif
466#if ! defined (YYSIZE_T)
467# define YYSIZE_T unsigned int
468#endif
469
470#define yyerrok         (yyerrstatus = 0)
471#define yyclearin       (yychar = YYEMPTY)
472#define YYEMPTY         -2
473#define YYEOF           0
474#define YYACCEPT        goto yyacceptlab
475#define YYABORT         goto yyabortlab
476#define YYERROR         goto yyerrlab1
477/* Like YYERROR except do call yyerror.  This remains here temporarily
478   to ease the transition to the new meaning of YYERROR, for GCC.
479   Once GCC version 2 has supplanted version 1, this can go.  */
480#define YYFAIL          goto yyerrlab
481#define YYRECOVERING()  (!!yyerrstatus)
482#define YYBACKUP(Token, Value)                                  \
483do                                                              \
484  if (yychar == YYEMPTY && yylen == 1)                          \
485    {                                                           \
486      yychar = (Token);                                         \
487      yylval = (Value);                                         \
488      yychar1 = YYTRANSLATE (yychar);                           \
489      YYPOPSTACK;                                               \
490      goto yybackup;                                            \
491    }                                                           \
492  else                                                          \
493    {                                                           \
494      yyerror ("syntax error: cannot back up");                 \
495      YYERROR;                                                  \
496    }                                                           \
497while (0)
498
499#define YYTERROR        1
500#define YYERRCODE       256
501
502
503/* YYLLOC_DEFAULT -- Compute the default location (before the actions
504   are run).
505
506   When YYLLOC_DEFAULT is run, CURRENT is set the location of the
507   first token.  By default, to implement support for ranges, extend
508   its range to the last symbol.  */
509
510#ifndef YYLLOC_DEFAULT
511# define YYLLOC_DEFAULT(Current, Rhs, N)        \
512   Current.last_line   = Rhs[N].last_line;      \
513   Current.last_column = Rhs[N].last_column;
514#endif
515
516
517/* YYLEX -- calling `yylex' with the right arguments.  */
518
519#if YYPURE
520# if YYLSP_NEEDED
521#  ifdef YYLEX_PARAM
522#   define YYLEX                yylex (&yylval, &yylloc, YYLEX_PARAM)
523#  else
524#   define YYLEX                yylex (&yylval, &yylloc)
525#  endif
526# else /* !YYLSP_NEEDED */
527#  ifdef YYLEX_PARAM
528#   define YYLEX                yylex (&yylval, YYLEX_PARAM)
529#  else
530#   define YYLEX                yylex (&yylval)
531#  endif
532# endif /* !YYLSP_NEEDED */
533#else /* !YYPURE */
534# define YYLEX                  yylex ()
535#endif /* !YYPURE */
536
537
538/* Enable debugging if requested.  */
539#if YYDEBUG
540
541# ifndef YYFPRINTF
542#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
543#  define YYFPRINTF fprintf
544# endif
545
546# define YYDPRINTF(Args)                        \
547do {                                            \
548  if (yydebug)                                  \
549    YYFPRINTF Args;                             \
550} while (0)
551/* Nonzero means print parse trace.  It is left uninitialized so that
552   multiple parsers can coexist.  */
553int yydebug;
554#else /* !YYDEBUG */
555# define YYDPRINTF(Args)
556#endif /* !YYDEBUG */
557
558/* YYINITDEPTH -- initial size of the parser's stacks.  */
559#ifndef YYINITDEPTH
560# define YYINITDEPTH 200
561#endif
562
563/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
564   if the built-in stack extension method is used).
565
566   Do not make this value too large; the results are undefined if
567   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
568   evaluated with infinite-precision integer arithmetic.  */
569
570#if YYMAXDEPTH == 0
571# undef YYMAXDEPTH
572#endif
573
574#ifndef YYMAXDEPTH
575# define YYMAXDEPTH 10000
576#endif
577
578#ifdef YYERROR_VERBOSE
579
580# ifndef yystrlen
581#  if defined (__GLIBC__) && defined (_STRING_H)
582#   define yystrlen strlen
583#  else
584/* Return the length of YYSTR.  */
585static YYSIZE_T
586#   if defined (__STDC__) || defined (__cplusplus)
587yystrlen (const char *yystr)
588#   else
589yystrlen (yystr)
590     const char *yystr;
591#   endif
592{
593  register const char *yys = yystr;
594
595  while (*yys++ != '\0')
596    continue;
597
598  return yys - yystr - 1;
599}
600#  endif
601# endif
602
603# ifndef yystpcpy
604#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
605#   define yystpcpy stpcpy
606#  else
607/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
608   YYDEST.  */
609static char *
610#   if defined (__STDC__) || defined (__cplusplus)
611yystpcpy (char *yydest, const char *yysrc)
612#   else
613yystpcpy (yydest, yysrc)
614     char *yydest;
615     const char *yysrc;
616#   endif
617{
618  register char *yyd = yydest;
619  register const char *yys = yysrc;
620
621  while ((*yyd++ = *yys++) != '\0')
622    continue;
623
624  return yyd - 1;
625}
626#  endif
627# endif
628#endif
629
630#line 315 "/usr/share/bison/bison.simple"
631
632
633/* The user can define YYPARSE_PARAM as the name of an argument to be passed
634   into yyparse.  The argument should have type void *.
635   It should actually point to an object.
636   Grammar actions can access the variable by casting it
637   to the proper pointer type.  */
638
639#ifdef YYPARSE_PARAM
640# if defined (__STDC__) || defined (__cplusplus)
641#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
642#  define YYPARSE_PARAM_DECL
643# else
644#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
645#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
646# endif
647#else /* !YYPARSE_PARAM */
648# define YYPARSE_PARAM_ARG
649# define YYPARSE_PARAM_DECL
650#endif /* !YYPARSE_PARAM */
651
652/* Prevent warning if -Wstrict-prototypes.  */
653#ifdef __GNUC__
654# ifdef YYPARSE_PARAM
655int yyparse (void *);
656# else
657int yyparse (void);
658# endif
659#endif
660
661/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
662   variables are global, or local to YYPARSE.  */
663
664#define YY_DECL_NON_LSP_VARIABLES                       \
665/* The lookahead symbol.  */                            \
666int yychar;                                             \
667                                                        \
668/* The semantic value of the lookahead symbol. */       \
669YYSTYPE yylval;                                         \
670                                                        \
671/* Number of parse errors so far.  */                   \
672int yynerrs;
673
674#if YYLSP_NEEDED
675# define YY_DECL_VARIABLES                      \
676YY_DECL_NON_LSP_VARIABLES                       \
677                                                \
678/* Location data for the lookahead symbol.  */  \
679YYLTYPE yylloc;
680#else
681# define YY_DECL_VARIABLES                      \
682YY_DECL_NON_LSP_VARIABLES
683#endif
684
685
686/* If nonreentrant, generate the variables here. */
687
688#if !YYPURE
689YY_DECL_VARIABLES
690#endif  /* !YYPURE */
691
692int
693yyparse (YYPARSE_PARAM_ARG)
694     YYPARSE_PARAM_DECL
695{
696  /* If reentrant, generate the variables here. */
697#if YYPURE
698  YY_DECL_VARIABLES
699#endif  /* !YYPURE */
700
701  register int yystate;
702  register int yyn;
703  int yyresult;
704  /* Number of tokens to shift before error messages enabled.  */
705  int yyerrstatus;
706  /* Lookahead token as an internal (translated) token number.  */
707  int yychar1 = 0;
708
709  /* Three stacks and their tools:
710     `yyss': related to states,
711     `yyvs': related to semantic values,
712     `yyls': related to locations.
713
714     Refer to the stacks thru separate pointers, to allow yyoverflow
715     to reallocate them elsewhere.  */
716
717  /* The state stack. */
718  short yyssa[YYINITDEPTH];
719  short *yyss = yyssa;
720  register short *yyssp;
721
722  /* The semantic value stack.  */
723  YYSTYPE yyvsa[YYINITDEPTH];
724  YYSTYPE *yyvs = yyvsa;
725  register YYSTYPE *yyvsp;
726
727#if YYLSP_NEEDED
728  /* The location stack.  */
729  YYLTYPE yylsa[YYINITDEPTH];
730  YYLTYPE *yyls = yylsa;
731  YYLTYPE *yylsp;
732#endif
733
734#if YYLSP_NEEDED
735# define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
736#else
737# define YYPOPSTACK   (yyvsp--, yyssp--)
738#endif
739
740  YYSIZE_T yystacksize = YYINITDEPTH;
741
742
743  /* The variables used to return semantic value and location from the
744     action routines.  */
745  YYSTYPE yyval;
746#if YYLSP_NEEDED
747  YYLTYPE yyloc;
748#endif
749
750  /* When reducing, the number of symbols on the RHS of the reduced
751     rule. */
752  int yylen;
753
754  YYDPRINTF ((stderr, "Starting parse\n"));
755
756  yystate = 0;
757  yyerrstatus = 0;
758  yynerrs = 0;
759  yychar = YYEMPTY;             /* Cause a token to be read.  */
760
761  /* Initialize stack pointers.
762     Waste one element of value and location stack
763     so that they stay on the same level as the state stack.
764     The wasted elements are never initialized.  */
765
766  yyssp = yyss;
767  yyvsp = yyvs;
768#if YYLSP_NEEDED
769  yylsp = yyls;
770#endif
771  goto yysetstate;
772
773/*------------------------------------------------------------.
774| yynewstate -- Push a new state, which is found in yystate.  |
775`------------------------------------------------------------*/
776 yynewstate:
777  /* In all cases, when you get here, the value and location stacks
778     have just been pushed. so pushing a state here evens the stacks.
779     */
780  yyssp++;
781
782 yysetstate:
783  *yyssp = yystate;
784
785  if (yyssp >= yyss + yystacksize - 1)
786    {
787      /* Get the current used size of the three stacks, in elements.  */
788      YYSIZE_T yysize = yyssp - yyss + 1;
789
790#ifdef yyoverflow
791      {
792        /* Give user a chance to reallocate the stack. Use copies of
793           these so that the &'s don't force the real ones into
794           memory.  */
795        YYSTYPE *yyvs1 = yyvs;
796        short *yyss1 = yyss;
797
798        /* Each stack pointer address is followed by the size of the
799           data in use in that stack, in bytes.  */
800# if YYLSP_NEEDED
801        YYLTYPE *yyls1 = yyls;
802        /* This used to be a conditional around just the two extra args,
803           but that might be undefined if yyoverflow is a macro.  */
804        yyoverflow ("parser stack overflow",
805                    &yyss1, yysize * sizeof (*yyssp),
806                    &yyvs1, yysize * sizeof (*yyvsp),
807                    &yyls1, yysize * sizeof (*yylsp),
808                    &yystacksize);
809        yyls = yyls1;
810# else
811        yyoverflow ("parser stack overflow",
812                    &yyss1, yysize * sizeof (*yyssp),
813                    &yyvs1, yysize * sizeof (*yyvsp),
814                    &yystacksize);
815# endif
816        yyss = yyss1;
817        yyvs = yyvs1;
818      }
819#else /* no yyoverflow */
820# ifndef YYSTACK_RELOCATE
821      goto yyoverflowlab;
822# else
823      /* Extend the stack our own way.  */
824      if (yystacksize >= YYMAXDEPTH)
825        goto yyoverflowlab;
826      yystacksize *= 2;
827      if (yystacksize > YYMAXDEPTH)
828        yystacksize = YYMAXDEPTH;
829
830      {
831        short *yyss1 = yyss;
832        union yyalloc *yyptr =
833          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
834        if (! yyptr)
835          goto yyoverflowlab;
836        YYSTACK_RELOCATE (yyss);
837        YYSTACK_RELOCATE (yyvs);
838# if YYLSP_NEEDED
839        YYSTACK_RELOCATE (yyls);
840# endif
841# undef YYSTACK_RELOCATE
842        if (yyss1 != yyssa)
843          YYSTACK_FREE (yyss1);
844      }
845# endif
846#endif /* no yyoverflow */
847
848      yyssp = yyss + yysize - 1;
849      yyvsp = yyvs + yysize - 1;
850#if YYLSP_NEEDED
851      yylsp = yyls + yysize - 1;
852#endif
853
854      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
855                  (unsigned long int) yystacksize));
856
857      if (yyssp >= yyss + yystacksize - 1)
858        YYABORT;
859    }
860
861  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
862
863  goto yybackup;
864
865
866/*-----------.
867| yybackup.  |
868`-----------*/
869yybackup:
870
871/* Do appropriate processing given the current state.  */
872/* Read a lookahead token if we need one and don't already have one.  */
873/* yyresume: */
874
875  /* First try to decide what to do without reference to lookahead token.  */
876
877  yyn = yypact[yystate];
878  if (yyn == YYFLAG)
879    goto yydefault;
880
881  /* Not known => get a lookahead token if don't already have one.  */
882
883  /* yychar is either YYEMPTY or YYEOF
884     or a valid token in external form.  */
885
886  if (yychar == YYEMPTY)
887    {
888      YYDPRINTF ((stderr, "Reading a token: "));
889      yychar = YYLEX;
890    }
891
892  /* Convert token to internal form (in yychar1) for indexing tables with */
893
894  if (yychar <= 0)              /* This means end of input. */
895    {
896      yychar1 = 0;
897      yychar = YYEOF;           /* Don't call YYLEX any more */
898
899      YYDPRINTF ((stderr, "Now at end of input.\n"));
900    }
901  else
902    {
903      yychar1 = YYTRANSLATE (yychar);
904
905#if YYDEBUG
906     /* We have to keep this `#if YYDEBUG', since we use variables
907        which are defined only if `YYDEBUG' is set.  */
908      if (yydebug)
909        {
910          YYFPRINTF (stderr, "Next token is %d (%s",
911                     yychar, yytname[yychar1]);
912          /* Give the individual parser a way to print the precise
913             meaning of a token, for further debugging info.  */
914# ifdef YYPRINT
915          YYPRINT (stderr, yychar, yylval);
916# endif
917          YYFPRINTF (stderr, ")\n");
918        }
919#endif
920    }
921
922  yyn += yychar1;
923  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
924    goto yydefault;
925
926  yyn = yytable[yyn];
927
928  /* yyn is what to do for this token type in this state.
929     Negative => reduce, -yyn is rule number.
930     Positive => shift, yyn is new state.
931       New state is final state => don't bother to shift,
932       just return success.
933     0, or most negative number => error.  */
934
935  if (yyn < 0)
936    {
937      if (yyn == YYFLAG)
938        goto yyerrlab;
939      yyn = -yyn;
940      goto yyreduce;
941    }
942  else if (yyn == 0)
943    goto yyerrlab;
944
945  if (yyn == YYFINAL)
946    YYACCEPT;
947
948  /* Shift the lookahead token.  */
949  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
950              yychar, yytname[yychar1]));
951
952  /* Discard the token being shifted unless it is eof.  */
953  if (yychar != YYEOF)
954    yychar = YYEMPTY;
955
956  *++yyvsp = yylval;
957#if YYLSP_NEEDED
958  *++yylsp = yylloc;
959#endif
960
961  /* Count tokens shifted since error; after three, turn off error
962     status.  */
963  if (yyerrstatus)
964    yyerrstatus--;
965
966  yystate = yyn;
967  goto yynewstate;
968
969
970/*-----------------------------------------------------------.
971| yydefault -- do the default action for the current state.  |
972`-----------------------------------------------------------*/
973yydefault:
974  yyn = yydefact[yystate];
975  if (yyn == 0)
976    goto yyerrlab;
977  goto yyreduce;
978
979
980/*-----------------------------.
981| yyreduce -- Do a reduction.  |
982`-----------------------------*/
983yyreduce:
984  /* yyn is the number of a rule to reduce with.  */
985  yylen = yyr2[yyn];
986
987  /* If YYLEN is nonzero, implement the default value of the action:
988     `$$ = $1'.
989
990     Otherwise, the following line sets YYVAL to the semantic value of
991     the lookahead token.  This behavior is undocumented and Bison
992     users should not rely upon it.  Assigning to YYVAL
993     unconditionally makes the parser a bit smaller, and it avoids a
994     GCC warning that YYVAL may be used uninitialized.  */
995  yyval = yyvsp[1-yylen];
996
997#if YYLSP_NEEDED
998  /* Similarly for the default location.  Let the user run additional
999     commands if for instance locations are ranges.  */
1000  yyloc = yylsp[1-yylen];
1001  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1002#endif
1003
1004#if YYDEBUG
1005  /* We have to keep this `#if YYDEBUG', since we use variables which
1006     are defined only if `YYDEBUG' is set.  */
1007  if (yydebug)
1008    {
1009      int yyi;
1010
1011      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1012                 yyn, yyrline[yyn]);
1013
1014      /* Print the symbols being reduced, and their result.  */
1015      for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1016        YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1017      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1018    }
1019#endif
1020
1021  switch (yyn) {
1022
1023case 10:
1024#line 127 "bindparser.yy"
1025{
1026                s_di.name=yyvsp[-1];
1027                parent->commit(s_di);
1028                s_di.clear();
1029        }
1030    break;
1031case 11:
1032#line 134 "bindparser.yy"
1033{
1034                s_di.name=yyvsp[-2];
1035                parent->commit(s_di);
1036                s_di.clear();
1037        }
1038    break;
1039case 24:
1040#line 173 "bindparser.yy"
1041{
1042                parent->setDirectory(yyvsp[0]);
1043        }
1044    break;
1045case 41:
1046#line 211 "bindparser.yy"
1047{
1048                s_di.master=yyvsp[0];
1049        }
1050    break;
1051case 42:
1052#line 218 "bindparser.yy"
1053{
1054          //            printf("Found a filename: '%s'\n",$2);
1055                s_di.filename=yyvsp[0];
1056        }
1057    break;
1058case 43:
1059#line 226 "bindparser.yy"
1060{
1061                s_di.type=yyvsp[0];
1062        }
1063    break;
1064case 44:
1065#line 234 "bindparser.yy"
1066{
1067                yyval=yyvsp[0];
1068        }
1069    break;
1070}
1071
1072#line 705 "/usr/share/bison/bison.simple"
1073
1074
1075  yyvsp -= yylen;
1076  yyssp -= yylen;
1077#if YYLSP_NEEDED
1078  yylsp -= yylen;
1079#endif
1080
1081#if YYDEBUG
1082  if (yydebug)
1083    {
1084      short *yyssp1 = yyss - 1;
1085      YYFPRINTF (stderr, "state stack now");
1086      while (yyssp1 != yyssp)
1087        YYFPRINTF (stderr, " %d", *++yyssp1);
1088      YYFPRINTF (stderr, "\n");
1089    }
1090#endif
1091
1092  *++yyvsp = yyval;
1093#if YYLSP_NEEDED
1094  *++yylsp = yyloc;
1095#endif
1096
1097  /* Now `shift' the result of the reduction.  Determine what state
1098     that goes to, based on the state we popped back to and the rule
1099     number reduced by.  */
1100
1101  yyn = yyr1[yyn];
1102
1103  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1104  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1105    yystate = yytable[yystate];
1106  else
1107    yystate = yydefgoto[yyn - YYNTBASE];
1108
1109  goto yynewstate;
1110
1111
1112/*------------------------------------.
1113| yyerrlab -- here on detecting error |
1114`------------------------------------*/
1115yyerrlab:
1116  /* If not already recovering from an error, report this error.  */
1117  if (!yyerrstatus)
1118    {
1119      ++yynerrs;
1120
1121#ifdef YYERROR_VERBOSE
1122      yyn = yypact[yystate];
1123
1124      if (yyn > YYFLAG && yyn < YYLAST)
1125        {
1126          YYSIZE_T yysize = 0;
1127          char *yymsg;
1128          int yyx, yycount;
1129
1130          yycount = 0;
1131          /* Start YYX at -YYN if negative to avoid negative indexes in
1132             YYCHECK.  */
1133          for (yyx = yyn < 0 ? -yyn : 0;
1134               yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1135            if (yycheck[yyx + yyn] == yyx)
1136              yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1137          yysize += yystrlen ("parse error, unexpected ") + 1;
1138          yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1139          yymsg = (char *) YYSTACK_ALLOC (yysize);
1140          if (yymsg != 0)
1141            {
1142              char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1143              yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1144
1145              if (yycount < 5)
1146                {
1147                  yycount = 0;
1148                  for (yyx = yyn < 0 ? -yyn : 0;
1149                       yyx < (int) (sizeof (yytname) / sizeof (char *));
1150                       yyx++)
1151                    if (yycheck[yyx + yyn] == yyx)
1152                      {
1153                        const char *yyq = ! yycount ? ", expecting " : " or ";
1154                        yyp = yystpcpy (yyp, yyq);
1155                        yyp = yystpcpy (yyp, yytname[yyx]);
1156                        yycount++;
1157                      }
1158                }
1159              yyerror (yymsg);
1160              YYSTACK_FREE (yymsg);
1161            }
1162          else
1163            yyerror ("parse error; also virtual memory exhausted");
1164        }
1165      else
1166#endif /* defined (YYERROR_VERBOSE) */
1167        yyerror ("parse error");
1168    }
1169  goto yyerrlab1;
1170
1171
1172/*--------------------------------------------------.
1173| yyerrlab1 -- error raised explicitly by an action |
1174`--------------------------------------------------*/
1175yyerrlab1:
1176  if (yyerrstatus == 3)
1177    {
1178      /* If just tried and failed to reuse lookahead token after an
1179         error, discard it.  */
1180
1181      /* return failure if at end of input */
1182      if (yychar == YYEOF)
1183        YYABORT;
1184      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1185                  yychar, yytname[yychar1]));
1186      yychar = YYEMPTY;
1187    }
1188
1189  /* Else will try to reuse lookahead token after shifting the error
1190     token.  */
1191
1192  yyerrstatus = 3;              /* Each real token shifted decrements this */
1193
1194  goto yyerrhandle;
1195
1196
1197/*-------------------------------------------------------------------.
1198| yyerrdefault -- current state does not do anything special for the |
1199| error token.                                                       |
1200`-------------------------------------------------------------------*/
1201yyerrdefault:
1202#if 0
1203  /* This is wrong; only states that explicitly want error tokens
1204     should shift them.  */
1205
1206  /* If its default is to accept any token, ok.  Otherwise pop it.  */
1207  yyn = yydefact[yystate];
1208  if (yyn)
1209    goto yydefault;
1210#endif
1211
1212
1213/*---------------------------------------------------------------.
1214| yyerrpop -- pop the current state because it cannot handle the |
1215| error token                                                    |
1216`---------------------------------------------------------------*/
1217yyerrpop:
1218  if (yyssp == yyss)
1219    YYABORT;
1220  yyvsp--;
1221  yystate = *--yyssp;
1222#if YYLSP_NEEDED
1223  yylsp--;
1224#endif
1225
1226#if YYDEBUG
1227  if (yydebug)
1228    {
1229      short *yyssp1 = yyss - 1;
1230      YYFPRINTF (stderr, "Error: state stack now");
1231      while (yyssp1 != yyssp)
1232        YYFPRINTF (stderr, " %d", *++yyssp1);
1233      YYFPRINTF (stderr, "\n");
1234    }
1235#endif
1236
1237/*--------------.
1238| yyerrhandle.  |
1239`--------------*/
1240yyerrhandle:
1241  yyn = yypact[yystate];
1242  if (yyn == YYFLAG)
1243    goto yyerrdefault;
1244
1245  yyn += YYTERROR;
1246  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1247    goto yyerrdefault;
1248
1249  yyn = yytable[yyn];
1250  if (yyn < 0)
1251    {
1252      if (yyn == YYFLAG)
1253        goto yyerrpop;
1254      yyn = -yyn;
1255      goto yyreduce;
1256    }
1257  else if (yyn == 0)
1258    goto yyerrpop;
1259
1260  if (yyn == YYFINAL)
1261    YYACCEPT;
1262
1263  YYDPRINTF ((stderr, "Shifting error token, "));
1264
1265  *++yyvsp = yylval;
1266#if YYLSP_NEEDED
1267  *++yylsp = yylloc;
1268#endif
1269
1270  yystate = yyn;
1271  goto yynewstate;
1272
1273
1274/*-------------------------------------.
1275| yyacceptlab -- YYACCEPT comes here.  |
1276`-------------------------------------*/
1277yyacceptlab:
1278  yyresult = 0;
1279  goto yyreturn;
1280
1281/*-----------------------------------.
1282| yyabortlab -- YYABORT comes here.  |
1283`-----------------------------------*/
1284yyabortlab:
1285  yyresult = 1;
1286  goto yyreturn;
1287
1288/*---------------------------------------------.
1289| yyoverflowab -- parser overflow comes here.  |
1290`---------------------------------------------*/
1291yyoverflowlab:
1292  yyerror ("parser stack overflow");
1293  yyresult = 2;
1294  /* Fall through.  */
1295
1296yyreturn:
1297#ifndef yyoverflow
1298  if (yyss != yyssa)
1299    YYSTACK_FREE (yyss);
1300#endif
1301  return yyresult;
1302}
1303#line 240 "bindparser.yy"
Note: See TracBrowser for help on using the browser.