1 /* A Bison parser, made by GNU Bison 3.0.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
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.
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.
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/>. */
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.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
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. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.2"
50 #define YYSKELETON_NAME "yacc.c"
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
69 #define yylval ical_yylval
70 #define yychar ical_yychar
72 /* Copy the first part of user declarations. */
73 #line 1 "icalyacc.y" /* yacc.c:339 */
76 ======================================================================
78 CREATOR: eric 10 June 1999
85 (C) COPYRIGHT 1999 Eric Busboom
86 http://www.softwarestudio.org
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/
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.
98 The original author is Eric Busboom
99 The original code is icalitip.y
103 =======================================================================*/
106 #include <string.h> /* for strdup() */
107 #include "icalparser.h"
110 icalvalue *icalparser_yy_value; /* Current Value */
112 void ical_yyerror(char* s);
113 void icalparser_clear_flex_input();
114 int ical_yy_lex(void);
116 /* Globals for UTCOFFSET values */
121 /* Globals for DURATION values */
122 struct icaldurationtype duration;
124 /* Globals for TRIGGER values */
125 struct icaltriggertype trigger;
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. */
139 /* Set the state of the lexer so it will interpret values ( iCAL
140 VALUEs, that is, ) correctly. */
143 #line 144 "icalyacc.c" /* yacc.c:339 */
146 # if defined __cplusplus && 201103L <= __cplusplus
147 # define YY_NULLPTR nullptr
149 # define YY_NULLPTR 0
153 /* Enabling verbose error messages. */
154 #ifdef YYERROR_VERBOSE
155 # undef YYERROR_VERBOSE
156 # define YYERROR_VERBOSE 1
158 # define YYERROR_VERBOSE 0
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
170 extern int ical_yydebug;
229 BUSYUNAVAILABLE = 309,
241 DECLINECOUNTER = 321,
258 NONPARTICIPANT = 338,
260 OPTPARTICIPANT = 340,
270 REQPARTICIPANT = 350,
312 #define INTNUMBER 259
313 #define FLOATNUMBER 260
317 #define CHARACTER 264
320 #define SEMICOLON 267
322 #define TIMESEPERATOR 269
330 #define BYMONTHDAY 277
334 #define BYYEARDAY 281
361 #define BUSYTENTATIVE 308
362 #define BUSYUNAVAILABLE 309
363 #define CALADDRESS 310
365 #define CANCELLED 312
368 #define COMPLETED 315
369 #define CONFIDENTIAL 316
370 #define CONFIRMED 317
374 #define DECLINECOUNTER 321
376 #define DELEGATED 323
385 #define GREGORIAN 332
387 #define INDIVIDUAL 334
388 #define INPROCESS 335
390 #define NEEDSACTION 337
391 #define NONPARTICIPANT 338
393 #define OPTPARTICIPANT 340
397 #define PROCEDURE 344
403 #define REQPARTICIPANT 350
409 #define TENTATIVE 356
411 #define THISANDFUTURE 358
412 #define THISANDPRIOR 359
414 #define TRANSPAENT 361
416 #define UTCOFFSET 363
439 #define TIME_CHAR 386
443 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
444 typedef union YYSTYPE YYSTYPE;
447 #line 71 "icalyacc.y" /* yacc.c:355 */
453 #line 454 "icalyacc.c" /* yacc.c:355 */
455 # define YYSTYPE_IS_TRIVIAL 1
456 # define YYSTYPE_IS_DECLARED 1
460 extern YYSTYPE ical_yylval;
462 int ical_yyparse (void);
464 #endif /* !YY_ICAL_YY_Y_TAB_H_INCLUDED */
466 /* Copy the second part of user declarations. */
468 #line 469 "icalyacc.c" /* yacc.c:358 */
475 typedef YYTYPE_UINT8 yytype_uint8;
477 typedef unsigned char yytype_uint8;
481 typedef YYTYPE_INT8 yytype_int8;
483 typedef signed char yytype_int8;
487 typedef YYTYPE_UINT16 yytype_uint16;
489 typedef unsigned short int yytype_uint16;
493 typedef YYTYPE_INT16 yytype_int16;
495 typedef short int yytype_int16;
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
507 # define YYSIZE_T unsigned int
511 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
514 # if defined YYENABLE_NLS && YYENABLE_NLS
516 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
517 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
521 # define YY_(Msgid) Msgid
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)
531 # define YY_ATTRIBUTE(Spec) /* empty */
535 #ifndef YY_ATTRIBUTE_PURE
536 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
539 #ifndef YY_ATTRIBUTE_UNUSED
540 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
543 #if !defined _Noreturn \
544 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
545 # if defined _MSC_VER && 1200 <= _MSC_VER
546 # define _Noreturn __declspec (noreturn)
548 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
552 /* Suppress unused-variable warnings by "using" E. */
553 #if ! defined lint || defined __GNUC__
554 # define YYUSE(E) ((void) (E))
556 # define YYUSE(E) /* empty */
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")
568 # define YY_INITIAL_VALUE(Value) Value
570 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
571 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
572 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
574 #ifndef YY_INITIAL_VALUE
575 # define YY_INITIAL_VALUE(Value) /* Nothing. */
579 #if ! defined yyoverflow || YYERROR_VERBOSE
581 /* The parser invokes alloca or malloc; define the necessary symbols. */
583 # ifdef YYSTACK_USE_ALLOCA
584 # if YYSTACK_USE_ALLOCA
586 # define YYSTACK_ALLOC __builtin_alloca
587 # elif defined __BUILTIN_VA_ARG_INCR
588 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
590 # define YYSTACK_ALLOC __alloca
591 # elif defined _MSC_VER
592 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
593 # define alloca _alloca
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
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 */
618 # define YYSTACK_ALLOC YYMALLOC
619 # define YYSTACK_FREE YYFREE
620 # ifndef YYSTACK_ALLOC_MAXIMUM
621 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
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
632 # define YYMALLOC malloc
633 # if ! defined malloc && ! defined EXIT_SUCCESS
634 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
639 # if ! defined free && ! defined EXIT_SUCCESS
640 void free (void *); /* INFRINGES ON USER NAME SPACE */
644 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
647 #if (! defined yyoverflow \
648 && (! defined __cplusplus \
649 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
651 /* A type that is properly aligned for any stack member. */
654 yytype_int16 yyss_alloc;
658 /* The size of the maximum gap between one aligned stack and the next. */
659 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
661 /* The size of an array large to enough to hold all stacks, each with
663 # define YYSTACK_BYTES(N) \
664 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
665 + YYSTACK_GAP_MAXIMUM)
667 # define YYCOPY_NEEDED 1
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
674 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
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); \
687 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
688 /* Copy COUNT objects from SRC to DST. The source and destination do
691 # if defined __GNUC__ && 1 < __GNUC__
692 # define YYCOPY(Dst, Src, Count) \
693 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
695 # define YYCOPY(Dst, Src, Count) \
699 for (yyi = 0; yyi < (Count); yyi++) \
700 (Dst)[yyi] = (Src)[yyi]; \
705 #endif /* !YYCOPY_NEEDED */
707 /* YYFINAL -- State number of the termination state. */
709 /* YYLAST -- Last index in YYTABLE. */
712 /* YYNTOKENS -- Number of terminals. */
713 #define YYNTOKENS 142
714 /* YYNNTS -- Number of nonterminals. */
716 /* YYNRULES -- Number of rules. */
718 /* YYNSTATES -- Number of states. */
721 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
722 by yylex, with out-of-bounds checking. */
724 #define YYMAXUTOK 387
726 #define YYTRANSLATE(YYX) \
727 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
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[] =
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
775 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
776 static const yytype_uint16 yyrline[] =
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
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[] =
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
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[] =
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,
842 #define YYPACT_NINF -131
844 #define yypact_value_is_default(Yystate) \
845 (!!((Yystate) == (-131)))
847 #define YYTABLE_NINF -36
849 #define yytable_value_is_error(Yytable_value) \
852 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
854 static const yytype_int16 yypact[] =
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,
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[] =
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,
877 /* YYPGOTO[NTERM-NUM]. */
878 static const yytype_int16 yypgoto[] =
880 -131, -131, -131, -131, -131, -131, -131, -131, 10, -131,
881 -7, -6, -131, -131, -5, -131, -131, -131
884 /* YYDEFGOTO[NTERM-NUM]. */
885 static const yytype_int8 yydefgoto[] =
887 -1, 5, 6, 26, 50, 7, 20, 21, 22, 30,
888 31, 32, 23, 8, 9, 10, 11, 12
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[] =
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,
913 static const yytype_int16 yycheck[] =
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,
932 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
933 symbol of state STATE-NUM. */
934 static const yytype_uint8 yystos[] =
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,
944 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
945 static const yytype_uint8 yyr1[] =
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
953 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
954 static const yytype_uint8 yyr2[] =
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
963 #define yyerrok (yyerrstatus = 0)
964 #define yyclearin (yychar = YYEMPTY)
968 #define YYACCEPT goto yyacceptlab
969 #define YYABORT goto yyabortlab
970 #define YYERROR goto yyerrorlab
973 #define YYRECOVERING() (!!yyerrstatus)
975 #define YYBACKUP(Token, Value) \
977 if (yychar == YYEMPTY) \
981 YYPOPSTACK (yylen); \
987 yyerror (YY_("syntax error: cannot back up")); \
992 /* Error token number */
994 #define YYERRCODE 256
998 /* Enable debugging if requested. */
1002 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1003 # define YYFPRINTF fprintf
1006 # define YYDPRINTF(Args) \
1012 /* This macro is provided for backward compatibility. */
1013 #ifndef YY_LOCATION_PRINT
1014 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1018 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1022 YYFPRINTF (stderr, "%s ", Title); \
1023 yy_symbol_print (stderr, \
1025 YYFPRINTF (stderr, "\n"); \
1030 /*----------------------------------------.
1031 | Print this symbol's value on YYOUTPUT. |
1032 `----------------------------------------*/
1035 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1037 FILE *yyo = yyoutput;
1042 if (yytype < YYNTOKENS)
1043 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1049 /*--------------------------------.
1050 | Print this symbol on YYOUTPUT. |
1051 `--------------------------------*/
1054 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1056 YYFPRINTF (yyoutput, "%s %s (",
1057 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1059 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1060 YYFPRINTF (yyoutput, ")");
1063 /*------------------------------------------------------------------.
1064 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1066 `------------------------------------------------------------------*/
1069 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1071 YYFPRINTF (stderr, "Stack now");
1072 for (; yybottom <= yytop; yybottom++)
1074 int yybot = *yybottom;
1075 YYFPRINTF (stderr, " %d", yybot);
1077 YYFPRINTF (stderr, "\n");
1080 # define YY_STACK_PRINT(Bottom, Top) \
1083 yy_stack_print ((Bottom), (Top)); \
1087 /*------------------------------------------------.
1088 | Report that the YYRULE is going to be reduced. |
1089 `------------------------------------------------*/
1092 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1094 unsigned long int yylno = yyrline[yyrule];
1095 int yynrhs = yyr2[yyrule];
1097 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1099 /* The symbols being reduced. */
1100 for (yyi = 0; yyi < yynrhs; yyi++)
1102 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1103 yy_symbol_print (stderr,
1104 yystos[yyssp[yyi + 1 - yynrhs]],
1105 &(yyvsp[(yyi + 1) - (yynrhs)])
1107 YYFPRINTF (stderr, "\n");
1111 # define YY_REDUCE_PRINT(Rule) \
1114 yy_reduce_print (yyssp, yyvsp, Rule); \
1117 /* Nonzero means print parse trace. It is left uninitialized so that
1118 multiple parsers can coexist. */
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 */
1128 /* YYINITDEPTH -- initial size of the parser's stacks. */
1130 # define YYINITDEPTH 200
1133 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1134 if the built-in stack extension method is used).
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. */
1141 # define YYMAXDEPTH 10000
1148 # if defined __GLIBC__ && defined _STRING_H
1149 # define yystrlen strlen
1151 /* Return the length of YYSTR. */
1153 yystrlen (const char *yystr)
1156 for (yylen = 0; yystr[yylen]; yylen++)
1164 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1165 # define yystpcpy stpcpy
1167 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1170 yystpcpy (char *yydest, const char *yysrc)
1173 const char *yys = yysrc;
1175 while ((*yyd++ = *yys++) != '\0')
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
1192 yytnamerr (char *yyres, const char *yystr)
1197 char const *yyp = yystr;
1204 goto do_not_strip_quotes;
1208 goto do_not_strip_quotes;
1221 do_not_strip_quotes: ;
1225 return yystrlen (yystr);
1227 return yystpcpy (yyres, yystr) - yyres;
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
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. */
1240 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1241 yytype_int16 *yyssp, int yytoken)
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
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.
1277 if (yytoken != YYEMPTY)
1279 int yyn = yypact[*yyssp];
1280 yyarg[yycount++] = yytname[yytoken];
1281 if (!yypact_value_is_default (yyn))
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;
1292 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1293 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1294 && !yytable_value_is_error (yytable[yyx + yyn]))
1296 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1302 yyarg[yycount++] = yytname[yyx];
1304 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1305 if (! (yysize <= yysize1
1306 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1316 # define YYCASE_(N, S) \
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"));
1330 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1331 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1336 if (*yymsg_alloc < yysize)
1338 *yymsg_alloc = 2 * yysize;
1339 if (! (yysize <= *yymsg_alloc
1340 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1341 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
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. */
1351 while ((*yyp = *yyformat) != '\0')
1352 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1354 yyp += yytnamerr (yyp, yyarg[yyi++]);
1365 #endif /* YYERROR_VERBOSE */
1367 /*-----------------------------------------------.
1368 | Release the memory associated to this symbol. |
1369 `-----------------------------------------------*/
1372 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1377 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1379 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1381 YY_IGNORE_MAYBE_UNINITIALIZED_END
1387 /* The lookahead symbol. */
1390 /* The semantic value of the lookahead symbol. */
1392 /* Number of syntax errors so far. */
1404 /* Number of tokens to shift before error messages enabled. */
1407 /* The stacks and their tools:
1408 'yyss': related to states.
1409 'yyvs': related to semantic values.
1411 Refer to the stacks through separate pointers, to allow yyoverflow
1412 to reallocate them elsewhere. */
1414 /* The state stack. */
1415 yytype_int16 yyssa[YYINITDEPTH];
1417 yytype_int16 *yyssp;
1419 /* The semantic value stack. */
1420 YYSTYPE yyvsa[YYINITDEPTH];
1424 YYSIZE_T yystacksize;
1428 /* Lookahead token as an internal (translated) token number. */
1430 /* The variables used to return semantic value and location from the
1435 /* Buffer for error messages, and its allocated size. */
1437 char *yymsg = yymsgbuf;
1438 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1441 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1443 /* The number of symbols on the RHS of the reduced rule.
1444 Keep to zero when no symbol should be popped. */
1447 yyssp = yyss = yyssa;
1448 yyvsp = yyvs = yyvsa;
1449 yystacksize = YYINITDEPTH;
1451 YYDPRINTF ((stderr, "Starting parse\n"));
1456 yychar = YYEMPTY; /* Cause a token to be read. */
1459 /*------------------------------------------------------------.
1460 | yynewstate -- Push a new state, which is found in yystate. |
1461 `------------------------------------------------------------*/
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. */
1470 if (yyss + yystacksize - 1 <= yyssp)
1472 /* Get the current used size of the three stacks, in elements. */
1473 YYSIZE_T yysize = yyssp - yyss + 1;
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
1480 YYSTYPE *yyvs1 = yyvs;
1481 yytype_int16 *yyss1 = yyss;
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),
1495 #else /* no yyoverflow */
1496 # ifndef YYSTACK_RELOCATE
1497 goto yyexhaustedlab;
1499 /* Extend the stack our own way. */
1500 if (YYMAXDEPTH <= yystacksize)
1501 goto yyexhaustedlab;
1503 if (YYMAXDEPTH < yystacksize)
1504 yystacksize = YYMAXDEPTH;
1507 yytype_int16 *yyss1 = yyss;
1508 union yyalloc *yyptr =
1509 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1511 goto yyexhaustedlab;
1512 YYSTACK_RELOCATE (yyss_alloc, yyss);
1513 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1514 # undef YYSTACK_RELOCATE
1516 YYSTACK_FREE (yyss1);
1519 #endif /* no yyoverflow */
1521 yyssp = yyss + yysize - 1;
1522 yyvsp = yyvs + yysize - 1;
1524 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1525 (unsigned long int) yystacksize));
1527 if (yyss + yystacksize - 1 <= yyssp)
1531 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1533 if (yystate == YYFINAL)
1543 /* Do appropriate processing given the current state. Read a
1544 lookahead token if we need one and don't already have one. */
1546 /* First try to decide what to do without reference to lookahead token. */
1547 yyn = yypact[yystate];
1548 if (yypact_value_is_default (yyn))
1551 /* Not known => get a lookahead token if don't already have one. */
1553 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1554 if (yychar == YYEMPTY)
1556 YYDPRINTF ((stderr, "Reading a token: "));
1560 if (yychar <= YYEOF)
1562 yychar = yytoken = YYEOF;
1563 YYDPRINTF ((stderr, "Now at end of input.\n"));
1567 yytoken = YYTRANSLATE (yychar);
1568 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1571 /* If the proper action on seeing token YYTOKEN is to reduce or to
1572 detect an error, take that action. */
1574 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1579 if (yytable_value_is_error (yyn))
1585 /* Count tokens shifted since error; after three, turn off error
1590 /* Shift the lookahead token. */
1591 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1593 /* Discard the shifted token. */
1597 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1599 YY_IGNORE_MAYBE_UNINITIALIZED_END
1604 /*-----------------------------------------------------------.
1605 | yydefault -- do the default action for the current state. |
1606 `-----------------------------------------------------------*/
1608 yyn = yydefact[yystate];
1614 /*-----------------------------.
1615 | yyreduce -- Do a reduction. |
1616 `-----------------------------*/
1618 /* yyn is the number of a rule to reduce with. */
1621 /* If YYLEN is nonzero, implement the default value of the action:
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];
1632 YY_REDUCE_PRINT (yyn);
1636 #line 184 "icalyacc.y" /* yacc.c:1646 */
1638 icalparser_yy_value = 0;
1639 icalparser_clear_flex_input();
1642 #line 1643 "icalyacc.c" /* yacc.c:1646 */
1646 #line 192 "icalyacc.y" /* yacc.c:1646 */
1648 struct icaltimetype stm;
1650 stm = fill_datetime((yyvsp[0].v_string),0);
1658 icalparser_yy_value = icalvalue_new_date(stm);
1660 #line 1661 "icalyacc.c" /* yacc.c:1646 */
1664 #line 207 "icalyacc.y" /* yacc.c:1646 */
1666 #line 1667 "icalyacc.c" /* yacc.c:1646 */
1670 #line 208 "icalyacc.y" /* yacc.c:1646 */
1672 #line 1673 "icalyacc.c" /* yacc.c:1646 */
1676 #line 212 "icalyacc.y" /* yacc.c:1646 */
1678 #line 1679 "icalyacc.c" /* yacc.c:1646 */
1682 #line 213 "icalyacc.y" /* yacc.c:1646 */
1684 #line 1685 "icalyacc.c" /* yacc.c:1646 */
1688 #line 217 "icalyacc.y" /* yacc.c:1646 */
1690 struct icaltimetype stm;
1691 stm = fill_datetime((yyvsp[-3].v_string), (yyvsp[-1].v_string));
1695 icalparser_yy_value =
1696 icalvalue_new_datetime(stm);
1698 #line 1699 "icalyacc.c" /* yacc.c:1646 */
1702 #line 235 "icalyacc.y" /* yacc.c:1646 */
1704 duration.weeks = atoi((yyvsp[-1].v_string));
1706 #line 1707 "icalyacc.c" /* yacc.c:1646 */
1710 #line 240 "icalyacc.y" /* yacc.c:1646 */
1713 #line 1714 "icalyacc.c" /* yacc.c:1646 */
1717 #line 243 "icalyacc.y" /* yacc.c:1646 */
1720 #line 1721 "icalyacc.c" /* yacc.c:1646 */
1724 #line 246 "icalyacc.y" /* yacc.c:1646 */
1727 #line 1728 "icalyacc.c" /* yacc.c:1646 */
1731 #line 250 "icalyacc.y" /* yacc.c:1646 */
1733 duration.hours = atoi((yyvsp[-1].v_string));
1735 #line 1736 "icalyacc.c" /* yacc.c:1646 */
1739 #line 254 "icalyacc.y" /* yacc.c:1646 */
1741 duration.hours = atoi((yyvsp[-2].v_string));
1743 #line 1744 "icalyacc.c" /* yacc.c:1646 */
1747 #line 259 "icalyacc.y" /* yacc.c:1646 */
1749 duration.minutes = atoi((yyvsp[-1].v_string));
1751 #line 1752 "icalyacc.c" /* yacc.c:1646 */
1755 #line 263 "icalyacc.y" /* yacc.c:1646 */
1757 duration.minutes = atoi((yyvsp[-2].v_string));
1759 #line 1760 "icalyacc.c" /* yacc.c:1646 */
1763 #line 268 "icalyacc.y" /* yacc.c:1646 */
1765 duration.seconds = atoi((yyvsp[-1].v_string));
1767 #line 1768 "icalyacc.c" /* yacc.c:1646 */
1771 #line 273 "icalyacc.y" /* yacc.c:1646 */
1773 duration.days = atoi((yyvsp[-1].v_string));
1775 #line 1776 "icalyacc.c" /* yacc.c:1646 */
1779 #line 278 "icalyacc.y" /* yacc.c:1646 */
1781 duration.is_neg = 0;
1783 #line 1784 "icalyacc.c" /* yacc.c:1646 */
1787 #line 282 "icalyacc.y" /* yacc.c:1646 */
1789 duration.is_neg = 0;
1791 #line 1792 "icalyacc.c" /* yacc.c:1646 */
1795 #line 286 "icalyacc.y" /* yacc.c:1646 */
1797 duration.is_neg = 1;
1799 #line 1800 "icalyacc.c" /* yacc.c:1646 */
1803 #line 291 "icalyacc.y" /* yacc.c:1646 */
1805 icalparser_yy_value = icalvalue_new_duration(duration);
1806 memset(&duration,0, sizeof(duration));
1808 #line 1809 "icalyacc.c" /* yacc.c:1646 */
1812 #line 296 "icalyacc.y" /* yacc.c:1646 */
1814 icalparser_yy_value = icalvalue_new_duration(duration);
1815 memset(&duration,0, sizeof(duration));
1817 #line 1818 "icalyacc.c" /* yacc.c:1646 */
1821 #line 301 "icalyacc.y" /* yacc.c:1646 */
1823 icalparser_yy_value = icalvalue_new_duration(duration);
1824 memset(&duration,0, sizeof(duration));
1826 #line 1827 "icalyacc.c" /* yacc.c:1646 */
1830 #line 310 "icalyacc.y" /* yacc.c:1646 */
1832 struct icalperiodtype p;
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;
1839 p.end = fill_datetime((yyvsp[-3].v_string),(yyvsp[-1].v_string));
1840 p.end.is_utc = utc_b;
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;
1849 icalparser_yy_value = icalvalue_new_period(p);
1851 #line 1852 "icalyacc.c" /* yacc.c:1646 */
1855 #line 331 "icalyacc.y" /* yacc.c:1646 */
1857 struct icalperiodtype p;
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;
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. */
1875 p.duration = icalvalue_get_duration(icalparser_yy_value);
1876 icalvalue_free(icalparser_yy_value);
1877 icalparser_yy_value = 0;
1879 icalparser_yy_value = icalvalue_new_period(p);
1882 #line 1883 "icalyacc.c" /* yacc.c:1646 */
1886 #line 361 "icalyacc.y" /* yacc.c:1646 */
1888 #line 1889 "icalyacc.c" /* yacc.c:1646 */
1892 #line 362 "icalyacc.y" /* yacc.c:1646 */
1894 #line 1895 "icalyacc.c" /* yacc.c:1646 */
1898 #line 366 "icalyacc.y" /* yacc.c:1646 */
1900 icalparser_yy_value = icalvalue_new_utcoffset( utcsign * ((yyvsp[-1].v_int)*3600) + ((yyvsp[0].v_int)*60) );
1902 #line 1903 "icalyacc.c" /* yacc.c:1646 */
1906 #line 371 "icalyacc.y" /* yacc.c:1646 */
1908 icalparser_yy_value = icalvalue_new_utcoffset(utcsign * ((yyvsp[-2].v_int)*3600) + ((yyvsp[-1].v_int)*60) +((yyvsp[0].v_int)));
1910 #line 1911 "icalyacc.c" /* yacc.c:1646 */
1914 #line 1915 "icalyacc.c" /* yacc.c:1646 */
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);
1932 YY_STACK_PRINT (yyss, yyssp);
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. */
1942 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1943 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1944 yystate = yytable[yystate];
1946 yystate = yydefgoto[yyn - YYNTOKENS];
1951 /*--------------------------------------.
1952 | yyerrlab -- here on detecting error. |
1953 `--------------------------------------*/
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);
1959 /* If not already recovering from an error, report this error. */
1963 #if ! YYERROR_VERBOSE
1964 yyerror (YY_("syntax error"));
1966 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1969 char const *yymsgp = YY_("syntax error");
1970 int yysyntax_error_status;
1971 yysyntax_error_status = YYSYNTAX_ERROR;
1972 if (yysyntax_error_status == 0)
1974 else if (yysyntax_error_status == 1)
1976 if (yymsg != yymsgbuf)
1977 YYSTACK_FREE (yymsg);
1978 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1982 yymsg_alloc = sizeof yymsgbuf;
1983 yysyntax_error_status = 2;
1987 yysyntax_error_status = YYSYNTAX_ERROR;
1992 if (yysyntax_error_status == 2)
1993 goto yyexhaustedlab;
1995 # undef YYSYNTAX_ERROR
2001 if (yyerrstatus == 3)
2003 /* If just tried and failed to reuse lookahead token after an
2004 error, discard it. */
2006 if (yychar <= YYEOF)
2008 /* Return failure if at end of input. */
2009 if (yychar == YYEOF)
2014 yydestruct ("Error: discarding",
2020 /* Else will try to reuse lookahead token after shifting the error
2025 /*---------------------------------------------------.
2026 | yyerrorlab -- error raised explicitly by YYERROR. |
2027 `---------------------------------------------------*/
2030 /* Pacify compilers like GCC when the user code never invokes
2031 YYERROR and the label yyerrorlab therefore never appears in user
2033 if (/*CONSTCOND*/ 0)
2036 /* Do not reclaim the symbols of the rule whose action triggered
2040 YY_STACK_PRINT (yyss, yyssp);
2045 /*-------------------------------------------------------------.
2046 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2047 `-------------------------------------------------------------*/
2049 yyerrstatus = 3; /* Each real token shifted decrements this. */
2053 yyn = yypact[yystate];
2054 if (!yypact_value_is_default (yyn))
2057 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2065 /* Pop the current state because it cannot handle the error token. */
2070 yydestruct ("Error: popping",
2071 yystos[yystate], yyvsp);
2074 YY_STACK_PRINT (yyss, yyssp);
2077 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2079 YY_IGNORE_MAYBE_UNINITIALIZED_END
2082 /* Shift the error token. */
2083 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2089 /*-------------------------------------.
2090 | yyacceptlab -- YYACCEPT comes here. |
2091 `-------------------------------------*/
2096 /*-----------------------------------.
2097 | yyabortlab -- YYABORT comes here. |
2098 `-----------------------------------*/
2103 #if !defined yyoverflow || YYERROR_VERBOSE
2104 /*-------------------------------------------------.
2105 | yyexhaustedlab -- memory exhaustion comes here. |
2106 `-------------------------------------------------*/
2108 yyerror (YY_("memory exhausted"));
2114 if (yychar != YYEMPTY)
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",
2122 /* Do not reclaim the symbols of the rule whose action triggered
2123 this YYABORT or YYACCEPT. */
2125 YY_STACK_PRINT (yyss, yyssp);
2126 while (yyssp != yyss)
2128 yydestruct ("Cleanup: popping",
2129 yystos[*yyssp], yyvsp);
2134 YYSTACK_FREE (yyss);
2137 if (yymsg != yymsgbuf)
2138 YYSTACK_FREE (yymsg);
2142 #line 375 "icalyacc.y" /* yacc.c:1906 */
2145 struct icaltimetype fill_datetime(char* datestr, char* timestr)
2147 struct icaltimetype stm;
2149 memset(&stm,0,sizeof(stm));
2152 sscanf(datestr,"%4d%2d%2d",&(stm.year), &(stm.month),
2157 sscanf(timestr,"%2d%2d%2d", &(stm.hour), &(stm.minute),
2165 void ical_yyerror(char* s)
2167 /*fprintf(stderr,"Parse error \'%s\'\n", s);*/