home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / imagemap / imap_csim_parse.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-20  |  35.2 KB  |  1,255 lines

  1.  
  2. /*  A Bison parser, made from imap_csim.y
  3.     by GNU Bison version 1.28  */
  4.  
  5. #define YYBISON 1  /* Identify Bison output.  */
  6.  
  7. #define yyparse csim_parse
  8. #define yylex csim_lex
  9. #define yyerror csim_error
  10. #define yylval csim_lval
  11. #define yychar csim_char
  12. #define yydebug csim_debug
  13. #define yynerrs csim_nerrs
  14. #define    IMG    257
  15. #define    SRC    258
  16. #define    WIDTH    259
  17. #define    HEIGHT    260
  18. #define    BORDER    261
  19. #define    USEMAP    262
  20. #define    START_MAP    263
  21. #define    END_MAP    264
  22. #define    NAME    265
  23. #define    AREA    266
  24. #define    SHAPE    267
  25. #define    COORDS    268
  26. #define    ALT    269
  27. #define    HREF    270
  28. #define    NOHREF    271
  29. #define    TARGET    272
  30. #define    ONMOUSEOVER    273
  31. #define    ONMOUSEOUT    274
  32. #define    ONFOCUS    275
  33. #define    ONBLUR    276
  34. #define    AUTHOR    277
  35. #define    DESCRIPTION    278
  36. #define    BEGIN_COMMENT    279
  37. #define    END_COMMENT    280
  38. #define    FLOAT    281
  39. #define    STRING    282
  40.  
  41. #line 1 "imap_csim.y"
  42.  
  43. /*
  44.  * This is a plug-in for the GIMP.
  45.  *
  46.  * Generates clickable image maps.
  47.  *
  48.  * Copyright (C) 1998-1999 Maurits Rijk  lpeek.mrijk@consunet.nl
  49.  *
  50.  * This program is free software; you can redistribute it and/or modify
  51.  * it under the terms of the GNU General Public License as published by
  52.  * the Free Software Foundation; either version 2 of the License, or
  53.  * (at your option) any later version.
  54.  *
  55.  * This program is distributed in the hope that it will be useful,
  56.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  57.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  58.  * GNU General Public License for more details.
  59.  *
  60.  * You should have received a copy of the GNU General Public License
  61.  * along with this program; if not, write to the Free Software
  62.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  63.  *
  64.  */
  65.  
  66. #include <stdlib.h>
  67. #include <string.h>
  68.  
  69. #include "gtk/gtk.h"
  70.  
  71. #include "imap_circle.h"
  72. #include "imap_file.h"
  73. #include "imap_main.h"
  74. #include "imap_polygon.h"
  75. #include "imap_rectangle.h"
  76. #include "imap_string.h"
  77.  
  78. extern int csim_lex();
  79. extern int csim_restart();
  80. static void csim_error(char* s);
  81.  
  82. static enum {UNDEFINED, RECTANGLE, CIRCLE, POLYGON} current_type;
  83. static Object_t *current_object;
  84. static MapInfo_t *_map_info;
  85.  
  86.  
  87. #line 47 "imap_csim.y"
  88. typedef union {
  89.    int val;
  90.    double value;
  91.    char id[256];
  92. } YYSTYPE;
  93. #include <stdio.h>
  94.  
  95. #ifndef __cplusplus
  96. #ifndef __STDC__
  97. #define const
  98. #endif
  99. #endif
  100.  
  101.  
  102.  
  103. #define    YYFINAL        98
  104. #define    YYFLAG        -32768
  105. #define    YYNTBASE    32
  106.  
  107. #define YYTRANSLATE(x) ((unsigned)(x) <= 282 ? yytranslate[x] : 59)
  108.  
  109. static const char yytranslate[] = {     0,
  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,    29,
  116.     30,    31,     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,     2,     2,     2,     2,
  120.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  121.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  122.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  123.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  124.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  125.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  126.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  127.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  128.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  129.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  130.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  131.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  132.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  134.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  135.      2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
  136.      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
  137.     17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
  138.     27,    28
  139. };
  140.  
  141. #if YYDEBUG != 0
  142. static const short yyprhs[] = {     0,
  143.      0,     6,    14,    15,    18,    20,    22,    26,    30,    34,
  144.     38,    42,    49,    50,    53,    55,    57,    59,    63,    67,
  145.     71,    72,    75,    80,    81,    84,    86,    88,    90,    92,
  146.     94,    96,    98,   100,   102,   104,   108,   112,   116,   118,
  147.    122,   126,   130,   134,   138,   142
  148. };
  149.  
  150. static const short yyrhs[] = {    33,
  151.     38,    39,    44,    58,     0,    29,     3,     4,    30,    28,
  152.     34,    31,     0,     0,    34,    35,     0,    36,     0,    37,
  153.      0,     7,    30,    27,     0,     8,    30,    28,     0,    15,
  154.     30,    28,     0,     5,    30,    27,     0,     6,    30,    27,
  155.      0,    29,     9,    11,    30,    28,    31,     0,     0,    39,
  156.     40,     0,    42,     0,    43,     0,    41,     0,    25,    28,
  157.     26,     0,    23,    28,    26,     0,    24,    28,    26,     0,
  158.      0,    44,    45,     0,    29,    12,    46,    31,     0,     0,
  159.     46,    47,     0,    48,     0,    49,     0,    50,     0,    51,
  160.      0,    52,     0,    53,     0,    54,     0,    55,     0,    56,
  161.      0,    57,     0,    13,    30,    28,     0,    14,    30,    28,
  162.      0,    16,    30,    28,     0,    17,     0,    15,    30,    28,
  163.      0,    18,    30,    28,     0,    19,    30,    28,     0,    20,
  164.     30,    28,     0,    21,    30,    28,     0,    22,    30,    28,
  165.      0,    29,    10,    31,     0
  166. };
  167.  
  168. #endif
  169.  
  170. #if YYDEBUG != 0
  171. static const short yyrline[] = { 0,
  172.     62,    65,    71,    72,    75,    76,    77,    78,    79,    82,
  173.     88,    94,   100,   101,   104,   105,   106,   109,   114,   121,
  174.    131,   132,   135,   142,   143,   146,   147,   148,   149,   150,
  175.    151,   152,   153,   154,   155,   158,   175,   233,   243,   248,
  176.    254,   260,   266,   272,   278,   284
  177. };
  178. #endif
  179.  
  180.  
  181. #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
  182.  
  183. static const char * const yytname[] = {   "$","error","$undefined.","IMG","SRC",
  184. "WIDTH","HEIGHT","BORDER","USEMAP","START_MAP","END_MAP","NAME","AREA","SHAPE",
  185. "COORDS","ALT","HREF","NOHREF","TARGET","ONMOUSEOVER","ONMOUSEOUT","ONFOCUS",
  186. "ONBLUR","AUTHOR","DESCRIPTION","BEGIN_COMMENT","END_COMMENT","FLOAT","STRING",
  187. "'<'","'='","'>'","csim_file","image","image_tags","image_tag","image_width",
  188. "image_height","start_map","comment_lines","comment_line","real_comment","author_line",
  189. "description_line","area_list","area","tag_list","tag","shape_tag","coords_tag",
  190. "href_tag","nohref_tag","alt_tag","target_tag","onmouseover_tag","onmouseout_tag",
  191. "onfocus_tag","onblur_tag","end_map", NULL
  192. };
  193. #endif
  194.  
  195. static const short yyr1[] = {     0,
  196.     32,    33,    34,    34,    35,    35,    35,    35,    35,    36,
  197.     37,    38,    39,    39,    40,    40,    40,    41,    42,    43,
  198.     44,    44,    45,    46,    46,    47,    47,    47,    47,    47,
  199.     47,    47,    47,    47,    47,    48,    49,    50,    51,    52,
  200.     53,    54,    55,    56,    57,    58
  201. };
  202.  
  203. static const short yyr2[] = {     0,
  204.      5,     7,     0,     2,     1,     1,     3,     3,     3,     3,
  205.      3,     6,     0,     2,     1,     1,     1,     3,     3,     3,
  206.      0,     2,     4,     0,     2,     1,     1,     1,     1,     1,
  207.      1,     1,     1,     1,     1,     3,     3,     3,     1,     3,
  208.      3,     3,     3,     3,     3,     3
  209. };
  210.  
  211. static const short yydefact[] = {     0,
  212.      0,     0,     0,     0,    13,     0,     0,    21,     0,     0,
  213.      0,     0,     0,    14,    17,    15,    16,     0,     3,     0,
  214.      0,     0,     0,     0,    22,     1,     0,     0,    19,    20,
  215.     18,     0,    24,     0,     0,     0,     0,     0,     2,     4,
  216.      5,     6,    12,    46,     0,     0,     0,     0,     0,     0,
  217.      0,     0,     0,     0,    39,     0,     0,     0,     0,     0,
  218.     23,    25,    26,    27,    28,    29,    30,    31,    32,    33,
  219.     34,    35,    10,    11,     7,     8,     9,     0,     0,     0,
  220.      0,     0,     0,     0,     0,     0,    36,    37,    40,    38,
  221.     41,    42,    43,    44,    45,     0,     0,     0
  222. };
  223.  
  224. static const short yydefgoto[] = {    96,
  225.      2,    27,    40,    41,    42,     5,     8,    14,    15,    16,
  226.     17,    18,    25,    45,    62,    63,    64,    65,    66,    67,
  227.     68,    69,    70,    71,    72,    26
  228. };
  229.  
  230. static const short yypact[] = {   -21,
  231.     18,    -7,    19,    15,-32768,     0,    14,   -19,    -1,     1,
  232.      4,     5,     6,-32768,-32768,-32768,-32768,     7,-32768,     9,
  233.      2,    12,    13,    -3,-32768,-32768,    -5,    10,-32768,-32768,
  234. -32768,    11,-32768,    16,    17,    20,    21,    22,-32768,-32768,
  235. -32768,-32768,-32768,-32768,    -2,     8,    26,    27,    28,    29,
  236.     25,    30,    31,    32,-32768,    33,    34,    35,    36,    37,
  237. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  238. -32768,-32768,-32768,-32768,-32768,-32768,-32768,    40,    41,    42,
  239.     43,    44,    45,    46,    47,    48,-32768,-32768,-32768,-32768,
  240. -32768,-32768,-32768,-32768,-32768,    49,    58,-32768
  241. };
  242.  
  243. static const short yypgoto[] = {-32768,
  244. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  245. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  246. -32768,-32768,-32768,-32768,-32768,-32768
  247. };
  248.  
  249.  
  250. #define    YYLAST        76
  251.  
  252.  
  253. static const short yytable[] = {    34,
  254.     35,    36,    37,    11,    12,    13,    32,     1,    33,    38,
  255.     51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
  256.      3,     4,     6,     7,    10,    39,    19,    29,    61,     9,
  257.     20,    21,    22,    23,    73,    24,    28,    30,    31,     0,
  258.     43,    44,     0,     0,     0,    46,    47,     0,    97,    48,
  259.     49,    50,    74,    75,    78,    76,    77,    98,     0,    79,
  260.     80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
  261.     90,    91,    92,    93,    94,    95
  262. };
  263.  
  264. static const short yycheck[] = {     5,
  265.      6,     7,     8,    23,    24,    25,    10,    29,    12,    15,
  266.     13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
  267.      3,    29,     4,     9,    11,    31,    28,    26,    31,    30,
  268.     30,    28,    28,    28,    27,    29,    28,    26,    26,    -1,
  269.     31,    31,    -1,    -1,    -1,    30,    30,    -1,     0,    30,
  270.     30,    30,    27,    27,    30,    28,    28,     0,    -1,    30,
  271.     30,    30,    30,    30,    30,    30,    30,    28,    28,    28,
  272.     28,    28,    28,    28,    28,    28
  273. };
  274. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  275. #line 3 "/usr/share/misc/bison.simple"
  276. /* This file comes from bison-1.28.  */
  277.  
  278. /* Skeleton output parser for bison,
  279.    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
  280.  
  281.    This program is free software; you can redistribute it and/or modify
  282.    it under the terms of the GNU General Public License as published by
  283.    the Free Software Foundation; either version 2, or (at your option)
  284.    any later version.
  285.  
  286.    This program is distributed in the hope that it will be useful,
  287.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  288.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  289.    GNU General Public License for more details.
  290.  
  291.    You should have received a copy of the GNU General Public License
  292.    along with this program; if not, write to the Free Software
  293.    Foundation, Inc., 59 Temple Place - Suite 330,
  294.    Boston, MA 02111-1307, USA.  */
  295.  
  296. /* As a special exception, when this file is copied by Bison into a
  297.    Bison output file, you may use that output file without restriction.
  298.    This special exception was added by the Free Software Foundation
  299.    in version 1.24 of Bison.  */
  300.  
  301. /* This is the parser code that is written into each bison parser
  302.   when the %semantic_parser declaration is not specified in the grammar.
  303.   It was written by Richard Stallman by simplifying the hairy parser
  304.   used when %semantic_parser is specified.  */
  305.  
  306. #ifndef YYSTACK_USE_ALLOCA
  307. #ifdef alloca
  308. #define YYSTACK_USE_ALLOCA
  309. #else /* alloca not defined */
  310. #ifdef __GNUC__
  311. #define YYSTACK_USE_ALLOCA
  312. #define alloca __builtin_alloca
  313. #else /* not GNU C.  */
  314. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
  315. #define YYSTACK_USE_ALLOCA
  316. #include <alloca.h>
  317. #else /* not sparc */
  318. /* We think this test detects Watcom and Microsoft C.  */
  319. /* This used to test MSDOS, but that is a bad idea
  320.    since that symbol is in the user namespace.  */
  321. #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
  322. #if 0 /* No need for malloc.h, which pollutes the namespace;
  323.      instead, just don't use alloca.  */
  324. #include <malloc.h>
  325. #endif
  326. #else /* not MSDOS, or __TURBOC__ */
  327. #if defined(_AIX)
  328. /* I don't know what this was needed for, but it pollutes the namespace.
  329.    So I turned it off.   rms, 2 May 1997.  */
  330. /* #include <malloc.h>  */
  331.  #pragma alloca
  332. #define YYSTACK_USE_ALLOCA
  333. #else /* not MSDOS, or __TURBOC__, or _AIX */
  334. #if 0
  335. #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
  336.          and on HPUX 10.  Eventually we can turn this on.  */
  337. #define YYSTACK_USE_ALLOCA
  338. #define alloca __builtin_alloca
  339. #endif /* __hpux */
  340. #endif
  341. #endif /* not _AIX */
  342. #endif /* not MSDOS, or __TURBOC__ */
  343. #endif /* not sparc */
  344. #endif /* not GNU C */
  345. #endif /* alloca not defined */
  346. #endif /* YYSTACK_USE_ALLOCA not defined */
  347.  
  348. #ifdef YYSTACK_USE_ALLOCA
  349. #define YYSTACK_ALLOC alloca
  350. #else
  351. #define YYSTACK_ALLOC malloc
  352. #endif
  353.  
  354. /* Note: there must be only one dollar sign in this file.
  355.    It is replaced by the list of actions, each action
  356.    as one case of the switch.  */
  357.  
  358. #define yyerrok        (yyerrstatus = 0)
  359. #define yyclearin    (yychar = YYEMPTY)
  360. #define YYEMPTY        -2
  361. #define YYEOF        0
  362. #define YYACCEPT    goto yyacceptlab
  363. #define YYABORT     goto yyabortlab
  364. #define YYERROR        goto yyerrlab1
  365. /* Like YYERROR except do call yyerror.
  366.    This remains here temporarily to ease the
  367.    transition to the new meaning of YYERROR, for GCC.
  368.    Once GCC version 2 has supplanted version 1, this can go.  */
  369. #define YYFAIL        goto yyerrlab
  370. #define YYRECOVERING()  (!!yyerrstatus)
  371. #define YYBACKUP(token, value) \
  372. do                                \
  373.   if (yychar == YYEMPTY && yylen == 1)                \
  374.     { yychar = (token), yylval = (value);            \
  375.       yychar1 = YYTRANSLATE (yychar);                \
  376.       YYPOPSTACK;                        \
  377.       goto yybackup;                        \
  378.     }                                \
  379.   else                                \
  380.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  381. while (0)
  382.  
  383. #define YYTERROR    1
  384. #define YYERRCODE    256
  385.  
  386. #ifndef YYPURE
  387. #define YYLEX        yylex()
  388. #endif
  389.  
  390. #ifdef YYPURE
  391. #ifdef YYLSP_NEEDED
  392. #ifdef YYLEX_PARAM
  393. #define YYLEX        yylex(&yylval, &yylloc, YYLEX_PARAM)
  394. #else
  395. #define YYLEX        yylex(&yylval, &yylloc)
  396. #endif
  397. #else /* not YYLSP_NEEDED */
  398. #ifdef YYLEX_PARAM
  399. #define YYLEX        yylex(&yylval, YYLEX_PARAM)
  400. #else
  401. #define YYLEX        yylex(&yylval)
  402. #endif
  403. #endif /* not YYLSP_NEEDED */
  404. #endif
  405.  
  406. /* If nonreentrant, generate the variables here */
  407.  
  408. #ifndef YYPURE
  409.  
  410. int    yychar;            /*  the lookahead symbol        */
  411. YYSTYPE    yylval;            /*  the semantic value of the        */
  412.                 /*  lookahead symbol            */
  413.  
  414. #ifdef YYLSP_NEEDED
  415. YYLTYPE yylloc;            /*  location data for the lookahead    */
  416.                 /*  symbol                */
  417. #endif
  418.  
  419. int yynerrs;            /*  number of parse errors so far       */
  420. #endif  /* not YYPURE */
  421.  
  422. #if YYDEBUG != 0
  423. int yydebug;            /*  nonzero means print parse trace    */
  424. /* Since this is uninitialized, it does not stop multiple parsers
  425.    from coexisting.  */
  426. #endif
  427.  
  428. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  429.  
  430. #ifndef    YYINITDEPTH
  431. #define YYINITDEPTH 200
  432. #endif
  433.  
  434. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  435.     (effective only if the built-in stack extension method is used).  */
  436.  
  437. #if YYMAXDEPTH == 0
  438. #undef YYMAXDEPTH
  439. #endif
  440.  
  441. #ifndef YYMAXDEPTH
  442. #define YYMAXDEPTH 10000
  443. #endif
  444.  
  445. /* Define __yy_memcpy.  Note that the size argument
  446.    should be passed with type unsigned int, because that is what the non-GCC
  447.    definitions require.  With GCC, __builtin_memcpy takes an arg
  448.    of type size_t, but it can handle unsigned int.  */
  449.  
  450. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  451. #define __yy_memcpy(TO,FROM,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  452. #else                /* not GNU C or C++ */
  453. #ifndef __cplusplus
  454.  
  455. /* This is the most reliable way to avoid incompatibilities
  456.    in available built-in functions on various systems.  */
  457. static void
  458. __yy_memcpy (to, from, count)
  459.      char *to;
  460.      char *from;
  461.      unsigned int count;
  462. {
  463.   register char *f = from;
  464.   register char *t = to;
  465.   register int i = count;
  466.  
  467.   while (i-- > 0)
  468.     *t++ = *f++;
  469. }
  470.  
  471. #else /* __cplusplus */
  472.  
  473. /* This is the most reliable way to avoid incompatibilities
  474.    in available built-in functions on various systems.  */
  475. static void
  476. __yy_memcpy (char *to, char *from, unsigned int count)
  477. {
  478.   register char *t = to;
  479.   register char *f = from;
  480.   register int i = count;
  481.  
  482.   while (i-- > 0)
  483.     *t++ = *f++;
  484. }
  485.  
  486. #endif
  487. #endif
  488.  
  489. #line 217 "/usr/share/misc/bison.simple"
  490.  
  491. /* The user can define YYPARSE_PARAM as the name of an argument to be passed
  492.    into yyparse.  The argument should have type void *.
  493.    It should actually point to an object.
  494.    Grammar actions can access the variable by casting it
  495.    to the proper pointer type.  */
  496.  
  497. #ifdef YYPARSE_PARAM
  498. #ifdef __cplusplus
  499. #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
  500. #define YYPARSE_PARAM_DECL
  501. #else /* not __cplusplus */
  502. #define YYPARSE_PARAM_ARG YYPARSE_PARAM
  503. #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
  504. #endif /* not __cplusplus */
  505. #else /* not YYPARSE_PARAM */
  506. #define YYPARSE_PARAM_ARG
  507. #define YYPARSE_PARAM_DECL
  508. #endif /* not YYPARSE_PARAM */
  509.  
  510. /* Prevent warning if -Wstrict-prototypes.  */
  511. #ifdef __GNUC__
  512. #ifdef YYPARSE_PARAM
  513. int yyparse (void *);
  514. #else
  515. int yyparse (void);
  516. #endif
  517. #endif
  518.  
  519. int
  520. yyparse(YYPARSE_PARAM_ARG)
  521.      YYPARSE_PARAM_DECL
  522. {
  523.   register int yystate;
  524.   register int yyn;
  525.   register short *yyssp;
  526.   register YYSTYPE *yyvsp;
  527.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  528.   int yychar1 = 0;        /*  lookahead token as an internal (translated) token number */
  529.  
  530.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  531.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  532.  
  533.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  534.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  535.  
  536. #ifdef YYLSP_NEEDED
  537.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  538.   YYLTYPE *yyls = yylsa;
  539.   YYLTYPE *yylsp;
  540.  
  541. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  542. #else
  543. #define YYPOPSTACK   (yyvsp--, yyssp--)
  544. #endif
  545.  
  546.   int yystacksize = YYINITDEPTH;
  547.   int yyfree_stacks = 0;
  548.  
  549. #ifdef YYPURE
  550.   int yychar;
  551.   YYSTYPE yylval;
  552.   int yynerrs;
  553. #ifdef YYLSP_NEEDED
  554.   YYLTYPE yylloc;
  555. #endif
  556. #endif
  557.  
  558.   YYSTYPE yyval;        /*  the variable used to return        */
  559.                 /*  semantic values from the action    */
  560.                 /*  routines                */
  561.  
  562.   int yylen;
  563.  
  564. #if YYDEBUG != 0
  565.   if (yydebug)
  566.     fprintf(stderr, "Starting parse\n");
  567. #endif
  568.  
  569.   yystate = 0;
  570.   yyerrstatus = 0;
  571.   yynerrs = 0;
  572.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  573.  
  574.   /* Initialize stack pointers.
  575.      Waste one element of value and location stack
  576.      so that they stay on the same level as the state stack.
  577.      The wasted elements are never initialized.  */
  578.  
  579.   yyssp = yyss - 1;
  580.   yyvsp = yyvs;
  581. #ifdef YYLSP_NEEDED
  582.   yylsp = yyls;
  583. #endif
  584.  
  585. /* Push a new state, which is found in  yystate  .  */
  586. /* In all cases, when you get here, the value and location stacks
  587.    have just been pushed. so pushing a state here evens the stacks.  */
  588. yynewstate:
  589.  
  590.   *++yyssp = yystate;
  591.  
  592.   if (yyssp >= yyss + yystacksize - 1)
  593.     {
  594.       /* Give user a chance to reallocate the stack */
  595.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  596.       YYSTYPE *yyvs1 = yyvs;
  597.       short *yyss1 = yyss;
  598. #ifdef YYLSP_NEEDED
  599.       YYLTYPE *yyls1 = yyls;
  600. #endif
  601.  
  602.       /* Get the current used size of the three stacks, in elements.  */
  603.       int size = yyssp - yyss + 1;
  604.  
  605. #ifdef yyoverflow
  606.       /* Each stack pointer address is followed by the size of
  607.      the data in use in that stack, in bytes.  */
  608. #ifdef YYLSP_NEEDED
  609.       /* This used to be a conditional around just the two extra args,
  610.      but that might be undefined if yyoverflow is a macro.  */
  611.       yyoverflow("parser stack overflow",
  612.          &yyss1, size * sizeof (*yyssp),
  613.          &yyvs1, size * sizeof (*yyvsp),
  614.          &yyls1, size * sizeof (*yylsp),
  615.          &yystacksize);
  616. #else
  617.       yyoverflow("parser stack overflow",
  618.          &yyss1, size * sizeof (*yyssp),
  619.          &yyvs1, size * sizeof (*yyvsp),
  620.          &yystacksize);
  621. #endif
  622.  
  623.       yyss = yyss1; yyvs = yyvs1;
  624. #ifdef YYLSP_NEEDED
  625.       yyls = yyls1;
  626. #endif
  627. #else /* no yyoverflow */
  628.       /* Extend the stack our own way.  */
  629.       if (yystacksize >= YYMAXDEPTH)
  630.     {
  631.       yyerror("parser stack overflow");
  632.       if (yyfree_stacks)
  633.         {
  634.           free (yyss);
  635.           free (yyvs);
  636. #ifdef YYLSP_NEEDED
  637.           free (yyls);
  638. #endif
  639.         }
  640.       return 2;
  641.     }
  642.       yystacksize *= 2;
  643.       if (yystacksize > YYMAXDEPTH)
  644.     yystacksize = YYMAXDEPTH;
  645. #ifndef YYSTACK_USE_ALLOCA
  646.       yyfree_stacks = 1;
  647. #endif
  648.       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
  649.       __yy_memcpy ((char *)yyss, (char *)yyss1,
  650.            size * (unsigned int) sizeof (*yyssp));
  651.       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
  652.       __yy_memcpy ((char *)yyvs, (char *)yyvs1,
  653.            size * (unsigned int) sizeof (*yyvsp));
  654. #ifdef YYLSP_NEEDED
  655.       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
  656.       __yy_memcpy ((char *)yyls, (char *)yyls1,
  657.            size * (unsigned int) sizeof (*yylsp));
  658. #endif
  659. #endif /* no yyoverflow */
  660.  
  661.       yyssp = yyss + size - 1;
  662.       yyvsp = yyvs + size - 1;
  663. #ifdef YYLSP_NEEDED
  664.       yylsp = yyls + size - 1;
  665. #endif
  666.  
  667. #if YYDEBUG != 0
  668.       if (yydebug)
  669.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  670. #endif
  671.  
  672.       if (yyssp >= yyss + yystacksize - 1)
  673.     YYABORT;
  674.     }
  675.  
  676. #if YYDEBUG != 0
  677.   if (yydebug)
  678.     fprintf(stderr, "Entering state %d\n", yystate);
  679. #endif
  680.  
  681.   goto yybackup;
  682.  yybackup:
  683.  
  684. /* Do appropriate processing given the current state.  */
  685. /* Read a lookahead token if we need one and don't already have one.  */
  686. /* yyresume: */
  687.  
  688.   /* First try to decide what to do without reference to lookahead token.  */
  689.  
  690.   yyn = yypact[yystate];
  691.   if (yyn == YYFLAG)
  692.     goto yydefault;
  693.  
  694.   /* Not known => get a lookahead token if don't already have one.  */
  695.  
  696.   /* yychar is either YYEMPTY or YYEOF
  697.      or a valid token in external form.  */
  698.  
  699.   if (yychar == YYEMPTY)
  700.     {
  701. #if YYDEBUG != 0
  702.       if (yydebug)
  703.     fprintf(stderr, "Reading a token: ");
  704. #endif
  705.       yychar = YYLEX;
  706.     }
  707.  
  708.   /* Convert token to internal form (in yychar1) for indexing tables with */
  709.  
  710.   if (yychar <= 0)        /* This means end of input. */
  711.     {
  712.       yychar1 = 0;
  713.       yychar = YYEOF;        /* Don't call YYLEX any more */
  714.  
  715. #if YYDEBUG != 0
  716.       if (yydebug)
  717.     fprintf(stderr, "Now at end of input.\n");
  718. #endif
  719.     }
  720.   else
  721.     {
  722.       yychar1 = YYTRANSLATE(yychar);
  723.  
  724. #if YYDEBUG != 0
  725.       if (yydebug)
  726.     {
  727.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  728.       /* Give the individual parser a way to print the precise meaning
  729.          of a token, for further debugging info.  */
  730. #ifdef YYPRINT
  731.       YYPRINT (stderr, yychar, yylval);
  732. #endif
  733.       fprintf (stderr, ")\n");
  734.     }
  735. #endif
  736.     }
  737.  
  738.   yyn += yychar1;
  739.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  740.     goto yydefault;
  741.  
  742.   yyn = yytable[yyn];
  743.  
  744.   /* yyn is what to do for this token type in this state.
  745.      Negative => reduce, -yyn is rule number.
  746.      Positive => shift, yyn is new state.
  747.        New state is final state => don't bother to shift,
  748.        just return success.
  749.      0, or most negative number => error.  */
  750.  
  751.   if (yyn < 0)
  752.     {
  753.       if (yyn == YYFLAG)
  754.     goto yyerrlab;
  755.       yyn = -yyn;
  756.       goto yyreduce;
  757.     }
  758.   else if (yyn == 0)
  759.     goto yyerrlab;
  760.  
  761.   if (yyn == YYFINAL)
  762.     YYACCEPT;
  763.  
  764.   /* Shift the lookahead token.  */
  765.  
  766. #if YYDEBUG != 0
  767.   if (yydebug)
  768.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  769. #endif
  770.  
  771.   /* Discard the token being shifted unless it is eof.  */
  772.   if (yychar != YYEOF)
  773.     yychar = YYEMPTY;
  774.  
  775.   *++yyvsp = yylval;
  776. #ifdef YYLSP_NEEDED
  777.   *++yylsp = yylloc;
  778. #endif
  779.  
  780.   /* count tokens shifted since error; after three, turn off error status.  */
  781.   if (yyerrstatus) yyerrstatus--;
  782.  
  783.   yystate = yyn;
  784.   goto yynewstate;
  785.  
  786. /* Do the default action for the current state.  */
  787. yydefault:
  788.  
  789.   yyn = yydefact[yystate];
  790.   if (yyn == 0)
  791.     goto yyerrlab;
  792.  
  793. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  794. yyreduce:
  795.   yylen = yyr2[yyn];
  796.   if (yylen > 0)
  797.     yyval = yyvsp[1-yylen]; /* implement default value of the action */
  798.  
  799. #if YYDEBUG != 0
  800.   if (yydebug)
  801.     {
  802.       int i;
  803.  
  804.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  805.            yyn, yyrline[yyn]);
  806.  
  807.       /* Print the symbols being reduced, and their result.  */
  808.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  809.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  810.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  811.     }
  812. #endif
  813.  
  814.  
  815.   switch (yyn) {
  816.  
  817. case 2:
  818. #line 66 "imap_csim.y"
  819. {
  820.            g_strreplace(&_map_info->image_name, yyvsp[-2].id);
  821.         ;
  822.     break;}
  823. case 7:
  824. #line 77 "imap_csim.y"
  825. {;
  826.     break;}
  827. case 8:
  828. #line 78 "imap_csim.y"
  829. {;
  830.     break;}
  831. case 9:
  832. #line 79 "imap_csim.y"
  833. {;
  834.     break;}
  835. case 10:
  836. #line 83 "imap_csim.y"
  837. {
  838.            _map_info->old_image_width = (gint) yyvsp[0].value;
  839.         ;
  840.     break;}
  841. case 11:
  842. #line 89 "imap_csim.y"
  843. {
  844.            _map_info->old_image_height = (gint) yyvsp[0].value;
  845.         ;
  846.     break;}
  847. case 12:
  848. #line 95 "imap_csim.y"
  849. {
  850.            g_strreplace(&_map_info->title, yyvsp[-1].id);
  851.         ;
  852.     break;}
  853. case 18:
  854. #line 110 "imap_csim.y"
  855. {
  856.         ;
  857.     break;}
  858. case 19:
  859. #line 115 "imap_csim.y"
  860. {
  861.            g_strreplace(&_map_info->author, yyvsp[-1].id);
  862.  
  863.         ;
  864.     break;}
  865. case 20:
  866. #line 122 "imap_csim.y"
  867. {
  868.            gchar *description;
  869.  
  870.            description = g_strconcat(_map_info->description, yyvsp[-1].id, "\n", 
  871.                          NULL);
  872.            g_strreplace(&_map_info->description, description);
  873.         ;
  874.     break;}
  875. case 23:
  876. #line 136 "imap_csim.y"
  877. {
  878.            if (current_type != UNDEFINED)
  879.               add_shape(current_object);
  880.         ;
  881.     break;}
  882. case 36:
  883. #line 159 "imap_csim.y"
  884. {
  885.            if (!g_strcasecmp(yyvsp[0].id, "RECT")) {
  886.               current_object = create_rectangle(0, 0, 0, 0);
  887.               current_type = RECTANGLE;
  888.            } else if (!g_strcasecmp(yyvsp[0].id, "CIRCLE")) {
  889.               current_object = create_circle(0, 0, 0);
  890.               current_type = CIRCLE;
  891.            } else if (!g_strcasecmp(yyvsp[0].id, "POLY")) {
  892.               current_object = create_polygon(NULL);
  893.               current_type = POLYGON;
  894.            } else if (!g_strcasecmp(yyvsp[0].id, "DEFAULT")) {
  895.               current_type = UNDEFINED;
  896.            }
  897.         ;
  898.     break;}
  899. case 37:
  900. #line 176 "imap_csim.y"
  901. {
  902.            char *p;
  903.            if (current_type == RECTANGLE) {
  904.               Rectangle_t *rectangle;
  905.  
  906.               rectangle = ObjectToRectangle(current_object);
  907.               p = strtok(yyvsp[0].id, ",");
  908.               rectangle->x = atoi(p);
  909.               p = strtok(NULL, ",");
  910.               rectangle->y = atoi(p);
  911.               p = strtok(NULL, ",");
  912.               rectangle->width = atoi(p) - rectangle->x;
  913.               p = strtok(NULL, ",");
  914.               rectangle->height = atoi(p) - rectangle->y;
  915.            } else if (current_type == CIRCLE) {
  916.               Circle_t *circle;
  917.  
  918.               circle = ObjectToCircle(current_object);
  919.               p = strtok(yyvsp[0].id, ",");
  920.               circle->x = atoi(p);
  921.               p = strtok(NULL, ",");
  922.               circle->y = atoi(p);
  923.               p = strtok(NULL, ",");
  924.               circle->r = atoi(p);
  925.            } else if (current_type == POLYGON) {
  926.               Polygon_t *polygon = ObjectToPolygon(current_object);
  927.               GList *points;
  928.               GdkPoint *point, *first;
  929.               gint x, y;
  930.  
  931.               p = strtok(yyvsp[0].id, ",");
  932.               x = atoi(p);
  933.               p = strtok(NULL, ",");
  934.               y = atoi(p);
  935.               point = new_point(x, y);
  936.               points = g_list_append(NULL, (gpointer) point);
  937.  
  938.               while(1) {
  939.              p = strtok(NULL, ",");
  940.              if (!p)
  941.                 break;
  942.              x = atoi(p);
  943.              p = strtok(NULL, ",");
  944.              y = atoi(p);
  945.              point = new_point(x, y);
  946.              g_list_append(points, (gpointer) point);
  947.               }
  948.               /* Remove last point if duplicate */
  949.               first = (GdkPoint*) points->data;
  950.               polygon->points = points;
  951.               if (first->x == point->x && first->y == point->y)
  952.              polygon_remove_last_point(polygon);
  953.               polygon->points = points;
  954.            }
  955.         ;
  956.     break;}
  957. case 38:
  958. #line 234 "imap_csim.y"
  959. {
  960.            if (current_type == UNDEFINED) {
  961.               g_strreplace(&_map_info->default_url, yyvsp[0].id);
  962.            } else {
  963.               object_set_url(current_object, yyvsp[0].id);
  964.            }
  965.         ;
  966.     break;}
  967. case 39:
  968. #line 244 "imap_csim.y"
  969. {
  970.         ;
  971.     break;}
  972. case 40:
  973. #line 249 "imap_csim.y"
  974. {
  975.            object_set_comment(current_object, yyvsp[0].id);
  976.         ;
  977.     break;}
  978. case 41:
  979. #line 255 "imap_csim.y"
  980. {
  981.            object_set_target(current_object, yyvsp[0].id);
  982.         ;
  983.     break;}
  984. case 42:
  985. #line 261 "imap_csim.y"
  986. {
  987.            object_set_mouse_over(current_object, yyvsp[0].id);
  988.         ;
  989.     break;}
  990. case 43:
  991. #line 267 "imap_csim.y"
  992. {
  993.            object_set_mouse_out(current_object, yyvsp[0].id);
  994.         ;
  995.     break;}
  996. case 44:
  997. #line 273 "imap_csim.y"
  998. {
  999.            object_set_focus(current_object, yyvsp[0].id);
  1000.         ;
  1001.     break;}
  1002. case 45:
  1003. #line 279 "imap_csim.y"
  1004. {
  1005.            object_set_blur(current_object, yyvsp[0].id);
  1006.         ;
  1007.     break;}
  1008. }
  1009.    /* the action file gets copied in in place of this dollarsign */
  1010. #line 543 "/usr/share/misc/bison.simple"
  1011.  
  1012.   yyvsp -= yylen;
  1013.   yyssp -= yylen;
  1014. #ifdef YYLSP_NEEDED
  1015.   yylsp -= yylen;
  1016. #endif
  1017.  
  1018. #if YYDEBUG != 0
  1019.   if (yydebug)
  1020.     {
  1021.       short *ssp1 = yyss - 1;
  1022.       fprintf (stderr, "state stack now");
  1023.       while (ssp1 != yyssp)
  1024.     fprintf (stderr, " %d", *++ssp1);
  1025.       fprintf (stderr, "\n");
  1026.     }
  1027. #endif
  1028.  
  1029.   *++yyvsp = yyval;
  1030.  
  1031. #ifdef YYLSP_NEEDED
  1032.   yylsp++;
  1033.   if (yylen == 0)
  1034.     {
  1035.       yylsp->first_line = yylloc.first_line;
  1036.       yylsp->first_column = yylloc.first_column;
  1037.       yylsp->last_line = (yylsp-1)->last_line;
  1038.       yylsp->last_column = (yylsp-1)->last_column;
  1039.       yylsp->text = 0;
  1040.     }
  1041.   else
  1042.     {
  1043.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1044.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1045.     }
  1046. #endif
  1047.  
  1048.   /* Now "shift" the result of the reduction.
  1049.      Determine what state that goes to,
  1050.      based on the state we popped back to
  1051.      and the rule number reduced by.  */
  1052.  
  1053.   yyn = yyr1[yyn];
  1054.  
  1055.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1056.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1057.     yystate = yytable[yystate];
  1058.   else
  1059.     yystate = yydefgoto[yyn - YYNTBASE];
  1060.  
  1061.   goto yynewstate;
  1062.  
  1063. yyerrlab:   /* here on detecting error */
  1064.  
  1065.   if (! yyerrstatus)
  1066.     /* If not already recovering from an error, report this error.  */
  1067.     {
  1068.       ++yynerrs;
  1069.  
  1070. #ifdef YYERROR_VERBOSE
  1071.       yyn = yypact[yystate];
  1072.  
  1073.       if (yyn > YYFLAG && yyn < YYLAST)
  1074.     {
  1075.       int size = 0;
  1076.       char *msg;
  1077.       int x, count;
  1078.  
  1079.       count = 0;
  1080.       /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
  1081.       for (x = (yyn < 0 ? -yyn : 0);
  1082.            x < (sizeof(yytname) / sizeof(char *)); x++)
  1083.         if (yycheck[x + yyn] == x)
  1084.           size += strlen(yytname[x]) + 15, count++;
  1085.       msg = (char *) malloc(size + 15);
  1086.       if (msg != 0)
  1087.         {
  1088.           strcpy(msg, "parse error");
  1089.  
  1090.           if (count < 5)
  1091.         {
  1092.           count = 0;
  1093.           for (x = (yyn < 0 ? -yyn : 0);
  1094.                x < (sizeof(yytname) / sizeof(char *)); x++)
  1095.             if (yycheck[x + yyn] == x)
  1096.               {
  1097.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1098.             strcat(msg, yytname[x]);
  1099.             strcat(msg, "'");
  1100.             count++;
  1101.               }
  1102.         }
  1103.           yyerror(msg);
  1104.           free(msg);
  1105.         }
  1106.       else
  1107.         yyerror ("parse error; also virtual memory exceeded");
  1108.     }
  1109.       else
  1110. #endif /* YYERROR_VERBOSE */
  1111.     yyerror("parse error");
  1112.     }
  1113.  
  1114.   goto yyerrlab1;
  1115. yyerrlab1:   /* here on error raised explicitly by an action */
  1116.  
  1117.   if (yyerrstatus == 3)
  1118.     {
  1119.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1120.  
  1121.       /* return failure if at end of input */
  1122.       if (yychar == YYEOF)
  1123.     YYABORT;
  1124.  
  1125. #if YYDEBUG != 0
  1126.       if (yydebug)
  1127.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1128. #endif
  1129.  
  1130.       yychar = YYEMPTY;
  1131.     }
  1132.  
  1133.   /* Else will try to reuse lookahead token
  1134.      after shifting the error token.  */
  1135.  
  1136.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1137.  
  1138.   goto yyerrhandle;
  1139.  
  1140. yyerrdefault:  /* current state does not do anything special for the error token. */
  1141.  
  1142. #if 0
  1143.   /* This is wrong; only states that explicitly want error tokens
  1144.      should shift them.  */
  1145.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1146.   if (yyn) goto yydefault;
  1147. #endif
  1148.  
  1149. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1150.  
  1151.   if (yyssp == yyss) YYABORT;
  1152.   yyvsp--;
  1153.   yystate = *--yyssp;
  1154. #ifdef YYLSP_NEEDED
  1155.   yylsp--;
  1156. #endif
  1157.  
  1158. #if YYDEBUG != 0
  1159.   if (yydebug)
  1160.     {
  1161.       short *ssp1 = yyss - 1;
  1162.       fprintf (stderr, "Error: state stack now");
  1163.       while (ssp1 != yyssp)
  1164.     fprintf (stderr, " %d", *++ssp1);
  1165.       fprintf (stderr, "\n");
  1166.     }
  1167. #endif
  1168.  
  1169. yyerrhandle:
  1170.  
  1171.   yyn = yypact[yystate];
  1172.   if (yyn == YYFLAG)
  1173.     goto yyerrdefault;
  1174.  
  1175.   yyn += YYTERROR;
  1176.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1177.     goto yyerrdefault;
  1178.  
  1179.   yyn = yytable[yyn];
  1180.   if (yyn < 0)
  1181.     {
  1182.       if (yyn == YYFLAG)
  1183.     goto yyerrpop;
  1184.       yyn = -yyn;
  1185.       goto yyreduce;
  1186.     }
  1187.   else if (yyn == 0)
  1188.     goto yyerrpop;
  1189.  
  1190.   if (yyn == YYFINAL)
  1191.     YYACCEPT;
  1192.  
  1193. #if YYDEBUG != 0
  1194.   if (yydebug)
  1195.     fprintf(stderr, "Shifting error token, ");
  1196. #endif
  1197.  
  1198.   *++yyvsp = yylval;
  1199. #ifdef YYLSP_NEEDED
  1200.   *++yylsp = yylloc;
  1201. #endif
  1202.  
  1203.   yystate = yyn;
  1204.   goto yynewstate;
  1205.  
  1206.  yyacceptlab:
  1207.   /* YYACCEPT comes here.  */
  1208.   if (yyfree_stacks)
  1209.     {
  1210.       free (yyss);
  1211.       free (yyvs);
  1212. #ifdef YYLSP_NEEDED
  1213.       free (yyls);
  1214. #endif
  1215.     }
  1216.   return 0;
  1217.  
  1218.  yyabortlab:
  1219.   /* YYABORT comes here.  */
  1220.   if (yyfree_stacks)
  1221.     {
  1222.       free (yyss);
  1223.       free (yyvs);
  1224. #ifdef YYLSP_NEEDED
  1225.       free (yyls);
  1226. #endif
  1227.     }
  1228.   return 1;
  1229. }
  1230. #line 287 "imap_csim.y"
  1231.  
  1232.  
  1233. static void 
  1234. csim_error(char* s)
  1235. {
  1236.    extern FILE *csim_in;
  1237.    csim_restart(csim_in);
  1238. }
  1239.  
  1240. gboolean
  1241. load_csim(const char* filename)
  1242. {
  1243.    gboolean status;
  1244.    extern FILE *csim_in;
  1245.    csim_in = fopen(filename, "r");
  1246.    if (csim_in) {
  1247.       _map_info = get_map_info();
  1248.       status = !csim_parse();
  1249.       fclose(csim_in);
  1250.    } else {
  1251.       status = FALSE;
  1252.    }
  1253.    return status;
  1254. }
  1255.