Commit 4c28829d authored by Maurits Rijk's avatar Maurits Rijk Committed by Maurits Rijk
Browse files

make buffer large enough to hold all polygon data.

2005-07-25  Maurits Rijk  <m.rijk@chello.nl>

	* plug-ins/imagemap/imap_csim.y: make buffer large enough to hold
	all polygon data.

	* plug-ins/imagemap/imap_csim_parse.[ch]: regenerated. Fixes #169698
parent c1c876a9
2005-07-25 Maurits Rijk <m.rijk@chello.nl>
* plug-ins/imagemap/imap_csim.y: make buffer large enough to hold
all polygon data.
* plug-ins/imagemap/imap_csim_parse.[ch]: regenerated. Fixes #169698
2005-07-25 Michael Natterer <mitch@gimp.org>
Some DND fixes / cleanup:
......
......@@ -4,7 +4,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-2003 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2005 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -47,9 +47,9 @@ static MapInfo_t *_map_info;
%}
%union {
int val;
double value;
char id[256];
int val;
double value;
char id[1024]; /* Large enough to hold all polygon points! */
}
%token<val> IMG SRC WIDTH HEIGHT BORDER USEMAP
......
/* A Bison parser, made from imap_csim.y
by GNU bison 1.35. */
/* A Bison parser, made by GNU Bison 2.0. */
#define YYBISON 1 /* Identify Bison output. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Written by Richard Stallman by simplifying the original so called
``semantic'' parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
/* Identify Bison output. */
#define YYBISON 1
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
#define YYPURE 0
/* Using locations. */
#define YYLSP_NEEDED 0
/* Substitute the variable and function names. */
#define yyparse csim_parse
#define yylex csim_lex
#define yylex csim_lex
#define yyerror csim_error
#define yylval csim_lval
#define yychar csim_char
#define yylval csim_lval
#define yychar csim_char
#define yydebug csim_debug
#define yynerrs csim_nerrs
# define IMG 257
# define SRC 258
# define WIDTH 259
# define HEIGHT 260
# define BORDER 261
# define USEMAP 262
# define START_MAP 263
# define END_MAP 264
# define NAME 265
# define AREA 266
# define SHAPE 267
# define COORDS 268
# define ALT 269
# define HREF 270
# define NOHREF 271
# define TARGET 272
# define ONMOUSEOVER 273
# define ONMOUSEOUT 274
# define ONFOCUS 275
# define ONBLUR 276
# define AUTHOR 277
# define DESCRIPTION 278
# define BEGIN_COMMENT 279
# define END_COMMENT 280
# define FLOAT 281
# define STRING 282
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
IMG = 258,
SRC = 259,
WIDTH = 260,
HEIGHT = 261,
BORDER = 262,
USEMAP = 263,
START_MAP = 264,
END_MAP = 265,
NAME = 266,
AREA = 267,
SHAPE = 268,
COORDS = 269,
ALT = 270,
HREF = 271,
NOHREF = 272,
TARGET = 273,
ONMOUSEOVER = 274,
ONMOUSEOUT = 275,
ONFOCUS = 276,
ONBLUR = 277,
AUTHOR = 278,
DESCRIPTION = 279,
BEGIN_COMMENT = 280,
END_COMMENT = 281,
FLOAT = 282,
STRING = 283
};
#endif
#define IMG 258
#define SRC 259
#define WIDTH 260
#define HEIGHT 261
#define BORDER 262
#define USEMAP 263
#define START_MAP 264
#define END_MAP 265
#define NAME 266
#define AREA 267
#define SHAPE 268
#define COORDS 269
#define ALT 270
#define HREF 271
#define NOHREF 272
#define TARGET 273
#define ONMOUSEOVER 274
#define ONMOUSEOUT 275
#define ONFOCUS 276
#define ONBLUR 277
#define AUTHOR 278
#define DESCRIPTION 279
#define BEGIN_COMMENT 280
#define END_COMMENT 281
#define FLOAT 282
#define STRING 283
/* Copy the first part of user declarations. */
#line 1 "imap_csim.y"
/*
......@@ -44,7 +127,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-2003 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2005 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -85,31 +168,162 @@ static Object_t *current_object;
static MapInfo_t *_map_info;
#line 47 "imap_csim.y"
#ifndef YYSTYPE
typedef union {
int val;
double value;
char id[256];
} yystype;
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
#endif
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 49 "imap_csim.y"
typedef union YYSTYPE {
int val;
double value;
char id[1024]; /* Large enough to hold all polygon points! */
} YYSTYPE;
/* Line 190 of yacc.c. */
#line 194 "y.tab.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
/* Copy the second part of user declarations. */
/* Line 213 of yacc.c. */
#line 206 "y.tab.c"
#if ! defined (yyoverflow) || YYERROR_VERBOSE
# ifndef YYFREE
# define YYFREE free
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# endif
/* The parser invokes alloca or malloc; define the necessary symbols. */
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# else
# define YYSTACK_ALLOC alloca
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
# if defined (__STDC__) || defined (__cplusplus)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
short int yyss;
YYSTYPE yyvs;
};
#define YYFINAL 106
#define YYFLAG -32768
#define YYNTBASE 33
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= 282 ? yytranslate[x] : 63)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const char yytranslate[] =
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined (__GNUC__) && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
register YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (0)
# endif
# endif
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#endif
#if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char;
#else
typedef short int yysigned_char;
#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 5
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 84
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 33
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 31
/* YYNRULES -- Number of rules. */
#define YYNRULES 53
/* YYNRULES -- Number of states. */
#define YYNSTATES 106
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 283
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const unsigned char yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
......@@ -136,314 +350,215 @@ static const char yytranslate[] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28
};
#if YYDEBUG
static const short yyprhs[] =
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const unsigned char yyprhs[] =
{
0, 0, 6, 14, 15, 18, 20, 22, 26, 30,
34, 38, 42, 44, 46, 53, 54, 57, 59, 61,
63, 67, 71, 75, 76, 79, 84, 86, 89, 90,
93, 95, 97, 99, 101, 103, 105, 107, 109, 111,
113, 117, 121, 125, 128, 129, 132, 136, 140, 144,
148, 152, 156
0, 0, 3, 9, 17, 18, 21, 23, 25, 29,
33, 37, 41, 45, 47, 49, 56, 57, 60, 62,
64, 66, 70, 74, 78, 79, 82, 87, 89, 92,
93, 96, 98, 100, 102, 104, 106, 108, 110, 112,
114, 116, 120, 124, 128, 131, 132, 135, 139, 143,
147, 151, 155, 159
};
static const short yyrhs[] =
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yysigned_char yyrhs[] =
{
34, 40, 41, 46, 62, 0, 29, 3, 4, 30,
28, 35, 48, 0, 0, 35, 36, 0, 37, 0,
38, 0, 7, 30, 39, 0, 8, 30, 28, 0,
15, 30, 28, 0, 5, 30, 39, 0, 6, 30,
39, 0, 27, 0, 28, 0, 29, 9, 11, 30,
28, 31, 0, 0, 41, 42, 0, 44, 0, 45,
0, 43, 0, 25, 28, 26, 0, 23, 28, 26,
0, 24, 28, 26, 0, 0, 46, 47, 0, 29,
12, 49, 48, 0, 31, 0, 32, 31, 0, 0,
49, 50, 0, 51, 0, 52, 0, 53, 0, 54,
0, 56, 0, 57, 0, 58, 0, 59, 0, 60,
0, 61, 0, 13, 30, 28, 0, 14, 30, 28,
0, 16, 30, 28, 0, 17, 55, 0, 0, 30,
28, 0, 15, 30, 28, 0, 18, 30, 28, 0,
19, 30, 28, 0, 20, 30, 28, 0, 21, 30,
28, 0, 22, 30, 28, 0, 29, 10, 31, 0
34, 0, -1, 35, 41, 42, 47, 63, -1, 29,
3, 4, 30, 28, 36, 49, -1, -1, 36, 37,
-1, 38, -1, 39, -1, 7, 30, 40, -1, 8,
30, 28, -1, 15, 30, 28, -1, 5, 30, 40,
-1, 6, 30, 40, -1, 27, -1, 28, -1, 29,
9, 11, 30, 28, 31, -1, -1, 42, 43, -1,
45, -1, 46, -1, 44, -1, 25, 28, 26, -1,
23, 28, 26, -1, 24, 28, 26, -1, -1, 47,
48, -1, 29, 12, 50, 49, -1, 31, -1, 32,
31, -1, -1, 50, 51, -1, 52, -1, 53, -1,
54, -1, 55, -1, 57, -1, 58, -1, 59, -1,
60, -1, 61, -1, 62, -1, 13, 30, 28, -1,
14, 30, 28, -1, 16, 30, 28, -1, 17, 56,
-1, -1, 30, 28, -1, 15, 30, 28, -1, 18,
30, 28, -1, 19, 30, 28, -1, 20, 30, 28,
-1, 21, 30, 28, -1, 22, 30, 28, -1, 29,
10, 31, -1
};
#endif
#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short int yyrline[] =
{
0, 64, 67, 73, 74, 77, 78, 79, 80, 81,
84, 90, 96, 100, 106, 112, 113, 116, 117, 118,
121, 126, 133, 143, 144, 147, 154, 155, 158, 159,
162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
174, 191, 249, 259, 264, 265, 270, 276, 282, 288,
294, 300, 306
0, 66, 66, 69, 75, 76, 79, 80, 81, 82,
83, 86, 92, 98, 102, 108, 114, 115, 118, 119,
120, 123, 128, 135, 145, 146, 149, 156, 157, 160,
161, 164, 165, 166, 167, 168, 169, 170, 171, 172,
173, 176, 193, 251, 261, 266, 267, 272, 278, 284,
290, 296, 302, 308
};
#endif
#if (YYDEBUG) || defined YYERROR_VERBOSE
/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$", "error", "$undefined.", "IMG", "SRC", "WIDTH", "HEIGHT", "BORDER",
"USEMAP", "START_MAP", "END_MAP", "NAME", "AREA", "SHAPE", "COORDS",
"ALT", "HREF", "NOHREF", "TARGET", "ONMOUSEOVER", "ONMOUSEOUT",
"ONFOCUS", "ONBLUR", "AUTHOR", "DESCRIPTION", "BEGIN_COMMENT",
"END_COMMENT", "FLOAT", "STRING", "'<'", "'='", "'>'", "'/'",
"csim_file", "image", "image_tags", "image_tag", "image_width",
"image_height", "integer_value", "start_map", "comment_lines",
"comment_line", "real_comment", "author_line", "description_line",
"area_list", "area", "xhtml_close", "tag_list", "tag", "shape_tag",
"coords_tag", "href_tag", "nohref_tag", "optional_value", "alt_tag",
"target_tag", "onmouseover_tag", "onmouseout_tag", "onfocus_tag",
"$end", "error", "$undefined", "IMG", "SRC", "WIDTH", "HEIGHT",
"BORDER", "USEMAP", "START_MAP", "END_MAP", "NAME", "AREA", "SHAPE",
"COORDS", "ALT", "HREF", "NOHREF", "TARGET", "ONMOUSEOVER", "ONMOUSEOUT",
"ONFOCUS", "ONBLUR", "AUTHOR", "DESCRIPTION", "BEGIN_COMMENT",
"END_COMMENT", "FLOAT", "STRING", "'<'", "'='", "'>'", "'/'", "$accept",
"csim_file", "image", "image_tags", "image_tag", "image_width",
"image_height", "integer_value", "start_map", "comment_lines",
"comment_line", "real_comment", "author_line", "description_line",
"area_list", "area", "xhtml_close", "tag_list", "tag", "shape_tag",
"coords_tag", "href_tag", "nohref_tag", "optional_value", "alt_tag",
"target_tag", "onmouseover_tag", "onmouseout_tag", "onfocus_tag",
"onblur_tag", "end_map", 0
};
#endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
static const unsigned short int yytoknum[] =
{
0, 33, 34, 35, 35, 36, 36, 36, 36, 36,
37, 38, 39, 39, 40, 41, 41, 42, 42, 42,
43, 44, 45, 46, 46, 47, 48, 48, 49, 49,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
51, 52, 53, 54, 55, 55, 56, 57, 58, 59,
60, 61, 62
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 60,
61, 62, 47
};
# endif
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const short yyr2[] =
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
0, 5, 7, 0, 2, 1, 1, 3, 3, 3,
3, 3, 1, 1, 6, 0, 2, 1, 1, 1,
3, 3, 3, 0, 2, 4, 1, 2, 0, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3, 3, 3, 2, 0, 2, 3, 3, 3, 3,
3, 3, 3
0, 33, 34, 35, 36, 36, 37, 37, 37, 37,
37, 38, 39, 40, 40, 41, 42, 42, 43, 43,
43, 44, 45, 46, 47, 47, 48, 49, 49, 50,
50, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 52, 53, 54, 55, 56, 56, 57, 58, 59,
60, 61, 62, 63
};
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
doesn't specify something else to do. Zero means the default is an
error. */
static const short yydefact[] =
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const unsigned char yyr2[] =
{
0, 0, 0, 0, 0, 15, 0, 0, 23, 0,
0, 0, 0, 0, 16, 19, 17, 18, 0, 3,
0, 0, 0, 0, 0, 24, 1, 0, 0, 21,
22, 20, 0, 28, 0, 0, 0, 0, 0, 26,
0, 4, 5, 6, 2, 14, 52, 0, 0, 0,
0, 0, 0, 27, 0, 0, 0, 0, 44, 0,
0, 0, 0, 0, 25, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 12, 13, 10, 11,
7, 8, 9, 0, 0, 0, 0, 0, 43, 0,
0, 0, 0, 0, 40, 41, 46, 42, 45, 47,
48, 49, 50, 51, 0, 0, 0
0, 2, 5, 7, 0, 2, 1, 1, 3, 3,
3, 3, 3, 1, 1, 6, 0, 2, 1, 1,
1, 3, 3, 3, 0, 2, 4, 1, 2, 0,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 3, 3, 3, 2, 0, 2, 3, 3, 3,
3, 3, 3, 3
};
static const short yydefgoto[] =
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const unsigned char yydefact[] =
{
104, 2, 27, 41, 42, 43, 78, 5, 8, 14,
15, 16, 17, 18, 25, 44, 47, 65, 66, 67,
68, 69, 88, 70, 71, 72, 73, 74, 75, 26
0, 0, 0, 0, 0, 1, 0, 16, 0, 0,
24, 0, 0, 0, 0, 0, 17, 20, 18, 19,
0, 4, 0, 0, 0, 0, 0, 25, 2, 0,
0, 22, 23, 21, 0, 29, 0, 0, 0, 0,
0, 27, 0, 5, 6, 7, 3, 15, 53, 0,
0, 0, 0, 0, 0, 28, 0, 0, 0, 0,
45, 0, 0, 0, 0, 0, 26, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 13, 14,
11, 12, 8, 9, 10, 0, 0, 0, 0, 0,
44, 0