]> www.wagner.pp.ru Git - oss/fgis.git/blob - lib/reclass.tab.c
GUI font definition moved to the config file.
[oss/fgis.git] / lib / reclass.tab.c
1
2 /*  A Bison parser, made from reclass.y
3  by  GNU Bison version 1.25
4   */
5
6 #define YYBISON 1  /* Identify Bison output.  */
7
8 #define NUMBER  258
9
10 #line 1 "reclass.y"
11
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include "reclass.h"
15 #include "epp.h"
16 #define YYSTYPE int
17 int yylex();
18 int yyerror();
19  RECLASS table;
20  int curval,startval,endval,loop_var;
21  int maxclass;
22  int interactive_parser=0;
23 #ifndef YYSTYPE
24 #define YYSTYPE int
25 #endif
26 #include <stdio.h>
27
28 #ifndef __cplusplus
29 #ifndef __STDC__
30 #define const
31 #endif
32 #endif
33
34
35
36 #define YYFINAL         33
37 #define YYFLAG          -32768
38 #define YYNTBASE        10
39
40 #define YYTRANSLATE(x) ((unsigned)(x) <= 258 ? yytranslate[x] : 18)
41
42 static const char yytranslate[] = {     0,
43      2,     2,     2,     2,     2,     2,     2,     2,     2,     8,
44      2,     2,     9,     2,     2,     2,     2,     2,     2,     2,
45      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
46      2,     2,     2,     2,     2,     2,     2,     2,     2,     5,
47      7,     2,     2,     2,     2,     2,     2,     2,     2,     2,
48      2,     2,     2,     2,     2,     2,     2,     6,     2,     2,
49      4,     2,     2,     2,     2,     2,     2,     2,     2,     2,
50      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
51      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
52      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
53      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
54      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
55      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
56      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
59      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
60      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
61      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
64      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
65      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
66      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
67      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
68      2,     2,     2,     2,     2,     1,     2,     3
69 };
70
71 #if YYDEBUG != 0
72 static const short yyprhs[] = {     0,
73      0,     2,     6,     7,    10,    12,    14,    17,    24,    26,
74     29,    31,    34,    36,    40,    42
75 };
76
77 static const short yyrhs[] = {    11,
78      0,    10,    13,    11,     0,     0,    12,    14,     0,    17,
79      0,     1,     0,    16,     4,     0,     5,    16,     6,    16,
80      7,     4,     0,     8,     0,     9,     8,     0,    15,     0,
81     14,    15,     0,    16,     0,    16,     6,    16,     0,     3,
82      0,    16,     6,    16,     4,    16,     6,    16,     0
83 };
84
85 #endif
86
87 #if YYDEBUG != 0
88 static const short yyrline[] = { 0,
89     17,    19,    22,    23,    24,    25,    31,    32,    34,    35,
90     36,    37,    38,    46,    54,    59
91 };
92 #endif
93
94
95 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
96
97 static const char * const yytname[] = {   "$","error","$undefined.","NUMBER",
98 "'='","'('","':'","')'","'\\n'","'\\r'","list","statement","dest","eol","range",
99 "subrange","value","map_statement", NULL
100 };
101 #endif
102
103 static const short yyr1[] = {     0,
104     10,    10,    11,    11,    11,    11,    12,    12,    13,    13,
105     14,    14,    15,    15,    16,    17
106 };
107
108 static const short yyr2[] = {     0,
109      1,     3,     0,     2,     1,     1,     2,     6,     1,     2,
110      1,     2,     1,     3,     1,     7
111 };
112
113 static const short yydefact[] = {     0,
114      6,    15,     0,     0,     1,     0,     0,     5,     0,     9,
115      0,     0,     4,    11,    13,     7,     0,     0,    10,     2,
116     12,     0,     0,     0,    14,     0,     0,     0,     8,     0,
117     16,     0,     0
118 };
119
120 static const short yydefgoto[] = {     4,
121      5,     6,    12,    13,    14,     7,     8
122 };
123
124 static const short yypact[] = {     4,
125 -32768,-32768,    -2,     8,-32768,    -2,    14,-32768,    -4,-32768,
126      3,     4,    -2,-32768,     0,-32768,    -2,    -2,-32768,-32768,
127 -32768,    -2,    17,    15,-32768,    -2,    20,    19,-32768,    -2,
128 -32768,    26,-32768
129 };
130
131 static const short yypgoto[] = {-32768,
132     16,-32768,-32768,-32768,    18,    -3,-32768
133 };
134
135
136 #define YYLAST          31
137
138
139 static const short yytable[] = {     9,
140      2,    18,    15,    -3,     1,    22,     2,    32,     3,    15,
141     19,    -3,    -3,    23,    24,    10,    11,    16,    25,    17,
142     26,    27,    28,    29,    30,    33,    31,    20,     0,     0,
143     21
144 };
145
146 static const short yycheck[] = {     3,
147      3,     6,     6,     0,     1,     6,     3,     0,     5,    13,
148      8,     8,     9,    17,    18,     8,     9,     4,    22,     6,
149      4,     7,    26,     4,     6,     0,    30,    12,    -1,    -1,
150     13
151 };
152 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
153 #line 3 "/usr/lib/bison.simple"
154
155 /* Skeleton output parser for bison,
156    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
157
158    This program is free software; you can redistribute it and/or modify
159    it under the terms of the GNU General Public License as published by
160    the Free Software Foundation; either version 2, or (at your option)
161    any later version.
162
163    This program is distributed in the hope that it will be useful,
164    but WITHOUT ANY WARRANTY; without even the implied warranty of
165    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
166    GNU General Public License for more details.
167
168    You should have received a copy of the GNU General Public License
169    along with this program; if not, write to the Free Software
170    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
171
172 /* As a special exception, when this file is copied by Bison into a
173    Bison output file, you may use that output file without restriction.
174    This special exception was added by the Free Software Foundation
175    in version 1.24 of Bison.  */
176
177 #ifndef alloca
178 #ifdef __GNUC__
179 #define alloca __builtin_alloca
180 #else /* not GNU C.  */
181 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
182 #include <alloca.h>
183 #else /* not sparc */
184 #if defined (MSDOS) && !defined (__TURBOC__)
185 #include <malloc.h>
186 #else /* not MSDOS, or __TURBOC__ */
187 #if defined(_AIX)
188 #include <malloc.h>
189  #pragma alloca
190 #else /* not MSDOS, __TURBOC__, or _AIX */
191 #ifdef __hpux
192 #ifdef __cplusplus
193 extern "C" {
194 void *alloca (unsigned int);
195 };
196 #else /* not __cplusplus */
197 void *alloca ();
198 #endif /* not __cplusplus */
199 #endif /* __hpux */
200 #endif /* not _AIX */
201 #endif /* not MSDOS, or __TURBOC__ */
202 #endif /* not sparc.  */
203 #endif /* not GNU C.  */
204 #endif /* alloca not defined.  */
205
206 /* This is the parser code that is written into each bison parser
207   when the %semantic_parser declaration is not specified in the grammar.
208   It was written by Richard Stallman by simplifying the hairy parser
209   used when %semantic_parser is specified.  */
210
211 /* Note: there must be only one dollar sign in this file.
212    It is replaced by the list of actions, each action
213    as one case of the switch.  */
214
215 #define yyerrok         (yyerrstatus = 0)
216 #define yyclearin       (yychar = YYEMPTY)
217 #define YYEMPTY         -2
218 #define YYEOF           0
219 #define YYACCEPT        return(0)
220 #define YYABORT         return(1)
221 #define YYERROR         goto yyerrlab1
222 /* Like YYERROR except do call yyerror.
223    This remains here temporarily to ease the
224    transition to the new meaning of YYERROR, for GCC.
225    Once GCC version 2 has supplanted version 1, this can go.  */
226 #define YYFAIL          goto yyerrlab
227 #define YYRECOVERING()  (!!yyerrstatus)
228 #define YYBACKUP(token, value) \
229 do                                                              \
230   if (yychar == YYEMPTY && yylen == 1)                          \
231     { yychar = (token), yylval = (value);                       \
232       yychar1 = YYTRANSLATE (yychar);                           \
233       YYPOPSTACK;                                               \
234       goto yybackup;                                            \
235     }                                                           \
236   else                                                          \
237     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
238 while (0)
239
240 #define YYTERROR        1
241 #define YYERRCODE       256
242
243 #ifndef YYPURE
244 #define YYLEX           yylex()
245 #endif
246
247 #ifdef YYPURE
248 #ifdef YYLSP_NEEDED
249 #ifdef YYLEX_PARAM
250 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
251 #else
252 #define YYLEX           yylex(&yylval, &yylloc)
253 #endif
254 #else /* not YYLSP_NEEDED */
255 #ifdef YYLEX_PARAM
256 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
257 #else
258 #define YYLEX           yylex(&yylval)
259 #endif
260 #endif /* not YYLSP_NEEDED */
261 #endif
262
263 /* If nonreentrant, generate the variables here */
264
265 #ifndef YYPURE
266
267 int     yychar;                 /*  the lookahead symbol                */
268 YYSTYPE yylval;                 /*  the semantic value of the           */
269                                 /*  lookahead symbol                    */
270
271 #ifdef YYLSP_NEEDED
272 YYLTYPE yylloc;                 /*  location data for the lookahead     */
273                                 /*  symbol                              */
274 #endif
275
276 int yynerrs;                    /*  number of parse errors so far       */
277 #endif  /* not YYPURE */
278
279 #if YYDEBUG != 0
280 int yydebug;                    /*  nonzero means print parse trace     */
281 /* Since this is uninitialized, it does not stop multiple parsers
282    from coexisting.  */
283 #endif
284
285 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
286
287 #ifndef YYINITDEPTH
288 #define YYINITDEPTH 200
289 #endif
290
291 /*  YYMAXDEPTH is the maximum size the stacks can grow to
292     (effective only if the built-in stack extension method is used).  */
293
294 #if YYMAXDEPTH == 0
295 #undef YYMAXDEPTH
296 #endif
297
298 #ifndef YYMAXDEPTH
299 #define YYMAXDEPTH 10000
300 #endif
301
302 /* Prevent warning if -Wstrict-prototypes.  */
303 #ifdef __GNUC__
304 int yyparse (void);
305 #endif
306 \f
307 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
308 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
309 #else                           /* not GNU C or C++ */
310 #ifndef __cplusplus
311
312 /* This is the most reliable way to avoid incompatibilities
313    in available built-in functions on various systems.  */
314 static void
315 __yy_memcpy (to, from, count)
316      char *to;
317      char *from;
318      int count;
319 {
320   register char *f = from;
321   register char *t = to;
322   register int i = count;
323
324   while (i-- > 0)
325     *t++ = *f++;
326 }
327
328 #else /* __cplusplus */
329
330 /* This is the most reliable way to avoid incompatibilities
331    in available built-in functions on various systems.  */
332 static void
333 __yy_memcpy (char *to, char *from, int count)
334 {
335   register char *f = from;
336   register char *t = to;
337   register int i = count;
338
339   while (i-- > 0)
340     *t++ = *f++;
341 }
342
343 #endif
344 #endif
345 \f
346 #line 196 "/usr/lib/bison.simple"
347
348 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
349    into yyparse.  The argument should have type void *.
350    It should actually point to an object.
351    Grammar actions can access the variable by casting it
352    to the proper pointer type.  */
353
354 #ifdef YYPARSE_PARAM
355 #ifdef __cplusplus
356 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
357 #define YYPARSE_PARAM_DECL
358 #else /* not __cplusplus */
359 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
360 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
361 #endif /* not __cplusplus */
362 #else /* not YYPARSE_PARAM */
363 #define YYPARSE_PARAM_ARG
364 #define YYPARSE_PARAM_DECL
365 #endif /* not YYPARSE_PARAM */
366
367 int
368 yyparse(YYPARSE_PARAM_ARG)
369      YYPARSE_PARAM_DECL
370 {
371   register int yystate;
372   register int yyn;
373   register short *yyssp;
374   register YYSTYPE *yyvsp;
375   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
376   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
377
378   short yyssa[YYINITDEPTH];     /*  the state stack                     */
379   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
380
381   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
382   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
383
384 #ifdef YYLSP_NEEDED
385   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
386   YYLTYPE *yyls = yylsa;
387   YYLTYPE *yylsp;
388
389 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
390 #else
391 #define YYPOPSTACK   (yyvsp--, yyssp--)
392 #endif
393
394   int yystacksize = YYINITDEPTH;
395
396 #ifdef YYPURE
397   int yychar;
398   YYSTYPE yylval;
399   int yynerrs;
400 #ifdef YYLSP_NEEDED
401   YYLTYPE yylloc;
402 #endif
403 #endif
404
405   YYSTYPE yyval;                /*  the variable used to return         */
406                                 /*  semantic values from the action     */
407                                 /*  routines                            */
408
409   int yylen;
410
411 #if YYDEBUG != 0
412   if (yydebug)
413     fprintf(stderr, "Starting parse\n");
414 #endif
415
416   yystate = 0;
417   yyerrstatus = 0;
418   yynerrs = 0;
419   yychar = YYEMPTY;             /* Cause a token to be read.  */
420
421   /* Initialize stack pointers.
422      Waste one element of value and location stack
423      so that they stay on the same level as the state stack.
424      The wasted elements are never initialized.  */
425
426   yyssp = yyss - 1;
427   yyvsp = yyvs;
428 #ifdef YYLSP_NEEDED
429   yylsp = yyls;
430 #endif
431
432 /* Push a new state, which is found in  yystate  .  */
433 /* In all cases, when you get here, the value and location stacks
434    have just been pushed. so pushing a state here evens the stacks.  */
435 yynewstate:
436
437   *++yyssp = yystate;
438
439   if (yyssp >= yyss + yystacksize - 1)
440     {
441       /* Give user a chance to reallocate the stack */
442       /* Use copies of these so that the &'s don't force the real ones into memory. */
443       YYSTYPE *yyvs1 = yyvs;
444       short *yyss1 = yyss;
445 #ifdef YYLSP_NEEDED
446       YYLTYPE *yyls1 = yyls;
447 #endif
448
449       /* Get the current used size of the three stacks, in elements.  */
450       int size = yyssp - yyss + 1;
451
452 #ifdef yyoverflow
453       /* Each stack pointer address is followed by the size of
454          the data in use in that stack, in bytes.  */
455 #ifdef YYLSP_NEEDED
456       /* This used to be a conditional around just the two extra args,
457          but that might be undefined if yyoverflow is a macro.  */
458       yyoverflow("parser stack overflow",
459                  &yyss1, size * sizeof (*yyssp),
460                  &yyvs1, size * sizeof (*yyvsp),
461                  &yyls1, size * sizeof (*yylsp),
462                  &yystacksize);
463 #else
464       yyoverflow("parser stack overflow",
465                  &yyss1, size * sizeof (*yyssp),
466                  &yyvs1, size * sizeof (*yyvsp),
467                  &yystacksize);
468 #endif
469
470       yyss = yyss1; yyvs = yyvs1;
471 #ifdef YYLSP_NEEDED
472       yyls = yyls1;
473 #endif
474 #else /* no yyoverflow */
475       /* Extend the stack our own way.  */
476       if (yystacksize >= YYMAXDEPTH)
477         {
478           yyerror("parser stack overflow");
479           return 2;
480         }
481       yystacksize *= 2;
482       if (yystacksize > YYMAXDEPTH)
483         yystacksize = YYMAXDEPTH;
484       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
485       __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
486       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
487       __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
488 #ifdef YYLSP_NEEDED
489       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
490       __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
491 #endif
492 #endif /* no yyoverflow */
493
494       yyssp = yyss + size - 1;
495       yyvsp = yyvs + size - 1;
496 #ifdef YYLSP_NEEDED
497       yylsp = yyls + size - 1;
498 #endif
499
500 #if YYDEBUG != 0
501       if (yydebug)
502         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
503 #endif
504
505       if (yyssp >= yyss + yystacksize - 1)
506         YYABORT;
507     }
508
509 #if YYDEBUG != 0
510   if (yydebug)
511     fprintf(stderr, "Entering state %d\n", yystate);
512 #endif
513
514   goto yybackup;
515  yybackup:
516
517 /* Do appropriate processing given the current state.  */
518 /* Read a lookahead token if we need one and don't already have one.  */
519 /* yyresume: */
520
521   /* First try to decide what to do without reference to lookahead token.  */
522
523   yyn = yypact[yystate];
524   if (yyn == YYFLAG)
525     goto yydefault;
526
527   /* Not known => get a lookahead token if don't already have one.  */
528
529   /* yychar is either YYEMPTY or YYEOF
530      or a valid token in external form.  */
531
532   if (yychar == YYEMPTY)
533     {
534 #if YYDEBUG != 0
535       if (yydebug)
536         fprintf(stderr, "Reading a token: ");
537 #endif
538       yychar = YYLEX;
539     }
540
541   /* Convert token to internal form (in yychar1) for indexing tables with */
542
543   if (yychar <= 0)              /* This means end of input. */
544     {
545       yychar1 = 0;
546       yychar = YYEOF;           /* Don't call YYLEX any more */
547
548 #if YYDEBUG != 0
549       if (yydebug)
550         fprintf(stderr, "Now at end of input.\n");
551 #endif
552     }
553   else
554     {
555       yychar1 = YYTRANSLATE(yychar);
556
557 #if YYDEBUG != 0
558       if (yydebug)
559         {
560           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
561           /* Give the individual parser a way to print the precise meaning
562              of a token, for further debugging info.  */
563 #ifdef YYPRINT
564           YYPRINT (stderr, yychar, yylval);
565 #endif
566           fprintf (stderr, ")\n");
567         }
568 #endif
569     }
570
571   yyn += yychar1;
572   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
573     goto yydefault;
574
575   yyn = yytable[yyn];
576
577   /* yyn is what to do for this token type in this state.
578      Negative => reduce, -yyn is rule number.
579      Positive => shift, yyn is new state.
580        New state is final state => don't bother to shift,
581        just return success.
582      0, or most negative number => error.  */
583
584   if (yyn < 0)
585     {
586       if (yyn == YYFLAG)
587         goto yyerrlab;
588       yyn = -yyn;
589       goto yyreduce;
590     }
591   else if (yyn == 0)
592     goto yyerrlab;
593
594   if (yyn == YYFINAL)
595     YYACCEPT;
596
597   /* Shift the lookahead token.  */
598
599 #if YYDEBUG != 0
600   if (yydebug)
601     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
602 #endif
603
604   /* Discard the token being shifted unless it is eof.  */
605   if (yychar != YYEOF)
606     yychar = YYEMPTY;
607
608   *++yyvsp = yylval;
609 #ifdef YYLSP_NEEDED
610   *++yylsp = yylloc;
611 #endif
612
613   /* count tokens shifted since error; after three, turn off error status.  */
614   if (yyerrstatus) yyerrstatus--;
615
616   yystate = yyn;
617   goto yynewstate;
618
619 /* Do the default action for the current state.  */
620 yydefault:
621
622   yyn = yydefact[yystate];
623   if (yyn == 0)
624     goto yyerrlab;
625
626 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
627 yyreduce:
628   yylen = yyr2[yyn];
629   if (yylen > 0)
630     yyval = yyvsp[1-yylen]; /* implement default value of the action */
631
632 #if YYDEBUG != 0
633   if (yydebug)
634     {
635       int i;
636
637       fprintf (stderr, "Reducing via rule %d (line %d), ",
638                yyn, yyrline[yyn]);
639
640       /* Print the symbols being reduced, and their result.  */
641       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
642         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
643       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
644     }
645 #endif
646
647
648   switch (yyn) {
649
650 case 6:
651 #line 25 "reclass.y"
652 { if (interactive_parser) 
653                      yyerrok;
654                    else
655                      YYABORT;
656                   ;
657     break;}
658 case 7:
659 #line 31 "reclass.y"
660 { curval=yyvsp[-1]; ;
661     break;}
662 case 8:
663 #line 32 "reclass.y"
664 { curval=-1; startval=yyvsp[-4] ; endval = yyvsp[-2]; 
665                                loop_var=startval;;
666     break;}
667 case 13:
668 #line 38 "reclass.y"
669
670                  if (curval>=0) table[yyvsp[0]]=curval;
671                     else {table[yyvsp[0]]=loop_var++;
672                           if (loop_var>endval) 
673                             loop_var=startval;
674                          }
675                  ;
676     break;}
677 case 14:
678 #line 46 "reclass.y"
679 { int i; for(i=yyvsp[-2];i<=yyvsp[0];i++) 
680                          if (curval>=0) table[i]=curval;
681                          else {table[i]=loop_var++;
682                                if (loop_var>endval) 
683                                 loop_var=startval;
684                               }
685                         ;
686     break;}
687 case 15:
688 #line 54 "reclass.y"
689 {if (yyvsp[0]>65535) 
690                    { yyerror("Class value out of range\n");
691                      return 1;YYERROR;
692                    }
693  ;
694     break;}
695 case 16:
696 #line 59 "reclass.y"
697 {
698                int i,start,stop,startv,stopv;
699                if (yyvsp[-2]>yyvsp[0]) {start=yyvsp[0];startv=yyvsp[-4];stop=yyvsp[-2];stopv=yyvsp[-6];}
700                    else   {start=yyvsp[-2];startv=yyvsp[-6];stop=yyvsp[0];stopv=yyvsp[-4];}
701                for (i=start;i<=stop;i++)
702                 table[i]=(i-start)*(stopv-startv)/(start-stop)+startv;
703                ;
704     break;}
705 }
706    /* the action file gets copied in in place of this dollarsign */
707 #line 498 "/usr/lib/bison.simple"
708 \f
709   yyvsp -= yylen;
710   yyssp -= yylen;
711 #ifdef YYLSP_NEEDED
712   yylsp -= yylen;
713 #endif
714
715 #if YYDEBUG != 0
716   if (yydebug)
717     {
718       short *ssp1 = yyss - 1;
719       fprintf (stderr, "state stack now");
720       while (ssp1 != yyssp)
721         fprintf (stderr, " %d", *++ssp1);
722       fprintf (stderr, "\n");
723     }
724 #endif
725
726   *++yyvsp = yyval;
727
728 #ifdef YYLSP_NEEDED
729   yylsp++;
730   if (yylen == 0)
731     {
732       yylsp->first_line = yylloc.first_line;
733       yylsp->first_column = yylloc.first_column;
734       yylsp->last_line = (yylsp-1)->last_line;
735       yylsp->last_column = (yylsp-1)->last_column;
736       yylsp->text = 0;
737     }
738   else
739     {
740       yylsp->last_line = (yylsp+yylen-1)->last_line;
741       yylsp->last_column = (yylsp+yylen-1)->last_column;
742     }
743 #endif
744
745   /* Now "shift" the result of the reduction.
746      Determine what state that goes to,
747      based on the state we popped back to
748      and the rule number reduced by.  */
749
750   yyn = yyr1[yyn];
751
752   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
753   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
754     yystate = yytable[yystate];
755   else
756     yystate = yydefgoto[yyn - YYNTBASE];
757
758   goto yynewstate;
759
760 yyerrlab:   /* here on detecting error */
761
762   if (! yyerrstatus)
763     /* If not already recovering from an error, report this error.  */
764     {
765       ++yynerrs;
766
767 #ifdef YYERROR_VERBOSE
768       yyn = yypact[yystate];
769
770       if (yyn > YYFLAG && yyn < YYLAST)
771         {
772           int size = 0;
773           char *msg;
774           int x, count;
775
776           count = 0;
777           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
778           for (x = (yyn < 0 ? -yyn : 0);
779                x < (sizeof(yytname) / sizeof(char *)); x++)
780             if (yycheck[x + yyn] == x)
781               size += strlen(yytname[x]) + 15, count++;
782           msg = (char *) malloc(size + 15);
783           if (msg != 0)
784             {
785               strcpy(msg, "parse error");
786
787               if (count < 5)
788                 {
789                   count = 0;
790                   for (x = (yyn < 0 ? -yyn : 0);
791                        x < (sizeof(yytname) / sizeof(char *)); x++)
792                     if (yycheck[x + yyn] == x)
793                       {
794                         strcat(msg, count == 0 ? ", expecting `" : " or `");
795                         strcat(msg, yytname[x]);
796                         strcat(msg, "'");
797                         count++;
798                       }
799                 }
800               yyerror(msg);
801               free(msg);
802             }
803           else
804             yyerror ("parse error; also virtual memory exceeded");
805         }
806       else
807 #endif /* YYERROR_VERBOSE */
808         yyerror("parse error");
809     }
810
811   goto yyerrlab1;
812 yyerrlab1:   /* here on error raised explicitly by an action */
813
814   if (yyerrstatus == 3)
815     {
816       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
817
818       /* return failure if at end of input */
819       if (yychar == YYEOF)
820         YYABORT;
821
822 #if YYDEBUG != 0
823       if (yydebug)
824         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
825 #endif
826
827       yychar = YYEMPTY;
828     }
829
830   /* Else will try to reuse lookahead token
831      after shifting the error token.  */
832
833   yyerrstatus = 3;              /* Each real token shifted decrements this */
834
835   goto yyerrhandle;
836
837 yyerrdefault:  /* current state does not do anything special for the error token. */
838
839 #if 0
840   /* This is wrong; only states that explicitly want error tokens
841      should shift them.  */
842   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
843   if (yyn) goto yydefault;
844 #endif
845
846 yyerrpop:   /* pop the current state because it cannot handle the error token */
847
848   if (yyssp == yyss) YYABORT;
849   yyvsp--;
850   yystate = *--yyssp;
851 #ifdef YYLSP_NEEDED
852   yylsp--;
853 #endif
854
855 #if YYDEBUG != 0
856   if (yydebug)
857     {
858       short *ssp1 = yyss - 1;
859       fprintf (stderr, "Error: state stack now");
860       while (ssp1 != yyssp)
861         fprintf (stderr, " %d", *++ssp1);
862       fprintf (stderr, "\n");
863     }
864 #endif
865
866 yyerrhandle:
867
868   yyn = yypact[yystate];
869   if (yyn == YYFLAG)
870     goto yyerrdefault;
871
872   yyn += YYTERROR;
873   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
874     goto yyerrdefault;
875
876   yyn = yytable[yyn];
877   if (yyn < 0)
878     {
879       if (yyn == YYFLAG)
880         goto yyerrpop;
881       yyn = -yyn;
882       goto yyreduce;
883     }
884   else if (yyn == 0)
885     goto yyerrpop;
886
887   if (yyn == YYFINAL)
888     YYACCEPT;
889
890 #if YYDEBUG != 0
891   if (yydebug)
892     fprintf(stderr, "Shifting error token, ");
893 #endif
894
895   *++yyvsp = yylval;
896 #ifdef YYLSP_NEEDED
897   *++yylsp = yylloc;
898 #endif
899
900   yystate = yyn;
901   goto yynewstate;
902 }
903 #line 68 "reclass.y"
904
905 int (*my_getc)();
906 int yylex()
907 { int c,numb=0,isnumb=0; 
908   static char unget_buf=0;
909  while ((c=unget_buf?unget_buf:(*my_getc)())!=EOF)
910  { unget_buf=0;
911    switch (c)
912    {
913     case '0':
914     case '1':
915     case '2': 
916     case '3':
917     case '4':
918     case '5':
919     case '6':
920     case '7':
921     case '8':
922     case '9': {isnumb=1; numb=numb*10+c-'0'; break;}
923     case ' ':
924     case '\t': {if (isnumb) { yylval=numb; return NUMBER; } break;}
925     default: if (isnumb) { yylval=numb; unget_buf=c; return NUMBER;}
926              else return c;
927  }
928  }
929  return 0;
930 }
931
932 int yyerror(char *s)
933 { fprintf(stderr,"%s\n",s);
934  return 0;
935 }
936 RECLASS make_reclass_table(EPP *infile,int (*recl_getc)())
937 { int size=epp_table_size(infile); 
938   
939   return parse_statements(size,create_reclass_table(size),recl_getc);
940 }
941 RECLASS parse_statements(int size,RECLASS src,int (*recl_getc)())
942 { my_getc=recl_getc;
943   table=src;
944   if (size>65535)size=65535;
945   maxclass=size;
946   if (yyparse()) { free(table);return NULL;}
947     else return table;
948 }
949 RECLASS create_reclass_table(size)
950 { RECLASS table;
951   int i;
952   if (size<=0) return NULL;
953   else if (size>65535) size=65535;
954   table=malloc((size+1)*sizeof(short int));
955   for(i=0;i<=size;i++) table[i]=i;
956   return table;
957 }
958 RECLASS wrapped_reclass(EPP *infile,int white)
959 { int i,maxclass;
960   RECLASS table;
961   maxclass=epp_table_size(infile);
962   table=malloc(maxclass*sizeof(short int));
963   table[0]=0;
964   for(i=1;i<=maxclass;i++) table[i]=(i-1)%(white-1)+1;
965   table[infile->offsite]=white;
966   return table;  
967 }