Fix build
[claws.git] / src / plugins / vcalendar / libical / libical / icalyacc.c
1 /* A Bison parser, made by GNU Bison 3.0.2.  */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5    Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 /* As a special exception, you may create a larger work that contains
21    part or all of the Bison parser skeleton and distribute that work
22    under terms of your choice, so long as that work isn't itself a
23    parser generator using the skeleton or a modified version thereof
24    as a parser skeleton.  Alternatively, if you modify or redistribute
25    the parser skeleton itself, you may (at your option) remove this
26    special exception, which will cause the skeleton and the resulting
27    Bison output files to be licensed under the GNU General Public
28    License without this special exception.
29
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37    infringing on user name space.  This should be done even for local
38    variables, as they might otherwise be expanded by user macros.
39    There are some unavoidable exceptions within include files to
40    define necessary library symbols; they are noted "INFRINGES ON
41    USER NAME SPACE" below.  */
42
43 /* Identify Bison output.  */
44 #define YYBISON 1
45
46 /* Bison version.  */
47 #define YYBISON_VERSION "3.0.2"
48
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers.  */
53 #define YYPURE 0
54
55 /* Push parsers.  */
56 #define YYPUSH 0
57
58 /* Pull parsers.  */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names.  */
63 #define yyparse         ical_yyparse
64 #define yylex           ical_yylex
65 #define yyerror         ical_yyerror
66 #define yydebug         ical_yydebug
67 #define yynerrs         ical_yynerrs
68
69 #define yylval          ical_yylval
70 #define yychar          ical_yychar
71
72 /* Copy the first part of user declarations.  */
73 #line 1 "icalyacc.y" /* yacc.c:339  */
74
75 /* -*- Mode: C -*-
76   ======================================================================
77   FILE: icalitip.y
78   CREATOR: eric 10 June 1999
79   
80   DESCRIPTION:
81   
82   $Id$
83   $Locker$
84
85   (C) COPYRIGHT 1999 Eric Busboom 
86   http://www.softwarestudio.org
87
88   The contents of this file are subject to the Mozilla Public License
89   Version 1.0 (the "License"); you may not use this file except in
90   compliance with the License. You may obtain a copy of the License at
91   http://www.mozilla.org/MPL/
92  
93   Software distributed under the License is distributed on an "AS IS"
94   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
95   the License for the specific language governing rights and
96   limitations under the License.
97
98   The original author is Eric Busboom
99   The original code is icalitip.y
100
101
102
103   =======================================================================*/
104
105 #include <stdlib.h>
106 #include <string.h> /* for strdup() */
107 #include "icalparser.h"
108 #include "pvl.h"
109
110 icalvalue *icalparser_yy_value; /* Current Value */
111
112 void ical_yyerror(char* s);
113 void icalparser_clear_flex_input();  
114 int ical_yy_lex(void);
115
116 /* Globals for UTCOFFSET values */
117 int utc; 
118 int utc_b; 
119 int utcsign;
120
121 /* Globals for DURATION values */
122 struct icaldurationtype duration;
123
124 /* Globals for TRIGGER values */
125 struct icaltriggertype trigger;
126
127 void copy_list(short* array, size_t size);
128 void add_prop(icalproperty_kind);
129 void icalparser_fill_date(struct tm* t, char* dstr);
130 void icalparser_fill_time(struct tm* t, char* tstr);
131 void set_value_type(icalvalue_kind kind);
132 void set_parser_value_state();
133 struct icaltimetype fill_datetime(char* d, char* t);
134 void ical_yy_error(char *s); /* Don't know why I need this.... */
135 int yylex(void); /* Or this. */
136
137
138
139 /* Set the state of the lexer so it will interpret values ( iCAL
140    VALUEs, that is, ) correctly. */
141
142
143 #line 144 "icalyacc.c" /* yacc.c:339  */
144
145 # ifndef YY_NULLPTR
146 #  if defined __cplusplus && 201103L <= __cplusplus
147 #   define YY_NULLPTR nullptr
148 #  else
149 #   define YY_NULLPTR 0
150 #  endif
151 # endif
152
153 /* Enabling verbose error messages.  */
154 #ifdef YYERROR_VERBOSE
155 # undef YYERROR_VERBOSE
156 # define YYERROR_VERBOSE 1
157 #else
158 # define YYERROR_VERBOSE 0
159 #endif
160
161 /* In a future release of Bison, this section will be replaced
162    by #include "y.tab.h".  */
163 #ifndef YY_ICAL_YY_Y_TAB_H_INCLUDED
164 # define YY_ICAL_YY_Y_TAB_H_INCLUDED
165 /* Debug traces.  */
166 #ifndef YYDEBUG
167 # define YYDEBUG 1
168 #endif
169 #if YYDEBUG
170 extern int ical_yydebug;
171 #endif
172
173 /* Token type.  */
174 #ifndef YYTOKENTYPE
175 # define YYTOKENTYPE
176   enum yytokentype
177   {
178     DIGITS = 258,
179     INTNUMBER = 259,
180     FLOATNUMBER = 260,
181     STRING = 261,
182     EOL = 262,
183     EQUALS = 263,
184     CHARACTER = 264,
185     COLON = 265,
186     COMMA = 266,
187     SEMICOLON = 267,
188     MINUS = 268,
189     TIMESEPERATOR = 269,
190     TRUE = 270,
191     FALSE = 271,
192     FREQ = 272,
193     BYDAY = 273,
194     BYHOUR = 274,
195     BYMINUTE = 275,
196     BYMONTH = 276,
197     BYMONTHDAY = 277,
198     BYSECOND = 278,
199     BYSETPOS = 279,
200     BYWEEKNO = 280,
201     BYYEARDAY = 281,
202     DAILY = 282,
203     MINUTELY = 283,
204     MONTHLY = 284,
205     SECONDLY = 285,
206     WEEKLY = 286,
207     HOURLY = 287,
208     YEARLY = 288,
209     INTERVAL = 289,
210     COUNT = 290,
211     UNTIL = 291,
212     WKST = 292,
213     MO = 293,
214     SA = 294,
215     SU = 295,
216     TU = 296,
217     WE = 297,
218     TH = 298,
219     FR = 299,
220     BIT8 = 300,
221     ACCEPTED = 301,
222     ADD = 302,
223     AUDIO = 303,
224     BASE64 = 304,
225     BINARY = 305,
226     BOOLEAN = 306,
227     BUSY = 307,
228     BUSYTENTATIVE = 308,
229     BUSYUNAVAILABLE = 309,
230     CALADDRESS = 310,
231     CANCEL = 311,
232     CANCELLED = 312,
233     CHAIR = 313,
234     CHILD = 314,
235     COMPLETED = 315,
236     CONFIDENTIAL = 316,
237     CONFIRMED = 317,
238     COUNTER = 318,
239     DATE = 319,
240     DATETIME = 320,
241     DECLINECOUNTER = 321,
242     DECLINED = 322,
243     DELEGATED = 323,
244     DISPLAY = 324,
245     DRAFT = 325,
246     DURATION = 326,
247     EMAIL = 327,
248     END = 328,
249     FINAL = 329,
250     FLOAT = 330,
251     FREE = 331,
252     GREGORIAN = 332,
253     GROUP = 333,
254     INDIVIDUAL = 334,
255     INPROCESS = 335,
256     INTEGER = 336,
257     NEEDSACTION = 337,
258     NONPARTICIPANT = 338,
259     OPAQUE = 339,
260     OPTPARTICIPANT = 340,
261     PARENT = 341,
262     PERIOD = 342,
263     PRIVATE = 343,
264     PROCEDURE = 344,
265     PUBLIC = 345,
266     PUBLISH = 346,
267     RECUR = 347,
268     REFRESH = 348,
269     REPLY = 349,
270     REQPARTICIPANT = 350,
271     REQUEST = 351,
272     RESOURCE = 352,
273     ROOM = 353,
274     SIBLING = 354,
275     START = 355,
276     TENTATIVE = 356,
277     TEXT = 357,
278     THISANDFUTURE = 358,
279     THISANDPRIOR = 359,
280     TIME = 360,
281     TRANSPAENT = 361,
282     UNKNOWN = 362,
283     UTCOFFSET = 363,
284     XNAME = 364,
285     ALTREP = 365,
286     CN = 366,
287     CUTYPE = 367,
288     DAYLIGHT = 368,
289     DIR = 369,
290     ENCODING = 370,
291     EVENT = 371,
292     FBTYPE = 372,
293     FMTTYPE = 373,
294     LANGUAGE = 374,
295     MEMBER = 375,
296     PARTSTAT = 376,
297     RANGE = 377,
298     RELATED = 378,
299     RELTYPE = 379,
300     ROLE = 380,
301     RSVP = 381,
302     SENTBY = 382,
303     STANDARD = 383,
304     URI = 384,
305     CHARSET = 385,
306     TIME_CHAR = 386,
307     UTC_CHAR = 387
308   };
309 #endif
310 /* Tokens.  */
311 #define DIGITS 258
312 #define INTNUMBER 259
313 #define FLOATNUMBER 260
314 #define STRING 261
315 #define EOL 262
316 #define EQUALS 263
317 #define CHARACTER 264
318 #define COLON 265
319 #define COMMA 266
320 #define SEMICOLON 267
321 #define MINUS 268
322 #define TIMESEPERATOR 269
323 #define TRUE 270
324 #define FALSE 271
325 #define FREQ 272
326 #define BYDAY 273
327 #define BYHOUR 274
328 #define BYMINUTE 275
329 #define BYMONTH 276
330 #define BYMONTHDAY 277
331 #define BYSECOND 278
332 #define BYSETPOS 279
333 #define BYWEEKNO 280
334 #define BYYEARDAY 281
335 #define DAILY 282
336 #define MINUTELY 283
337 #define MONTHLY 284
338 #define SECONDLY 285
339 #define WEEKLY 286
340 #define HOURLY 287
341 #define YEARLY 288
342 #define INTERVAL 289
343 #define COUNT 290
344 #define UNTIL 291
345 #define WKST 292
346 #define MO 293
347 #define SA 294
348 #define SU 295
349 #define TU 296
350 #define WE 297
351 #define TH 298
352 #define FR 299
353 #define BIT8 300
354 #define ACCEPTED 301
355 #define ADD 302
356 #define AUDIO 303
357 #define BASE64 304
358 #define BINARY 305
359 #define BOOLEAN 306
360 #define BUSY 307
361 #define BUSYTENTATIVE 308
362 #define BUSYUNAVAILABLE 309
363 #define CALADDRESS 310
364 #define CANCEL 311
365 #define CANCELLED 312
366 #define CHAIR 313
367 #define CHILD 314
368 #define COMPLETED 315
369 #define CONFIDENTIAL 316
370 #define CONFIRMED 317
371 #define COUNTER 318
372 #define DATE 319
373 #define DATETIME 320
374 #define DECLINECOUNTER 321
375 #define DECLINED 322
376 #define DELEGATED 323
377 #define DISPLAY 324
378 #define DRAFT 325
379 #define DURATION 326
380 #define EMAIL 327
381 #define END 328
382 #define FINAL 329
383 #define FLOAT 330
384 #define FREE 331
385 #define GREGORIAN 332
386 #define GROUP 333
387 #define INDIVIDUAL 334
388 #define INPROCESS 335
389 #define INTEGER 336
390 #define NEEDSACTION 337
391 #define NONPARTICIPANT 338
392 #define OPAQUE 339
393 #define OPTPARTICIPANT 340
394 #define PARENT 341
395 #define PERIOD 342
396 #define PRIVATE 343
397 #define PROCEDURE 344
398 #define PUBLIC 345
399 #define PUBLISH 346
400 #define RECUR 347
401 #define REFRESH 348
402 #define REPLY 349
403 #define REQPARTICIPANT 350
404 #define REQUEST 351
405 #define RESOURCE 352
406 #define ROOM 353
407 #define SIBLING 354
408 #define START 355
409 #define TENTATIVE 356
410 #define TEXT 357
411 #define THISANDFUTURE 358
412 #define THISANDPRIOR 359
413 #define TIME 360
414 #define TRANSPAENT 361
415 #define UNKNOWN 362
416 #define UTCOFFSET 363
417 #define XNAME 364
418 #define ALTREP 365
419 #define CN 366
420 #define CUTYPE 367
421 #define DAYLIGHT 368
422 #define DIR 369
423 #define ENCODING 370
424 #define EVENT 371
425 #define FBTYPE 372
426 #define FMTTYPE 373
427 #define LANGUAGE 374
428 #define MEMBER 375
429 #define PARTSTAT 376
430 #define RANGE 377
431 #define RELATED 378
432 #define RELTYPE 379
433 #define ROLE 380
434 #define RSVP 381
435 #define SENTBY 382
436 #define STANDARD 383
437 #define URI 384
438 #define CHARSET 385
439 #define TIME_CHAR 386
440 #define UTC_CHAR 387
441
442 /* Value type.  */
443 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
444 typedef union YYSTYPE YYSTYPE;
445 union YYSTYPE
446 {
447 #line 71 "icalyacc.y" /* yacc.c:355  */
448
449         float v_float;
450         int   v_int;
451         char* v_string;
452
453 #line 454 "icalyacc.c" /* yacc.c:355  */
454 };
455 # define YYSTYPE_IS_TRIVIAL 1
456 # define YYSTYPE_IS_DECLARED 1
457 #endif
458
459
460 extern YYSTYPE ical_yylval;
461
462 int ical_yyparse (void);
463
464 #endif /* !YY_ICAL_YY_Y_TAB_H_INCLUDED  */
465
466 /* Copy the second part of user declarations.  */
467
468 #line 469 "icalyacc.c" /* yacc.c:358  */
469
470 #ifdef short
471 # undef short
472 #endif
473
474 #ifdef YYTYPE_UINT8
475 typedef YYTYPE_UINT8 yytype_uint8;
476 #else
477 typedef unsigned char yytype_uint8;
478 #endif
479
480 #ifdef YYTYPE_INT8
481 typedef YYTYPE_INT8 yytype_int8;
482 #else
483 typedef signed char yytype_int8;
484 #endif
485
486 #ifdef YYTYPE_UINT16
487 typedef YYTYPE_UINT16 yytype_uint16;
488 #else
489 typedef unsigned short int yytype_uint16;
490 #endif
491
492 #ifdef YYTYPE_INT16
493 typedef YYTYPE_INT16 yytype_int16;
494 #else
495 typedef short int yytype_int16;
496 #endif
497
498 #ifndef YYSIZE_T
499 # ifdef __SIZE_TYPE__
500 #  define YYSIZE_T __SIZE_TYPE__
501 # elif defined size_t
502 #  define YYSIZE_T size_t
503 # elif ! defined YYSIZE_T
504 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
505 #  define YYSIZE_T size_t
506 # else
507 #  define YYSIZE_T unsigned int
508 # endif
509 #endif
510
511 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
512
513 #ifndef YY_
514 # if defined YYENABLE_NLS && YYENABLE_NLS
515 #  if ENABLE_NLS
516 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
517 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
518 #  endif
519 # endif
520 # ifndef YY_
521 #  define YY_(Msgid) Msgid
522 # endif
523 #endif
524
525 #ifndef YY_ATTRIBUTE
526 # if (defined __GNUC__                                               \
527       && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
528      || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
529 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
530 # else
531 #  define YY_ATTRIBUTE(Spec) /* empty */
532 # endif
533 #endif
534
535 #ifndef YY_ATTRIBUTE_PURE
536 # define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
537 #endif
538
539 #ifndef YY_ATTRIBUTE_UNUSED
540 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
541 #endif
542
543 #if !defined _Noreturn \
544      && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
545 # if defined _MSC_VER && 1200 <= _MSC_VER
546 #  define _Noreturn __declspec (noreturn)
547 # else
548 #  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
549 # endif
550 #endif
551
552 /* Suppress unused-variable warnings by "using" E.  */
553 #if ! defined lint || defined __GNUC__
554 # define YYUSE(E) ((void) (E))
555 #else
556 # define YYUSE(E) /* empty */
557 #endif
558
559 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
560 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
561 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
562     _Pragma ("GCC diagnostic push") \
563     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
564     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
565 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
566     _Pragma ("GCC diagnostic pop")
567 #else
568 # define YY_INITIAL_VALUE(Value) Value
569 #endif
570 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
571 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
572 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
573 #endif
574 #ifndef YY_INITIAL_VALUE
575 # define YY_INITIAL_VALUE(Value) /* Nothing. */
576 #endif
577
578
579 #if ! defined yyoverflow || YYERROR_VERBOSE
580
581 /* The parser invokes alloca or malloc; define the necessary symbols.  */
582
583 # ifdef YYSTACK_USE_ALLOCA
584 #  if YYSTACK_USE_ALLOCA
585 #   ifdef __GNUC__
586 #    define YYSTACK_ALLOC __builtin_alloca
587 #   elif defined __BUILTIN_VA_ARG_INCR
588 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
589 #   elif defined _AIX
590 #    define YYSTACK_ALLOC __alloca
591 #   elif defined _MSC_VER
592 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
593 #    define alloca _alloca
594 #   else
595 #    define YYSTACK_ALLOC alloca
596 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
597 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
598       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
599 #     ifndef EXIT_SUCCESS
600 #      define EXIT_SUCCESS 0
601 #     endif
602 #    endif
603 #   endif
604 #  endif
605 # endif
606
607 # ifdef YYSTACK_ALLOC
608    /* Pacify GCC's 'empty if-body' warning.  */
609 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
610 #  ifndef YYSTACK_ALLOC_MAXIMUM
611     /* The OS might guarantee only one guard page at the bottom of the stack,
612        and a page size can be as small as 4096 bytes.  So we cannot safely
613        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
614        to allow for a few compiler-allocated temporary stack slots.  */
615 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
616 #  endif
617 # else
618 #  define YYSTACK_ALLOC YYMALLOC
619 #  define YYSTACK_FREE YYFREE
620 #  ifndef YYSTACK_ALLOC_MAXIMUM
621 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
622 #  endif
623 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
624        && ! ((defined YYMALLOC || defined malloc) \
625              && (defined YYFREE || defined free)))
626 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
627 #   ifndef EXIT_SUCCESS
628 #    define EXIT_SUCCESS 0
629 #   endif
630 #  endif
631 #  ifndef YYMALLOC
632 #   define YYMALLOC malloc
633 #   if ! defined malloc && ! defined EXIT_SUCCESS
634 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
635 #   endif
636 #  endif
637 #  ifndef YYFREE
638 #   define YYFREE free
639 #   if ! defined free && ! defined EXIT_SUCCESS
640 void free (void *); /* INFRINGES ON USER NAME SPACE */
641 #   endif
642 #  endif
643 # endif
644 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
645
646
647 #if (! defined yyoverflow \
648      && (! defined __cplusplus \
649          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
650
651 /* A type that is properly aligned for any stack member.  */
652 union yyalloc
653 {
654   yytype_int16 yyss_alloc;
655   YYSTYPE yyvs_alloc;
656 };
657
658 /* The size of the maximum gap between one aligned stack and the next.  */
659 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
660
661 /* The size of an array large to enough to hold all stacks, each with
662    N elements.  */
663 # define YYSTACK_BYTES(N) \
664      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
665       + YYSTACK_GAP_MAXIMUM)
666
667 # define YYCOPY_NEEDED 1
668
669 /* Relocate STACK from its old location to the new one.  The
670    local variables YYSIZE and YYSTACKSIZE give the old and new number of
671    elements in the stack, and YYPTR gives the new location of the
672    stack.  Advance YYPTR to a properly aligned location for the next
673    stack.  */
674 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
675     do                                                                  \
676       {                                                                 \
677         YYSIZE_T yynewbytes;                                            \
678         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
679         Stack = &yyptr->Stack_alloc;                                    \
680         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
681         yyptr += yynewbytes / sizeof (*yyptr);                          \
682       }                                                                 \
683     while (0)
684
685 #endif
686
687 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
688 /* Copy COUNT objects from SRC to DST.  The source and destination do
689    not overlap.  */
690 # ifndef YYCOPY
691 #  if defined __GNUC__ && 1 < __GNUC__
692 #   define YYCOPY(Dst, Src, Count) \
693       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
694 #  else
695 #   define YYCOPY(Dst, Src, Count)              \
696       do                                        \
697         {                                       \
698           YYSIZE_T yyi;                         \
699           for (yyi = 0; yyi < (Count); yyi++)   \
700             (Dst)[yyi] = (Src)[yyi];            \
701         }                                       \
702       while (0)
703 #  endif
704 # endif
705 #endif /* !YYCOPY_NEEDED */
706
707 /* YYFINAL -- State number of the termination state.  */
708 #define YYFINAL  14
709 /* YYLAST -- Last index in YYTABLE.  */
710 #define YYLAST   141
711
712 /* YYNTOKENS -- Number of terminals.  */
713 #define YYNTOKENS  142
714 /* YYNNTS -- Number of nonterminals.  */
715 #define YYNNTS  18
716 /* YYNRULES -- Number of rules.  */
717 #define YYNRULES  37
718 /* YYNSTATES -- Number of states.  */
719 #define YYNSTATES  51
720
721 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
722    by yylex, with out-of-bounds checking.  */
723 #define YYUNDEFTOK  2
724 #define YYMAXUTOK   387
725
726 #define YYTRANSLATE(YYX)                                                \
727   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
728
729 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
730    as returned by yylex, without out-of-bounds checking.  */
731 static const yytype_uint8 yytranslate[] =
732 {
733        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
734        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
735        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
736        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
737        2,     2,     2,   138,     2,   139,     2,   141,     2,     2,
738        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
739        2,     2,     2,     2,     2,     2,     2,     2,   137,     2,
740        2,     2,   134,     2,     2,     2,     2,   135,     2,     2,
741      140,     2,     2,   136,     2,     2,     2,   133,     2,     2,
742        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
743        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
744        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
745        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
746        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
747        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
748        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
749        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
750        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
751        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
752        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
753        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
754        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
755        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
756        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
757        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
758        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
759        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
760       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
761       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
762       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
763       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
764       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
765       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
766       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
767       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
768       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
769      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
770      115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
771      125,   126,   127,   128,   129,   130,   131,   132
772 };
773
774 #if YYDEBUG
775   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
776 static const yytype_uint16 yyrline[] =
777 {
778        0,   179,   179,   180,   181,   182,   183,   184,   191,   207,
779      208,   212,   213,   216,   231,   232,   234,   239,   242,   245,
780      249,   253,   258,   262,   267,   272,   278,   281,   285,   290,
781      295,   300,   309,   330,   361,   362,   365,   370
782 };
783 #endif
784
785 #if YYDEBUG || YYERROR_VERBOSE || 0
786 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
787    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
788 static const char *const yytname[] =
789 {
790   "$end", "error", "$undefined", "DIGITS", "INTNUMBER", "FLOATNUMBER",
791   "STRING", "EOL", "EQUALS", "CHARACTER", "COLON", "COMMA", "SEMICOLON",
792   "MINUS", "TIMESEPERATOR", "TRUE", "FALSE", "FREQ", "BYDAY", "BYHOUR",
793   "BYMINUTE", "BYMONTH", "BYMONTHDAY", "BYSECOND", "BYSETPOS", "BYWEEKNO",
794   "BYYEARDAY", "DAILY", "MINUTELY", "MONTHLY", "SECONDLY", "WEEKLY",
795   "HOURLY", "YEARLY", "INTERVAL", "COUNT", "UNTIL", "WKST", "MO", "SA",
796   "SU", "TU", "WE", "TH", "FR", "BIT8", "ACCEPTED", "ADD", "AUDIO",
797   "BASE64", "BINARY", "BOOLEAN", "BUSY", "BUSYTENTATIVE",
798   "BUSYUNAVAILABLE", "CALADDRESS", "CANCEL", "CANCELLED", "CHAIR", "CHILD",
799   "COMPLETED", "CONFIDENTIAL", "CONFIRMED", "COUNTER", "DATE", "DATETIME",
800   "DECLINECOUNTER", "DECLINED", "DELEGATED", "DISPLAY", "DRAFT",
801   "DURATION", "EMAIL", "END", "FINAL", "FLOAT", "FREE", "GREGORIAN",
802   "GROUP", "INDIVIDUAL", "INPROCESS", "INTEGER", "NEEDSACTION",
803   "NONPARTICIPANT", "OPAQUE", "OPTPARTICIPANT", "PARENT", "PERIOD",
804   "PRIVATE", "PROCEDURE", "PUBLIC", "PUBLISH", "RECUR", "REFRESH", "REPLY",
805   "REQPARTICIPANT", "REQUEST", "RESOURCE", "ROOM", "SIBLING", "START",
806   "TENTATIVE", "TEXT", "THISANDFUTURE", "THISANDPRIOR", "TIME",
807   "TRANSPAENT", "UNKNOWN", "UTCOFFSET", "XNAME", "ALTREP", "CN", "CUTYPE",
808   "DAYLIGHT", "DIR", "ENCODING", "EVENT", "FBTYPE", "FMTTYPE", "LANGUAGE",
809   "MEMBER", "PARTSTAT", "RANGE", "RELATED", "RELTYPE", "ROLE", "RSVP",
810   "SENTBY", "STANDARD", "URI", "CHARSET", "TIME_CHAR", "UTC_CHAR", "'W'",
811   "'H'", "'M'", "'S'", "'D'", "'+'", "'-'", "'P'", "'/'", "$accept",
812   "value", "date_value", "utc_char", "utc_char_b", "datetime_value",
813   "dur_date", "dur_week", "dur_time", "dur_hour", "dur_minute",
814   "dur_second", "dur_day", "dur_prefix", "duration_value", "period_value",
815   "plusminus", "utcoffset_value", YY_NULLPTR
816 };
817 #endif
818
819 # ifdef YYPRINT
820 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
821    (internal) symbol number NUM (which must be that of a token).  */
822 static const yytype_uint16 yytoknum[] =
823 {
824        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
825      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
826      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
827      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
828      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
829      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
830      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
831      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
832      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
833      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
834      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
835      365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
836      375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
837      385,   386,   387,    87,    72,    77,    83,    68,    43,    45,
838       80,    47
839 };
840 # endif
841
842 #define YYPACT_NINF -131
843
844 #define yypact_value_is_default(Yystate) \
845   (!!((Yystate) == (-131)))
846
847 #define YYTABLE_NINF -36
848
849 #define yytable_value_is_error(Yytable_value) \
850   0
851
852   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
853      STATE-NUM.  */
854 static const yytype_int16 yypact[] =
855 {
856       -1,  -131,  -127,     7,     8,     6,  -131,  -131,  -125,  -131,
857     -131,     9,  -131,    11,  -131,    -2,    12,  -115,  -130,    15,
858     -131,  -131,  -131,  -112,    16,  -131,  -120,  -131,  -131,  -126,
859     -131,  -131,  -131,  -131,  -131,     2,    19,    20,  -131,  -107,
860     -131,  -131,  -131,  -110,  -131,  -109,  -131,    23,  -104,  -131,
861     -131
862 };
863
864   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
865      Performed when YYTABLE does not specify something else to do.  Zero
866      means the default is an error.  */
867 static const yytype_uint8 yydefact[] =
868 {
869        0,     7,     8,    27,    28,     0,     2,     3,     0,     4,
870        5,     0,     6,     0,     1,     0,     0,     9,     0,     0,
871       29,    31,    30,    14,    36,    10,    13,    16,    25,     0,
872       17,    18,    19,    15,    37,    26,    20,    22,    24,     0,
873       27,    28,    33,     0,    21,     0,    23,     0,    11,    12,
874       32
875 };
876
877   /* YYPGOTO[NTERM-NUM].  */
878 static const yytype_int16 yypgoto[] =
879 {
880     -131,  -131,  -131,  -131,  -131,  -131,  -131,  -131,    10,  -131,
881       -7,    -6,  -131,  -131,    -5,  -131,  -131,  -131
882 };
883
884   /* YYDEFGOTO[NTERM-NUM].  */
885 static const yytype_int8 yydefgoto[] =
886 {
887       -1,     5,     6,    26,    50,     7,    20,    21,    22,    30,
888       31,    32,    23,     8,     9,    10,    11,    12
889 };
890
891   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
892      positive, shift that token.  If negative, reduce the rule whose
893      number is the opposite.  If YYTABLE_NINF, syntax error.  */
894 static const yytype_int8 yytable[] =
895 {
896        1,    18,     2,    27,    13,    39,    14,    28,    36,    37,
897       38,   -34,   -35,    16,    17,    15,    24,    25,    29,    19,
898       34,    35,    43,    45,    47,    37,    48,    38,    49,    44,
899       42,    46,     0,    33,     0,     0,     0,     0,     0,     0,
900        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
901        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
902        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
903        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
904        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
905        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
906        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
907        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
908        0,     0,     0,     0,     0,     0,     0,     0,     0,    19,
909        0,     0,     0,     0,     0,     0,     0,     3,     4,   -26,
910       40,    41
911 };
912
913 static const yytype_int16 yycheck[] =
914 {
915        1,     3,     3,   133,   131,     3,     0,   137,   134,   135,
916      136,     4,     4,     4,     3,   140,     4,   132,     3,   131,
917        4,   141,     3,     3,   131,   135,     3,   136,   132,    36,
918       35,    37,    -1,    23,    -1,    -1,    -1,    -1,    -1,    -1,
919       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
920       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
921       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
922       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
923       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
924       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
925       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
926       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
927       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,
928       -1,    -1,    -1,    -1,    -1,    -1,    -1,   138,   139,   140,
929      138,   139
930 };
931
932   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
933      symbol of state STATE-NUM.  */
934 static const yytype_uint8 yystos[] =
935 {
936        0,     1,     3,   138,   139,   143,   144,   147,   155,   156,
937      157,   158,   159,   131,     0,   140,     4,     3,     3,   131,
938      148,   149,   150,   154,     4,   132,   145,   133,   137,     3,
939      151,   152,   153,   150,     4,   141,   134,   135,   136,     3,
940      138,   139,   156,     3,   152,     3,   153,   131,     3,   132,
941      146
942 };
943
944   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
945 static const yytype_uint8 yyr1[] =
946 {
947        0,   142,   143,   143,   143,   143,   143,   143,   144,   145,
948      145,   146,   146,   147,   148,   148,   149,   150,   150,   150,
949      151,   151,   152,   152,   153,   154,   155,   155,   155,   156,
950      156,   156,   157,   157,   158,   158,   159,   159
951 };
952
953   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
954 static const yytype_uint8 yyr2[] =
955 {
956        0,     2,     1,     1,     1,     1,     1,     1,     1,     0,
957        1,     0,     1,     4,     1,     2,     2,     2,     2,     2,
958        2,     3,     2,     3,     2,     2,     0,     1,     1,     3,
959        3,     3,     9,     6,     1,     1,     3,     4
960 };
961
962
963 #define yyerrok         (yyerrstatus = 0)
964 #define yyclearin       (yychar = YYEMPTY)
965 #define YYEMPTY         (-2)
966 #define YYEOF           0
967
968 #define YYACCEPT        goto yyacceptlab
969 #define YYABORT         goto yyabortlab
970 #define YYERROR         goto yyerrorlab
971
972
973 #define YYRECOVERING()  (!!yyerrstatus)
974
975 #define YYBACKUP(Token, Value)                                  \
976 do                                                              \
977   if (yychar == YYEMPTY)                                        \
978     {                                                           \
979       yychar = (Token);                                         \
980       yylval = (Value);                                         \
981       YYPOPSTACK (yylen);                                       \
982       yystate = *yyssp;                                         \
983       goto yybackup;                                            \
984     }                                                           \
985   else                                                          \
986     {                                                           \
987       yyerror (YY_("syntax error: cannot back up")); \
988       YYERROR;                                                  \
989     }                                                           \
990 while (0)
991
992 /* Error token number */
993 #define YYTERROR        1
994 #define YYERRCODE       256
995
996
997
998 /* Enable debugging if requested.  */
999 #if YYDEBUG
1000
1001 # ifndef YYFPRINTF
1002 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1003 #  define YYFPRINTF fprintf
1004 # endif
1005
1006 # define YYDPRINTF(Args)                        \
1007 do {                                            \
1008   if (yydebug)                                  \
1009     YYFPRINTF Args;                             \
1010 } while (0)
1011
1012 /* This macro is provided for backward compatibility. */
1013 #ifndef YY_LOCATION_PRINT
1014 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1015 #endif
1016
1017
1018 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
1019 do {                                                                      \
1020   if (yydebug)                                                            \
1021     {                                                                     \
1022       YYFPRINTF (stderr, "%s ", Title);                                   \
1023       yy_symbol_print (stderr,                                            \
1024                   Type, Value); \
1025       YYFPRINTF (stderr, "\n");                                           \
1026     }                                                                     \
1027 } while (0)
1028
1029
1030 /*----------------------------------------.
1031 | Print this symbol's value on YYOUTPUT.  |
1032 `----------------------------------------*/
1033
1034 static void
1035 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1036 {
1037   FILE *yyo = yyoutput;
1038   YYUSE (yyo);
1039   if (!yyvaluep)
1040     return;
1041 # ifdef YYPRINT
1042   if (yytype < YYNTOKENS)
1043     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1044 # endif
1045   YYUSE (yytype);
1046 }
1047
1048
1049 /*--------------------------------.
1050 | Print this symbol on YYOUTPUT.  |
1051 `--------------------------------*/
1052
1053 static void
1054 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1055 {
1056   YYFPRINTF (yyoutput, "%s %s (",
1057              yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1058
1059   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1060   YYFPRINTF (yyoutput, ")");
1061 }
1062
1063 /*------------------------------------------------------------------.
1064 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1065 | TOP (included).                                                   |
1066 `------------------------------------------------------------------*/
1067
1068 static void
1069 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1070 {
1071   YYFPRINTF (stderr, "Stack now");
1072   for (; yybottom <= yytop; yybottom++)
1073     {
1074       int yybot = *yybottom;
1075       YYFPRINTF (stderr, " %d", yybot);
1076     }
1077   YYFPRINTF (stderr, "\n");
1078 }
1079
1080 # define YY_STACK_PRINT(Bottom, Top)                            \
1081 do {                                                            \
1082   if (yydebug)                                                  \
1083     yy_stack_print ((Bottom), (Top));                           \
1084 } while (0)
1085
1086
1087 /*------------------------------------------------.
1088 | Report that the YYRULE is going to be reduced.  |
1089 `------------------------------------------------*/
1090
1091 static void
1092 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1093 {
1094   unsigned long int yylno = yyrline[yyrule];
1095   int yynrhs = yyr2[yyrule];
1096   int yyi;
1097   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1098              yyrule - 1, yylno);
1099   /* The symbols being reduced.  */
1100   for (yyi = 0; yyi < yynrhs; yyi++)
1101     {
1102       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1103       yy_symbol_print (stderr,
1104                        yystos[yyssp[yyi + 1 - yynrhs]],
1105                        &(yyvsp[(yyi + 1) - (yynrhs)])
1106                                               );
1107       YYFPRINTF (stderr, "\n");
1108     }
1109 }
1110
1111 # define YY_REDUCE_PRINT(Rule)          \
1112 do {                                    \
1113   if (yydebug)                          \
1114     yy_reduce_print (yyssp, yyvsp, Rule); \
1115 } while (0)
1116
1117 /* Nonzero means print parse trace.  It is left uninitialized so that
1118    multiple parsers can coexist.  */
1119 int yydebug;
1120 #else /* !YYDEBUG */
1121 # define YYDPRINTF(Args)
1122 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1123 # define YY_STACK_PRINT(Bottom, Top)
1124 # define YY_REDUCE_PRINT(Rule)
1125 #endif /* !YYDEBUG */
1126
1127
1128 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1129 #ifndef YYINITDEPTH
1130 # define YYINITDEPTH 200
1131 #endif
1132
1133 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1134    if the built-in stack extension method is used).
1135
1136    Do not make this value too large; the results are undefined if
1137    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1138    evaluated with infinite-precision integer arithmetic.  */
1139
1140 #ifndef YYMAXDEPTH
1141 # define YYMAXDEPTH 10000
1142 #endif
1143
1144
1145 #if YYERROR_VERBOSE
1146
1147 # ifndef yystrlen
1148 #  if defined __GLIBC__ && defined _STRING_H
1149 #   define yystrlen strlen
1150 #  else
1151 /* Return the length of YYSTR.  */
1152 static YYSIZE_T
1153 yystrlen (const char *yystr)
1154 {
1155   YYSIZE_T yylen;
1156   for (yylen = 0; yystr[yylen]; yylen++)
1157     continue;
1158   return yylen;
1159 }
1160 #  endif
1161 # endif
1162
1163 # ifndef yystpcpy
1164 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1165 #   define yystpcpy stpcpy
1166 #  else
1167 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1168    YYDEST.  */
1169 static char *
1170 yystpcpy (char *yydest, const char *yysrc)
1171 {
1172   char *yyd = yydest;
1173   const char *yys = yysrc;
1174
1175   while ((*yyd++ = *yys++) != '\0')
1176     continue;
1177
1178   return yyd - 1;
1179 }
1180 #  endif
1181 # endif
1182
1183 # ifndef yytnamerr
1184 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1185    quotes and backslashes, so that it's suitable for yyerror.  The
1186    heuristic is that double-quoting is unnecessary unless the string
1187    contains an apostrophe, a comma, or backslash (other than
1188    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1189    null, do not copy; instead, return the length of what the result
1190    would have been.  */
1191 static YYSIZE_T
1192 yytnamerr (char *yyres, const char *yystr)
1193 {
1194   if (*yystr == '"')
1195     {
1196       YYSIZE_T yyn = 0;
1197       char const *yyp = yystr;
1198
1199       for (;;)
1200         switch (*++yyp)
1201           {
1202           case '\'':
1203           case ',':
1204             goto do_not_strip_quotes;
1205
1206           case '\\':
1207             if (*++yyp != '\\')
1208               goto do_not_strip_quotes;
1209             /* Fall through.  */
1210           default:
1211             if (yyres)
1212               yyres[yyn] = *yyp;
1213             yyn++;
1214             break;
1215
1216           case '"':
1217             if (yyres)
1218               yyres[yyn] = '\0';
1219             return yyn;
1220           }
1221     do_not_strip_quotes: ;
1222     }
1223
1224   if (! yyres)
1225     return yystrlen (yystr);
1226
1227   return yystpcpy (yyres, yystr) - yyres;
1228 }
1229 # endif
1230
1231 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1232    about the unexpected token YYTOKEN for the state stack whose top is
1233    YYSSP.
1234
1235    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1236    not large enough to hold the message.  In that case, also set
1237    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1238    required number of bytes is too large to store.  */
1239 static int
1240 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1241                 yytype_int16 *yyssp, int yytoken)
1242 {
1243   YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1244   YYSIZE_T yysize = yysize0;
1245   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1246   /* Internationalized format string. */
1247   const char *yyformat = YY_NULLPTR;
1248   /* Arguments of yyformat. */
1249   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1250   /* Number of reported tokens (one for the "unexpected", one per
1251      "expected"). */
1252   int yycount = 0;
1253
1254   /* There are many possibilities here to consider:
1255      - If this state is a consistent state with a default action, then
1256        the only way this function was invoked is if the default action
1257        is an error action.  In that case, don't check for expected
1258        tokens because there are none.
1259      - The only way there can be no lookahead present (in yychar) is if
1260        this state is a consistent state with a default action.  Thus,
1261        detecting the absence of a lookahead is sufficient to determine
1262        that there is no unexpected or expected token to report.  In that
1263        case, just report a simple "syntax error".
1264      - Don't assume there isn't a lookahead just because this state is a
1265        consistent state with a default action.  There might have been a
1266        previous inconsistent state, consistent state with a non-default
1267        action, or user semantic action that manipulated yychar.
1268      - Of course, the expected token list depends on states to have
1269        correct lookahead information, and it depends on the parser not
1270        to perform extra reductions after fetching a lookahead from the
1271        scanner and before detecting a syntax error.  Thus, state merging
1272        (from LALR or IELR) and default reductions corrupt the expected
1273        token list.  However, the list is correct for canonical LR with
1274        one exception: it will still contain any token that will not be
1275        accepted due to an error action in a later state.
1276   */
1277   if (yytoken != YYEMPTY)
1278     {
1279       int yyn = yypact[*yyssp];
1280       yyarg[yycount++] = yytname[yytoken];
1281       if (!yypact_value_is_default (yyn))
1282         {
1283           /* Start YYX at -YYN if negative to avoid negative indexes in
1284              YYCHECK.  In other words, skip the first -YYN actions for
1285              this state because they are default actions.  */
1286           int yyxbegin = yyn < 0 ? -yyn : 0;
1287           /* Stay within bounds of both yycheck and yytname.  */
1288           int yychecklim = YYLAST - yyn + 1;
1289           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1290           int yyx;
1291
1292           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1293             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1294                 && !yytable_value_is_error (yytable[yyx + yyn]))
1295               {
1296                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1297                   {
1298                     yycount = 1;
1299                     yysize = yysize0;
1300                     break;
1301                   }
1302                 yyarg[yycount++] = yytname[yyx];
1303                 {
1304                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1305                   if (! (yysize <= yysize1
1306                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1307                     return 2;
1308                   yysize = yysize1;
1309                 }
1310               }
1311         }
1312     }
1313
1314   switch (yycount)
1315     {
1316 # define YYCASE_(N, S)                      \
1317       case N:                               \
1318         yyformat = S;                       \
1319       break
1320       YYCASE_(0, YY_("syntax error"));
1321       YYCASE_(1, YY_("syntax error, unexpected %s"));
1322       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1323       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1324       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1325       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1326 # undef YYCASE_
1327     }
1328
1329   {
1330     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1331     if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1332       return 2;
1333     yysize = yysize1;
1334   }
1335
1336   if (*yymsg_alloc < yysize)
1337     {
1338       *yymsg_alloc = 2 * yysize;
1339       if (! (yysize <= *yymsg_alloc
1340              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1341         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1342       return 1;
1343     }
1344
1345   /* Avoid sprintf, as that infringes on the user's name space.
1346      Don't have undefined behavior even if the translation
1347      produced a string with the wrong number of "%s"s.  */
1348   {
1349     char *yyp = *yymsg;
1350     int yyi = 0;
1351     while ((*yyp = *yyformat) != '\0')
1352       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1353         {
1354           yyp += yytnamerr (yyp, yyarg[yyi++]);
1355           yyformat += 2;
1356         }
1357       else
1358         {
1359           yyp++;
1360           yyformat++;
1361         }
1362   }
1363   return 0;
1364 }
1365 #endif /* YYERROR_VERBOSE */
1366
1367 /*-----------------------------------------------.
1368 | Release the memory associated to this symbol.  |
1369 `-----------------------------------------------*/
1370
1371 static void
1372 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1373 {
1374   YYUSE (yyvaluep);
1375   if (!yymsg)
1376     yymsg = "Deleting";
1377   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1378
1379   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1380   YYUSE (yytype);
1381   YY_IGNORE_MAYBE_UNINITIALIZED_END
1382 }
1383
1384
1385
1386
1387 /* The lookahead symbol.  */
1388 int yychar;
1389
1390 /* The semantic value of the lookahead symbol.  */
1391 YYSTYPE yylval;
1392 /* Number of syntax errors so far.  */
1393 int yynerrs;
1394
1395
1396 /*----------.
1397 | yyparse.  |
1398 `----------*/
1399
1400 int
1401 yyparse (void)
1402 {
1403     int yystate;
1404     /* Number of tokens to shift before error messages enabled.  */
1405     int yyerrstatus;
1406
1407     /* The stacks and their tools:
1408        'yyss': related to states.
1409        'yyvs': related to semantic values.
1410
1411        Refer to the stacks through separate pointers, to allow yyoverflow
1412        to reallocate them elsewhere.  */
1413
1414     /* The state stack.  */
1415     yytype_int16 yyssa[YYINITDEPTH];
1416     yytype_int16 *yyss;
1417     yytype_int16 *yyssp;
1418
1419     /* The semantic value stack.  */
1420     YYSTYPE yyvsa[YYINITDEPTH];
1421     YYSTYPE *yyvs;
1422     YYSTYPE *yyvsp;
1423
1424     YYSIZE_T yystacksize;
1425
1426   int yyn;
1427   int yyresult;
1428   /* Lookahead token as an internal (translated) token number.  */
1429   int yytoken = 0;
1430   /* The variables used to return semantic value and location from the
1431      action routines.  */
1432   YYSTYPE yyval;
1433
1434 #if YYERROR_VERBOSE
1435   /* Buffer for error messages, and its allocated size.  */
1436   char yymsgbuf[128];
1437   char *yymsg = yymsgbuf;
1438   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1439 #endif
1440
1441 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1442
1443   /* The number of symbols on the RHS of the reduced rule.
1444      Keep to zero when no symbol should be popped.  */
1445   int yylen = 0;
1446
1447   yyssp = yyss = yyssa;
1448   yyvsp = yyvs = yyvsa;
1449   yystacksize = YYINITDEPTH;
1450
1451   YYDPRINTF ((stderr, "Starting parse\n"));
1452
1453   yystate = 0;
1454   yyerrstatus = 0;
1455   yynerrs = 0;
1456   yychar = YYEMPTY; /* Cause a token to be read.  */
1457   goto yysetstate;
1458
1459 /*------------------------------------------------------------.
1460 | yynewstate -- Push a new state, which is found in yystate.  |
1461 `------------------------------------------------------------*/
1462  yynewstate:
1463   /* In all cases, when you get here, the value and location stacks
1464      have just been pushed.  So pushing a state here evens the stacks.  */
1465   yyssp++;
1466
1467  yysetstate:
1468   *yyssp = yystate;
1469
1470   if (yyss + yystacksize - 1 <= yyssp)
1471     {
1472       /* Get the current used size of the three stacks, in elements.  */
1473       YYSIZE_T yysize = yyssp - yyss + 1;
1474
1475 #ifdef yyoverflow
1476       {
1477         /* Give user a chance to reallocate the stack.  Use copies of
1478            these so that the &'s don't force the real ones into
1479            memory.  */
1480         YYSTYPE *yyvs1 = yyvs;
1481         yytype_int16 *yyss1 = yyss;
1482
1483         /* Each stack pointer address is followed by the size of the
1484            data in use in that stack, in bytes.  This used to be a
1485            conditional around just the two extra args, but that might
1486            be undefined if yyoverflow is a macro.  */
1487         yyoverflow (YY_("memory exhausted"),
1488                     &yyss1, yysize * sizeof (*yyssp),
1489                     &yyvs1, yysize * sizeof (*yyvsp),
1490                     &yystacksize);
1491
1492         yyss = yyss1;
1493         yyvs = yyvs1;
1494       }
1495 #else /* no yyoverflow */
1496 # ifndef YYSTACK_RELOCATE
1497       goto yyexhaustedlab;
1498 # else
1499       /* Extend the stack our own way.  */
1500       if (YYMAXDEPTH <= yystacksize)
1501         goto yyexhaustedlab;
1502       yystacksize *= 2;
1503       if (YYMAXDEPTH < yystacksize)
1504         yystacksize = YYMAXDEPTH;
1505
1506       {
1507         yytype_int16 *yyss1 = yyss;
1508         union yyalloc *yyptr =
1509           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1510         if (! yyptr)
1511           goto yyexhaustedlab;
1512         YYSTACK_RELOCATE (yyss_alloc, yyss);
1513         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1514 #  undef YYSTACK_RELOCATE
1515         if (yyss1 != yyssa)
1516           YYSTACK_FREE (yyss1);
1517       }
1518 # endif
1519 #endif /* no yyoverflow */
1520
1521       yyssp = yyss + yysize - 1;
1522       yyvsp = yyvs + yysize - 1;
1523
1524       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1525                   (unsigned long int) yystacksize));
1526
1527       if (yyss + yystacksize - 1 <= yyssp)
1528         YYABORT;
1529     }
1530
1531   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1532
1533   if (yystate == YYFINAL)
1534     YYACCEPT;
1535
1536   goto yybackup;
1537
1538 /*-----------.
1539 | yybackup.  |
1540 `-----------*/
1541 yybackup:
1542
1543   /* Do appropriate processing given the current state.  Read a
1544      lookahead token if we need one and don't already have one.  */
1545
1546   /* First try to decide what to do without reference to lookahead token.  */
1547   yyn = yypact[yystate];
1548   if (yypact_value_is_default (yyn))
1549     goto yydefault;
1550
1551   /* Not known => get a lookahead token if don't already have one.  */
1552
1553   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1554   if (yychar == YYEMPTY)
1555     {
1556       YYDPRINTF ((stderr, "Reading a token: "));
1557       yychar = yylex ();
1558     }
1559
1560   if (yychar <= YYEOF)
1561     {
1562       yychar = yytoken = YYEOF;
1563       YYDPRINTF ((stderr, "Now at end of input.\n"));
1564     }
1565   else
1566     {
1567       yytoken = YYTRANSLATE (yychar);
1568       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1569     }
1570
1571   /* If the proper action on seeing token YYTOKEN is to reduce or to
1572      detect an error, take that action.  */
1573   yyn += yytoken;
1574   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1575     goto yydefault;
1576   yyn = yytable[yyn];
1577   if (yyn <= 0)
1578     {
1579       if (yytable_value_is_error (yyn))
1580         goto yyerrlab;
1581       yyn = -yyn;
1582       goto yyreduce;
1583     }
1584
1585   /* Count tokens shifted since error; after three, turn off error
1586      status.  */
1587   if (yyerrstatus)
1588     yyerrstatus--;
1589
1590   /* Shift the lookahead token.  */
1591   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1592
1593   /* Discard the shifted token.  */
1594   yychar = YYEMPTY;
1595
1596   yystate = yyn;
1597   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1598   *++yyvsp = yylval;
1599   YY_IGNORE_MAYBE_UNINITIALIZED_END
1600
1601   goto yynewstate;
1602
1603
1604 /*-----------------------------------------------------------.
1605 | yydefault -- do the default action for the current state.  |
1606 `-----------------------------------------------------------*/
1607 yydefault:
1608   yyn = yydefact[yystate];
1609   if (yyn == 0)
1610     goto yyerrlab;
1611   goto yyreduce;
1612
1613
1614 /*-----------------------------.
1615 | yyreduce -- Do a reduction.  |
1616 `-----------------------------*/
1617 yyreduce:
1618   /* yyn is the number of a rule to reduce with.  */
1619   yylen = yyr2[yyn];
1620
1621   /* If YYLEN is nonzero, implement the default value of the action:
1622      '$$ = $1'.
1623
1624      Otherwise, the following line sets YYVAL to garbage.
1625      This behavior is undocumented and Bison
1626      users should not rely upon it.  Assigning to YYVAL
1627      unconditionally makes the parser a bit smaller, and it avoids a
1628      GCC warning that YYVAL may be used uninitialized.  */
1629   yyval = yyvsp[1-yylen];
1630
1631
1632   YY_REDUCE_PRINT (yyn);
1633   switch (yyn)
1634     {
1635         case 7:
1636 #line 184 "icalyacc.y" /* yacc.c:1646  */
1637     { 
1638                   icalparser_yy_value = 0;
1639                   icalparser_clear_flex_input();
1640                   yyclearin;
1641                   }
1642 #line 1643 "icalyacc.c" /* yacc.c:1646  */
1643     break;
1644
1645   case 8:
1646 #line 192 "icalyacc.y" /* yacc.c:1646  */
1647     {
1648             struct icaltimetype stm;
1649
1650             stm = fill_datetime((yyvsp[0].v_string),0);
1651
1652             stm.hour = -1;
1653             stm.minute = -1;
1654             stm.second = -1;
1655             stm.is_utc = 0;
1656             stm.is_date = 1;
1657
1658             icalparser_yy_value = icalvalue_new_date(stm);
1659         }
1660 #line 1661 "icalyacc.c" /* yacc.c:1646  */
1661     break;
1662
1663   case 9:
1664 #line 207 "icalyacc.y" /* yacc.c:1646  */
1665     {utc = 0;}
1666 #line 1667 "icalyacc.c" /* yacc.c:1646  */
1667     break;
1668
1669   case 10:
1670 #line 208 "icalyacc.y" /* yacc.c:1646  */
1671     {utc = 1;}
1672 #line 1673 "icalyacc.c" /* yacc.c:1646  */
1673     break;
1674
1675   case 11:
1676 #line 212 "icalyacc.y" /* yacc.c:1646  */
1677     {utc_b = 0;}
1678 #line 1679 "icalyacc.c" /* yacc.c:1646  */
1679     break;
1680
1681   case 12:
1682 #line 213 "icalyacc.y" /* yacc.c:1646  */
1683     {utc_b = 1;}
1684 #line 1685 "icalyacc.c" /* yacc.c:1646  */
1685     break;
1686
1687   case 13:
1688 #line 217 "icalyacc.y" /* yacc.c:1646  */
1689     {
1690             struct  icaltimetype stm;
1691             stm = fill_datetime((yyvsp[-3].v_string), (yyvsp[-1].v_string));
1692             stm.is_utc = utc;
1693             stm.is_date = 0;
1694
1695             icalparser_yy_value = 
1696                 icalvalue_new_datetime(stm);
1697         }
1698 #line 1699 "icalyacc.c" /* yacc.c:1646  */
1699     break;
1700
1701   case 16:
1702 #line 235 "icalyacc.y" /* yacc.c:1646  */
1703     {
1704             duration.weeks = atoi((yyvsp[-1].v_string));
1705         }
1706 #line 1707 "icalyacc.c" /* yacc.c:1646  */
1707     break;
1708
1709   case 17:
1710 #line 240 "icalyacc.y" /* yacc.c:1646  */
1711     {
1712         }
1713 #line 1714 "icalyacc.c" /* yacc.c:1646  */
1714     break;
1715
1716   case 18:
1717 #line 243 "icalyacc.y" /* yacc.c:1646  */
1718     {
1719         }
1720 #line 1721 "icalyacc.c" /* yacc.c:1646  */
1721     break;
1722
1723   case 19:
1724 #line 246 "icalyacc.y" /* yacc.c:1646  */
1725     {
1726         }
1727 #line 1728 "icalyacc.c" /* yacc.c:1646  */
1728     break;
1729
1730   case 20:
1731 #line 250 "icalyacc.y" /* yacc.c:1646  */
1732     {
1733             duration.hours = atoi((yyvsp[-1].v_string));
1734         }
1735 #line 1736 "icalyacc.c" /* yacc.c:1646  */
1736     break;
1737
1738   case 21:
1739 #line 254 "icalyacc.y" /* yacc.c:1646  */
1740     {
1741             duration.hours = atoi((yyvsp[-2].v_string));
1742         }
1743 #line 1744 "icalyacc.c" /* yacc.c:1646  */
1744     break;
1745
1746   case 22:
1747 #line 259 "icalyacc.y" /* yacc.c:1646  */
1748     {
1749             duration.minutes = atoi((yyvsp[-1].v_string));
1750         }
1751 #line 1752 "icalyacc.c" /* yacc.c:1646  */
1752     break;
1753
1754   case 23:
1755 #line 263 "icalyacc.y" /* yacc.c:1646  */
1756     {
1757             duration.minutes = atoi((yyvsp[-2].v_string));
1758         }
1759 #line 1760 "icalyacc.c" /* yacc.c:1646  */
1760     break;
1761
1762   case 24:
1763 #line 268 "icalyacc.y" /* yacc.c:1646  */
1764     {
1765             duration.seconds = atoi((yyvsp[-1].v_string));
1766         }
1767 #line 1768 "icalyacc.c" /* yacc.c:1646  */
1768     break;
1769
1770   case 25:
1771 #line 273 "icalyacc.y" /* yacc.c:1646  */
1772     {
1773             duration.days = atoi((yyvsp[-1].v_string));
1774         }
1775 #line 1776 "icalyacc.c" /* yacc.c:1646  */
1776     break;
1777
1778   case 26:
1779 #line 278 "icalyacc.y" /* yacc.c:1646  */
1780     {
1781             duration.is_neg = 0;
1782         }
1783 #line 1784 "icalyacc.c" /* yacc.c:1646  */
1784     break;
1785
1786   case 27:
1787 #line 282 "icalyacc.y" /* yacc.c:1646  */
1788     {
1789             duration.is_neg = 0;
1790         }
1791 #line 1792 "icalyacc.c" /* yacc.c:1646  */
1792     break;
1793
1794   case 28:
1795 #line 286 "icalyacc.y" /* yacc.c:1646  */
1796     { 
1797             duration.is_neg = 1;
1798         }
1799 #line 1800 "icalyacc.c" /* yacc.c:1646  */
1800     break;
1801
1802   case 29:
1803 #line 291 "icalyacc.y" /* yacc.c:1646  */
1804     { 
1805             icalparser_yy_value = icalvalue_new_duration(duration); 
1806             memset(&duration,0, sizeof(duration));
1807         }
1808 #line 1809 "icalyacc.c" /* yacc.c:1646  */
1809     break;
1810
1811   case 30:
1812 #line 296 "icalyacc.y" /* yacc.c:1646  */
1813     { 
1814             icalparser_yy_value = icalvalue_new_duration(duration); 
1815             memset(&duration,0, sizeof(duration));
1816         }
1817 #line 1818 "icalyacc.c" /* yacc.c:1646  */
1818     break;
1819
1820   case 31:
1821 #line 301 "icalyacc.y" /* yacc.c:1646  */
1822     { 
1823             icalparser_yy_value = icalvalue_new_duration(duration); 
1824             memset(&duration,0, sizeof(duration));
1825         }
1826 #line 1827 "icalyacc.c" /* yacc.c:1646  */
1827     break;
1828
1829   case 32:
1830 #line 310 "icalyacc.y" /* yacc.c:1646  */
1831     {
1832             struct icalperiodtype p;
1833         
1834             p.start = fill_datetime((yyvsp[-8].v_string),(yyvsp[-6].v_string));
1835             p.start.is_utc = utc;
1836             p.start.is_date = 0;
1837
1838
1839             p.end = fill_datetime((yyvsp[-3].v_string),(yyvsp[-1].v_string));
1840             p.end.is_utc = utc_b;
1841             p.end.is_date = 0;
1842                 
1843             p.duration.days = -1;
1844             p.duration.weeks = -1;
1845             p.duration.hours = -1;
1846             p.duration.minutes = -1;
1847             p.duration.seconds = -1;
1848
1849             icalparser_yy_value = icalvalue_new_period(p);
1850         }
1851 #line 1852 "icalyacc.c" /* yacc.c:1646  */
1852     break;
1853
1854   case 33:
1855 #line 331 "icalyacc.y" /* yacc.c:1646  */
1856     {
1857             struct icalperiodtype p;
1858             
1859             p.start = fill_datetime((yyvsp[-5].v_string),(yyvsp[-3].v_string));
1860             p.start.is_utc = utc;
1861             p.start.is_date = 0;
1862
1863             p.end.year = -1;
1864             p.end.month = -1;
1865             p.end.day = -1;
1866             p.end.hour = -1;
1867             p.end.minute = -1;
1868             p.end.second = -1;
1869                    
1870             /* The duration_value rule setes the global 'duration'
1871                variable, but it also creates a new value in
1872                icalparser_yy_value. So, free that, then copy
1873                'duration' into the icalperiodtype struct. */
1874
1875             p.duration = icalvalue_get_duration(icalparser_yy_value);
1876             icalvalue_free(icalparser_yy_value);
1877             icalparser_yy_value = 0;
1878
1879             icalparser_yy_value = icalvalue_new_period(p);
1880
1881         }
1882 #line 1883 "icalyacc.c" /* yacc.c:1646  */
1883     break;
1884
1885   case 34:
1886 #line 361 "icalyacc.y" /* yacc.c:1646  */
1887     { utcsign = 1; }
1888 #line 1889 "icalyacc.c" /* yacc.c:1646  */
1889     break;
1890
1891   case 35:
1892 #line 362 "icalyacc.y" /* yacc.c:1646  */
1893     { utcsign = -1; }
1894 #line 1895 "icalyacc.c" /* yacc.c:1646  */
1895     break;
1896
1897   case 36:
1898 #line 366 "icalyacc.y" /* yacc.c:1646  */
1899     {
1900             icalparser_yy_value = icalvalue_new_utcoffset( utcsign * ((yyvsp[-1].v_int)*3600) + ((yyvsp[0].v_int)*60) );
1901         }
1902 #line 1903 "icalyacc.c" /* yacc.c:1646  */
1903     break;
1904
1905   case 37:
1906 #line 371 "icalyacc.y" /* yacc.c:1646  */
1907     {
1908             icalparser_yy_value = icalvalue_new_utcoffset(utcsign * ((yyvsp[-2].v_int)*3600) + ((yyvsp[-1].v_int)*60) +((yyvsp[0].v_int)));
1909         }
1910 #line 1911 "icalyacc.c" /* yacc.c:1646  */
1911     break;
1912
1913
1914 #line 1915 "icalyacc.c" /* yacc.c:1646  */
1915       default: break;
1916     }
1917   /* User semantic actions sometimes alter yychar, and that requires
1918      that yytoken be updated with the new translation.  We take the
1919      approach of translating immediately before every use of yytoken.
1920      One alternative is translating here after every semantic action,
1921      but that translation would be missed if the semantic action invokes
1922      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1923      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1924      incorrect destructor might then be invoked immediately.  In the
1925      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1926      to an incorrect destructor call or verbose syntax error message
1927      before the lookahead is translated.  */
1928   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1929
1930   YYPOPSTACK (yylen);
1931   yylen = 0;
1932   YY_STACK_PRINT (yyss, yyssp);
1933
1934   *++yyvsp = yyval;
1935
1936   /* Now 'shift' the result of the reduction.  Determine what state
1937      that goes to, based on the state we popped back to and the rule
1938      number reduced by.  */
1939
1940   yyn = yyr1[yyn];
1941
1942   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1943   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1944     yystate = yytable[yystate];
1945   else
1946     yystate = yydefgoto[yyn - YYNTOKENS];
1947
1948   goto yynewstate;
1949
1950
1951 /*--------------------------------------.
1952 | yyerrlab -- here on detecting error.  |
1953 `--------------------------------------*/
1954 yyerrlab:
1955   /* Make sure we have latest lookahead translation.  See comments at
1956      user semantic actions for why this is necessary.  */
1957   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1958
1959   /* If not already recovering from an error, report this error.  */
1960   if (!yyerrstatus)
1961     {
1962       ++yynerrs;
1963 #if ! YYERROR_VERBOSE
1964       yyerror (YY_("syntax error"));
1965 #else
1966 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1967                                         yyssp, yytoken)
1968       {
1969         char const *yymsgp = YY_("syntax error");
1970         int yysyntax_error_status;
1971         yysyntax_error_status = YYSYNTAX_ERROR;
1972         if (yysyntax_error_status == 0)
1973           yymsgp = yymsg;
1974         else if (yysyntax_error_status == 1)
1975           {
1976             if (yymsg != yymsgbuf)
1977               YYSTACK_FREE (yymsg);
1978             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1979             if (!yymsg)
1980               {
1981                 yymsg = yymsgbuf;
1982                 yymsg_alloc = sizeof yymsgbuf;
1983                 yysyntax_error_status = 2;
1984               }
1985             else
1986               {
1987                 yysyntax_error_status = YYSYNTAX_ERROR;
1988                 yymsgp = yymsg;
1989               }
1990           }
1991         yyerror (yymsgp);
1992         if (yysyntax_error_status == 2)
1993           goto yyexhaustedlab;
1994       }
1995 # undef YYSYNTAX_ERROR
1996 #endif
1997     }
1998
1999
2000
2001   if (yyerrstatus == 3)
2002     {
2003       /* If just tried and failed to reuse lookahead token after an
2004          error, discard it.  */
2005
2006       if (yychar <= YYEOF)
2007         {
2008           /* Return failure if at end of input.  */
2009           if (yychar == YYEOF)
2010             YYABORT;
2011         }
2012       else
2013         {
2014           yydestruct ("Error: discarding",
2015                       yytoken, &yylval);
2016           yychar = YYEMPTY;
2017         }
2018     }
2019
2020   /* Else will try to reuse lookahead token after shifting the error
2021      token.  */
2022   goto yyerrlab1;
2023
2024
2025 /*---------------------------------------------------.
2026 | yyerrorlab -- error raised explicitly by YYERROR.  |
2027 `---------------------------------------------------*/
2028 yyerrorlab:
2029
2030   /* Pacify compilers like GCC when the user code never invokes
2031      YYERROR and the label yyerrorlab therefore never appears in user
2032      code.  */
2033   if (/*CONSTCOND*/ 0)
2034      goto yyerrorlab;
2035
2036   /* Do not reclaim the symbols of the rule whose action triggered
2037      this YYERROR.  */
2038   YYPOPSTACK (yylen);
2039   yylen = 0;
2040   YY_STACK_PRINT (yyss, yyssp);
2041   yystate = *yyssp;
2042   goto yyerrlab1;
2043
2044
2045 /*-------------------------------------------------------------.
2046 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2047 `-------------------------------------------------------------*/
2048 yyerrlab1:
2049   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2050
2051   for (;;)
2052     {
2053       yyn = yypact[yystate];
2054       if (!yypact_value_is_default (yyn))
2055         {
2056           yyn += YYTERROR;
2057           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2058             {
2059               yyn = yytable[yyn];
2060               if (0 < yyn)
2061                 break;
2062             }
2063         }
2064
2065       /* Pop the current state because it cannot handle the error token.  */
2066       if (yyssp == yyss)
2067         YYABORT;
2068
2069
2070       yydestruct ("Error: popping",
2071                   yystos[yystate], yyvsp);
2072       YYPOPSTACK (1);
2073       yystate = *yyssp;
2074       YY_STACK_PRINT (yyss, yyssp);
2075     }
2076
2077   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2078   *++yyvsp = yylval;
2079   YY_IGNORE_MAYBE_UNINITIALIZED_END
2080
2081
2082   /* Shift the error token.  */
2083   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2084
2085   yystate = yyn;
2086   goto yynewstate;
2087
2088
2089 /*-------------------------------------.
2090 | yyacceptlab -- YYACCEPT comes here.  |
2091 `-------------------------------------*/
2092 yyacceptlab:
2093   yyresult = 0;
2094   goto yyreturn;
2095
2096 /*-----------------------------------.
2097 | yyabortlab -- YYABORT comes here.  |
2098 `-----------------------------------*/
2099 yyabortlab:
2100   yyresult = 1;
2101   goto yyreturn;
2102
2103 #if !defined yyoverflow || YYERROR_VERBOSE
2104 /*-------------------------------------------------.
2105 | yyexhaustedlab -- memory exhaustion comes here.  |
2106 `-------------------------------------------------*/
2107 yyexhaustedlab:
2108   yyerror (YY_("memory exhausted"));
2109   yyresult = 2;
2110   /* Fall through.  */
2111 #endif
2112
2113 yyreturn:
2114   if (yychar != YYEMPTY)
2115     {
2116       /* Make sure we have latest lookahead translation.  See comments at
2117          user semantic actions for why this is necessary.  */
2118       yytoken = YYTRANSLATE (yychar);
2119       yydestruct ("Cleanup: discarding lookahead",
2120                   yytoken, &yylval);
2121     }
2122   /* Do not reclaim the symbols of the rule whose action triggered
2123      this YYABORT or YYACCEPT.  */
2124   YYPOPSTACK (yylen);
2125   YY_STACK_PRINT (yyss, yyssp);
2126   while (yyssp != yyss)
2127     {
2128       yydestruct ("Cleanup: popping",
2129                   yystos[*yyssp], yyvsp);
2130       YYPOPSTACK (1);
2131     }
2132 #ifndef yyoverflow
2133   if (yyss != yyssa)
2134     YYSTACK_FREE (yyss);
2135 #endif
2136 #if YYERROR_VERBOSE
2137   if (yymsg != yymsgbuf)
2138     YYSTACK_FREE (yymsg);
2139 #endif
2140   return yyresult;
2141 }
2142 #line 375 "icalyacc.y" /* yacc.c:1906  */
2143
2144
2145 struct icaltimetype fill_datetime(char* datestr, char* timestr)
2146 {
2147             struct icaltimetype stm;
2148
2149             memset(&stm,0,sizeof(stm));
2150
2151             if (datestr != 0){
2152                 sscanf(datestr,"%4d%2d%2d",&(stm.year), &(stm.month), 
2153                        &(stm.day));
2154             }
2155
2156             if (timestr != 0){
2157                 sscanf(timestr,"%2d%2d%2d", &(stm.hour), &(stm.minute), 
2158                        &(stm.second));
2159             }
2160
2161             return stm;
2162
2163 }
2164
2165 void ical_yyerror(char* s)
2166 {
2167     /*fprintf(stderr,"Parse error \'%s\'\n", s);*/
2168 }
2169