1
/* A Bison parser, made from imap_cern.y
4
#define YYBISON 1 /* Identify Bison output. */
6
#define yyparse cern_parse
8
#define yyerror cern_error
9
#define yylval cern_lval
10
#define yychar cern_char
11
#define yydebug cern_debug
12
#define yynerrs cern_nerrs
13
# define RECTANGLE 257
18
# define DESCRIPTION 262
19
# define BEGIN_COMMENT 263
27
* This is a plug-in for the GIMP.
29
* Generates clickable image maps.
31
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
33
* This program is free software; you can redistribute it and/or modify
34
* it under the terms of the GNU General Public License as published by
35
* the Free Software Foundation; either version 2 of the License, or
36
* (at your option) any later version.
38
* This program is distributed in the hope that it will be useful,
39
* but WITHOUT ANY WARRANTY; without even the implied warranty of
40
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41
* GNU General Public License for more details.
43
* You should have received a copy of the GNU General Public License
44
* along with this program; if not, write to the Free Software
45
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
54
#include "imap_circle.h"
55
#include "imap_file.h"
56
#include "imap_main.h"
57
#include "imap_polygon.h"
58
#include "imap_rectangle.h"
59
#include "imap_string.h"
61
extern int cern_lex();
62
extern int cern_restart();
63
static void cern_error(char* s);
65
static Object_t *current_object;
68
#line 45 "imap_cern.y"
75
# define YYSTYPE yystype
76
# define YYSTYPE_IS_TRIVIAL 1
88
/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
89
#define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 30)
91
/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
92
static const char yytranslate[] =
94
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
95
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
96
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
97
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
98
13, 15, 2, 2, 14, 2, 2, 2, 2, 2,
99
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
100
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
101
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
102
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
103
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
104
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
105
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
106
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
107
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
108
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
109
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
110
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
111
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
112
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
113
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
114
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
115
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
116
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
117
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
118
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
119
2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
120
6, 7, 8, 9, 10, 11, 12
124
static const short yyprhs[] =
126
0, 0, 2, 3, 6, 8, 10, 12, 14, 16,
127
19, 32, 41, 42, 47, 48, 51, 57, 59, 61,
130
static const short yyrhs[] =
132
17, 0, 0, 17, 18, 0, 19, 0, 20, 0,
133
21, 0, 22, 0, 26, 0, 6, 12, 0, 3,
134
13, 10, 14, 10, 15, 13, 10, 14, 10, 15,
135
12, 0, 5, 13, 10, 14, 10, 15, 10, 12,
136
0, 0, 4, 23, 24, 12, 0, 0, 24, 25,
137
0, 13, 10, 14, 10, 15, 0, 28, 0, 29,
138
0, 27, 0, 9, 11, 0, 7, 11, 0, 8,
145
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
146
static const short yyrline[] =
148
0, 58, 61, 62, 65, 66, 67, 68, 69, 72,
149
80, 92, 103, 103, 110, 111, 116, 125, 126, 127,
155
#if (YYDEBUG) || defined YYERROR_VERBOSE
157
/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
158
static const char *const yytname[] =
160
"$", "error", "$undefined.", "RECTANGLE", "POLYGON", "CIRCLE", "DEFAULT",
161
"AUTHOR", "DESCRIPTION", "BEGIN_COMMENT", "FLOAT", "COMMENT", "LINK",
162
"'('", "','", "')'", "cern_file", "area_list", "area", "default",
163
"rectangle", "circle", "polygon", "@1", "coord_list", "coord",
164
"comment_line", "real_comment", "author_line", "description_line", 0
168
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
169
static const short yyr1[] =
171
0, 16, 17, 17, 18, 18, 18, 18, 18, 19,
172
20, 21, 23, 22, 24, 24, 25, 26, 26, 26,
176
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
177
static const short yyr2[] =
179
0, 1, 0, 2, 1, 1, 1, 1, 1, 2,
180
12, 8, 0, 4, 0, 2, 5, 1, 1, 1,
184
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
185
doesn't specify something else to do. Zero means the default is an
187
static const short yydefact[] =
189
2, 1, 0, 12, 0, 0, 0, 0, 0, 3,
190
4, 5, 6, 7, 8, 19, 17, 18, 0, 14,
191
0, 9, 21, 22, 20, 0, 0, 0, 0, 13,
192
0, 15, 0, 0, 0, 0, 0, 0, 0, 0,
193
0, 0, 0, 16, 11, 0, 0, 0, 10, 0,
197
static const short yydefgoto[] =
199
49, 1, 9, 10, 11, 12, 13, 19, 26, 31,
203
static const short yypact[] =
205
-32768, -3, -4,-32768, -2, 0, -1, 2, 3,-32768,
206
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 5,-32768,
207
6,-32768,-32768,-32768,-32768, 4, -5, 7, 9,-32768,
208
10,-32768, 12, 8, 11, 13, 14, 16, 19, 20,
209
17, 21, 22,-32768,-32768, 24, 23, 25,-32768, 31,
213
static const short yypgoto[] =
215
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
216
-32768,-32768,-32768,-32768
223
static const short yytable[] =
225
2, 3, 4, 5, 6, 7, 8, 29, 30, 18,
226
22, 20, 21, 23, 24, 25, 27, 0, 28, 33,
227
34, 32, 35, 36, 0, 37, 40, 39, 38, 41,
228
42, 50, 43, 44, 46, 51, 45, 48, 47
231
static const short yycheck[] =
233
3, 4, 5, 6, 7, 8, 9, 12, 13, 13,
234
11, 13, 12, 11, 11, 10, 10, -1, 14, 10,
235
10, 14, 10, 15, -1, 14, 10, 13, 15, 10,
236
10, 0, 15, 12, 10, 0, 14, 12, 15
238
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
239
#line 3 "/usr/share/bison/bison.simple"
241
/* Skeleton output parser for bison,
243
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
246
This program is free software; you can redistribute it and/or modify
247
it under the terms of the GNU General Public License as published by
248
the Free Software Foundation; either version 2, or (at your option)
251
This program is distributed in the hope that it will be useful,
252
but WITHOUT ANY WARRANTY; without even the implied warranty of
253
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
254
GNU General Public License for more details.
256
You should have received a copy of the GNU General Public License
257
along with this program; if not, write to the Free Software
258
Foundation, Inc., 59 Temple Place - Suite 330,
259
Boston, MA 02111-1307, USA. */
261
/* As a special exception, when this file is copied by Bison into a
262
Bison output file, you may use that output file without restriction.
263
This special exception was added by the Free Software Foundation
264
in version 1.24 of Bison. */
266
/* This is the parser code that is written into each bison parser when
267
the %semantic_parser declaration is not specified in the grammar.
268
It was written by Richard Stallman by simplifying the hairy parser
269
used when %semantic_parser is specified. */
271
/* All symbols defined below should begin with yy or YY, to avoid
272
infringing on user name space. This should be done even for local
273
variables, as they might otherwise be expanded by user macros.
274
There are some unavoidable exceptions within include files to
275
define necessary library symbols; they are noted "INFRINGES ON
276
USER NAME SPACE" below. */
278
#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
280
/* The parser invokes alloca or malloc; define the necessary symbols. */
282
# if YYSTACK_USE_ALLOCA
283
# define YYSTACK_ALLOC alloca
285
# ifndef YYSTACK_USE_ALLOCA
286
# if defined (alloca) || defined (_ALLOCA_H)
287
# define YYSTACK_ALLOC alloca
290
# define YYSTACK_ALLOC __builtin_alloca
296
# ifdef YYSTACK_ALLOC
297
/* Pacify GCC's `empty if-body' warning. */
298
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
300
# if defined (__STDC__) || defined (__cplusplus)
301
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
302
# define YYSIZE_T size_t
304
# define YYSTACK_ALLOC malloc
305
# define YYSTACK_FREE free
307
#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
310
#if (! defined (yyoverflow) \
311
&& (! defined (__cplusplus) \
312
|| (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
314
/* A type that is properly aligned for any stack member. */
324
/* The size of the maximum gap between one aligned stack and the next. */
325
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
327
/* The size of an array large to enough to hold all stacks, each with
330
# define YYSTACK_BYTES(N) \
331
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
332
+ 2 * YYSTACK_GAP_MAX)
334
# define YYSTACK_BYTES(N) \
335
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
339
/* Copy COUNT objects from FROM to TO. The source and destination do
343
# define YYCOPY(To, From, Count) \
344
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
346
# define YYCOPY(To, From, Count) \
349
register YYSIZE_T yyi; \
350
for (yyi = 0; yyi < (Count); yyi++) \
351
(To)[yyi] = (From)[yyi]; \
357
/* Relocate STACK from its old location to the new one. The
358
local variables YYSIZE and YYSTACKSIZE give the old and new number of
359
elements in the stack, and YYPTR gives the new location of the
360
stack. Advance YYPTR to a properly aligned location for the next
362
# define YYSTACK_RELOCATE(Stack) \
365
YYSIZE_T yynewbytes; \
366
YYCOPY (&yyptr->Stack, Stack, yysize); \
367
Stack = &yyptr->Stack; \
368
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
369
yyptr += yynewbytes / sizeof (*yyptr); \
376
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
377
# define YYSIZE_T __SIZE_TYPE__
379
#if ! defined (YYSIZE_T) && defined (size_t)
380
# define YYSIZE_T size_t
382
#if ! defined (YYSIZE_T)
383
# if defined (__STDC__) || defined (__cplusplus)
384
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
385
# define YYSIZE_T size_t
388
#if ! defined (YYSIZE_T)
389
# define YYSIZE_T unsigned int
392
#define yyerrok (yyerrstatus = 0)
393
#define yyclearin (yychar = YYEMPTY)
396
#define YYACCEPT goto yyacceptlab
397
#define YYABORT goto yyabortlab
398
#define YYERROR goto yyerrlab1
399
/* Like YYERROR except do call yyerror. This remains here temporarily
400
to ease the transition to the new meaning of YYERROR, for GCC.
401
Once GCC version 2 has supplanted version 1, this can go. */
402
#define YYFAIL goto yyerrlab
403
#define YYRECOVERING() (!!yyerrstatus)
404
#define YYBACKUP(Token, Value) \
406
if (yychar == YYEMPTY && yylen == 1) \
410
yychar1 = YYTRANSLATE (yychar); \
416
yyerror ("syntax error: cannot back up"); \
422
#define YYERRCODE 256
425
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
428
When YYLLOC_DEFAULT is run, CURRENT is set the location of the
429
first token. By default, to implement support for ranges, extend
430
its range to the last symbol. */
432
#ifndef YYLLOC_DEFAULT
433
# define YYLLOC_DEFAULT(Current, Rhs, N) \
434
Current.last_line = Rhs[N].last_line; \
435
Current.last_column = Rhs[N].last_column;
439
/* YYLEX -- calling `yylex' with the right arguments. */
444
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
446
# define YYLEX yylex (&yylval, &yylloc)
448
# else /* !YYLSP_NEEDED */
450
# define YYLEX yylex (&yylval, YYLEX_PARAM)
452
# define YYLEX yylex (&yylval)
454
# endif /* !YYLSP_NEEDED */
456
# define YYLEX yylex ()
460
/* Enable debugging if requested. */
464
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
465
# define YYFPRINTF fprintf
468
# define YYDPRINTF(Args) \
473
/* Nonzero means print parse trace. It is left uninitialized so that
474
multiple parsers can coexist. */
477
# define YYDPRINTF(Args)
478
#endif /* !YYDEBUG */
480
/* YYINITDEPTH -- initial size of the parser's stacks. */
482
# define YYINITDEPTH 200
485
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
486
if the built-in stack extension method is used).
488
Do not make this value too large; the results are undefined if
489
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
490
evaluated with infinite-precision integer arithmetic. */
497
# define YYMAXDEPTH 10000
500
#ifdef YYERROR_VERBOSE
503
# if defined (__GLIBC__) && defined (_STRING_H)
504
# define yystrlen strlen
506
/* Return the length of YYSTR. */
508
# if defined (__STDC__) || defined (__cplusplus)
509
yystrlen (const char *yystr)
515
register const char *yys = yystr;
517
while (*yys++ != '\0')
520
return yys - yystr - 1;
526
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
527
# define yystpcpy stpcpy
529
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
532
# if defined (__STDC__) || defined (__cplusplus)
533
yystpcpy (char *yydest, const char *yysrc)
535
yystpcpy (yydest, yysrc)
540
register char *yyd = yydest;
541
register const char *yys = yysrc;
543
while ((*yyd++ = *yys++) != '\0')
552
#line 315 "/usr/share/bison/bison.simple"
555
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
556
into yyparse. The argument should have type void *.
557
It should actually point to an object.
558
Grammar actions can access the variable by casting it
559
to the proper pointer type. */
562
# if defined (__STDC__) || defined (__cplusplus)
563
# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
564
# define YYPARSE_PARAM_DECL
566
# define YYPARSE_PARAM_ARG YYPARSE_PARAM
567
# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
569
#else /* !YYPARSE_PARAM */
570
# define YYPARSE_PARAM_ARG
571
# define YYPARSE_PARAM_DECL
572
#endif /* !YYPARSE_PARAM */
574
/* Prevent warning if -Wstrict-prototypes. */
576
# ifdef YYPARSE_PARAM
577
int yyparse (void *);
583
/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
584
variables are global, or local to YYPARSE. */
586
#define YY_DECL_NON_LSP_VARIABLES \
587
/* The lookahead symbol. */ \
590
/* The semantic value of the lookahead symbol. */ \
593
/* Number of parse errors so far. */ \
597
# define YY_DECL_VARIABLES \
598
YY_DECL_NON_LSP_VARIABLES \
600
/* Location data for the lookahead symbol. */ \
603
# define YY_DECL_VARIABLES \
604
YY_DECL_NON_LSP_VARIABLES
608
/* If nonreentrant, generate the variables here. */
615
yyparse (YYPARSE_PARAM_ARG)
618
/* If reentrant, generate the variables here. */
623
register int yystate;
626
/* Number of tokens to shift before error messages enabled. */
628
/* Lookahead token as an internal (translated) token number. */
631
/* Three stacks and their tools:
632
`yyss': related to states,
633
`yyvs': related to semantic values,
634
`yyls': related to locations.
636
Refer to the stacks thru separate pointers, to allow yyoverflow
637
to reallocate them elsewhere. */
639
/* The state stack. */
640
short yyssa[YYINITDEPTH];
642
register short *yyssp;
644
/* The semantic value stack. */
645
YYSTYPE yyvsa[YYINITDEPTH];
646
YYSTYPE *yyvs = yyvsa;
647
register YYSTYPE *yyvsp;
650
/* The location stack. */
651
YYLTYPE yylsa[YYINITDEPTH];
652
YYLTYPE *yyls = yylsa;
657
# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
659
# define YYPOPSTACK (yyvsp--, yyssp--)
662
YYSIZE_T yystacksize = YYINITDEPTH;
665
/* The variables used to return semantic value and location from the
672
/* When reducing, the number of symbols on the RHS of the reduced
676
YYDPRINTF ((stderr, "Starting parse\n"));
681
yychar = YYEMPTY; /* Cause a token to be read. */
683
/* Initialize stack pointers.
684
Waste one element of value and location stack
685
so that they stay on the same level as the state stack.
686
The wasted elements are never initialized. */
695
/*------------------------------------------------------------.
696
| yynewstate -- Push a new state, which is found in yystate. |
697
`------------------------------------------------------------*/
699
/* In all cases, when you get here, the value and location stacks
700
have just been pushed. so pushing a state here evens the stacks.
707
if (yyssp >= yyss + yystacksize - 1)
709
/* Get the current used size of the three stacks, in elements. */
710
YYSIZE_T yysize = yyssp - yyss + 1;
714
/* Give user a chance to reallocate the stack. Use copies of
715
these so that the &'s don't force the real ones into
717
YYSTYPE *yyvs1 = yyvs;
720
/* Each stack pointer address is followed by the size of the
721
data in use in that stack, in bytes. */
723
YYLTYPE *yyls1 = yyls;
724
/* This used to be a conditional around just the two extra args,
725
but that might be undefined if yyoverflow is a macro. */
726
yyoverflow ("parser stack overflow",
727
&yyss1, yysize * sizeof (*yyssp),
728
&yyvs1, yysize * sizeof (*yyvsp),
729
&yyls1, yysize * sizeof (*yylsp),
733
yyoverflow ("parser stack overflow",
734
&yyss1, yysize * sizeof (*yyssp),
735
&yyvs1, yysize * sizeof (*yyvsp),
741
#else /* no yyoverflow */
742
# ifndef YYSTACK_RELOCATE
745
/* Extend the stack our own way. */
746
if (yystacksize >= YYMAXDEPTH)
749
if (yystacksize > YYMAXDEPTH)
750
yystacksize = YYMAXDEPTH;
754
union yyalloc *yyptr =
755
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
758
YYSTACK_RELOCATE (yyss);
759
YYSTACK_RELOCATE (yyvs);
761
YYSTACK_RELOCATE (yyls);
763
# undef YYSTACK_RELOCATE
765
YYSTACK_FREE (yyss1);
768
#endif /* no yyoverflow */
770
yyssp = yyss + yysize - 1;
771
yyvsp = yyvs + yysize - 1;
773
yylsp = yyls + yysize - 1;
776
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
777
(unsigned long int) yystacksize));
779
if (yyssp >= yyss + yystacksize - 1)
783
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
793
/* Do appropriate processing given the current state. */
794
/* Read a lookahead token if we need one and don't already have one. */
797
/* First try to decide what to do without reference to lookahead token. */
799
yyn = yypact[yystate];
803
/* Not known => get a lookahead token if don't already have one. */
805
/* yychar is either YYEMPTY or YYEOF
806
or a valid token in external form. */
808
if (yychar == YYEMPTY)
810
YYDPRINTF ((stderr, "Reading a token: "));
814
/* Convert token to internal form (in yychar1) for indexing tables with */
816
if (yychar <= 0) /* This means end of input. */
819
yychar = YYEOF; /* Don't call YYLEX any more */
821
YYDPRINTF ((stderr, "Now at end of input.\n"));
825
yychar1 = YYTRANSLATE (yychar);
828
/* We have to keep this `#if YYDEBUG', since we use variables
829
which are defined only if `YYDEBUG' is set. */
832
YYFPRINTF (stderr, "Next token is %d (%s",
833
yychar, yytname[yychar1]);
834
/* Give the individual parser a way to print the precise
835
meaning of a token, for further debugging info. */
837
YYPRINT (stderr, yychar, yylval);
839
YYFPRINTF (stderr, ")\n");
845
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
850
/* yyn is what to do for this token type in this state.
851
Negative => reduce, -yyn is rule number.
852
Positive => shift, yyn is new state.
853
New state is final state => don't bother to shift,
855
0, or most negative number => error. */
870
/* Shift the lookahead token. */
871
YYDPRINTF ((stderr, "Shifting token %d (%s), ",
872
yychar, yytname[yychar1]));
874
/* Discard the token being shifted unless it is eof. */
883
/* Count tokens shifted since error; after three, turn off error
892
/*-----------------------------------------------------------.
893
| yydefault -- do the default action for the current state. |
894
`-----------------------------------------------------------*/
896
yyn = yydefact[yystate];
902
/*-----------------------------.
903
| yyreduce -- Do a reduction. |
904
`-----------------------------*/
906
/* yyn is the number of a rule to reduce with. */
909
/* If YYLEN is nonzero, implement the default value of the action:
912
Otherwise, the following line sets YYVAL to the semantic value of
913
the lookahead token. This behavior is undocumented and Bison
914
users should not rely upon it. Assigning to YYVAL
915
unconditionally makes the parser a bit smaller, and it avoids a
916
GCC warning that YYVAL may be used uninitialized. */
917
yyval = yyvsp[1-yylen];
920
/* Similarly for the default location. Let the user run additional
921
commands if for instance locations are ranges. */
922
yyloc = yylsp[1-yylen];
923
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
927
/* We have to keep this `#if YYDEBUG', since we use variables which
928
are defined only if `YYDEBUG' is set. */
933
YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
936
/* Print the symbols being reduced, and their result. */
937
for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
938
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
939
YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
946
#line 73 "imap_cern.y"
948
MapInfo_t *info = get_map_info();
949
g_strreplace(&info->default_url, yyvsp[0].id);
953
#line 81 "imap_cern.y"
955
gint x = (gint) yyvsp[-9].value;
956
gint y = (gint) yyvsp[-7].value;
957
gint width = (gint) fabs(yyvsp[-4].value - x);
958
gint height = (gint) fabs(yyvsp[-2].value - y);
959
current_object = create_rectangle(x, y, width, height);
960
object_set_url(current_object, yyvsp[0].id);
961
add_shape(current_object);
965
#line 93 "imap_cern.y"
967
gint x = (gint) yyvsp[-5].value;
968
gint y = (gint) yyvsp[-3].value;
969
gint r = (gint) yyvsp[-1].value;
970
current_object = create_circle(x, y, r);
971
object_set_url(current_object, yyvsp[0].id);
972
add_shape(current_object);
976
#line 103 "imap_cern.y"
977
{current_object = create_polygon(NULL);}
980
#line 104 "imap_cern.y"
982
object_set_url(current_object, yyvsp[0].id);
983
add_shape(current_object);
987
#line 112 "imap_cern.y"
992
#line 117 "imap_cern.y"
994
Polygon_t *polygon = ObjectToPolygon(current_object);
995
GdkPoint *point = new_point((gint) yyvsp[-3].value, (gint) yyvsp[-1].value);
996
polygon->points = g_list_append(polygon->points,
1001
#line 131 "imap_cern.y"
1006
#line 136 "imap_cern.y"
1008
MapInfo_t *info = get_map_info();
1009
g_strreplace(&info->author, yyvsp[0].id);
1014
#line 144 "imap_cern.y"
1016
MapInfo_t *info = get_map_info();
1019
description = g_strconcat(info->description, yyvsp[0].id, "\n",
1021
g_strreplace(&info->description, description);
1026
#line 705 "/usr/share/bison/bison.simple"
1038
short *yyssp1 = yyss - 1;
1039
YYFPRINTF (stderr, "state stack now");
1040
while (yyssp1 != yyssp)
1041
YYFPRINTF (stderr, " %d", *++yyssp1);
1042
YYFPRINTF (stderr, "\n");
1051
/* Now `shift' the result of the reduction. Determine what state
1052
that goes to, based on the state we popped back to and the rule
1053
number reduced by. */
1057
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1058
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1059
yystate = yytable[yystate];
1061
yystate = yydefgoto[yyn - YYNTBASE];
1066
/*------------------------------------.
1067
| yyerrlab -- here on detecting error |
1068
`------------------------------------*/
1070
/* If not already recovering from an error, report this error. */
1075
#ifdef YYERROR_VERBOSE
1076
yyn = yypact[yystate];
1078
if (yyn > YYFLAG && yyn < YYLAST)
1080
YYSIZE_T yysize = 0;
1085
/* Start YYX at -YYN if negative to avoid negative indexes in
1087
for (yyx = yyn < 0 ? -yyn : 0;
1088
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1089
if (yycheck[yyx + yyn] == yyx)
1090
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1091
yysize += yystrlen ("parse error, unexpected ") + 1;
1092
yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1093
yymsg = (char *) YYSTACK_ALLOC (yysize);
1096
char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1097
yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1102
for (yyx = yyn < 0 ? -yyn : 0;
1103
yyx < (int) (sizeof (yytname) / sizeof (char *));
1105
if (yycheck[yyx + yyn] == yyx)
1107
const char *yyq = ! yycount ? ", expecting " : " or ";
1108
yyp = yystpcpy (yyp, yyq);
1109
yyp = yystpcpy (yyp, yytname[yyx]);
1114
YYSTACK_FREE (yymsg);
1117
yyerror ("parse error; also virtual memory exhausted");
1120
#endif /* defined (YYERROR_VERBOSE) */
1121
yyerror ("parse error");
1126
/*--------------------------------------------------.
1127
| yyerrlab1 -- error raised explicitly by an action |
1128
`--------------------------------------------------*/
1130
if (yyerrstatus == 3)
1132
/* If just tried and failed to reuse lookahead token after an
1133
error, discard it. */
1135
/* return failure if at end of input */
1136
if (yychar == YYEOF)
1138
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1139
yychar, yytname[yychar1]));
1143
/* Else will try to reuse lookahead token after shifting the error
1146
yyerrstatus = 3; /* Each real token shifted decrements this */
1151
/*-------------------------------------------------------------------.
1152
| yyerrdefault -- current state does not do anything special for the |
1154
`-------------------------------------------------------------------*/
1157
/* This is wrong; only states that explicitly want error tokens
1158
should shift them. */
1160
/* If its default is to accept any token, ok. Otherwise pop it. */
1161
yyn = yydefact[yystate];
1167
/*---------------------------------------------------------------.
1168
| yyerrpop -- pop the current state because it cannot handle the |
1170
`---------------------------------------------------------------*/
1183
short *yyssp1 = yyss - 1;
1184
YYFPRINTF (stderr, "Error: state stack now");
1185
while (yyssp1 != yyssp)
1186
YYFPRINTF (stderr, " %d", *++yyssp1);
1187
YYFPRINTF (stderr, "\n");
1195
yyn = yypact[yystate];
1200
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1217
YYDPRINTF ((stderr, "Shifting error token, "));
1228
/*-------------------------------------.
1229
| yyacceptlab -- YYACCEPT comes here. |
1230
`-------------------------------------*/
1235
/*-----------------------------------.
1236
| yyabortlab -- YYABORT comes here. |
1237
`-----------------------------------*/
1242
/*---------------------------------------------.
1243
| yyoverflowab -- parser overflow comes here. |
1244
`---------------------------------------------*/
1246
yyerror ("parser stack overflow");
1253
YYSTACK_FREE (yyss);
1257
#line 155 "imap_cern.y"
1263
extern FILE *cern_in;
1264
cern_restart(cern_in);
1268
load_cern(const char* filename)
1271
extern FILE *cern_in;
1272
cern_in = fopen(filename, "r");
1274
status = !cern_parse();