4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define yy_create_buffer ical_yy_create_buffer
9 #define yy_delete_buffer ical_yy_delete_buffer
10 #define yy_flex_debug ical_yy_flex_debug
11 #define yy_init_buffer ical_yy_init_buffer
12 #define yy_flush_buffer ical_yy_flush_buffer
13 #define yy_load_buffer_state ical_yy_load_buffer_state
14 #define yy_switch_to_buffer ical_yy_switch_to_buffer
15 #define yyin ical_yyin
16 #define yyleng ical_yyleng
17 #define yylex ical_yylex
18 #define yylineno ical_yylineno
19 #define yyout ical_yyout
20 #define yyrestart ical_yyrestart
21 #define yytext ical_yytext
22 #define yywrap ical_yywrap
23 #define yyalloc ical_yyalloc
24 #define yyrealloc ical_yyrealloc
25 #define yyfree ical_yyfree
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t;
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
76 /* Limits of integral types. */
78 #define INT8_MIN (-128)
81 #define INT16_MIN (-32767-1)
84 #define INT32_MIN (-2147483647-1)
87 #define INT8_MAX (127)
90 #define INT16_MAX (32767)
93 #define INT32_MAX (2147483647)
96 #define UINT8_MAX (255U)
99 #define UINT16_MAX (65535U)
102 #define UINT32_MAX (4294967295U)
107 #endif /* ! FLEXINT_H */
111 /* The "const" storage-class-modifier is valid. */
114 #else /* ! __cplusplus */
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
125 #define yyconst const
130 /* Returned upon end-of-file. */
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140 /* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
144 #define BEGIN (yy_start) = 1 + 2 *
146 /* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE ical_yyrestart(ical_yyin )
159 #define YY_END_OF_BUFFER_CHAR 0
161 /* Size of default input buffer. */
164 /* On IA-64, the buffer size is 16k, not 8k.
165 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
166 * Ditto for the __ia64__ case accordingly.
168 #define YY_BUF_SIZE 32768
170 #define YY_BUF_SIZE 16384
171 #endif /* __ia64__ */
174 /* The state buf must be large enough to hold one state per character in the main buffer.
176 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
178 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
179 #define YY_TYPEDEF_YY_BUFFER_STATE
180 typedef struct yy_buffer_state *YY_BUFFER_STATE;
183 extern int ical_yyleng;
185 extern FILE *ical_yyin, *ical_yyout;
187 #define EOB_ACT_CONTINUE_SCAN 0
188 #define EOB_ACT_END_OF_FILE 1
189 #define EOB_ACT_LAST_MATCH 2
191 #define YY_LESS_LINENO(n)
193 /* Return all but the first "n" matched characters back to the input stream. */
197 /* Undo effects of setting up ical_yytext. */ \
198 int yyless_macro_arg = (n); \
199 YY_LESS_LINENO(yyless_macro_arg);\
200 *yy_cp = (yy_hold_char); \
201 YY_RESTORE_YY_MORE_OFFSET \
202 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
203 YY_DO_BEFORE_ACTION; /* set up ical_yytext again */ \
207 #define unput(c) yyunput( c, (yytext_ptr) )
209 #ifndef YY_TYPEDEF_YY_SIZE_T
210 #define YY_TYPEDEF_YY_SIZE_T
211 typedef size_t yy_size_t;
214 #ifndef YY_STRUCT_YY_BUFFER_STATE
215 #define YY_STRUCT_YY_BUFFER_STATE
216 struct yy_buffer_state
220 char *yy_ch_buf; /* input buffer */
221 char *yy_buf_pos; /* current position in input buffer */
223 /* Size of input buffer in bytes, not including room for EOB
226 yy_size_t yy_buf_size;
228 /* Number of characters read into yy_ch_buf, not including EOB
233 /* Whether we "own" the buffer - i.e., we know we created it,
234 * and can realloc() it to grow it, and should free() it to
237 int yy_is_our_buffer;
239 /* Whether this is an "interactive" input source; if so, and
240 * if we're using stdio for input, then we want to use getc()
241 * instead of fread(), to make sure we stop fetching input after
244 int yy_is_interactive;
246 /* Whether we're considered to be at the beginning of a line.
247 * If so, '^' rules will be active on the next match, otherwise
252 int yy_bs_lineno; /**< The line count. */
253 int yy_bs_column; /**< The column count. */
255 /* Whether to try to fill the input buffer when we reach the
260 int yy_buffer_status;
262 #define YY_BUFFER_NEW 0
263 #define YY_BUFFER_NORMAL 1
264 /* When an EOF's been seen but there's still some text to process
265 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
266 * shouldn't try reading from the input source any more. We might
267 * still have a bunch of tokens to match, though, because of
268 * possible backing-up.
270 * When we actually see the EOF, we change the status to "new"
271 * (via ical_yyrestart()), so that the user can continue scanning by
272 * just pointing ical_yyin at a new input file.
274 #define YY_BUFFER_EOF_PENDING 2
277 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
279 /* Stack of input buffers. */
280 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
281 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
282 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
284 /* We provide macros for accessing buffer states in case in the
285 * future we want to put the buffer states in a more general
288 * Returns the top of the stack, or NULL.
290 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
291 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
294 /* Same as previous macro, but useful when we know that the buffer stack is not
295 * NULL or when we need an lvalue. For internal use only.
297 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
299 /* yy_hold_char holds the character lost when ical_yytext is formed. */
300 static char yy_hold_char;
301 static int yy_n_chars; /* number of characters read into yy_ch_buf */
304 /* Points to current character in buffer. */
305 static char *yy_c_buf_p = (char *) 0;
306 static int yy_init = 0; /* whether we need to initialize */
307 static int yy_start = 0; /* start state number */
309 /* Flag which is used to allow ical_yywrap()'s to do buffer switches
310 * instead of setting up a fresh ical_yyin. A bit of a hack ...
312 static int yy_did_buffer_switch_on_eof;
314 void ical_yyrestart (FILE *input_file );
315 void ical_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
316 YY_BUFFER_STATE ical_yy_create_buffer (FILE *file,int size );
317 void ical_yy_delete_buffer (YY_BUFFER_STATE b );
318 void ical_yy_flush_buffer (YY_BUFFER_STATE b );
319 void ical_yypush_buffer_state (YY_BUFFER_STATE new_buffer );
320 void ical_yypop_buffer_state (void );
322 static void ical_yyensure_buffer_stack (void );
323 static void ical_yy_load_buffer_state (void );
324 static void ical_yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
326 #define YY_FLUSH_BUFFER ical_yy_flush_buffer(YY_CURRENT_BUFFER )
328 YY_BUFFER_STATE ical_yy_scan_buffer (char *base,yy_size_t size );
329 YY_BUFFER_STATE ical_yy_scan_string (yyconst char *yy_str );
330 YY_BUFFER_STATE ical_yy_scan_bytes (yyconst char *bytes,int len );
332 void *ical_yyalloc (yy_size_t );
333 void *ical_yyrealloc (void *,yy_size_t );
334 void ical_yyfree (void * );
336 #define yy_new_buffer ical_yy_create_buffer
338 #define yy_set_interactive(is_interactive) \
340 if ( ! YY_CURRENT_BUFFER ){ \
341 ical_yyensure_buffer_stack (); \
342 YY_CURRENT_BUFFER_LVALUE = \
343 ical_yy_create_buffer(ical_yyin,YY_BUF_SIZE ); \
345 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
348 #define yy_set_bol(at_bol) \
350 if ( ! YY_CURRENT_BUFFER ){\
351 ical_yyensure_buffer_stack (); \
352 YY_CURRENT_BUFFER_LVALUE = \
353 ical_yy_create_buffer(ical_yyin,YY_BUF_SIZE ); \
355 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
358 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
360 /* Begin user sect3 */
362 typedef unsigned char YY_CHAR;
364 FILE *ical_yyin = (FILE *) 0, *ical_yyout = (FILE *) 0;
366 typedef int yy_state_type;
368 extern int ical_yylineno;
370 int ical_yylineno = 1;
372 extern char ical_yytext[];
374 static yy_state_type yy_get_previous_state (void );
375 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
376 static int yy_get_next_buffer (void );
377 static void yy_fatal_error (yyconst char msg[] );
379 /* Done after the current pattern has been matched and before the
380 * corresponding action - sets up ical_yytext.
382 #define YY_DO_BEFORE_ACTION \
383 (yytext_ptr) = yy_bp; \
384 ical_yyleng = (size_t) (yy_cp - yy_bp); \
385 (yy_hold_char) = *yy_cp; \
387 if ( ical_yyleng >= YYLMAX ) \
388 YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \
389 yy_flex_strncpy( ical_yytext, (yytext_ptr), ical_yyleng + 1 ); \
390 (yy_c_buf_p) = yy_cp;
392 #define YY_NUM_RULES 12
393 #define YY_END_OF_BUFFER 13
394 /* This struct is not used in this scanner,
395 but its presence is necessary. */
398 flex_int32_t yy_verify;
401 static yyconst flex_int16_t yy_accept[67] =
403 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
406 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
407 0, 0, 0, 0, 13, 12, 5, 12, 4, 1,
408 2, 3, 6, 12, 7, 12, 9, 10, 9, 11,
412 static yyconst flex_int32_t yy_ec[256] =
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
415 1, 1, 3, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 4, 5, 6, 1, 7, 8, 8, 8,
419 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 7, 1, 1,
421 1, 7, 1, 1, 1, 1, 7, 1, 1, 7,
422 1, 1, 7, 9, 1, 1, 7, 1, 1, 10,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,
425 1, 1, 1, 7, 1, 1, 1, 1, 7, 1,
426 1, 7, 1, 1, 7, 11, 1, 1, 7, 1,
427 1, 12, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
440 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444 static yyconst flex_int32_t yy_meta[13] =
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 static yyconst flex_int16_t yy_base[69] =
452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
454 0, 0, 11, 0, 18, 20, 0, 0, 0, 0,
455 0, 0, 0, 0, 0, 0, 27, 26, 0, 0,
456 0, 0, 0, 0, 30, 33, 33, 27, 33, 20,
457 33, 33, 33, 25, 33, 18, 33, 33, 23, 33,
458 33, 16, 33, 33, 33, 33, 17, 15
461 static yyconst flex_int16_t yy_def[69] =
463 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
464 66, 11, 67, 67, 67, 67, 67, 67, 67, 67,
465 67, 67, 67, 23, 68, 68, 67, 67, 67, 67,
466 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
467 67, 67, 67, 67, 66, 66, 66, 66, 66, 66,
468 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
469 66, 66, 66, 66, 66, 0, 66, 66
472 static yyconst flex_int16_t yy_nxt[46] =
474 46, 47, 48, 49, 46, 49, 49, 50, 51, 52,
475 51, 52, 53, 54, 55, 57, 55, 46, 56, 58,
476 59, 58, 59, 62, 65, 64, 63, 62, 61, 66,
477 60, 60, 45, 66, 66, 66, 66, 66, 66, 66,
481 static yyconst flex_int16_t yy_chk[46] =
483 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
484 11, 11, 23, 23, 23, 68, 23, 67, 23, 25,
485 25, 26, 26, 62, 59, 56, 54, 50, 48, 45,
486 38, 37, 66, 66, 66, 66, 66, 66, 66, 66,
490 static yy_state_type yy_last_accepting_state;
491 static char *yy_last_accepting_cpos;
493 extern int ical_yy_flex_debug;
494 int ical_yy_flex_debug = 0;
496 /* The intent behind this definition is that it'll catch
497 * any uses of REJECT which flex missed.
499 #define REJECT reject_used_but_not_detected
500 #define yymore() yymore_used_but_not_detected
501 #define YY_MORE_ADJ 0
502 #define YY_RESTORE_YY_MORE_OFFSET
507 char ical_yytext[YYLMAX];
509 #line 1 "icallexer.l"
510 #line 2 "icallexer.l"
512 ======================================================================
514 CREATOR: eric 10 June 1999
521 (C) COPYRIGHT 1999 Eric Busboom
522 http://www.softwarestudio.org
524 The contents of this file are subject to the Mozilla Public License
525 Version 1.0 (the "License"); you may not use this file except in
526 compliance with the License. You may obtain a copy of the License at
527 http://www.mozilla.org/MPL/
529 Software distributed under the License is distributed on an "AS IS"
530 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
531 the License for the specific language governing rights and
532 limitations under the License.
534 The original author is Eric Busboom
535 The original code is icalitip.y
539 ======================================================================*/
540 #include "icalparser.h"
541 #include "icalenums.h"
542 #include "icalmemory.h"
544 #include "icalyacc.h"
546 #include <string.h> /* For strdup() */
548 int icalparser_flex_input(char* buf, int max_size);
549 void icalparser_clear_flex_input(void);
552 #define ICAL_MAX_STR_CONST 1024
555 #define YY_INPUT(b,r,ms) ( r= icalparser_flex_input(b,ms))
558 #undef YY_FATAL_ERROR
559 #define YY_FATAL_ERROR(msg) ical_yyerror(msg)
561 icalvalue_kind value_kind=ICAL_NO_VALUE;
562 void set_parser_value_state(icalvalue_kind kind);
565 void ical_yyerror(char *s);
567 void init_str_buf(void);
573 size_t buf_sz; /* = ICAL_MAX_STR_CONST;*/
578 #line 579 "icallexer.c"
581 #define quoted_string 1
582 #define binary_value 2
583 #define boolean_value 3
586 #define duration_value 6
587 #define number_value 7
588 #define period_value 8
589 #define recur_value 9
590 #define text_value 10
591 #define utcoffset_value 11
592 #define enum_param_value 12
593 #define string_param_value 13
594 #define stringlist_param_value 14
596 #define line_start 16
600 #define end_of_value 20
603 #ifndef YY_NO_UNISTD_H
604 /* Special case for "unistd.h", since it is non-ANSI. We include it way
605 * down here because we want the user's section 1 to have been scanned first.
606 * The user has a chance to override it with an option.
611 #ifndef YY_EXTRA_TYPE
612 #define YY_EXTRA_TYPE void *
615 static int yy_init_globals (void );
617 /* Accessor methods to globals.
618 These are made visible to non-reentrant scanners for convenience. */
620 int ical_yylex_destroy (void );
622 int ical_yyget_debug (void );
624 void ical_yyset_debug (int debug_flag );
626 YY_EXTRA_TYPE ical_yyget_extra (void );
628 void ical_yyset_extra (YY_EXTRA_TYPE user_defined );
630 FILE *ical_yyget_in (void );
632 void ical_yyset_in (FILE * in_str );
634 FILE *ical_yyget_out (void );
636 void ical_yyset_out (FILE * out_str );
638 int ical_yyget_leng (void );
640 char *ical_yyget_text (void );
642 int ical_yyget_lineno (void );
644 void ical_yyset_lineno (int line_number );
646 /* Macros after this point can all be overridden by user definitions in
650 #ifndef YY_SKIP_YYWRAP
652 extern "C" int ical_yywrap (void );
654 extern int ical_yywrap (void );
658 static void yyunput (int c,char *buf_ptr );
661 static void yy_flex_strncpy (char *,yyconst char *,int );
664 #ifdef YY_NEED_STRLEN
665 static int yy_flex_strlen (yyconst char * );
671 static int yyinput (void );
673 static int input (void );
678 /* Amount of stuff to slurp up with each read. */
679 #ifndef YY_READ_BUF_SIZE
681 /* On IA-64, the buffer size is 16k, not 8k */
682 #define YY_READ_BUF_SIZE 16384
684 #define YY_READ_BUF_SIZE 8192
685 #endif /* __ia64__ */
688 /* Copy whatever the last rule matched to the standard output. */
690 /* This used to be an fputs(), but since the string might contain NUL's,
691 * we now use fwrite().
693 #define ECHO do { if (fwrite( ical_yytext, ical_yyleng, 1, ical_yyout )) {} } while (0)
696 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
697 * is returned in "result".
700 #define YY_INPUT(buf,result,max_size) \
701 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
705 for ( n = 0; n < max_size && \
706 (c = getc( ical_yyin )) != EOF && c != '\n'; ++n ) \
709 buf[n++] = (char) c; \
710 if ( c == EOF && ferror( ical_yyin ) ) \
711 YY_FATAL_ERROR( "input in flex scanner failed" ); \
717 while ( (result = fread(buf, 1, max_size, ical_yyin))==0 && ferror(ical_yyin)) \
719 if( errno != EINTR) \
721 YY_FATAL_ERROR( "input in flex scanner failed" ); \
725 clearerr(ical_yyin); \
732 /* No semi-colon after return; correct usage is to write "yyterminate();" -
733 * we don't want an extra ';' after the "return" because that will cause
734 * some compilers to complain about unreachable statements.
737 #define yyterminate() return YY_NULL
740 /* Number of entries by which start-condition stack grows. */
741 #ifndef YY_START_STACK_INCR
742 #define YY_START_STACK_INCR 25
745 /* Report a fatal error. */
746 #ifndef YY_FATAL_ERROR
747 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
750 /* end tables serialization structures and prototypes */
752 /* Default declaration of generated scanner - a define so the user can
753 * easily add parameters.
756 #define YY_DECL_IS_OURS 1
758 extern int ical_yylex (void);
760 #define YY_DECL int ical_yylex (void)
761 #endif /* !YY_DECL */
763 /* Code executed at the beginning of each rule, after ical_yytext and ical_yyleng
766 #ifndef YY_USER_ACTION
767 #define YY_USER_ACTION
770 /* Code executed at the end of each rule. */
772 #define YY_BREAK break;
775 #define YY_RULE_SETUP \
778 /** The main scanner function which does all the work.
782 register yy_state_type yy_current_state;
783 register char *yy_cp, *yy_bp;
786 #line 91 "icallexer.l"
794 #line 795 "icallexer.c"
805 (yy_start) = 1; /* first start state */
813 if ( ! YY_CURRENT_BUFFER ) {
814 ical_yyensure_buffer_stack ();
815 YY_CURRENT_BUFFER_LVALUE =
816 ical_yy_create_buffer(ical_yyin,YY_BUF_SIZE );
819 ical_yy_load_buffer_state( );
822 while ( 1 ) /* loops until end-of-file is reached */
824 yy_cp = (yy_c_buf_p);
826 /* Support of ical_yytext. */
827 *yy_cp = (yy_hold_char);
829 /* yy_bp points to the position in yy_ch_buf of the start of
834 yy_current_state = (yy_start);
838 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
839 if ( yy_accept[yy_current_state] )
841 (yy_last_accepting_state) = yy_current_state;
842 (yy_last_accepting_cpos) = yy_cp;
844 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
846 yy_current_state = (int) yy_def[yy_current_state];
847 if ( yy_current_state >= 67 )
848 yy_c = yy_meta[(unsigned int) yy_c];
850 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
853 while ( yy_base[yy_current_state] != 33 );
856 yy_act = yy_accept[yy_current_state];
858 { /* have to back up */
859 yy_cp = (yy_last_accepting_cpos);
860 yy_current_state = (yy_last_accepting_state);
861 yy_act = yy_accept[yy_current_state];
866 do_action: /* This label is used only to access EOF actions. */
869 { /* beginning of action switch */
870 case 0: /* must back up */
871 /* undo the effects of YY_DO_BEFORE_ACTION */
872 *yy_cp = (yy_hold_char);
873 yy_cp = (yy_last_accepting_cpos);
874 yy_current_state = (yy_last_accepting_state);
879 #line 99 "icallexer.l"
880 { ical_yylval.v_string =icalmemory_tmp_copy(ical_yytext) ;
885 #line 101 "icallexer.l"
886 { return TIME_CHAR; }
890 #line 102 "icallexer.l"
895 #line 103 "icallexer.l"
896 { return ical_yytext[0]; }
899 /* rule 5 can match eol */
901 #line 104 "icallexer.l"
907 /* rule 6 can match eol */
909 #line 109 "icallexer.l"
914 #line 110 "icallexer.l"
915 { return ical_yytext[0]; }
919 #line 111 "icallexer.l"
920 { ical_yylval.v_int=atoi(ical_yytext); return INTNUMBER; }
926 #line 116 "icallexer.l"
927 { return CHARACTER; }
930 /* rule 10 can match eol */
932 #line 117 "icallexer.l"
939 #line 122 "icallexer.l"
940 { BEGIN(last_state); return COMMA; }
945 #line 126 "icallexer.l"
948 #line 949 "icallexer.c"
949 case YY_STATE_EOF(INITIAL):
950 case YY_STATE_EOF(quoted_string):
951 case YY_STATE_EOF(binary_value):
952 case YY_STATE_EOF(boolean_value):
953 case YY_STATE_EOF(uri_value):
954 case YY_STATE_EOF(time_value):
955 case YY_STATE_EOF(duration_value):
956 case YY_STATE_EOF(number_value):
957 case YY_STATE_EOF(period_value):
958 case YY_STATE_EOF(recur_value):
959 case YY_STATE_EOF(text_value):
960 case YY_STATE_EOF(utcoffset_value):
961 case YY_STATE_EOF(enum_param_value):
962 case YY_STATE_EOF(string_param_value):
963 case YY_STATE_EOF(stringlist_param_value):
964 case YY_STATE_EOF(keyword):
965 case YY_STATE_EOF(line_start):
966 case YY_STATE_EOF(component):
967 case YY_STATE_EOF(seperator):
968 case YY_STATE_EOF(parameter):
969 case YY_STATE_EOF(end_of_value):
970 case YY_STATE_EOF(paramtext):
973 case YY_END_OF_BUFFER:
975 /* Amount of text matched not including the EOB char. */
976 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
978 /* Undo the effects of YY_DO_BEFORE_ACTION. */
979 *yy_cp = (yy_hold_char);
980 YY_RESTORE_YY_MORE_OFFSET
982 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
984 /* We're scanning a new file or input source. It's
985 * possible that this happened because the user
986 * just pointed ical_yyin at a new source and called
987 * ical_yylex(). If so, then we have to assure
988 * consistency between YY_CURRENT_BUFFER and our
989 * globals. Here is the right place to do so, because
990 * this is the first action (other than possibly a
991 * back-up) that will match for the new input source.
993 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
994 YY_CURRENT_BUFFER_LVALUE->yy_input_file = ical_yyin;
995 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
998 /* Note that here we test for yy_c_buf_p "<=" to the position
999 * of the first EOB in the buffer, since yy_c_buf_p will
1000 * already have been incremented past the NUL character
1001 * (since all states make transitions on EOB to the
1002 * end-of-buffer state). Contrast this with the test
1005 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1006 { /* This was really a NUL. */
1007 yy_state_type yy_next_state;
1009 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1011 yy_current_state = yy_get_previous_state( );
1013 /* Okay, we're now positioned to make the NUL
1014 * transition. We couldn't have
1015 * yy_get_previous_state() go ahead and do it
1016 * for us because it doesn't know how to deal
1017 * with the possibility of jamming (and we don't
1018 * want to build jamming into it because then it
1019 * will run more slowly).
1022 yy_next_state = yy_try_NUL_trans( yy_current_state );
1024 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1026 if ( yy_next_state )
1028 /* Consume the NUL. */
1029 yy_cp = ++(yy_c_buf_p);
1030 yy_current_state = yy_next_state;
1036 yy_cp = (yy_c_buf_p);
1037 goto yy_find_action;
1041 else switch ( yy_get_next_buffer( ) )
1043 case EOB_ACT_END_OF_FILE:
1045 (yy_did_buffer_switch_on_eof) = 0;
1047 if ( ical_yywrap( ) )
1049 /* Note: because we've taken care in
1050 * yy_get_next_buffer() to have set up
1051 * ical_yytext, we can now set up
1052 * yy_c_buf_p so that if some total
1053 * hoser (like flex itself) wants to
1054 * call the scanner after we return the
1055 * YY_NULL, it'll still work - another
1056 * YY_NULL will get returned.
1058 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1060 yy_act = YY_STATE_EOF(YY_START);
1066 if ( ! (yy_did_buffer_switch_on_eof) )
1072 case EOB_ACT_CONTINUE_SCAN:
1074 (yytext_ptr) + yy_amount_of_matched_text;
1076 yy_current_state = yy_get_previous_state( );
1078 yy_cp = (yy_c_buf_p);
1079 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1082 case EOB_ACT_LAST_MATCH:
1084 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1086 yy_current_state = yy_get_previous_state( );
1088 yy_cp = (yy_c_buf_p);
1089 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1090 goto yy_find_action;
1097 "fatal flex scanner internal error--no action found" );
1098 } /* end of action switch */
1099 } /* end of scanning one token */
1100 } /* end of ical_yylex */
1102 /* yy_get_next_buffer - try to read in a new buffer
1104 * Returns a code representing an action:
1105 * EOB_ACT_LAST_MATCH -
1106 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1107 * EOB_ACT_END_OF_FILE - end of file
1109 static int yy_get_next_buffer (void)
1111 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1112 register char *source = (yytext_ptr);
1113 register int number_to_move, i;
1116 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1118 "fatal flex scanner internal error--end of buffer missed" );
1120 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1121 { /* Don't try to fill the buffer, so this is an EOF. */
1122 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1124 /* We matched a single character, the EOB, so
1125 * treat this as a final EOF.
1127 return EOB_ACT_END_OF_FILE;
1132 /* We matched some text prior to the EOB, first
1135 return EOB_ACT_LAST_MATCH;
1139 /* Try to read more data. */
1141 /* First move last chars to start of buffer. */
1142 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1144 for ( i = 0; i < number_to_move; ++i )
1145 *(dest++) = *(source++);
1147 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1148 /* don't do the read, it's not guaranteed to return an EOF,
1151 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1156 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1158 while ( num_to_read <= 0 )
1159 { /* Not enough room in the buffer - grow it. */
1161 /* just a shorter name for the current buffer */
1162 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1164 int yy_c_buf_p_offset =
1165 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1167 if ( b->yy_is_our_buffer )
1169 int new_size = b->yy_buf_size * 2;
1171 if ( new_size <= 0 )
1172 b->yy_buf_size += b->yy_buf_size / 8;
1174 b->yy_buf_size *= 2;
1176 b->yy_ch_buf = (char *)
1177 /* Include room in for 2 EOB chars. */
1178 ical_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1181 /* Can't grow it, we don't own it. */
1184 if ( ! b->yy_ch_buf )
1186 "fatal error - scanner input buffer overflow" );
1188 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1190 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1195 if ( num_to_read > YY_READ_BUF_SIZE )
1196 num_to_read = YY_READ_BUF_SIZE;
1198 /* Read in more data. */
1199 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1200 (yy_n_chars), (size_t) num_to_read );
1202 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1205 if ( (yy_n_chars) == 0 )
1207 if ( number_to_move == YY_MORE_ADJ )
1209 ret_val = EOB_ACT_END_OF_FILE;
1210 ical_yyrestart(ical_yyin );
1215 ret_val = EOB_ACT_LAST_MATCH;
1216 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1217 YY_BUFFER_EOF_PENDING;
1222 ret_val = EOB_ACT_CONTINUE_SCAN;
1224 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1225 /* Extend the array by 50%, plus the number we really need. */
1226 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1227 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ical_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1228 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1229 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1232 (yy_n_chars) += number_to_move;
1233 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1234 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1236 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1241 /* yy_get_previous_state - get the state just before the EOB char was reached */
1243 static yy_state_type yy_get_previous_state (void)
1245 register yy_state_type yy_current_state;
1246 register char *yy_cp;
1248 yy_current_state = (yy_start);
1250 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1252 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1253 if ( yy_accept[yy_current_state] )
1255 (yy_last_accepting_state) = yy_current_state;
1256 (yy_last_accepting_cpos) = yy_cp;
1258 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1260 yy_current_state = (int) yy_def[yy_current_state];
1261 if ( yy_current_state >= 67 )
1262 yy_c = yy_meta[(unsigned int) yy_c];
1264 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1267 return yy_current_state;
1270 /* yy_try_NUL_trans - try to make a transition on the NUL character
1273 * next_state = yy_try_NUL_trans( current_state );
1275 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1277 register int yy_is_jam;
1278 register char *yy_cp = (yy_c_buf_p);
1280 register YY_CHAR yy_c = 1;
1281 if ( yy_accept[yy_current_state] )
1283 (yy_last_accepting_state) = yy_current_state;
1284 (yy_last_accepting_cpos) = yy_cp;
1286 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1288 yy_current_state = (int) yy_def[yy_current_state];
1289 if ( yy_current_state >= 67 )
1290 yy_c = yy_meta[(unsigned int) yy_c];
1292 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1293 yy_is_jam = (yy_current_state == 66);
1295 return yy_is_jam ? 0 : yy_current_state;
1298 static void yyunput (int c, register char * yy_bp )
1300 register char *yy_cp;
1302 yy_cp = (yy_c_buf_p);
1304 /* undo effects of setting up ical_yytext */
1305 *yy_cp = (yy_hold_char);
1307 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1308 { /* need to shift things up to make room */
1309 /* +2 for EOB chars. */
1310 register int number_to_move = (yy_n_chars) + 2;
1311 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1312 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1313 register char *source =
1314 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1316 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1317 *--dest = *--source;
1319 yy_cp += (int) (dest - source);
1320 yy_bp += (int) (dest - source);
1321 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1322 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1324 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1325 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1328 *--yy_cp = (char) c;
1330 (yytext_ptr) = yy_bp;
1331 (yy_hold_char) = *yy_cp;
1332 (yy_c_buf_p) = yy_cp;
1337 static int yyinput (void)
1339 static int input (void)
1345 *(yy_c_buf_p) = (yy_hold_char);
1347 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1349 /* yy_c_buf_p now points to the character we want to return.
1350 * If this occurs *before* the EOB characters, then it's a
1351 * valid NUL; if not, then we've hit the end of the buffer.
1353 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1354 /* This was really a NUL. */
1355 *(yy_c_buf_p) = '\0';
1358 { /* need more input */
1359 int offset = (yy_c_buf_p) - (yytext_ptr);
1362 switch ( yy_get_next_buffer( ) )
1364 case EOB_ACT_LAST_MATCH:
1365 /* This happens because yy_g_n_b()
1366 * sees that we've accumulated a
1367 * token and flags that we need to
1368 * try matching the token before
1369 * proceeding. But for input(),
1370 * there's no matching to consider.
1371 * So convert the EOB_ACT_LAST_MATCH
1372 * to EOB_ACT_END_OF_FILE.
1375 /* Reset buffer status. */
1376 ical_yyrestart(ical_yyin );
1380 case EOB_ACT_END_OF_FILE:
1382 if ( ical_yywrap( ) )
1385 if ( ! (yy_did_buffer_switch_on_eof) )
1394 case EOB_ACT_CONTINUE_SCAN:
1395 (yy_c_buf_p) = (yytext_ptr) + offset;
1401 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1402 *(yy_c_buf_p) = '\0'; /* preserve ical_yytext */
1403 (yy_hold_char) = *++(yy_c_buf_p);
1407 #endif /* ifndef YY_NO_INPUT */
1409 /** Immediately switch to a different input stream.
1410 * @param input_file A readable stream.
1412 * @note This function does not reset the start condition to @c INITIAL .
1414 void ical_yyrestart (FILE * input_file )
1417 if ( ! YY_CURRENT_BUFFER ){
1418 ical_yyensure_buffer_stack ();
1419 YY_CURRENT_BUFFER_LVALUE =
1420 ical_yy_create_buffer(ical_yyin,YY_BUF_SIZE );
1423 ical_yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1424 ical_yy_load_buffer_state( );
1427 /** Switch to a different input buffer.
1428 * @param new_buffer The new input buffer.
1431 void ical_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1434 /* TODO. We should be able to replace this entire function body
1436 * ical_yypop_buffer_state();
1437 * ical_yypush_buffer_state(new_buffer);
1439 ical_yyensure_buffer_stack ();
1440 if ( YY_CURRENT_BUFFER == new_buffer )
1443 if ( YY_CURRENT_BUFFER )
1445 /* Flush out information for old buffer. */
1446 *(yy_c_buf_p) = (yy_hold_char);
1447 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1448 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1451 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1452 ical_yy_load_buffer_state( );
1454 /* We don't actually know whether we did this switch during
1455 * EOF (ical_yywrap()) processing, but the only time this flag
1456 * is looked at is after ical_yywrap() is called, so it's safe
1457 * to go ahead and always set it.
1459 (yy_did_buffer_switch_on_eof) = 1;
1462 static void ical_yy_load_buffer_state (void)
1464 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1465 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1466 ical_yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1467 (yy_hold_char) = *(yy_c_buf_p);
1470 /** Allocate and initialize an input buffer state.
1471 * @param file A readable stream.
1472 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1474 * @return the allocated buffer state.
1476 YY_BUFFER_STATE ical_yy_create_buffer (FILE * file, int size )
1480 b = (YY_BUFFER_STATE) ical_yyalloc(sizeof( struct yy_buffer_state ) );
1482 YY_FATAL_ERROR( "out of dynamic memory in ical_yy_create_buffer()" );
1484 b->yy_buf_size = size;
1486 /* yy_ch_buf has to be 2 characters longer than the size given because
1487 * we need to put in 2 end-of-buffer characters.
1489 b->yy_ch_buf = (char *) ical_yyalloc(b->yy_buf_size + 2 );
1490 if ( ! b->yy_ch_buf )
1491 YY_FATAL_ERROR( "out of dynamic memory in ical_yy_create_buffer()" );
1493 b->yy_is_our_buffer = 1;
1495 ical_yy_init_buffer(b,file );
1500 /** Destroy the buffer.
1501 * @param b a buffer created with ical_yy_create_buffer()
1504 void ical_yy_delete_buffer (YY_BUFFER_STATE b )
1510 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1511 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1513 if ( b->yy_is_our_buffer )
1514 ical_yyfree((void *) b->yy_ch_buf );
1516 ical_yyfree((void *) b );
1520 extern int isatty (int );
1521 #endif /* __cplusplus */
1523 /* Initializes or reinitializes a buffer.
1524 * This function is sometimes called more than once on the same buffer,
1525 * such as during a ical_yyrestart() or at EOF.
1527 static void ical_yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1532 ical_yy_flush_buffer(b );
1534 b->yy_input_file = file;
1535 b->yy_fill_buffer = 1;
1537 /* If b is the current buffer, then ical_yy_init_buffer was _probably_
1538 * called from ical_yyrestart() or through yy_get_next_buffer.
1539 * In that case, we don't want to reset the lineno or column.
1541 if (b != YY_CURRENT_BUFFER){
1542 b->yy_bs_lineno = 1;
1543 b->yy_bs_column = 0;
1546 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1551 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1552 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1555 void ical_yy_flush_buffer (YY_BUFFER_STATE b )
1562 /* We always need two end-of-buffer characters. The first causes
1563 * a transition to the end-of-buffer state. The second causes
1564 * a jam in that state.
1566 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1567 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1569 b->yy_buf_pos = &b->yy_ch_buf[0];
1572 b->yy_buffer_status = YY_BUFFER_NEW;
1574 if ( b == YY_CURRENT_BUFFER )
1575 ical_yy_load_buffer_state( );
1578 /** Pushes the new state onto the stack. The new state becomes
1579 * the current state. This function will allocate the stack
1581 * @param new_buffer The new state.
1584 void ical_yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1586 if (new_buffer == NULL)
1589 ical_yyensure_buffer_stack();
1591 /* This block is copied from ical_yy_switch_to_buffer. */
1592 if ( YY_CURRENT_BUFFER )
1594 /* Flush out information for old buffer. */
1595 *(yy_c_buf_p) = (yy_hold_char);
1596 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1597 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1600 /* Only push if top exists. Otherwise, replace top. */
1601 if (YY_CURRENT_BUFFER)
1602 (yy_buffer_stack_top)++;
1603 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1605 /* copied from ical_yy_switch_to_buffer. */
1606 ical_yy_load_buffer_state( );
1607 (yy_did_buffer_switch_on_eof) = 1;
1610 /** Removes and deletes the top of the stack, if present.
1611 * The next element becomes the new top.
1614 void ical_yypop_buffer_state (void)
1616 if (!YY_CURRENT_BUFFER)
1619 ical_yy_delete_buffer(YY_CURRENT_BUFFER );
1620 YY_CURRENT_BUFFER_LVALUE = NULL;
1621 if ((yy_buffer_stack_top) > 0)
1622 --(yy_buffer_stack_top);
1624 if (YY_CURRENT_BUFFER) {
1625 ical_yy_load_buffer_state( );
1626 (yy_did_buffer_switch_on_eof) = 1;
1630 /* Allocates the stack if it does not exist.
1631 * Guarantees space for at least one push.
1633 static void ical_yyensure_buffer_stack (void)
1637 if (!(yy_buffer_stack)) {
1639 /* First allocation is just for 2 elements, since we don't know if this
1640 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1641 * immediate realloc on the next call.
1644 (yy_buffer_stack) = (struct yy_buffer_state**)ical_yyalloc
1645 (num_to_alloc * sizeof(struct yy_buffer_state*)
1647 if ( ! (yy_buffer_stack) )
1648 YY_FATAL_ERROR( "out of dynamic memory in ical_yyensure_buffer_stack()" );
1650 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1652 (yy_buffer_stack_max) = num_to_alloc;
1653 (yy_buffer_stack_top) = 0;
1657 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1659 /* Increase the buffer to prepare for a possible push. */
1660 int grow_size = 8 /* arbitrary grow size */;
1662 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1663 (yy_buffer_stack) = (struct yy_buffer_state**)ical_yyrealloc
1665 num_to_alloc * sizeof(struct yy_buffer_state*)
1667 if ( ! (yy_buffer_stack) )
1668 YY_FATAL_ERROR( "out of dynamic memory in ical_yyensure_buffer_stack()" );
1670 /* zero only the new slots.*/
1671 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1672 (yy_buffer_stack_max) = num_to_alloc;
1676 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1677 * @param base the character buffer
1678 * @param size the size in bytes of the character buffer
1680 * @return the newly allocated buffer state object.
1682 YY_BUFFER_STATE ical_yy_scan_buffer (char * base, yy_size_t size )
1687 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1688 base[size-1] != YY_END_OF_BUFFER_CHAR )
1689 /* They forgot to leave room for the EOB's. */
1692 b = (YY_BUFFER_STATE) ical_yyalloc(sizeof( struct yy_buffer_state ) );
1694 YY_FATAL_ERROR( "out of dynamic memory in ical_yy_scan_buffer()" );
1696 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1697 b->yy_buf_pos = b->yy_ch_buf = base;
1698 b->yy_is_our_buffer = 0;
1699 b->yy_input_file = 0;
1700 b->yy_n_chars = b->yy_buf_size;
1701 b->yy_is_interactive = 0;
1703 b->yy_fill_buffer = 0;
1704 b->yy_buffer_status = YY_BUFFER_NEW;
1706 ical_yy_switch_to_buffer(b );
1711 /** Setup the input buffer state to scan a string. The next call to ical_yylex() will
1712 * scan from a @e copy of @a str.
1713 * @param yystr a NUL-terminated string to scan
1715 * @return the newly allocated buffer state object.
1716 * @note If you want to scan bytes that may contain NUL values, then use
1717 * ical_yy_scan_bytes() instead.
1719 YY_BUFFER_STATE ical_yy_scan_string (yyconst char * yystr )
1722 return ical_yy_scan_bytes(yystr,strlen(yystr) );
1725 /** Setup the input buffer state to scan the given bytes. The next call to ical_yylex() will
1726 * scan from a @e copy of @a bytes.
1727 * @param yybytes the byte buffer to scan
1728 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1730 * @return the newly allocated buffer state object.
1732 YY_BUFFER_STATE ical_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1739 /* Get memory for full buffer, including space for trailing EOB's. */
1740 n = _yybytes_len + 2;
1741 buf = (char *) ical_yyalloc(n );
1743 YY_FATAL_ERROR( "out of dynamic memory in ical_yy_scan_bytes()" );
1745 for ( i = 0; i < _yybytes_len; ++i )
1746 buf[i] = yybytes[i];
1748 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1750 b = ical_yy_scan_buffer(buf,n );
1752 YY_FATAL_ERROR( "bad buffer in ical_yy_scan_bytes()" );
1754 /* It's okay to grow etc. this buffer, and we should throw it
1755 * away when we're done.
1757 b->yy_is_our_buffer = 1;
1762 #ifndef YY_EXIT_FAILURE
1763 #define YY_EXIT_FAILURE 2
1766 static void yy_fatal_error (yyconst char* msg )
1768 (void) fprintf( stderr, "%s\n", msg );
1769 exit( YY_EXIT_FAILURE );
1772 /* Redefine yyless() so it works in section 3 code. */
1778 /* Undo effects of setting up ical_yytext. */ \
1779 int yyless_macro_arg = (n); \
1780 YY_LESS_LINENO(yyless_macro_arg);\
1781 ical_yytext[ical_yyleng] = (yy_hold_char); \
1782 (yy_c_buf_p) = ical_yytext + yyless_macro_arg; \
1783 (yy_hold_char) = *(yy_c_buf_p); \
1784 *(yy_c_buf_p) = '\0'; \
1785 ical_yyleng = yyless_macro_arg; \
1789 /* Accessor methods (get/set functions) to struct members. */
1791 /** Get the current line number.
1794 int ical_yyget_lineno (void)
1797 return ical_yylineno;
1800 /** Get the input stream.
1803 FILE *ical_yyget_in (void)
1808 /** Get the output stream.
1811 FILE *ical_yyget_out (void)
1816 /** Get the length of the current token.
1819 int ical_yyget_leng (void)
1824 /** Get the current token.
1828 char *ical_yyget_text (void)
1833 /** Set the current line number.
1834 * @param line_number
1837 void ical_yyset_lineno (int line_number )
1840 ical_yylineno = line_number;
1843 /** Set the input stream. This does not discard the current
1845 * @param in_str A readable stream.
1847 * @see ical_yy_switch_to_buffer
1849 void ical_yyset_in (FILE * in_str )
1851 ical_yyin = in_str ;
1854 void ical_yyset_out (FILE * out_str )
1856 ical_yyout = out_str ;
1859 int ical_yyget_debug (void)
1861 return ical_yy_flex_debug;
1864 void ical_yyset_debug (int bdebug )
1866 ical_yy_flex_debug = bdebug ;
1869 static int yy_init_globals (void)
1871 /* Initialization is the same as for the non-reentrant scanner.
1872 * This function is called from ical_yylex_destroy(), so don't allocate here.
1875 (yy_buffer_stack) = 0;
1876 (yy_buffer_stack_top) = 0;
1877 (yy_buffer_stack_max) = 0;
1878 (yy_c_buf_p) = (char *) 0;
1882 /* Defined in main.c */
1885 ical_yyout = stdout;
1887 ical_yyin = (FILE *) 0;
1888 ical_yyout = (FILE *) 0;
1891 /* For future reference: Set errno on error, since we are called by
1897 /* ical_yylex_destroy is for both reentrant and non-reentrant scanners. */
1898 int ical_yylex_destroy (void)
1901 /* Pop the buffer stack, destroying each element. */
1902 while(YY_CURRENT_BUFFER){
1903 ical_yy_delete_buffer(YY_CURRENT_BUFFER );
1904 YY_CURRENT_BUFFER_LVALUE = NULL;
1905 ical_yypop_buffer_state();
1908 /* Destroy the stack itself. */
1909 ical_yyfree((yy_buffer_stack) );
1910 (yy_buffer_stack) = NULL;
1912 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1913 * ical_yylex() is called, initialization will occur. */
1920 * Internal utility routines.
1924 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1927 for ( i = 0; i < n; ++i )
1932 #ifdef YY_NEED_STRLEN
1933 static int yy_flex_strlen (yyconst char * s )
1936 for ( n = 0; s[n]; ++n )
1943 void *ical_yyalloc (yy_size_t size )
1945 return (void *) malloc( size );
1948 void *ical_yyrealloc (void * ptr, yy_size_t size )
1950 /* The cast to (char *) in the following accommodates both
1951 * implementations that use char* generic pointers, and those
1952 * that use void* generic pointers. It works with the latter
1953 * because both ANSI C and C++ allow castless assignment from
1954 * any pointer type to void*, and deal with argument conversions
1955 * as though doing an assignment.
1957 return (void *) realloc( (char *) ptr, size );
1960 void ical_yyfree (void * ptr )
1962 free( (char *) ptr ); /* see ical_yyrealloc() for (char *) cast */
1965 #define YYTABLES_NAME "yytables"
1967 #line 126 "icallexer.l"
1977 void set_parser_value_state(icalvalue_kind kind)
1982 case ICAL_UTCOFFSET_VALUE:
1983 {BEGIN(utcoffset_value);break;}
1985 case ICAL_DATETIMEPERIOD_VALUE:
1986 case ICAL_DURATION_VALUE:
1987 case ICAL_PERIOD_VALUE:
1988 {BEGIN(time_value);break;}
1997 void init_str_buf(void)
1999 str_buf = icalmemory_tmp_buffer(ICAL_MAX_STR_CONST);
2000 str_buf_p = str_buf;
2001 buf_sz = ICAL_MAX_STR_CONST;