1 #line 2 "sieve/sieve-lex.c"
2 
3 #line 4 "sieve/sieve-lex.c"
4 
5 #define  YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer sieve_create_buffer
10 #define yy_delete_buffer sieve_delete_buffer
11 #define yy_scan_buffer sieve_scan_buffer
12 #define yy_scan_string sieve_scan_string
13 #define yy_scan_bytes sieve_scan_bytes
14 #define yy_init_buffer sieve_init_buffer
15 #define yy_flush_buffer sieve_flush_buffer
16 #define yy_load_buffer_state sieve_load_buffer_state
17 #define yy_switch_to_buffer sieve_switch_to_buffer
18 #define yypush_buffer_state sievepush_buffer_state
19 #define yypop_buffer_state sievepop_buffer_state
20 #define yyensure_buffer_stack sieveensure_buffer_stack
21 #define yy_flex_debug sieve_flex_debug
22 #define yyin sievein
23 #define yyleng sieveleng
24 #define yylex sievelex
25 #define yylineno sievelineno
26 #define yyout sieveout
27 #define yyrestart sieverestart
28 #define yytext sievetext
29 #define yywrap sievewrap
30 #define yyalloc sievealloc
31 #define yyrealloc sieverealloc
32 #define yyfree sievefree
33 
34 #define FLEX_SCANNER
35 #define YY_FLEX_MAJOR_VERSION 2
36 #define YY_FLEX_MINOR_VERSION 6
37 #define YY_FLEX_SUBMINOR_VERSION 4
38 #if YY_FLEX_SUBMINOR_VERSION > 0
39 #define FLEX_BETA
40 #endif
41 
42 #ifdef yy_create_buffer
43 #define sieve_create_buffer_ALREADY_DEFINED
44 #else
45 #define yy_create_buffer sieve_create_buffer
46 #endif
47 
48 #ifdef yy_delete_buffer
49 #define sieve_delete_buffer_ALREADY_DEFINED
50 #else
51 #define yy_delete_buffer sieve_delete_buffer
52 #endif
53 
54 #ifdef yy_scan_buffer
55 #define sieve_scan_buffer_ALREADY_DEFINED
56 #else
57 #define yy_scan_buffer sieve_scan_buffer
58 #endif
59 
60 #ifdef yy_scan_string
61 #define sieve_scan_string_ALREADY_DEFINED
62 #else
63 #define yy_scan_string sieve_scan_string
64 #endif
65 
66 #ifdef yy_scan_bytes
67 #define sieve_scan_bytes_ALREADY_DEFINED
68 #else
69 #define yy_scan_bytes sieve_scan_bytes
70 #endif
71 
72 #ifdef yy_init_buffer
73 #define sieve_init_buffer_ALREADY_DEFINED
74 #else
75 #define yy_init_buffer sieve_init_buffer
76 #endif
77 
78 #ifdef yy_flush_buffer
79 #define sieve_flush_buffer_ALREADY_DEFINED
80 #else
81 #define yy_flush_buffer sieve_flush_buffer
82 #endif
83 
84 #ifdef yy_load_buffer_state
85 #define sieve_load_buffer_state_ALREADY_DEFINED
86 #else
87 #define yy_load_buffer_state sieve_load_buffer_state
88 #endif
89 
90 #ifdef yy_switch_to_buffer
91 #define sieve_switch_to_buffer_ALREADY_DEFINED
92 #else
93 #define yy_switch_to_buffer sieve_switch_to_buffer
94 #endif
95 
96 #ifdef yypush_buffer_state
97 #define sievepush_buffer_state_ALREADY_DEFINED
98 #else
99 #define yypush_buffer_state sievepush_buffer_state
100 #endif
101 
102 #ifdef yypop_buffer_state
103 #define sievepop_buffer_state_ALREADY_DEFINED
104 #else
105 #define yypop_buffer_state sievepop_buffer_state
106 #endif
107 
108 #ifdef yyensure_buffer_stack
109 #define sieveensure_buffer_stack_ALREADY_DEFINED
110 #else
111 #define yyensure_buffer_stack sieveensure_buffer_stack
112 #endif
113 
114 #ifdef yylex
115 #define sievelex_ALREADY_DEFINED
116 #else
117 #define yylex sievelex
118 #endif
119 
120 #ifdef yyrestart
121 #define sieverestart_ALREADY_DEFINED
122 #else
123 #define yyrestart sieverestart
124 #endif
125 
126 #ifdef yylex_init
127 #define sievelex_init_ALREADY_DEFINED
128 #else
129 #define yylex_init sievelex_init
130 #endif
131 
132 #ifdef yylex_init_extra
133 #define sievelex_init_extra_ALREADY_DEFINED
134 #else
135 #define yylex_init_extra sievelex_init_extra
136 #endif
137 
138 #ifdef yylex_destroy
139 #define sievelex_destroy_ALREADY_DEFINED
140 #else
141 #define yylex_destroy sievelex_destroy
142 #endif
143 
144 #ifdef yyget_debug
145 #define sieveget_debug_ALREADY_DEFINED
146 #else
147 #define yyget_debug sieveget_debug
148 #endif
149 
150 #ifdef yyset_debug
151 #define sieveset_debug_ALREADY_DEFINED
152 #else
153 #define yyset_debug sieveset_debug
154 #endif
155 
156 #ifdef yyget_extra
157 #define sieveget_extra_ALREADY_DEFINED
158 #else
159 #define yyget_extra sieveget_extra
160 #endif
161 
162 #ifdef yyset_extra
163 #define sieveset_extra_ALREADY_DEFINED
164 #else
165 #define yyset_extra sieveset_extra
166 #endif
167 
168 #ifdef yyget_in
169 #define sieveget_in_ALREADY_DEFINED
170 #else
171 #define yyget_in sieveget_in
172 #endif
173 
174 #ifdef yyset_in
175 #define sieveset_in_ALREADY_DEFINED
176 #else
177 #define yyset_in sieveset_in
178 #endif
179 
180 #ifdef yyget_out
181 #define sieveget_out_ALREADY_DEFINED
182 #else
183 #define yyget_out sieveget_out
184 #endif
185 
186 #ifdef yyset_out
187 #define sieveset_out_ALREADY_DEFINED
188 #else
189 #define yyset_out sieveset_out
190 #endif
191 
192 #ifdef yyget_leng
193 #define sieveget_leng_ALREADY_DEFINED
194 #else
195 #define yyget_leng sieveget_leng
196 #endif
197 
198 #ifdef yyget_text
199 #define sieveget_text_ALREADY_DEFINED
200 #else
201 #define yyget_text sieveget_text
202 #endif
203 
204 #ifdef yyget_lineno
205 #define sieveget_lineno_ALREADY_DEFINED
206 #else
207 #define yyget_lineno sieveget_lineno
208 #endif
209 
210 #ifdef yyset_lineno
211 #define sieveset_lineno_ALREADY_DEFINED
212 #else
213 #define yyset_lineno sieveset_lineno
214 #endif
215 
216 #ifdef yywrap
217 #define sievewrap_ALREADY_DEFINED
218 #else
219 #define yywrap sievewrap
220 #endif
221 
222 #ifdef yyalloc
223 #define sievealloc_ALREADY_DEFINED
224 #else
225 #define yyalloc sievealloc
226 #endif
227 
228 #ifdef yyrealloc
229 #define sieverealloc_ALREADY_DEFINED
230 #else
231 #define yyrealloc sieverealloc
232 #endif
233 
234 #ifdef yyfree
235 #define sievefree_ALREADY_DEFINED
236 #else
237 #define yyfree sievefree
238 #endif
239 
240 #ifdef yytext
241 #define sievetext_ALREADY_DEFINED
242 #else
243 #define yytext sievetext
244 #endif
245 
246 #ifdef yyleng
247 #define sieveleng_ALREADY_DEFINED
248 #else
249 #define yyleng sieveleng
250 #endif
251 
252 #ifdef yyin
253 #define sievein_ALREADY_DEFINED
254 #else
255 #define yyin sievein
256 #endif
257 
258 #ifdef yyout
259 #define sieveout_ALREADY_DEFINED
260 #else
261 #define yyout sieveout
262 #endif
263 
264 #ifdef yy_flex_debug
265 #define sieve_flex_debug_ALREADY_DEFINED
266 #else
267 #define yy_flex_debug sieve_flex_debug
268 #endif
269 
270 #ifdef yylineno
271 #define sievelineno_ALREADY_DEFINED
272 #else
273 #define yylineno sievelineno
274 #endif
275 
276 /* First, we deal with  platform-specific or compiler-specific issues. */
277 
278 /* begin standard C headers. */
279 #include <stdio.h>
280 #include <string.h>
281 #include <errno.h>
282 #include <stdlib.h>
283 
284 /* end standard C headers. */
285 
286 /* flex integer type definitions */
287 
288 #ifndef FLEXINT_H
289 #define FLEXINT_H
290 
291 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
292 
293 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
294 
295 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
296  * if you want the limit (max/min) macros for int types.
297  */
298 #ifndef __STDC_LIMIT_MACROS
299 #define __STDC_LIMIT_MACROS 1
300 #endif
301 
302 #include <inttypes.h>
303 typedef int8_t flex_int8_t;
304 typedef uint8_t flex_uint8_t;
305 typedef int16_t flex_int16_t;
306 typedef uint16_t flex_uint16_t;
307 typedef int32_t flex_int32_t;
308 typedef uint32_t flex_uint32_t;
309 #else
310 typedef signed char flex_int8_t;
311 typedef short int flex_int16_t;
312 typedef int flex_int32_t;
313 typedef unsigned char flex_uint8_t;
314 typedef unsigned short int flex_uint16_t;
315 typedef unsigned int flex_uint32_t;
316 
317 /* Limits of integral types. */
318 #ifndef INT8_MIN
319 #define INT8_MIN               (-128)
320 #endif
321 #ifndef INT16_MIN
322 #define INT16_MIN              (-32767-1)
323 #endif
324 #ifndef INT32_MIN
325 #define INT32_MIN              (-2147483647-1)
326 #endif
327 #ifndef INT8_MAX
328 #define INT8_MAX               (127)
329 #endif
330 #ifndef INT16_MAX
331 #define INT16_MAX              (32767)
332 #endif
333 #ifndef INT32_MAX
334 #define INT32_MAX              (2147483647)
335 #endif
336 #ifndef UINT8_MAX
337 #define UINT8_MAX              (255U)
338 #endif
339 #ifndef UINT16_MAX
340 #define UINT16_MAX             (65535U)
341 #endif
342 #ifndef UINT32_MAX
343 #define UINT32_MAX             (4294967295U)
344 #endif
345 
346 #ifndef SIZE_MAX
347 #define SIZE_MAX               (~(size_t)0)
348 #endif
349 
350 #endif /* ! C99 */
351 
352 #endif /* ! FLEXINT_H */
353 
354 /* begin standard C++ headers. */
355 
356 /* TODO: this is always defined, so inline it */
357 #define yyconst const
358 
359 #if defined(__GNUC__) && __GNUC__ >= 3
360 #define yynoreturn __attribute__((__noreturn__))
361 #else
362 #define yynoreturn
363 #endif
364 
365 /* Returned upon end-of-file. */
366 #define YY_NULL 0
367 
368 /* Promotes a possibly negative, possibly signed char to an
369  *   integer in range [0..255] for use as an array index.
370  */
371 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
372 
373 /* Enter a start condition.  This macro really ought to take a parameter,
374  * but we do it the disgusting crufty way forced on us by the ()-less
375  * definition of BEGIN.
376  */
377 #define BEGIN (yy_start) = 1 + 2 *
378 /* Translate the current start state into a value that can be later handed
379  * to BEGIN to return to the state.  The YYSTATE alias is for lex
380  * compatibility.
381  */
382 #define YY_START (((yy_start) - 1) / 2)
383 #define YYSTATE YY_START
384 /* Action number for EOF rule of a given start state. */
385 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
386 /* Special action meaning "start processing a new file". */
387 #define YY_NEW_FILE yyrestart( yyin  )
388 #define YY_END_OF_BUFFER_CHAR 0
389 
390 /* Size of default input buffer. */
391 #ifndef YY_BUF_SIZE
392 #ifdef __ia64__
393 /* On IA-64, the buffer size is 16k, not 8k.
394  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
395  * Ditto for the __ia64__ case accordingly.
396  */
397 #define YY_BUF_SIZE 32768
398 #else
399 #define YY_BUF_SIZE 16384
400 #endif /* __ia64__ */
401 #endif
402 
403 /* The state buf must be large enough to hold one state per character in the main buffer.
404  */
405 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
406 
407 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
408 #define YY_TYPEDEF_YY_BUFFER_STATE
409 typedef struct yy_buffer_state *YY_BUFFER_STATE;
410 #endif
411 
412 #ifndef YY_TYPEDEF_YY_SIZE_T
413 #define YY_TYPEDEF_YY_SIZE_T
414 typedef size_t yy_size_t;
415 #endif
416 
417 extern int yyleng;
418 
419 extern FILE *yyin, *yyout;
420 
421 #define EOB_ACT_CONTINUE_SCAN 0
422 #define EOB_ACT_END_OF_FILE 1
423 #define EOB_ACT_LAST_MATCH 2
424 
425     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
426      *       access to the local variable yy_act. Since yyless() is a macro, it would break
427      *       existing scanners that call yyless() from OUTSIDE yylex.
428      *       One obvious solution it to make yy_act a global. I tried that, and saw
429      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
430      *       normally declared as a register variable-- so it is not worth it.
431      */
432     #define  YY_LESS_LINENO(n) \
433             do { \
434                 int yyl;\
435                 for ( yyl = n; yyl < yyleng; ++yyl )\
436                     if ( yytext[yyl] == '\n' )\
437                         --yylineno;\
438             }while(0)
439     #define YY_LINENO_REWIND_TO(dst) \
440             do {\
441                 const char *p;\
442                 for ( p = yy_cp-1; p >= (dst); --p)\
443                     if ( *p == '\n' )\
444                         --yylineno;\
445             }while(0)
446 
447 /* Return all but the first "n" matched characters back to the input stream. */
448 #define yyless(n) \
449 	do \
450 		{ \
451 		/* Undo effects of setting up yytext. */ \
452         int yyless_macro_arg = (n); \
453         YY_LESS_LINENO(yyless_macro_arg);\
454 		*yy_cp = (yy_hold_char); \
455 		YY_RESTORE_YY_MORE_OFFSET \
456 		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
457 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
458 		} \
459 	while ( 0 )
460 #define unput(c) yyunput( c, (yytext_ptr)  )
461 
462 #ifndef YY_STRUCT_YY_BUFFER_STATE
463 #define YY_STRUCT_YY_BUFFER_STATE
464 struct yy_buffer_state
465 	{
466 	FILE *yy_input_file;
467 
468 	char *yy_ch_buf;		/* input buffer */
469 	char *yy_buf_pos;		/* current position in input buffer */
470 
471 	/* Size of input buffer in bytes, not including room for EOB
472 	 * characters.
473 	 */
474 	int yy_buf_size;
475 
476 	/* Number of characters read into yy_ch_buf, not including EOB
477 	 * characters.
478 	 */
479 	int yy_n_chars;
480 
481 	/* Whether we "own" the buffer - i.e., we know we created it,
482 	 * and can realloc() it to grow it, and should free() it to
483 	 * delete it.
484 	 */
485 	int yy_is_our_buffer;
486 
487 	/* Whether this is an "interactive" input source; if so, and
488 	 * if we're using stdio for input, then we want to use getc()
489 	 * instead of fread(), to make sure we stop fetching input after
490 	 * each newline.
491 	 */
492 	int yy_is_interactive;
493 
494 	/* Whether we're considered to be at the beginning of a line.
495 	 * If so, '^' rules will be active on the next match, otherwise
496 	 * not.
497 	 */
498 	int yy_at_bol;
499 
500     int yy_bs_lineno; /**< The line count. */
501     int yy_bs_column; /**< The column count. */
502 
503 	/* Whether to try to fill the input buffer when we reach the
504 	 * end of it.
505 	 */
506 	int yy_fill_buffer;
507 
508 	int yy_buffer_status;
509 
510 #define YY_BUFFER_NEW 0
511 #define YY_BUFFER_NORMAL 1
512 	/* When an EOF's been seen but there's still some text to process
513 	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
514 	 * shouldn't try reading from the input source any more.  We might
515 	 * still have a bunch of tokens to match, though, because of
516 	 * possible backing-up.
517 	 *
518 	 * When we actually see the EOF, we change the status to "new"
519 	 * (via yyrestart()), so that the user can continue scanning by
520 	 * just pointing yyin at a new input file.
521 	 */
522 #define YY_BUFFER_EOF_PENDING 2
523 
524 	};
525 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
526 
527 /* Stack of input buffers. */
528 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
529 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
530 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
531 
532 /* We provide macros for accessing buffer states in case in the
533  * future we want to put the buffer states in a more general
534  * "scanner state".
535  *
536  * Returns the top of the stack, or NULL.
537  */
538 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
539                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
540                           : NULL)
541 /* Same as previous macro, but useful when we know that the buffer stack is not
542  * NULL or when we need an lvalue. For internal use only.
543  */
544 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
545 
546 /* yy_hold_char holds the character lost when yytext is formed. */
547 static char yy_hold_char;
548 static int yy_n_chars;		/* number of characters read into yy_ch_buf */
549 int yyleng;
550 
551 /* Points to current character in buffer. */
552 static char *yy_c_buf_p = NULL;
553 static int yy_init = 0;		/* whether we need to initialize */
554 static int yy_start = 0;	/* start state number */
555 
556 /* Flag which is used to allow yywrap()'s to do buffer switches
557  * instead of setting up a fresh yyin.  A bit of a hack ...
558  */
559 static int yy_did_buffer_switch_on_eof;
560 
561 void yyrestart ( FILE *input_file  );
562 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer  );
563 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size  );
564 void yy_delete_buffer ( YY_BUFFER_STATE b  );
565 void yy_flush_buffer ( YY_BUFFER_STATE b  );
566 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer  );
567 void yypop_buffer_state ( void );
568 
569 static void yyensure_buffer_stack ( void );
570 static void yy_load_buffer_state ( void );
571 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file  );
572 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
573 
574 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size  );
575 YY_BUFFER_STATE yy_scan_string ( const char *yy_str  );
576 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len  );
577 
578 void *yyalloc ( yy_size_t  );
579 void *yyrealloc ( void *, yy_size_t  );
580 void yyfree ( void *  );
581 
582 #define yy_new_buffer yy_create_buffer
583 #define yy_set_interactive(is_interactive) \
584 	{ \
585 	if ( ! YY_CURRENT_BUFFER ){ \
586         yyensure_buffer_stack (); \
587 		YY_CURRENT_BUFFER_LVALUE =    \
588             yy_create_buffer( yyin, YY_BUF_SIZE ); \
589 	} \
590 	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
591 	}
592 #define yy_set_bol(at_bol) \
593 	{ \
594 	if ( ! YY_CURRENT_BUFFER ){\
595         yyensure_buffer_stack (); \
596 		YY_CURRENT_BUFFER_LVALUE =    \
597             yy_create_buffer( yyin, YY_BUF_SIZE ); \
598 	} \
599 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
600 	}
601 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
602 
603 /* Begin user sect3 */
604 
605 #define sievewrap() (/*CONSTCOND*/1)
606 #define YY_SKIP_YYWRAP
607 typedef flex_uint8_t YY_CHAR;
608 
609 FILE *yyin = NULL, *yyout = NULL;
610 
611 typedef int yy_state_type;
612 
613 extern int yylineno;
614 int yylineno = 1;
615 
616 extern char *yytext;
617 #ifdef yytext_ptr
618 #undef yytext_ptr
619 #endif
620 #define yytext_ptr yytext
621 
622 static yy_state_type yy_get_previous_state ( void );
623 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  );
624 static int yy_get_next_buffer ( void );
625 static void yynoreturn yy_fatal_error ( const char* msg  );
626 
627 /* Done after the current pattern has been matched and before the
628  * corresponding action - sets up yytext.
629  */
630 #define YY_DO_BEFORE_ACTION \
631 	(yytext_ptr) = yy_bp; \
632 	yyleng = (int) (yy_cp - yy_bp); \
633 	(yy_hold_char) = *yy_cp; \
634 	*yy_cp = '\0'; \
635 	(yy_c_buf_p) = yy_cp;
636 #define YY_NUM_RULES 155
637 #define YY_END_OF_BUFFER 156
638 /* This struct is not used in this scanner,
639    but its presence is necessary. */
640 struct yy_trans_info
641 	{
642 	flex_int32_t yy_verify;
643 	flex_int32_t yy_nxt;
644 	};
645 static const flex_int16_t yy_accept[816] =
646     {   0,
647         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
648         0,    0,  156,  154,  153,  153,    7,  152,  154,    8,
649       154,  154,  154,  154,  154,  154,  154,  154,  154,  154,
650       154,  154,  154,  154,  154,  154,  154,  154,  154,    5,
651         5,    5,    3,    5,   32,   32,  154,   72,   72,  154,
652       104,  104,  154,  152,    0,    8,    8,    0,    0,    0,
653         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
654         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
655         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
656         0,    0,    0,    0,    0,    0,    9,    0,    0,    0,
657 
658         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
659         0,    0,    0,    0,    0,    2,    2,    1,    4,    0,
660        36,    0,    0,   79,    0,    0,    0,    0,    0,  108,
661         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
662         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
663         0,  111,    0,    0,   37,    0,    0,    0,    0,    0,
664         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
665         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
666         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
667         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
668 
669         0,    0,    0,    0,    0,  143,    0,    0,    0,   19,
670         0,    0,    0,    0,    0,    0,   55,    0,    0,    0,
671         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
672         0,    0,    0,    0,  105,  106,  107,    0,  151,    0,
673        44,    0,    0,    0,    0,    0,    0,    0,    0,    0,
674         0,    0,  140,    0,    0,    0,    0,    0,    0,    0,
675         0,    0,    0,    0,    0,  112,    0,    0,    0,    0,
676         0,    0,    0,    0,    0,    0,    0,    0,    0,   50,
677         0,    0,  128,    0,    0,    0,    0,    0,    0,    0,
678         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
679 
680        49,    0,   87,    0,    0,    0,    0,   11,    0,    0,
681         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
682         0,   27,    0,   85,    0,    0,    0,    0,    0,    0,
683         0,    0,    0,   23,    0,    0,   13,    0,    0,   18,
684         0,    0,    0,    0,    0,   73,   76,   75,   78,   77,
685        74,  151,    0,    0,    0,    0,    0,    0,    0,   30,
686         0,    0,   63,    0,    0,    0,    0,   66,    0,    0,
687         0,  114,    0,    0,   92,    0,   42,    0,    0,    0,
688         0,    0,    0,   68,    0,    0,  133,    0,    0,   24,
689         0,    0,    0,    0,    0,    0,    0,   51,  150,    0,
690 
691         0,    0,   47,    0,    0,   89,    0,    0,    0,   15,
692        14,    0,    0,    0,    0,    0,   10,    0,    0,    0,
693       116,    0,   17,    0,    0,    0,  115,    0,    0,    0,
694         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
695         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
696         0,    0,    0,    0,    0,    0,   70,    0,    0,    0,
697         0,   84,    0,    0,    0,    0,   91,    0,    0,   56,
698         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
699        40,    0,    0,    0,    0,   25,    0,   57,   71,    0,
700         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
701 
702         0,   16,    0,    0,   20,    0,    0,    0,    0,   99,
703         0,   95,    0,    0,  134,    0,    0,  145,    0,   54,
704         0,    6,    6,    0,   86,    0,    0,    0,    0,    0,
705         0,  125,    0,    0,    0,    0,    0,  118,   48,   46,
706         0,  131,   67,  136,    0,   61,    0,    0,    0,    0,
707         0,  110,  113,  127,    0,    0,    0,    0,    0,    0,
708         0,    0,    0,    0,    0,    0,   81,    0,   21,    0,
709         0,    0,   26,    0,    0,    0,   96,    0,   83,  129,
710         0,    0,    0,    0,    0,    0,   12,    0,   80,    0,
711         0,    6,    0,    0,    0,    0,    0,    0,    0,    0,
712 
713         0,  126,    0,    0,   52,    0,    0,    0,    0,  146,
714        39,  101,    0,  100,    0,    0,    0,    0,    0,   69,
715         0,   65,    0,    0,    0,    0,    0,    0,  109,    0,
716        22,    0,   28,    0,    0,    0,  119,    0,   29,    0,
717         0,    0,    6,   62,    0,    0,    0,    0,  147,    0,
718         0,    0,    0,   38,    0,    0,    0,    0,    0,  132,
719         0,  130,    0,    0,    0,    0,  137,    0,  149,   93,
720         0,    0,  135,    0,  144,    0,    0,    0,    0,    0,
721         0,    0,    0,    0,    0,   33,   64,    0,    0,    0,
722       102,    0,   45,    0,  142,    0,    0,    0,    0,    0,
723 
724         0,    0,    0,    0,    0,    0,    0,    0,   82,    0,
725         0,    0,    0,    0,    0,    0,    0,   31,  103,   58,
726         0,   41,    0,    0,  139,   59,   90,    0,   53,    0,
727         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
728         0,    0,    0,  148,   94,    0,    0,    0,    0,    0,
729         0,    0,    0,    0,    0,    0,    0,   88,    0,  117,
730         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
731         0,   60,    0,  120,    0,  121,    0,   43,    0,    0,
732         0,  124,  123,  141,    0,    0,    0,    0,    0,    0,
733         0,    0,    0,    0,    0,    0,    0,    0,  138,    0,
734 
735        34,   35,    0,    0,    0,    0,    0,   98,    0,  122,
736         0,    0,    0,   97,    0
737     } ;
738 
739 static const YY_CHAR yy_ec[256] =
740     {   0,
741         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
742         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
743         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
744         1,    2,    1,    5,    6,    1,    1,    1,    1,    1,
745         1,    7,    1,    1,    8,    9,   10,   11,   12,   13,
746        14,   11,   11,   11,   11,   11,   11,   15,   16,    1,
747         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
748        17,    1,    1,    1,   17,    1,   17,    1,    1,    1,
749         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
750         1,   18,    1,    1,   19,    1,   20,   21,   22,   23,
751 
752        24,   25,   26,   27,   28,   29,   30,   31,   32,   33,
753        34,   35,   36,   37,   38,   39,   40,   41,   42,   43,
754        44,   45,    1,    1,    1,    1,    1,    1,    1,    1,
755         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
756         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
757         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
758         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
759         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
760         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
761         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
762 
763         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
764         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
765         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
766         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
767         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
768         1,    1,    1,    1,    1
769     } ;
770 
771 static const YY_CHAR yy_meta[46] =
772     {   0,
773         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
774         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
775         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
776         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
777         1,    1,    1,    1,    1
778     } ;
779 
780 static const flex_int16_t yy_base[825] =
781     {   0,
782         0,    0,  896,   43,   44,   45,   51,   55,   62,   66,
783        70,   74,  898,  900,  900,  900,  900,    0,  890,   69,
784        82,   61,  862,  855,  105,   54,   68,   69,  101,  862,
785       869,  858,  111,  857,  866,  108,   74,  856,  868,  900,
786       900,  135,  900,    0,  900,  900,  125,  900,  900,  132,
787       900,  900,  137,    0,  880,    0,  900,  117,  842,  118,
788       137,  852,  137,  853,  142,  144,  155,  160,  849,  157,
789       858,  841,  140,  161,  148,  162,  860,  855,  844,  854,
790       845,  831,  851,  836,  833,  171,  833,  835,  831,  827,
791       149,  839,  835,  834,  826,  843,  900,  842,  839,  840,
792 
793       835,  832,  141,  818,  817,  176,  170,  810,  820,  829,
794       169,  809,  811,  818,  188,  900,  846,  900,  900,  843,
795       900,  206,  842,  900,  182,  208,  209,  211,  841,  900,
796       840,  839,  838,  835,  210,  818,  809,  189,  191,  815,
797       794,  798,  804,  813,  812,  813,  798,  797,  797,  809,
798       802,  900,  792,  803,  900,  787,  791,  785,  203,  199,
799       191,  790,  197,  799,  781,  791,  794,  780,  782,  773,
800       211,  792,  789,  791,  768,  782,  216,  774,  784,  776,
801       782,  772,  215,  770,  769,  758,  764,  776,  775,  764,
802       775,  765,  225,  227,  766,  760,  755,  754,  767,  765,
803 
804       766,  747,  756,  751,  750,  900,  753,  753,  762,  753,
805       752,  755,  744,  737,  736,  734,  749,  749,  738,  749,
806       735,  741,  729,  743,  746,  745,  736,  236,  758,  757,
807       756,  755,  754,  753,  900,  900,  900,  247,  900,   75,
808       900,  723,  230,  721,  716,  710,  720,  732,  713,  730,
809       729,  714,  900,  721,  714,  724,  721,  720,  715,  707,
810       716,  700,  712,  698,  716,  711,  703,  711,  694,  704,
811       706,  697,  700,  703,  698,  699,  687,  685,  683,  900,
812       697,  686,  900,  685,  696,  688,  677,  692,  690,  677,
813       688,  674,  670,  679,  684,  676,  682,  681,  679,  678,
814 
815       900,  678,  900,  662,  661,  679,  670,  900,  672,  665,
816       658,  670,  656,  653,  667,  662,  658,  664,  663,  646,
817       649,  900,  663,  900,  660,  657,  644,  658,  638,  650,
818       640,  652,  644,  900,  629,  645,  900,  639,  656,  900,
819       633,  630,  645,  241,  254,  900,  900,  900,  900,  900,
820       900,  660,  635,  641,  641,  631,  642,  641,  240,  900,
821       621,  620,  900,  630,  629,  633,  617,  900,  634,  622,
822       628,  900,  614,  607,  900,  610,  900,  617,  610,  625,
823       618,  624,  609,  900,  622,  616,  900,  606,  611,  900,
824       604,  613,  593,  594,  601,  605,  608,  900,  900,  594,
825 
826       590,  592,  900,  604,  604,  900,  606,  605,  586,  900,
827       900,  590,  598,  593,  583,  597,  900,  584,  583,  594,
828       900,  577,  900,  581,  593,  575,  900,  588,  570,  575,
829       588,  563,  582,  566,  580,  566,  569,  564,  580,  575,
830       578,  571,  259,  566,  567,  575,  261,  263,  573,  554,
831       567,  566,  567,  551,  559,  553,  900,  561,  553,  550,
832       558,  900,  550,  556,  542,  539,  900,  550,  541,  550,
833       540,  549,  546,  548,  539,  525,  535,  534,  533,  232,
834       900,  541,  541,  543,  540,  900,  537,  535,  900,  539,
835       532,  534,  518,  516,  527,  528,  529,  531,  515,  516,
836 
837       509,  900,  508,  520,  900,  521,  520,  500,  503,  522,
838       518,  900,  514,  514,  900,  505,  510,  900,  504,  900,
839       269,  900,  531,  274,  900,  499,  256,  276,  277,  506,
840       493,  900,  266,  506,  509,  495,  488,  900,  900,  900,
841       486,  900,  900,  900,  505,  900,  504,  495,  479,  483,
842       496,  900,  900,  900,  267,  499,  498,  493,  488,  490,
843       476,  482,  473,  483,  482,  465,  900,  484,  900,  484,
844       482,  461,  900,  465,  479,  470,  900,  467,  900,  900,
845       463,  260,  479,  466,  458,  465,  900,  471,  900,  454,
846       287,  289,  460,  449,  457,  280,  289,  452,  465,  467,
847 
848       463,  900,  447,  447,  900,  447,  450,  445,  444,  452,
849       900,  900,  448,  900,  447,  446,  450,  444,  443,  900,
850       433,  900,  449,  434,  432,  432,  448,  447,  900,  442,
851       900,  441,  900,  420,  420,  439,  437,  436,  900,  439,
852       419,  419,  900,  900,  417,  416,  290,  449,  900,  415,
853       414,  420,  416,  900,  418,  426,  408,  408,  422,  900,
854       399,  900,  419,  419,  421,  402,  900,  401,  900,  900,
855       399,  414,  900,  403,  900,  407,  410,  390,  393,  405,
856       410,  405,  409,  399,  291,  900,  900,  392,  405,  387,
857       900,  399,  900,  383,  900,  387,  377,  397,  392,  393,
858 
859       377,  391,  390,  374,  374,  368,  382,  382,  900,  385,
860       388,  375,  380,  292,  141,  373,  349,  900,  900,  900,
861       354,  900,  366,   13,  900,  900,  900,   24,  900,   51,
862       126,  153,  265,  280,  282,  279,  265,  305,  306,  274,
863       287,  292,  280,  900,  900,  280,  281,  281,  298,  283,
864       280,  287,  307,  322,  324,  291,  290,  900,  309,  900,
865       294,  296,  316,  316,  309,  300,  308,  336,  337,  320,
866       321,  900,  309,  900,  327,  326,  313,  900,  328,  349,
867       348,  900,  900,  900,  335,  313,  318,  319,  354,  355,
868       326,  334,  325,  337,  360,  361,  347,  332,  900,  337,
869 
870       900,  900,  351,  334,  352,  350,  341,  900,  349,  900,
871       353,  343,  339,  900,  900,  389,  391,  383,  384,  393,
872       395,  397,  399,  401
873     } ;
874 
875 static const flex_int16_t yy_def[825] =
876     {   0,
877       815,    1,  816,  816,  816,  816,  817,  817,  817,  817,
878       817,  817,  815,  815,  815,  815,  815,  818,  815,  815,
879       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
880       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
881       815,  815,  815,  819,  815,  815,  820,  815,  815,  821,
882       815,  815,  822,  818,  823,   20,  815,  815,  815,  815,
883       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
884       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
885       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
886       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
887 
888       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
889       815,  815,  815,  815,  815,  815,  815,  815,  815,  820,
890       815,  820,  821,  815,  821,  821,  821,  821,  822,  815,
891       822,  822,  822,  823,  823,  815,  815,  815,  815,  815,
892       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
893       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
894       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
895       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
896       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
897       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
898 
899       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
900       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
901       815,  815,  815,  815,  815,  815,  815,  820,  821,  821,
902       821,  821,  821,  821,  815,  815,  815,  823,  815,  815,
903       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
904       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
905       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
906       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
907       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
908       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
909 
910       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
911       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
912       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
913       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
914       815,  815,  815,  820,  820,  815,  815,  815,  815,  815,
915       815,  823,  815,  815,  815,  815,  815,  815,  815,  815,
916       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
917       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
918       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
919       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
920 
921       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
922       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
923       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
924       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
925       815,  815,  815,  815,  815,  815,  820,  820,  815,  815,
926       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
927       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
928       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
929       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
930       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
931 
932       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
933       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
934       815,  815,  815,  824,  815,  815,  815,  820,  820,  815,
935       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
936       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
937       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
938       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
939       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
940       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
941       824,  824,  815,  815,  815,  820,  820,  815,  815,  815,
942 
943       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
944       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
945       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
946       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
947       815,  815,  815,  815,  815,  815,  820,  820,  815,  815,
948       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
949       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
950       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
951       815,  815,  815,  815,  820,  815,  815,  815,  815,  815,
952       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
953 
954       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
955       815,  815,  815,  820,  820,  815,  815,  815,  815,  815,
956       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
957       815,  815,  815,  815,  815,  815,  815,  820,  820,  815,
958       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
959       815,  815,  815,  820,  820,  815,  815,  815,  815,  815,
960       815,  815,  815,  815,  815,  815,  815,  820,  820,  815,
961       815,  815,  815,  815,  815,  815,  815,  815,  815,  820,
962       820,  815,  815,  815,  815,  815,  815,  815,  820,  820,
963       815,  815,  815,  815,  820,  820,  815,  815,  815,  815,
964 
965       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
966       815,  815,  815,  815,    0,  815,  815,  815,  815,  815,
967       815,  815,  815,  815
968     } ;
969 
970 static const flex_int16_t yy_nxt[946] =
971     {   0,
972        14,   15,   16,   15,   17,   18,   14,   14,   14,   19,
973        20,   20,   20,   20,   21,   14,   14,   14,   14,   22,
974        23,   24,   25,   26,   27,   14,   28,   29,   30,   31,
975        32,   33,   34,   14,   14,   14,   35,   36,   37,   38,
976        39,   14,   14,   14,   14,   41,   41,   41,   43,   43,
977       744,   42,   45,   46,   45,   47,   45,   46,   45,   47,
978       745,   44,   44,   48,   49,   48,   50,   48,   49,   48,
979        50,   51,   52,   51,   53,   51,   52,   51,   53,   56,
980        56,   56,   56,   80,   89,   57,   90,   93,   95,  746,
981        91,   81,   96,   82,   57,   94,   92,  112,   57,  353,
982 
983        57,   58,   59,   60,   61,   62,   63,   64,   65,   66,
984       113,  354,   67,   68,   69,   70,   71,   72,   73,   74,
985        75,   76,   77,   78,   85,   97,   79,   98,   86,  121,
986       103,  107,   87,   99,  104,  108,  124,  116,  117,  136,
987       109,  130,  110,  118,   88,  121,  111,  137,  131,  132,
988       133,  139,  122,  747,  140,  125,  141,  126,  145,  170,
989       142,  149,  127,  171,  128,  150,  152,  146,  207,  151,
990       143,  175,  195,  147,  156,  153,  154,  208,  157,  160,
991       739,  155,  158,  161,  172,  196,  124,  162,  159,  164,
992       748,  165,  176,  166,  177,  173,  178,  167,  211,  179,
993 
994       174,  189,  221,  190,  212,  222,  216,  213,  217,  226,
995       121,  214,  124,  124,  215,  124,  238,  229,  227,  239,
996       242,  228,  244,  245,  265,  246,  267,  243,  269,  270,
997       247,  230,  232,  272,  234,  273,  281,  268,  289,  296,
998       121,  297,  282,  290,  266,  121,  231,  233,  308,  283,
999       310,  298,  309,  135,  311,  344,  352,  356,  121,  455,
1000       521,  522,  523,  456,  524,  121,  357,  121,  558,  345,
1001       521,  522,  523,  559,  524,  448,  522,  592,  447,  594,
1002       121,  121,  528,  635,  121,  600,  613,  636,  595,  522,
1003       592,  643,  592,  121,  121,  121,  121,  685,  749,  750,
1004 
1005       597,  529,  601,  596,  614,  751,  752,  647,  753,  121,
1006       121,  738,  714,  756,  757,  758,  759,  760,  761,  762,
1007       763,  764,  765,  715,  766,  767,  121,  648,  121,  770,
1008       771,  772,  773,  774,  775,  776,  777,  755,  778,  779,
1009       121,  121,  754,  782,  783,  768,  784,  769,  785,  786,
1010       787,  788,  121,  121,  791,  792,  793,  794,  121,  121,
1011       797,  798,  799,  800,  801,  802,  803,  780,  789,  804,
1012       805,  806,  807,  781,  808,  790,  796,  809,  810,  811,
1013       812,  813,  814,   54,  119,  743,  742,  741,  795,   40,
1014        40,   14,   14,  120,  120,  123,  123,  129,  129,  134,
1015 
1016       134,  591,  591,  740,  737,  736,  735,  734,  733,  732,
1017       731,  730,  729,  728,  727,  726,  725,  724,  723,  722,
1018       721,  720,  719,  718,  717,  716,  713,  712,  711,  710,
1019       709,  708,  707,  706,  705,  704,  703,  702,  701,  700,
1020       699,  698,  697,  696,  695,  694,  693,  692,  691,  690,
1021       689,  688,  687,  686,  684,  683,  682,  681,  680,  679,
1022       678,  677,  676,  675,  674,  673,  672,  671,  670,  669,
1023       668,  667,  666,  665,  664,  663,  662,  661,  660,  659,
1024       658,  657,  656,  655,  654,  653,  652,  651,  650,  649,
1025       646,  645,  644,  642,  641,  640,  639,  638,  637,  634,
1026 
1027       633,  632,  631,  630,  629,  628,  627,  626,  625,  624,
1028       623,  622,  621,  620,  619,  618,  617,  616,  615,  612,
1029       611,  610,  609,  608,  607,  606,  605,  604,  603,  602,
1030       599,  598,  593,  522,  590,  589,  588,  587,  586,  585,
1031       584,  583,  582,  581,  580,  579,  578,  577,  576,  575,
1032       574,  573,  572,  571,  570,  569,  568,  567,  566,  565,
1033       564,  563,  562,  561,  560,  557,  556,  555,  554,  553,
1034       552,  551,  550,  549,  548,  547,  546,  545,  544,  543,
1035       542,  541,  540,  539,  538,  537,  536,  535,  534,  533,
1036       532,  531,  530,  527,  526,  525,  520,  519,  518,  517,
1037 
1038       516,  515,  514,  513,  512,  511,  510,  509,  508,  507,
1039       506,  505,  504,  503,  502,  501,  500,  499,  498,  497,
1040       496,  495,  494,  493,  492,  491,  490,  489,  488,  487,
1041       486,  485,  484,  483,  482,  481,  480,  479,  478,  477,
1042       476,  475,  474,  473,  472,  471,  470,  469,  468,  467,
1043       466,  465,  464,  463,  462,  461,  460,  459,  458,  457,
1044       454,  453,  452,  451,  450,  449,  135,  446,  445,  444,
1045       443,  442,  441,  440,  439,  438,  437,  436,  435,  434,
1046       433,  432,  431,  430,  429,  428,  427,  426,  425,  424,
1047       423,  422,  421,  420,  419,  418,  417,  416,  415,  414,
1048 
1049       413,  412,  411,  410,  409,  408,  407,  406,  405,  404,
1050       403,  402,  401,  400,  399,  398,  397,  396,  395,  394,
1051       393,  392,  391,  390,  389,  388,  387,  386,  385,  384,
1052       383,  382,  381,  380,  379,  378,  377,  376,  375,  374,
1053       373,  372,  371,  370,  369,  368,  367,  366,  365,  364,
1054       363,  362,  361,  360,  359,  358,  355,  351,  350,  349,
1055       348,  347,  346,  343,  342,  341,  340,  339,  338,  337,
1056       336,  335,  334,  333,  332,  331,  330,  329,  328,  327,
1057       326,  325,  324,  323,  322,  321,  320,  319,  318,  317,
1058       316,  315,  314,  313,  312,  307,  306,  305,  304,  303,
1059 
1060       302,  301,  300,  299,  295,  294,  293,  292,  291,  288,
1061       287,  286,  285,  284,  280,  279,  278,  277,  276,  275,
1062       274,  271,  264,  263,  262,  261,  260,  259,  258,  257,
1063       256,  255,  254,  253,  252,  251,  250,  249,  248,  241,
1064       240,  135,  237,  236,  235,  130,  124,  121,  116,  225,
1065       224,  223,  220,  219,  218,  210,  209,  206,  205,  204,
1066       203,  202,  201,  200,  199,  198,  197,  194,  193,  192,
1067       191,  188,  187,  186,  185,  184,  183,  182,  181,  180,
1068       169,  168,  163,  148,  144,  138,  135,  115,  114,  106,
1069       105,  102,  101,  100,   84,   83,   55,  815,   41,   13,
1070 
1071       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1072       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1073       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1074       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1075       815,  815,  815,  815,  815
1076     } ;
1077 
1078 static const flex_int16_t yy_chk[946] =
1079     {   0,
1080         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1081         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1082         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1083         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1084         1,    1,    1,    1,    1,    4,    5,    6,    5,    6,
1085       724,    4,    7,    7,    7,    7,    8,    8,    8,    8,
1086       728,    5,    6,    9,    9,    9,    9,   10,   10,   10,
1087        10,   11,   11,   11,   11,   12,   12,   12,   12,   20,
1088        20,   20,   20,   22,   26,   20,   26,   27,   28,  730,
1089        26,   22,   28,   22,   20,   27,   26,   37,   20,  240,
1090 
1091        20,   21,   21,   21,   21,   21,   21,   21,   21,   21,
1092        37,  240,   21,   21,   21,   21,   21,   21,   21,   21,
1093        21,   21,   21,   21,   25,   29,   21,   29,   25,   47,
1094        33,   36,   25,   29,   33,   36,   50,   42,   42,   58,
1095        36,   53,   36,   42,   25,  715,   36,   58,   53,   53,
1096        53,   60,   47,  731,   60,   50,   61,   50,   63,   73,
1097        61,   65,   50,   73,   50,   65,   66,   63,  103,   65,
1098        61,   75,   91,   63,   67,   66,   66,  103,   67,   68,
1099       715,   66,   67,   68,   74,   91,  125,   68,   67,   70,
1100       732,   70,   75,   70,   76,   74,   76,   70,  106,   76,
1101 
1102        74,   86,  111,   86,  106,  111,  107,  106,  107,  115,
1103       122,  106,  126,  127,  106,  128,  135,  125,  115,  135,
1104       138,  122,  139,  139,  159,  139,  160,  138,  161,  161,
1105       139,  126,  127,  163,  128,  163,  171,  160,  177,  183,
1106       228,  183,  171,  177,  159,  344,  126,  127,  193,  171,
1107       194,  183,  193,  238,  194,  228,  238,  243,  345,  359,
1108       443,  443,  443,  359,  443,  447,  243,  448,  480,  228,
1109       521,  521,  521,  480,  521,  345,  524,  524,  344,  527,
1110       528,  529,  447,  582,  596,  533,  555,  582,  527,  591,
1111       591,  592,  592,  597,  647,  685,  714,  647,  733,  734,
1112 
1113       529,  448,  533,  528,  555,  735,  736,  596,  737,  738,
1114       739,  714,  685,  740,  741,  742,  743,  746,  747,  748,
1115       749,  750,  751,  685,  752,  753,  754,  597,  755,  756,
1116       757,  759,  761,  762,  763,  764,  765,  739,  766,  767,
1117       768,  769,  738,  770,  771,  754,  773,  755,  775,  776,
1118       777,  779,  781,  780,  785,  786,  787,  788,  789,  790,
1119       791,  792,  793,  794,  795,  796,  797,  768,  780,  798,
1120       800,  803,  804,  769,  805,  781,  790,  806,  807,  809,
1121       811,  812,  813,  818,  819,  723,  721,  717,  789,  816,
1122       816,  817,  817,  820,  820,  821,  821,  822,  822,  823,
1123 
1124       823,  824,  824,  716,  713,  712,  711,  710,  708,  707,
1125       706,  705,  704,  703,  702,  701,  700,  699,  698,  697,
1126       696,  694,  692,  690,  689,  688,  684,  683,  682,  681,
1127       680,  679,  678,  677,  676,  674,  672,  671,  668,  666,
1128       665,  664,  663,  661,  659,  658,  657,  656,  655,  653,
1129       652,  651,  650,  648,  646,  645,  642,  641,  640,  638,
1130       637,  636,  635,  634,  632,  630,  628,  627,  626,  625,
1131       624,  623,  621,  619,  618,  617,  616,  615,  613,  610,
1132       609,  608,  607,  606,  604,  603,  601,  600,  599,  598,
1133       595,  594,  593,  590,  588,  586,  585,  584,  583,  581,
1134 
1135       578,  576,  575,  574,  572,  571,  570,  568,  566,  565,
1136       564,  563,  562,  561,  560,  559,  558,  557,  556,  551,
1137       550,  549,  548,  547,  545,  541,  537,  536,  535,  534,
1138       531,  530,  526,  523,  519,  517,  516,  514,  513,  511,
1139       510,  509,  508,  507,  506,  504,  503,  501,  500,  499,
1140       498,  497,  496,  495,  494,  493,  492,  491,  490,  488,
1141       487,  485,  484,  483,  482,  479,  478,  477,  476,  475,
1142       474,  473,  472,  471,  470,  469,  468,  466,  465,  464,
1143       463,  461,  460,  459,  458,  456,  455,  454,  453,  452,
1144       451,  450,  449,  446,  445,  444,  442,  441,  440,  439,
1145 
1146       438,  437,  436,  435,  434,  433,  432,  431,  430,  429,
1147       428,  426,  425,  424,  422,  420,  419,  418,  416,  415,
1148       414,  413,  412,  409,  408,  407,  405,  404,  402,  401,
1149       400,  397,  396,  395,  394,  393,  392,  391,  389,  388,
1150       386,  385,  383,  382,  381,  380,  379,  378,  376,  374,
1151       373,  371,  370,  369,  367,  366,  365,  364,  362,  361,
1152       358,  357,  356,  355,  354,  353,  352,  343,  342,  341,
1153       339,  338,  336,  335,  333,  332,  331,  330,  329,  328,
1154       327,  326,  325,  323,  321,  320,  319,  318,  317,  316,
1155       315,  314,  313,  312,  311,  310,  309,  307,  306,  305,
1156 
1157       304,  302,  300,  299,  298,  297,  296,  295,  294,  293,
1158       292,  291,  290,  289,  288,  287,  286,  285,  284,  282,
1159       281,  279,  278,  277,  276,  275,  274,  273,  272,  271,
1160       270,  269,  268,  267,  266,  265,  264,  263,  262,  261,
1161       260,  259,  258,  257,  256,  255,  254,  252,  251,  250,
1162       249,  248,  247,  246,  245,  244,  242,  234,  233,  232,
1163       231,  230,  229,  227,  226,  225,  224,  223,  222,  221,
1164       220,  219,  218,  217,  216,  215,  214,  213,  212,  211,
1165       210,  209,  208,  207,  205,  204,  203,  202,  201,  200,
1166       199,  198,  197,  196,  195,  192,  191,  190,  189,  188,
1167 
1168       187,  186,  185,  184,  182,  181,  180,  179,  178,  176,
1169       175,  174,  173,  172,  170,  169,  168,  167,  166,  165,
1170       164,  162,  158,  157,  156,  154,  153,  151,  150,  149,
1171       148,  147,  146,  145,  144,  143,  142,  141,  140,  137,
1172       136,  134,  133,  132,  131,  129,  123,  120,  117,  114,
1173       113,  112,  110,  109,  108,  105,  104,  102,  101,  100,
1174        99,   98,   96,   95,   94,   93,   92,   90,   89,   88,
1175        87,   85,   84,   83,   82,   81,   80,   79,   78,   77,
1176        72,   71,   69,   64,   62,   59,   55,   39,   38,   35,
1177        34,   32,   31,   30,   24,   23,   19,   13,    3,  815,
1178 
1179       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1180       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1181       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1182       815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
1183       815,  815,  815,  815,  815
1184     } ;
1185 
1186 /* Table of booleans, true if rule could match eol. */
1187 static const flex_int32_t yy_rule_can_match_eol[156] =
1188     {   0,
1189 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1190     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1191     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1192     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
1193     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1194     0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1195     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1196     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,     };
1197 
1198 static yy_state_type yy_last_accepting_state;
1199 static char *yy_last_accepting_cpos;
1200 
1201 extern int yy_flex_debug;
1202 int yy_flex_debug = 0;
1203 
1204 /* The intent behind this definition is that it'll catch
1205  * any uses of REJECT which flex missed.
1206  */
1207 #define REJECT reject_used_but_not_detected
1208 #define yymore() yymore_used_but_not_detected
1209 #define YY_MORE_ADJ 0
1210 #define YY_RESTORE_YY_MORE_OFFSET
1211 char *yytext;
1212 #line 1 "sieve/sieve-lex.l"
1213 #line 2 "sieve/sieve-lex.l"
1214 /* sieve.l -- sieve lexer
1215  * Larry Greenfield
1216  * Ken Murchison
1217  *
1218  * Copyright (c) 1994-2017 Carnegie Mellon University.  All rights reserved.
1219  *
1220  * Redistribution and use in source and binary forms, with or without
1221  * modification, are permitted provided that the following conditions
1222  * are met:
1223  *
1224  * 1. Redistributions of source code must retain the above copyright
1225  *    notice, this list of conditions and the following disclaimer.
1226  *
1227  * 2. Redistributions in binary form must reproduce the above copyright
1228  *    notice, this list of conditions and the following disclaimer in
1229  *    the documentation and/or other materials provided with the
1230  *    distribution.
1231  *
1232  * 3. The name "Carnegie Mellon University" must not be used to
1233  *    endorse or promote products derived from this software without
1234  *    prior written permission. For permission or any legal
1235  *    details, please contact
1236  *      Carnegie Mellon University
1237  *      Center for Technology Transfer and Enterprise Creation
1238  *      4615 Forbes Avenue
1239  *      Suite 302
1240  *      Pittsburgh, PA  15213
1241  *      (412) 268-7393, fax: (412) 268-7395
1242  *      innovation@andrew.cmu.edu
1243  *
1244  * 4. Redistributions of any form whatsoever must retain the following
1245  *    acknowledgment:
1246  *    "This product includes software developed by Computing Services
1247  *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
1248  *
1249  * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
1250  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1251  * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
1252  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1253  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
1254  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
1255  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1256  */
1257 
1258 #ifdef HAVE_CONFIG_H
1259 #include <config.h>
1260 #endif
1261 
1262 #include "util.h"
1263 
1264 #include "sieve/tree.h"
1265 #include "sieve/sieve_interface.h"
1266 #include "sieve/sieve.h"
1267 
1268 #define YY_NO_INPUT
1269 #define YY_DECL int yylex(YYSTYPE *yylval, sieve_script_t *sscript)
1270 
1271 static struct buf buf;   /* buffer for multi-line text and quoted strings */
1272 extern int encoded_char; /* used to receive encoded-char feedback from parser */
1273 
1274 static unsigned long long tonum(const char *str);
1275 static int decode_string(struct buf *buf);
1276 extern void sieveerror(sieve_script_t *, char *);
1277 extern void sieveerror_f(sieve_script_t *, char *fmt, ...);
1278 #line 1279 "sieve/sieve-lex.c"
1279 #line 74 "sieve/sieve-lex.l"
1280     /* linebreak */
1281     /* non-linebreaking whitespace */
1282 
1283 
1284 
1285 
1286 
1287 #line 1288 "sieve/sieve-lex.c"
1288 
1289 #define INITIAL 0
1290 #define MULTILINE 1
1291 #define QSTRING 2
1292 #define QCOLLATION 3
1293 #define QRELATION 4
1294 #define QIMPORTANCE 5
1295 
1296 #ifndef YY_NO_UNISTD_H
1297 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1298  * down here because we want the user's section 1 to have been scanned first.
1299  * The user has a chance to override it with an option.
1300  */
1301 #include <unistd.h>
1302 #endif
1303 
1304 #ifndef YY_EXTRA_TYPE
1305 #define YY_EXTRA_TYPE void *
1306 #endif
1307 
1308 static int yy_init_globals ( void );
1309 
1310 /* Accessor methods to globals.
1311    These are made visible to non-reentrant scanners for convenience. */
1312 
1313 int yylex_destroy ( void );
1314 
1315 int yyget_debug ( void );
1316 
1317 void yyset_debug ( int debug_flag  );
1318 
1319 YY_EXTRA_TYPE yyget_extra ( void );
1320 
1321 void yyset_extra ( YY_EXTRA_TYPE user_defined  );
1322 
1323 FILE *yyget_in ( void );
1324 
1325 void yyset_in  ( FILE * _in_str  );
1326 
1327 FILE *yyget_out ( void );
1328 
1329 void yyset_out  ( FILE * _out_str  );
1330 
1331 			int yyget_leng ( void );
1332 
1333 char *yyget_text ( void );
1334 
1335 int yyget_lineno ( void );
1336 
1337 void yyset_lineno ( int _line_number  );
1338 
1339 /* Macros after this point can all be overridden by user definitions in
1340  * section 1.
1341  */
1342 
1343 #ifndef YY_SKIP_YYWRAP
1344 #ifdef __cplusplus
1345 extern "C" int yywrap ( void );
1346 #else
1347 extern int yywrap ( void );
1348 #endif
1349 #endif
1350 
1351 #ifndef YY_NO_UNPUT
1352 
1353 #endif
1354 
1355 #ifndef yytext_ptr
1356 static void yy_flex_strncpy ( char *, const char *, int );
1357 #endif
1358 
1359 #ifdef YY_NEED_STRLEN
1360 static int yy_flex_strlen ( const char * );
1361 #endif
1362 
1363 #ifndef YY_NO_INPUT
1364 #ifdef __cplusplus
1365 static int yyinput ( void );
1366 #else
1367 static int input ( void );
1368 #endif
1369 
1370 #endif
1371 
1372 /* Amount of stuff to slurp up with each read. */
1373 #ifndef YY_READ_BUF_SIZE
1374 #ifdef __ia64__
1375 /* On IA-64, the buffer size is 16k, not 8k */
1376 #define YY_READ_BUF_SIZE 16384
1377 #else
1378 #define YY_READ_BUF_SIZE 8192
1379 #endif /* __ia64__ */
1380 #endif
1381 
1382 /* Copy whatever the last rule matched to the standard output. */
1383 #ifndef ECHO
1384 /* This used to be an fputs(), but since the string might contain NUL's,
1385  * we now use fwrite().
1386  */
1387 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1388 #endif
1389 
1390 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1391  * is returned in "result".
1392  */
1393 #ifndef YY_INPUT
1394 #define YY_INPUT(buf,result,max_size) \
1395 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1396 		{ \
1397 		int c = '*'; \
1398 		int n; \
1399 		for ( n = 0; n < max_size && \
1400 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1401 			buf[n] = (char) c; \
1402 		if ( c == '\n' ) \
1403 			buf[n++] = (char) c; \
1404 		if ( c == EOF && ferror( yyin ) ) \
1405 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
1406 		result = n; \
1407 		} \
1408 	else \
1409 		{ \
1410 		errno=0; \
1411 		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1412 			{ \
1413 			if( errno != EINTR) \
1414 				{ \
1415 				YY_FATAL_ERROR( "input in flex scanner failed" ); \
1416 				break; \
1417 				} \
1418 			errno=0; \
1419 			clearerr(yyin); \
1420 			} \
1421 		}\
1422 \
1423 
1424 #endif
1425 
1426 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1427  * we don't want an extra ';' after the "return" because that will cause
1428  * some compilers to complain about unreachable statements.
1429  */
1430 #ifndef yyterminate
1431 #define yyterminate() return YY_NULL
1432 #endif
1433 
1434 /* Number of entries by which start-condition stack grows. */
1435 #ifndef YY_START_STACK_INCR
1436 #define YY_START_STACK_INCR 25
1437 #endif
1438 
1439 /* Report a fatal error. */
1440 #ifndef YY_FATAL_ERROR
1441 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1442 #endif
1443 
1444 /* end tables serialization structures and prototypes */
1445 
1446 /* Default declaration of generated scanner - a define so the user can
1447  * easily add parameters.
1448  */
1449 #ifndef YY_DECL
1450 #define YY_DECL_IS_OURS 1
1451 
1452 extern int yylex (void);
1453 
1454 #define YY_DECL int yylex (void)
1455 #endif /* !YY_DECL */
1456 
1457 /* Code executed at the beginning of each rule, after yytext and yyleng
1458  * have been set up.
1459  */
1460 #ifndef YY_USER_ACTION
1461 #define YY_USER_ACTION
1462 #endif
1463 
1464 /* Code executed at the end of each rule. */
1465 #ifndef YY_BREAK
1466 #define YY_BREAK /*LINTED*/break;
1467 #endif
1468 
1469 #define YY_RULE_SETUP \
1470 	if ( yyleng > 0 ) \
1471 		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1472 				(yytext[yyleng - 1] == '\n'); \
1473 	YY_USER_ACTION
1474 
1475 /** The main scanner function which does all the work.
1476  */
1477 YY_DECL
1478 {
1479 	yy_state_type yy_current_state;
1480 	char *yy_cp, *yy_bp;
1481 	int yy_act;
1482 
1483 	if ( !(yy_init) )
1484 		{
1485 		(yy_init) = 1;
1486 
1487 #ifdef YY_USER_INIT
1488 		YY_USER_INIT;
1489 #endif
1490 
1491 		if ( ! (yy_start) )
1492 			(yy_start) = 1;	/* first start state */
1493 
1494 		if ( ! yyin )
1495 			yyin = stdin;
1496 
1497 		if ( ! yyout )
1498 			yyout = stdout;
1499 
1500 		if ( ! YY_CURRENT_BUFFER ) {
1501 			yyensure_buffer_stack ();
1502 			YY_CURRENT_BUFFER_LVALUE =
1503 				yy_create_buffer( yyin, YY_BUF_SIZE );
1504 		}
1505 
1506 		yy_load_buffer_state(  );
1507 		}
1508 
1509 	{
1510 #line 86 "sieve/sieve-lex.l"
1511 
1512     /* dot stuffing */
1513 #line 1514 "sieve/sieve-lex.c"
1514 
1515 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
1516 		{
1517 		yy_cp = (yy_c_buf_p);
1518 
1519 		/* Support of yytext. */
1520 		*yy_cp = (yy_hold_char);
1521 
1522 		/* yy_bp points to the position in yy_ch_buf of the start of
1523 		 * the current run.
1524 		 */
1525 		yy_bp = yy_cp;
1526 
1527 		yy_current_state = (yy_start);
1528 		yy_current_state += YY_AT_BOL();
1529 yy_match:
1530 		do
1531 			{
1532 			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1533 			if ( yy_accept[yy_current_state] )
1534 				{
1535 				(yy_last_accepting_state) = yy_current_state;
1536 				(yy_last_accepting_cpos) = yy_cp;
1537 				}
1538 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1539 				{
1540 				yy_current_state = (int) yy_def[yy_current_state];
1541 				if ( yy_current_state >= 816 )
1542 					yy_c = yy_meta[yy_c];
1543 				}
1544 			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1545 			++yy_cp;
1546 			}
1547 		while ( yy_base[yy_current_state] != 900 );
1548 
1549 yy_find_action:
1550 		yy_act = yy_accept[yy_current_state];
1551 		if ( yy_act == 0 )
1552 			{ /* have to back up */
1553 			yy_cp = (yy_last_accepting_cpos);
1554 			yy_current_state = (yy_last_accepting_state);
1555 			yy_act = yy_accept[yy_current_state];
1556 			}
1557 
1558 		YY_DO_BEFORE_ACTION;
1559 
1560 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1561 			{
1562 			int yyl;
1563 			for ( yyl = 0; yyl < yyleng; ++yyl )
1564 				if ( yytext[yyl] == '\n' )
1565 
1566     yylineno++;
1567 ;
1568 			}
1569 
1570 do_action:	/* This label is used only to access EOF actions. */
1571 
1572 		switch ( yy_act )
1573 	{ /* beginning of action switch */
1574 			case 0: /* must back up */
1575 			/* undo the effects of YY_DO_BEFORE_ACTION */
1576 			*yy_cp = (yy_hold_char);
1577 			yy_cp = (yy_last_accepting_cpos);
1578 			yy_current_state = (yy_last_accepting_state);
1579 			goto yy_find_action;
1580 
1581 case 1:
1582 YY_RULE_SETUP
1583 #line 88 "sieve/sieve-lex.l"
1584 buf_putc(&buf, yytext[1]);
1585 	YY_BREAK
1586 /* end of multi-line text */
1587 case 2:
1588 /* rule 2 can match eol */
1589 #line 92 "sieve/sieve-lex.l"
1590 /* end of quoted string */
1591 case 3:
1592 YY_RULE_SETUP
1593 #line 94 "sieve/sieve-lex.l"
1594 {
1595                                   BEGIN INITIAL;
1596                                   if (encoded_char && !decode_string(&buf)) {
1597                                       sieveerror_f(sscript,
1598                                                    "invalid unicode encoding: %s",
1599                                                    buf_cstring(&buf));
1600                                   }
1601                                   yylval->sval = buf_release(&buf);
1602                                   return STRING;
1603                               }
1604 	YY_BREAK
1605 /* escaped character */
1606 case 4:
1607 YY_RULE_SETUP
1608 #line 106 "sieve/sieve-lex.l"
1609 buf_putc(&buf, yytext[1]);
1610 	YY_BREAK
1611 /* any character (including LF) */
1612 case 5:
1613 /* rule 5 can match eol */
1614 YY_RULE_SETUP
1615 #line 109 "sieve/sieve-lex.l"
1616 buf_putc(&buf, yytext[0]);
1617 	YY_BREAK
1618 /* premature EOF */
1619 case YY_STATE_EOF(QSTRING):
1620 case YY_STATE_EOF(MULTILINE):
1621 #line 112 "sieve/sieve-lex.l"
1622 {
1623                                   BEGIN INITIAL;
1624                                   sieveerror(sscript,
1625                                              "unexpected end of file in string");
1626                                   buf_free(&buf);
1627                                   yyterminate();
1628                               }
1629 	YY_BREAK
1630 /* beginning of multi-line text */
1631 case 6:
1632 /* rule 6 can match eol */
1633 YY_RULE_SETUP
1634 #line 121 "sieve/sieve-lex.l"
1635 {
1636                                   BEGIN MULTILINE;
1637                                   buf_reset(&buf);
1638                               }
1639 	YY_BREAK
1640 /* beginning of quoted string */
1641 case 7:
1642 YY_RULE_SETUP
1643 #line 127 "sieve/sieve-lex.l"
1644 {
1645                                   BEGIN QSTRING;
1646                                   buf_reset(&buf);
1647                               }
1648 	YY_BREAK
1649 /* number with optional power of 2 suffix */
1650 case 8:
1651 YY_RULE_SETUP
1652 #line 133 "sieve/sieve-lex.l"
1653 {
1654                                   unsigned long long val = tonum(yytext);
1655                                   if (val > INT_MAX) {
1656                                       sieveerror_f(sscript,
1657                                                    "number too large %s",
1658                                                    yytext);
1659                                   }
1660                                   yylval->nval = val;
1661                                   return NUMBER;
1662                               }
1663 	YY_BREAK
1664 /* standard control commands - RFC 5228 */
1665 case 9:
1666 YY_RULE_SETUP
1667 #line 145 "sieve/sieve-lex.l"
1668 return IF;
1669 	YY_BREAK
1670 case 10:
1671 YY_RULE_SETUP
1672 #line 146 "sieve/sieve-lex.l"
1673 return ELSIF;
1674 	YY_BREAK
1675 case 11:
1676 YY_RULE_SETUP
1677 #line 147 "sieve/sieve-lex.l"
1678 return ELSE;
1679 	YY_BREAK
1680 case 12:
1681 YY_RULE_SETUP
1682 #line 148 "sieve/sieve-lex.l"
1683 return REQUIRE;
1684 	YY_BREAK
1685 case 13:
1686 YY_RULE_SETUP
1687 #line 149 "sieve/sieve-lex.l"
1688 return STOP;
1689 	YY_BREAK
1690 /* standard tests - RFC 5228 */
1691 case 14:
1692 YY_RULE_SETUP
1693 #line 152 "sieve/sieve-lex.l"
1694 return ANYOF;
1695 	YY_BREAK
1696 case 15:
1697 YY_RULE_SETUP
1698 #line 153 "sieve/sieve-lex.l"
1699 return ALLOF;
1700 	YY_BREAK
1701 case 16:
1702 YY_RULE_SETUP
1703 #line 154 "sieve/sieve-lex.l"
1704 return EXISTS;
1705 	YY_BREAK
1706 case 17:
1707 YY_RULE_SETUP
1708 #line 155 "sieve/sieve-lex.l"
1709 return SFALSE;
1710 	YY_BREAK
1711 case 18:
1712 YY_RULE_SETUP
1713 #line 156 "sieve/sieve-lex.l"
1714 return STRUE;
1715 	YY_BREAK
1716 case 19:
1717 YY_RULE_SETUP
1718 #line 157 "sieve/sieve-lex.l"
1719 return NOT;
1720 	YY_BREAK
1721 case 20:
1722 YY_RULE_SETUP
1723 #line 158 "sieve/sieve-lex.l"
1724 return HEADERT;
1725 	YY_BREAK
1726 case 21:
1727 YY_RULE_SETUP
1728 #line 159 "sieve/sieve-lex.l"
1729 return ADDRESS;
1730 	YY_BREAK
1731 case 22:
1732 YY_RULE_SETUP
1733 #line 160 "sieve/sieve-lex.l"
1734 return ENVELOPE;
1735 	YY_BREAK
1736 case 23:
1737 YY_RULE_SETUP
1738 #line 161 "sieve/sieve-lex.l"
1739 return SIZE;
1740 	YY_BREAK
1741 case 24:
1742 YY_RULE_SETUP
1743 #line 162 "sieve/sieve-lex.l"
1744 return yylval->nval = OVER;
1745 	YY_BREAK
1746 case 25:
1747 YY_RULE_SETUP
1748 #line 163 "sieve/sieve-lex.l"
1749 return yylval->nval = UNDER;
1750 	YY_BREAK
1751 /* standard action commands - RFC 5228 */
1752 case 26:
1753 YY_RULE_SETUP
1754 #line 166 "sieve/sieve-lex.l"
1755 return DISCARD;
1756 	YY_BREAK
1757 case 27:
1758 YY_RULE_SETUP
1759 #line 167 "sieve/sieve-lex.l"
1760 return KEEP;
1761 	YY_BREAK
1762 case 28:
1763 YY_RULE_SETUP
1764 #line 168 "sieve/sieve-lex.l"
1765 return FILEINTO;
1766 	YY_BREAK
1767 case 29:
1768 YY_RULE_SETUP
1769 #line 169 "sieve/sieve-lex.l"
1770 return REDIRECT;
1771 	YY_BREAK
1772 /* copy - RFC 3894 */
1773 case 30:
1774 YY_RULE_SETUP
1775 #line 172 "sieve/sieve-lex.l"
1776 return COPY;
1777 	YY_BREAK
1778 /* comparator-types - RFC 5228 */
1779 case 31:
1780 YY_RULE_SETUP
1781 #line 175 "sieve/sieve-lex.l"
1782 { BEGIN QCOLLATION; return COMPARATOR; }
1783 	YY_BREAK
1784 case 32:
1785 /* rule 32 can match eol */
1786 YY_RULE_SETUP
1787 #line 177 "sieve/sieve-lex.l"
1788 ;       /* ignore whitespace */
1789 	YY_BREAK
1790 case 33:
1791 YY_RULE_SETUP
1792 #line 178 "sieve/sieve-lex.l"
1793 {
1794                                   BEGIN INITIAL;
1795                                   return yylval->nval = OCTET;
1796                               }
1797 	YY_BREAK
1798 case 34:
1799 YY_RULE_SETUP
1800 #line 182 "sieve/sieve-lex.l"
1801 {
1802                                   BEGIN INITIAL;
1803                                   return yylval->nval = ASCIICASEMAP;
1804                               }
1805 	YY_BREAK
1806 case 35:
1807 YY_RULE_SETUP
1808 #line 186 "sieve/sieve-lex.l"
1809 {
1810                                   BEGIN INITIAL;
1811                                   return yylval->nval = ASCIINUMERIC;
1812                               }
1813 	YY_BREAK
1814 case 36:
1815 /* rule 36 can match eol */
1816 YY_RULE_SETUP
1817 #line 190 "sieve/sieve-lex.l"
1818 {
1819                                   BEGIN INITIAL;
1820                                   sieveerror_f(sscript,
1821                                                "unknown comparator-name %s",
1822                                                yytext);
1823                               }
1824 	YY_BREAK
1825 /* match-types - RFC 5228 */
1826 case 37:
1827 YY_RULE_SETUP
1828 #line 198 "sieve/sieve-lex.l"
1829 return yylval->nval = IS;
1830 	YY_BREAK
1831 case 38:
1832 YY_RULE_SETUP
1833 #line 199 "sieve/sieve-lex.l"
1834 return yylval->nval = CONTAINS;
1835 	YY_BREAK
1836 case 39:
1837 YY_RULE_SETUP
1838 #line 200 "sieve/sieve-lex.l"
1839 return yylval->nval = MATCHES;
1840 	YY_BREAK
1841 /* regex - draft-ietf-sieve-regex */
1842 case 40:
1843 YY_RULE_SETUP
1844 #line 203 "sieve/sieve-lex.l"
1845 return yylval->nval = REGEX;
1846 	YY_BREAK
1847 case 41:
1848 YY_RULE_SETUP
1849 #line 204 "sieve/sieve-lex.l"
1850 return yylval->nval = QUOTEREGEX;
1851 	YY_BREAK
1852 /* extlists - RFC 6134 */
1853 case 42:
1854 YY_RULE_SETUP
1855 #line 207 "sieve/sieve-lex.l"
1856 return yylval->nval = LIST;
1857 	YY_BREAK
1858 case 43:
1859 YY_RULE_SETUP
1860 #line 208 "sieve/sieve-lex.l"
1861 return VALIDEXTLIST;
1862 	YY_BREAK
1863 /* address-parts - RFC 5228 */
1864 case 44:
1865 YY_RULE_SETUP
1866 #line 211 "sieve/sieve-lex.l"
1867 return yylval->nval = ALL;
1868 	YY_BREAK
1869 case 45:
1870 YY_RULE_SETUP
1871 #line 212 "sieve/sieve-lex.l"
1872 return yylval->nval = LOCALPART;
1873 	YY_BREAK
1874 case 46:
1875 YY_RULE_SETUP
1876 #line 213 "sieve/sieve-lex.l"
1877 return yylval->nval = DOMAIN;
1878 	YY_BREAK
1879 /* subaddress - RFC 5233 */
1880 case 47:
1881 YY_RULE_SETUP
1882 #line 216 "sieve/sieve-lex.l"
1883 return yylval->nval = USER;
1884 	YY_BREAK
1885 case 48:
1886 YY_RULE_SETUP
1887 #line 217 "sieve/sieve-lex.l"
1888 return yylval->nval = DETAIL;
1889 	YY_BREAK
1890 /* body - RFC 5173 */
1891 case 49:
1892 YY_RULE_SETUP
1893 #line 220 "sieve/sieve-lex.l"
1894 return BODY;
1895 	YY_BREAK
1896 case 50:
1897 YY_RULE_SETUP
1898 #line 221 "sieve/sieve-lex.l"
1899 return yylval->nval = RAW;
1900 	YY_BREAK
1901 case 51:
1902 YY_RULE_SETUP
1903 #line 222 "sieve/sieve-lex.l"
1904 return yylval->nval = TEXT;
1905 	YY_BREAK
1906 case 52:
1907 YY_RULE_SETUP
1908 #line 223 "sieve/sieve-lex.l"
1909 return yylval->nval = CONTENT;
1910 	YY_BREAK
1911 /* environment - RFC 5183 */
1912 case 53:
1913 YY_RULE_SETUP
1914 #line 226 "sieve/sieve-lex.l"
1915 return ENVIRONMENT;
1916 	YY_BREAK
1917 /* variables - RFC 5229 */
1918 case 54:
1919 YY_RULE_SETUP
1920 #line 229 "sieve/sieve-lex.l"
1921 return STRINGT;
1922 	YY_BREAK
1923 case 55:
1924 YY_RULE_SETUP
1925 #line 230 "sieve/sieve-lex.l"
1926 return SET;
1927 	YY_BREAK
1928 case 56:
1929 YY_RULE_SETUP
1930 #line 231 "sieve/sieve-lex.l"
1931 return yylval->nval = LOWER;
1932 	YY_BREAK
1933 case 57:
1934 YY_RULE_SETUP
1935 #line 232 "sieve/sieve-lex.l"
1936 return yylval->nval = UPPER;
1937 	YY_BREAK
1938 case 58:
1939 YY_RULE_SETUP
1940 #line 233 "sieve/sieve-lex.l"
1941 return yylval->nval = LOWERFIRST;
1942 	YY_BREAK
1943 case 59:
1944 YY_RULE_SETUP
1945 #line 234 "sieve/sieve-lex.l"
1946 return yylval->nval = UPPERFIRST;
1947 	YY_BREAK
1948 case 60:
1949 YY_RULE_SETUP
1950 #line 235 "sieve/sieve-lex.l"
1951 return yylval->nval = QUOTEWILDCARD;
1952 	YY_BREAK
1953 case 61:
1954 YY_RULE_SETUP
1955 #line 236 "sieve/sieve-lex.l"
1956 return yylval->nval = LENGTH;
1957 	YY_BREAK
1958 /* vacation - RFC 5230 */
1959 case 62:
1960 YY_RULE_SETUP
1961 #line 239 "sieve/sieve-lex.l"
1962 return VACATION;
1963 	YY_BREAK
1964 case 63:
1965 YY_RULE_SETUP
1966 #line 240 "sieve/sieve-lex.l"
1967 return DAYS;
1968 	YY_BREAK
1969 case 64:
1970 YY_RULE_SETUP
1971 #line 241 "sieve/sieve-lex.l"
1972 return ADDRESSES;
1973 	YY_BREAK
1974 case 65:
1975 YY_RULE_SETUP
1976 #line 242 "sieve/sieve-lex.l"
1977 return SUBJECT;
1978 	YY_BREAK
1979 case 66:
1980 YY_RULE_SETUP
1981 #line 243 "sieve/sieve-lex.l"
1982 return FROM;
1983 	YY_BREAK
1984 case 67:
1985 YY_RULE_SETUP
1986 #line 244 "sieve/sieve-lex.l"
1987 return HANDLE;
1988 	YY_BREAK
1989 case 68:
1990 YY_RULE_SETUP
1991 #line 245 "sieve/sieve-lex.l"
1992 return MIME;
1993 	YY_BREAK
1994 /* vacation-seconds - RFC 6131 */
1995 case 69:
1996 YY_RULE_SETUP
1997 #line 248 "sieve/sieve-lex.l"
1998 return SECONDS;
1999 	YY_BREAK
2000 /* relational - RFC 5231 */
2001 case 70:
2002 YY_RULE_SETUP
2003 #line 251 "sieve/sieve-lex.l"
2004 { BEGIN QRELATION; return yylval->nval = COUNT; }
2005 	YY_BREAK
2006 case 71:
2007 YY_RULE_SETUP
2008 #line 252 "sieve/sieve-lex.l"
2009 { BEGIN QRELATION; return yylval->nval = VALUE; }
2010 	YY_BREAK
2011 case 72:
2012 /* rule 72 can match eol */
2013 YY_RULE_SETUP
2014 #line 254 "sieve/sieve-lex.l"
2015 ;        /* ignore whitespace */
2016 	YY_BREAK
2017 case 73:
2018 YY_RULE_SETUP
2019 #line 255 "sieve/sieve-lex.l"
2020 { BEGIN INITIAL; return yylval->nval = EQ; }
2021 	YY_BREAK
2022 case 74:
2023 YY_RULE_SETUP
2024 #line 256 "sieve/sieve-lex.l"
2025 { BEGIN INITIAL; return yylval->nval = NE; }
2026 	YY_BREAK
2027 case 75:
2028 YY_RULE_SETUP
2029 #line 257 "sieve/sieve-lex.l"
2030 { BEGIN INITIAL; return yylval->nval = GT; }
2031 	YY_BREAK
2032 case 76:
2033 YY_RULE_SETUP
2034 #line 258 "sieve/sieve-lex.l"
2035 { BEGIN INITIAL; return yylval->nval = GE; }
2036 	YY_BREAK
2037 case 77:
2038 YY_RULE_SETUP
2039 #line 259 "sieve/sieve-lex.l"
2040 { BEGIN INITIAL; return yylval->nval = LT; }
2041 	YY_BREAK
2042 case 78:
2043 YY_RULE_SETUP
2044 #line 260 "sieve/sieve-lex.l"
2045 { BEGIN INITIAL; return yylval->nval = LE; }
2046 	YY_BREAK
2047 case 79:
2048 /* rule 79 can match eol */
2049 YY_RULE_SETUP
2050 #line 261 "sieve/sieve-lex.l"
2051 {
2052                                   BEGIN INITIAL;
2053                                   sieveerror_f(sscript,
2054                                                "invalid relational-match %s",
2055                                                yytext);
2056                               }
2057 	YY_BREAK
2058 /* imap4flags - RFC 5232 */
2059 case 80:
2060 YY_RULE_SETUP
2061 #line 269 "sieve/sieve-lex.l"
2062 return yylval->nval = SETFLAG;
2063 	YY_BREAK
2064 case 81:
2065 YY_RULE_SETUP
2066 #line 270 "sieve/sieve-lex.l"
2067 return yylval->nval = ADDFLAG;
2068 	YY_BREAK
2069 case 82:
2070 YY_RULE_SETUP
2071 #line 271 "sieve/sieve-lex.l"
2072 return yylval->nval = REMOVEFLAG;
2073 	YY_BREAK
2074 case 83:
2075 YY_RULE_SETUP
2076 #line 272 "sieve/sieve-lex.l"
2077 return yylval->nval = HASFLAG;
2078 	YY_BREAK
2079 case 84:
2080 YY_RULE_SETUP
2081 #line 273 "sieve/sieve-lex.l"
2082 return FLAGS;
2083 	YY_BREAK
2084 /* imapflags - draft-melnikov-sieve-imapflags-04 */
2085 case 85:
2086 YY_RULE_SETUP
2087 #line 276 "sieve/sieve-lex.l"
2088 return yylval->nval = MARK;
2089 	YY_BREAK
2090 case 86:
2091 YY_RULE_SETUP
2092 #line 277 "sieve/sieve-lex.l"
2093 return yylval->nval = UNMARK;
2094 	YY_BREAK
2095 /* date - RFC 5260 */
2096 case 87:
2097 YY_RULE_SETUP
2098 #line 280 "sieve/sieve-lex.l"
2099 return DATE;
2100 	YY_BREAK
2101 case 88:
2102 YY_RULE_SETUP
2103 #line 281 "sieve/sieve-lex.l"
2104 return ORIGINALZONE;
2105 	YY_BREAK
2106 case 89:
2107 YY_RULE_SETUP
2108 #line 282 "sieve/sieve-lex.l"
2109 return ZONE;
2110 	YY_BREAK
2111 case 90:
2112 YY_RULE_SETUP
2113 #line 283 "sieve/sieve-lex.l"
2114 return CURRENTDATE;
2115 	YY_BREAK
2116 /* index - RFC 5260 */
2117 case 91:
2118 YY_RULE_SETUP
2119 #line 286 "sieve/sieve-lex.l"
2120 return INDEX;
2121 	YY_BREAK
2122 case 92:
2123 YY_RULE_SETUP
2124 #line 287 "sieve/sieve-lex.l"
2125 return LAST;
2126 	YY_BREAK
2127 /* editheader - RFC 5293 */
2128 case 93:
2129 YY_RULE_SETUP
2130 #line 290 "sieve/sieve-lex.l"
2131 return ADDHEADER;
2132 	YY_BREAK
2133 case 94:
2134 YY_RULE_SETUP
2135 #line 291 "sieve/sieve-lex.l"
2136 return DELETEHEADER;
2137 	YY_BREAK
2138 /*   :index               defined in 'index' */
2139 /*   :last                defined in 'index' */
2140 /* [e]reject - RFC 5429 */
2141 case 95:
2142 YY_RULE_SETUP
2143 #line 296 "sieve/sieve-lex.l"
2144 return yylval->nval = REJCT;
2145 	YY_BREAK
2146 case 96:
2147 YY_RULE_SETUP
2148 #line 297 "sieve/sieve-lex.l"
2149 return yylval->nval = EREJECT;
2150 	YY_BREAK
2151 /* enotify - RFC 5435 */
2152 case 97:
2153 YY_RULE_SETUP
2154 #line 300 "sieve/sieve-lex.l"
2155 return NOTIFYMETHODCAPABILITY;
2156 	YY_BREAK
2157 case 98:
2158 YY_RULE_SETUP
2159 #line 301 "sieve/sieve-lex.l"
2160 return VALIDNOTIFYMETHOD;
2161 	YY_BREAK
2162 case 99:
2163 YY_RULE_SETUP
2164 #line 302 "sieve/sieve-lex.l"
2165 return NOTIFY;
2166 	YY_BREAK
2167 case 100:
2168 YY_RULE_SETUP
2169 #line 303 "sieve/sieve-lex.l"
2170 return OPTIONS;
2171 	YY_BREAK
2172 case 101:
2173 YY_RULE_SETUP
2174 #line 304 "sieve/sieve-lex.l"
2175 return MESSAGE;
2176 	YY_BREAK
2177 case 102:
2178 YY_RULE_SETUP
2179 #line 305 "sieve/sieve-lex.l"
2180 return yylval->nval = ENCODEURL;
2181 	YY_BREAK
2182 case 103:
2183 YY_RULE_SETUP
2184 #line 306 "sieve/sieve-lex.l"
2185 { BEGIN QIMPORTANCE; return IMPORTANCE; }
2186 	YY_BREAK
2187 case 104:
2188 /* rule 104 can match eol */
2189 YY_RULE_SETUP
2190 #line 308 "sieve/sieve-lex.l"
2191 ;      /* ignore whitespace */
2192 	YY_BREAK
2193 case 105:
2194 YY_RULE_SETUP
2195 #line 309 "sieve/sieve-lex.l"
2196 { BEGIN INITIAL; return yylval->nval = HIGH;   }
2197 	YY_BREAK
2198 case 106:
2199 YY_RULE_SETUP
2200 #line 310 "sieve/sieve-lex.l"
2201 { BEGIN INITIAL; return yylval->nval = NORMAL; }
2202 	YY_BREAK
2203 case 107:
2204 YY_RULE_SETUP
2205 #line 311 "sieve/sieve-lex.l"
2206 { BEGIN INITIAL; return yylval->nval = LOW;    }
2207 	YY_BREAK
2208 case 108:
2209 /* rule 108 can match eol */
2210 YY_RULE_SETUP
2211 #line 312 "sieve/sieve-lex.l"
2212 {
2213                                   BEGIN INITIAL;
2214                                   sieveerror_f(sscript,
2215                                                "invalid importance %s", yytext);
2216                               }
2217 	YY_BREAK
2218 /* notify - draft-martin-sieve-notify-01 */
2219 case 109:
2220 YY_RULE_SETUP
2221 #line 319 "sieve/sieve-lex.l"
2222 return DENOTIFY;
2223 	YY_BREAK
2224 case 110:
2225 YY_RULE_SETUP
2226 #line 320 "sieve/sieve-lex.l"
2227 return METHOD;
2228 	YY_BREAK
2229 case 111:
2230 YY_RULE_SETUP
2231 #line 321 "sieve/sieve-lex.l"
2232 return ID;
2233 	YY_BREAK
2234 case 112:
2235 YY_RULE_SETUP
2236 #line 322 "sieve/sieve-lex.l"
2237 return yylval->nval = LOW;
2238 	YY_BREAK
2239 case 113:
2240 YY_RULE_SETUP
2241 #line 323 "sieve/sieve-lex.l"
2242 return yylval->nval = NORMAL;
2243 	YY_BREAK
2244 case 114:
2245 YY_RULE_SETUP
2246 #line 324 "sieve/sieve-lex.l"
2247 return yylval->nval = HIGH;
2248 	YY_BREAK
2249 /* ihave - RFC 5463 */
2250 case 115:
2251 YY_RULE_SETUP
2252 #line 327 "sieve/sieve-lex.l"
2253 return IHAVE;
2254 	YY_BREAK
2255 case 116:
2256 YY_RULE_SETUP
2257 #line 328 "sieve/sieve-lex.l"
2258 return ERROR;
2259 	YY_BREAK
2260 /* mailbox - RFC 5490 */
2261 case 117:
2262 YY_RULE_SETUP
2263 #line 331 "sieve/sieve-lex.l"
2264 return MAILBOXEXISTS;
2265 	YY_BREAK
2266 case 118:
2267 YY_RULE_SETUP
2268 #line 332 "sieve/sieve-lex.l"
2269 return CREATE;
2270 	YY_BREAK
2271 /* mboxmetadata - RFC 5490 */
2272 case 119:
2273 YY_RULE_SETUP
2274 #line 335 "sieve/sieve-lex.l"
2275 return yylval->nval = METADATA;
2276 	YY_BREAK
2277 case 120:
2278 YY_RULE_SETUP
2279 #line 336 "sieve/sieve-lex.l"
2280 return METADATAEXISTS;
2281 	YY_BREAK
2282 /* servermetadata - RFC 5490 */
2283 case 121:
2284 YY_RULE_SETUP
2285 #line 339 "sieve/sieve-lex.l"
2286 return yylval->nval = SERVERMETADATA;
2287 	YY_BREAK
2288 case 122:
2289 YY_RULE_SETUP
2290 #line 340 "sieve/sieve-lex.l"
2291 return SERVERMETADATAEXISTS;
2292 	YY_BREAK
2293 /* redirect-deliverby - RFC 6009 */
2294 case 123:
2295 YY_RULE_SETUP
2296 #line 343 "sieve/sieve-lex.l"
2297 return BYTIMEREL;
2298 	YY_BREAK
2299 case 124:
2300 YY_RULE_SETUP
2301 #line 344 "sieve/sieve-lex.l"
2302 return BYTIMEABS;
2303 	YY_BREAK
2304 case 125:
2305 YY_RULE_SETUP
2306 #line 345 "sieve/sieve-lex.l"
2307 return BYMODE;
2308 	YY_BREAK
2309 case 126:
2310 YY_RULE_SETUP
2311 #line 346 "sieve/sieve-lex.l"
2312 return BYTRACE;
2313 	YY_BREAK
2314 /* redirect-dsn - RFC 6009 */
2315 case 127:
2316 YY_RULE_SETUP
2317 #line 349 "sieve/sieve-lex.l"
2318 return DSNNOTIFY;
2319 	YY_BREAK
2320 case 128:
2321 YY_RULE_SETUP
2322 #line 350 "sieve/sieve-lex.l"
2323 return DSNRET;
2324 	YY_BREAK
2325 /* include - RFC 6609 */
2326 case 129:
2327 YY_RULE_SETUP
2328 #line 353 "sieve/sieve-lex.l"
2329 return INCLUDE;
2330 	YY_BREAK
2331 case 130:
2332 YY_RULE_SETUP
2333 #line 354 "sieve/sieve-lex.l"
2334 return yylval->nval = PERSONAL;
2335 	YY_BREAK
2336 case 131:
2337 YY_RULE_SETUP
2338 #line 355 "sieve/sieve-lex.l"
2339 return yylval->nval = GLOBAL;
2340 	YY_BREAK
2341 case 132:
2342 YY_RULE_SETUP
2343 #line 356 "sieve/sieve-lex.l"
2344 return OPTIONAL;
2345 	YY_BREAK
2346 case 133:
2347 YY_RULE_SETUP
2348 #line 357 "sieve/sieve-lex.l"
2349 return ONCE;
2350 	YY_BREAK
2351 case 134:
2352 YY_RULE_SETUP
2353 #line 358 "sieve/sieve-lex.l"
2354 return RETURN;
2355 	YY_BREAK
2356 /* duplicate - RFC 7352 */
2357 case 135:
2358 YY_RULE_SETUP
2359 #line 361 "sieve/sieve-lex.l"
2360 return DUPLICATE;
2361 	YY_BREAK
2362 case 136:
2363 YY_RULE_SETUP
2364 #line 362 "sieve/sieve-lex.l"
2365 return yylval->nval = HEADER;
2366 	YY_BREAK
2367 case 137:
2368 YY_RULE_SETUP
2369 #line 363 "sieve/sieve-lex.l"
2370 return yylval->nval = UNIQUEID;
2371 	YY_BREAK
2372 /*   :handle              defined in 'vacation'         */
2373 /*   :seconds             defined in 'vacation-seconds' */
2374 /*   :last                defined in 'index'            */
2375 /* special-use - RFC 8579 */
2376 case 138:
2377 YY_RULE_SETUP
2378 #line 369 "sieve/sieve-lex.l"
2379 return SPECIALUSEEXISTS;
2380 	YY_BREAK
2381 case 139:
2382 YY_RULE_SETUP
2383 #line 370 "sieve/sieve-lex.l"
2384 return SPECIALUSE;
2385 	YY_BREAK
2386 /* fcc - RFC 8580 */
2387 case 140:
2388 YY_RULE_SETUP
2389 #line 373 "sieve/sieve-lex.l"
2390 return FCC;
2391 	YY_BREAK
2392 /* draft-gondwana-sieve-mailboxid */
2393 case 141:
2394 YY_RULE_SETUP
2395 #line 376 "sieve/sieve-lex.l"
2396 return MAILBOXIDEXISTS;
2397 	YY_BREAK
2398 case 142:
2399 YY_RULE_SETUP
2400 #line 377 "sieve/sieve-lex.l"
2401 return MAILBOXID;
2402 	YY_BREAK
2403 /* vnd.cyrus.log */
2404 case 143:
2405 YY_RULE_SETUP
2406 #line 380 "sieve/sieve-lex.l"
2407 return LOG;
2408 	YY_BREAK
2409 /* vnd.cyrus.jmapquery */
2410 case 144:
2411 YY_RULE_SETUP
2412 #line 383 "sieve/sieve-lex.l"
2413 return JMAPQUERY;
2414 	YY_BREAK
2415 /* vnd.cyrus.snooze */
2416 case 145:
2417 YY_RULE_SETUP
2418 #line 386 "sieve/sieve-lex.l"
2419 return SNOOZE;
2420 	YY_BREAK
2421 case 146:
2422 YY_RULE_SETUP
2423 #line 387 "sieve/sieve-lex.l"
2424 return MAILBOX;
2425 	YY_BREAK
2426 case 147:
2427 YY_RULE_SETUP
2428 #line 388 "sieve/sieve-lex.l"
2429 return ADDFLAGS;
2430 	YY_BREAK
2431 case 148:
2432 YY_RULE_SETUP
2433 #line 389 "sieve/sieve-lex.l"
2434 return REMOVEFLAGS;
2435 	YY_BREAK
2436 case 149:
2437 YY_RULE_SETUP
2438 #line 390 "sieve/sieve-lex.l"
2439 return WEEKDAYS;
2440 	YY_BREAK
2441 case 150:
2442 YY_RULE_SETUP
2443 #line 391 "sieve/sieve-lex.l"
2444 return TZID;
2445 	YY_BREAK
2446 /*   :create               defined in 'mailbox'     */
2447 /*   :mailboxid            defined in 'mailboxid'   */
2448 /*   :specialuse           defined in 'special-use' */
2449 case 151:
2450 /* rule 151 can match eol */
2451 YY_RULE_SETUP
2452 #line 396 "sieve/sieve-lex.l"
2453 ;  /* ignore bracketed comments */
2454 	YY_BREAK
2455 case 152:
2456 YY_RULE_SETUP
2457 #line 397 "sieve/sieve-lex.l"
2458 ;                /* ignore hash comments */
2459 	YY_BREAK
2460 case 153:
2461 /* rule 153 can match eol */
2462 YY_RULE_SETUP
2463 #line 398 "sieve/sieve-lex.l"
2464 ;          /* ignore whitespace */
2465 	YY_BREAK
2466 case 154:
2467 YY_RULE_SETUP
2468 #line 399 "sieve/sieve-lex.l"
2469 return yytext[0];
2470 	YY_BREAK
2471 case 155:
2472 YY_RULE_SETUP
2473 #line 401 "sieve/sieve-lex.l"
2474 ECHO;
2475 	YY_BREAK
2476 #line 2477 "sieve/sieve-lex.c"
2477 case YY_STATE_EOF(INITIAL):
2478 case YY_STATE_EOF(QCOLLATION):
2479 case YY_STATE_EOF(QRELATION):
2480 case YY_STATE_EOF(QIMPORTANCE):
2481 	yyterminate();
2482 
2483 	case YY_END_OF_BUFFER:
2484 		{
2485 		/* Amount of text matched not including the EOB char. */
2486 		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2487 
2488 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
2489 		*yy_cp = (yy_hold_char);
2490 		YY_RESTORE_YY_MORE_OFFSET
2491 
2492 		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2493 			{
2494 			/* We're scanning a new file or input source.  It's
2495 			 * possible that this happened because the user
2496 			 * just pointed yyin at a new source and called
2497 			 * yylex().  If so, then we have to assure
2498 			 * consistency between YY_CURRENT_BUFFER and our
2499 			 * globals.  Here is the right place to do so, because
2500 			 * this is the first action (other than possibly a
2501 			 * back-up) that will match for the new input source.
2502 			 */
2503 			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2504 			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2505 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2506 			}
2507 
2508 		/* Note that here we test for yy_c_buf_p "<=" to the position
2509 		 * of the first EOB in the buffer, since yy_c_buf_p will
2510 		 * already have been incremented past the NUL character
2511 		 * (since all states make transitions on EOB to the
2512 		 * end-of-buffer state).  Contrast this with the test
2513 		 * in input().
2514 		 */
2515 		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2516 			{ /* This was really a NUL. */
2517 			yy_state_type yy_next_state;
2518 
2519 			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2520 
2521 			yy_current_state = yy_get_previous_state(  );
2522 
2523 			/* Okay, we're now positioned to make the NUL
2524 			 * transition.  We couldn't have
2525 			 * yy_get_previous_state() go ahead and do it
2526 			 * for us because it doesn't know how to deal
2527 			 * with the possibility of jamming (and we don't
2528 			 * want to build jamming into it because then it
2529 			 * will run more slowly).
2530 			 */
2531 
2532 			yy_next_state = yy_try_NUL_trans( yy_current_state );
2533 
2534 			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2535 
2536 			if ( yy_next_state )
2537 				{
2538 				/* Consume the NUL. */
2539 				yy_cp = ++(yy_c_buf_p);
2540 				yy_current_state = yy_next_state;
2541 				goto yy_match;
2542 				}
2543 
2544 			else
2545 				{
2546 				yy_cp = (yy_c_buf_p);
2547 				goto yy_find_action;
2548 				}
2549 			}
2550 
2551 		else switch ( yy_get_next_buffer(  ) )
2552 			{
2553 			case EOB_ACT_END_OF_FILE:
2554 				{
2555 				(yy_did_buffer_switch_on_eof) = 0;
2556 
2557 				if ( yywrap(  ) )
2558 					{
2559 					/* Note: because we've taken care in
2560 					 * yy_get_next_buffer() to have set up
2561 					 * yytext, we can now set up
2562 					 * yy_c_buf_p so that if some total
2563 					 * hoser (like flex itself) wants to
2564 					 * call the scanner after we return the
2565 					 * YY_NULL, it'll still work - another
2566 					 * YY_NULL will get returned.
2567 					 */
2568 					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2569 
2570 					yy_act = YY_STATE_EOF(YY_START);
2571 					goto do_action;
2572 					}
2573 
2574 				else
2575 					{
2576 					if ( ! (yy_did_buffer_switch_on_eof) )
2577 						YY_NEW_FILE;
2578 					}
2579 				break;
2580 				}
2581 
2582 			case EOB_ACT_CONTINUE_SCAN:
2583 				(yy_c_buf_p) =
2584 					(yytext_ptr) + yy_amount_of_matched_text;
2585 
2586 				yy_current_state = yy_get_previous_state(  );
2587 
2588 				yy_cp = (yy_c_buf_p);
2589 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2590 				goto yy_match;
2591 
2592 			case EOB_ACT_LAST_MATCH:
2593 				(yy_c_buf_p) =
2594 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2595 
2596 				yy_current_state = yy_get_previous_state(  );
2597 
2598 				yy_cp = (yy_c_buf_p);
2599 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2600 				goto yy_find_action;
2601 			}
2602 		break;
2603 		}
2604 
2605 	default:
2606 		YY_FATAL_ERROR(
2607 			"fatal flex scanner internal error--no action found" );
2608 	} /* end of action switch */
2609 		} /* end of scanning one token */
2610 	} /* end of user's declarations */
2611 } /* end of yylex */
2612 
2613 /* yy_get_next_buffer - try to read in a new buffer
2614  *
2615  * Returns a code representing an action:
2616  *	EOB_ACT_LAST_MATCH -
2617  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2618  *	EOB_ACT_END_OF_FILE - end of file
2619  */
yy_get_next_buffer(void)2620 static int yy_get_next_buffer (void)
2621 {
2622     	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2623 	char *source = (yytext_ptr);
2624 	int number_to_move, i;
2625 	int ret_val;
2626 
2627 	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2628 		YY_FATAL_ERROR(
2629 		"fatal flex scanner internal error--end of buffer missed" );
2630 
2631 	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2632 		{ /* Don't try to fill the buffer, so this is an EOF. */
2633 		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2634 			{
2635 			/* We matched a single character, the EOB, so
2636 			 * treat this as a final EOF.
2637 			 */
2638 			return EOB_ACT_END_OF_FILE;
2639 			}
2640 
2641 		else
2642 			{
2643 			/* We matched some text prior to the EOB, first
2644 			 * process it.
2645 			 */
2646 			return EOB_ACT_LAST_MATCH;
2647 			}
2648 		}
2649 
2650 	/* Try to read more data. */
2651 
2652 	/* First move last chars to start of buffer. */
2653 	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
2654 
2655 	for ( i = 0; i < number_to_move; ++i )
2656 		*(dest++) = *(source++);
2657 
2658 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2659 		/* don't do the read, it's not guaranteed to return an EOF,
2660 		 * just force an EOF
2661 		 */
2662 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2663 
2664 	else
2665 		{
2666 			int num_to_read =
2667 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2668 
2669 		while ( num_to_read <= 0 )
2670 			{ /* Not enough room in the buffer - grow it. */
2671 
2672 			/* just a shorter name for the current buffer */
2673 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
2674 
2675 			int yy_c_buf_p_offset =
2676 				(int) ((yy_c_buf_p) - b->yy_ch_buf);
2677 
2678 			if ( b->yy_is_our_buffer )
2679 				{
2680 				int new_size = b->yy_buf_size * 2;
2681 
2682 				if ( new_size <= 0 )
2683 					b->yy_buf_size += b->yy_buf_size / 8;
2684 				else
2685 					b->yy_buf_size *= 2;
2686 
2687 				b->yy_ch_buf = (char *)
2688 					/* Include room in for 2 EOB chars. */
2689 					yyrealloc( (void *) b->yy_ch_buf,
2690 							 (yy_size_t) (b->yy_buf_size + 2)  );
2691 				}
2692 			else
2693 				/* Can't grow it, we don't own it. */
2694 				b->yy_ch_buf = NULL;
2695 
2696 			if ( ! b->yy_ch_buf )
2697 				YY_FATAL_ERROR(
2698 				"fatal error - scanner input buffer overflow" );
2699 
2700 			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2701 
2702 			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2703 						number_to_move - 1;
2704 
2705 			}
2706 
2707 		if ( num_to_read > YY_READ_BUF_SIZE )
2708 			num_to_read = YY_READ_BUF_SIZE;
2709 
2710 		/* Read in more data. */
2711 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2712 			(yy_n_chars), num_to_read );
2713 
2714 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2715 		}
2716 
2717 	if ( (yy_n_chars) == 0 )
2718 		{
2719 		if ( number_to_move == YY_MORE_ADJ )
2720 			{
2721 			ret_val = EOB_ACT_END_OF_FILE;
2722 			yyrestart( yyin  );
2723 			}
2724 
2725 		else
2726 			{
2727 			ret_val = EOB_ACT_LAST_MATCH;
2728 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2729 				YY_BUFFER_EOF_PENDING;
2730 			}
2731 		}
2732 
2733 	else
2734 		ret_val = EOB_ACT_CONTINUE_SCAN;
2735 
2736 	if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2737 		/* Extend the array by 50%, plus the number we really need. */
2738 		int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2739 		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2740 			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size  );
2741 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2742 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2743 		/* "- 2" to take care of EOB's */
2744 		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2745 	}
2746 
2747 	(yy_n_chars) += number_to_move;
2748 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2749 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2750 
2751 	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2752 
2753 	return ret_val;
2754 }
2755 
2756 /* yy_get_previous_state - get the state just before the EOB char was reached */
2757 
yy_get_previous_state(void)2758     static yy_state_type yy_get_previous_state (void)
2759 {
2760 	yy_state_type yy_current_state;
2761 	char *yy_cp;
2762 
2763 	yy_current_state = (yy_start);
2764 	yy_current_state += YY_AT_BOL();
2765 
2766 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2767 		{
2768 		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2769 		if ( yy_accept[yy_current_state] )
2770 			{
2771 			(yy_last_accepting_state) = yy_current_state;
2772 			(yy_last_accepting_cpos) = yy_cp;
2773 			}
2774 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2775 			{
2776 			yy_current_state = (int) yy_def[yy_current_state];
2777 			if ( yy_current_state >= 816 )
2778 				yy_c = yy_meta[yy_c];
2779 			}
2780 		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2781 		}
2782 
2783 	return yy_current_state;
2784 }
2785 
2786 /* yy_try_NUL_trans - try to make a transition on the NUL character
2787  *
2788  * synopsis
2789  *	next_state = yy_try_NUL_trans( current_state );
2790  */
yy_try_NUL_trans(yy_state_type yy_current_state)2791     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
2792 {
2793 	int yy_is_jam;
2794     	char *yy_cp = (yy_c_buf_p);
2795 
2796 	YY_CHAR yy_c = 1;
2797 	if ( yy_accept[yy_current_state] )
2798 		{
2799 		(yy_last_accepting_state) = yy_current_state;
2800 		(yy_last_accepting_cpos) = yy_cp;
2801 		}
2802 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2803 		{
2804 		yy_current_state = (int) yy_def[yy_current_state];
2805 		if ( yy_current_state >= 816 )
2806 			yy_c = yy_meta[yy_c];
2807 		}
2808 	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2809 	yy_is_jam = (yy_current_state == 815);
2810 
2811 		return yy_is_jam ? 0 : yy_current_state;
2812 }
2813 
2814 #ifndef YY_NO_UNPUT
2815 
2816 #endif
2817 
2818 #ifndef YY_NO_INPUT
2819 #ifdef __cplusplus
yyinput(void)2820     static int yyinput (void)
2821 #else
2822     static int input  (void)
2823 #endif
2824 
2825 {
2826 	int c;
2827 
2828 	*(yy_c_buf_p) = (yy_hold_char);
2829 
2830 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2831 		{
2832 		/* yy_c_buf_p now points to the character we want to return.
2833 		 * If this occurs *before* the EOB characters, then it's a
2834 		 * valid NUL; if not, then we've hit the end of the buffer.
2835 		 */
2836 		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2837 			/* This was really a NUL. */
2838 			*(yy_c_buf_p) = '\0';
2839 
2840 		else
2841 			{ /* need more input */
2842 			int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2843 			++(yy_c_buf_p);
2844 
2845 			switch ( yy_get_next_buffer(  ) )
2846 				{
2847 				case EOB_ACT_LAST_MATCH:
2848 					/* This happens because yy_g_n_b()
2849 					 * sees that we've accumulated a
2850 					 * token and flags that we need to
2851 					 * try matching the token before
2852 					 * proceeding.  But for input(),
2853 					 * there's no matching to consider.
2854 					 * So convert the EOB_ACT_LAST_MATCH
2855 					 * to EOB_ACT_END_OF_FILE.
2856 					 */
2857 
2858 					/* Reset buffer status. */
2859 					yyrestart( yyin );
2860 
2861 					/*FALLTHROUGH*/
2862 
2863 				case EOB_ACT_END_OF_FILE:
2864 					{
2865 					if ( yywrap(  ) )
2866 						return 0;
2867 
2868 					if ( ! (yy_did_buffer_switch_on_eof) )
2869 						YY_NEW_FILE;
2870 #ifdef __cplusplus
2871 					return yyinput();
2872 #else
2873 					return input();
2874 #endif
2875 					}
2876 
2877 				case EOB_ACT_CONTINUE_SCAN:
2878 					(yy_c_buf_p) = (yytext_ptr) + offset;
2879 					break;
2880 				}
2881 			}
2882 		}
2883 
2884 	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
2885 	*(yy_c_buf_p) = '\0';	/* preserve yytext */
2886 	(yy_hold_char) = *++(yy_c_buf_p);
2887 
2888 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2889 	if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
2890 
2891     yylineno++;
2892 ;
2893 
2894 	return c;
2895 }
2896 #endif	/* ifndef YY_NO_INPUT */
2897 
2898 /** Immediately switch to a different input stream.
2899  * @param input_file A readable stream.
2900  *
2901  * @note This function does not reset the start condition to @c INITIAL .
2902  */
yyrestart(FILE * input_file)2903     void yyrestart  (FILE * input_file )
2904 {
2905 
2906 	if ( ! YY_CURRENT_BUFFER ){
2907         yyensure_buffer_stack ();
2908 		YY_CURRENT_BUFFER_LVALUE =
2909             yy_create_buffer( yyin, YY_BUF_SIZE );
2910 	}
2911 
2912 	yy_init_buffer( YY_CURRENT_BUFFER, input_file );
2913 	yy_load_buffer_state(  );
2914 }
2915 
2916 /** Switch to a different input buffer.
2917  * @param new_buffer The new input buffer.
2918  *
2919  */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)2920     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2921 {
2922 
2923 	/* TODO. We should be able to replace this entire function body
2924 	 * with
2925 	 *		yypop_buffer_state();
2926 	 *		yypush_buffer_state(new_buffer);
2927      */
2928 	yyensure_buffer_stack ();
2929 	if ( YY_CURRENT_BUFFER == new_buffer )
2930 		return;
2931 
2932 	if ( YY_CURRENT_BUFFER )
2933 		{
2934 		/* Flush out information for old buffer. */
2935 		*(yy_c_buf_p) = (yy_hold_char);
2936 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2937 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2938 		}
2939 
2940 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
2941 	yy_load_buffer_state(  );
2942 
2943 	/* We don't actually know whether we did this switch during
2944 	 * EOF (yywrap()) processing, but the only time this flag
2945 	 * is looked at is after yywrap() is called, so it's safe
2946 	 * to go ahead and always set it.
2947 	 */
2948 	(yy_did_buffer_switch_on_eof) = 1;
2949 }
2950 
yy_load_buffer_state(void)2951 static void yy_load_buffer_state  (void)
2952 {
2953     	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2954 	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2955 	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2956 	(yy_hold_char) = *(yy_c_buf_p);
2957 }
2958 
2959 /** Allocate and initialize an input buffer state.
2960  * @param file A readable stream.
2961  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2962  *
2963  * @return the allocated buffer state.
2964  */
yy_create_buffer(FILE * file,int size)2965     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
2966 {
2967 	YY_BUFFER_STATE b;
2968 
2969 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
2970 	if ( ! b )
2971 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2972 
2973 	b->yy_buf_size = size;
2974 
2975 	/* yy_ch_buf has to be 2 characters longer than the size given because
2976 	 * we need to put in 2 end-of-buffer characters.
2977 	 */
2978 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
2979 	if ( ! b->yy_ch_buf )
2980 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2981 
2982 	b->yy_is_our_buffer = 1;
2983 
2984 	yy_init_buffer( b, file );
2985 
2986 	return b;
2987 }
2988 
2989 /** Destroy the buffer.
2990  * @param b a buffer created with yy_create_buffer()
2991  *
2992  */
yy_delete_buffer(YY_BUFFER_STATE b)2993     void yy_delete_buffer (YY_BUFFER_STATE  b )
2994 {
2995 
2996 	if ( ! b )
2997 		return;
2998 
2999 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3000 		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3001 
3002 	if ( b->yy_is_our_buffer )
3003 		yyfree( (void *) b->yy_ch_buf  );
3004 
3005 	yyfree( (void *) b  );
3006 }
3007 
3008 /* Initializes or reinitializes a buffer.
3009  * This function is sometimes called more than once on the same buffer,
3010  * such as during a yyrestart() or at EOF.
3011  */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)3012     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
3013 
3014 {
3015 	int oerrno = errno;
3016 
3017 	yy_flush_buffer( b );
3018 
3019 	b->yy_input_file = file;
3020 	b->yy_fill_buffer = 1;
3021 
3022     /* If b is the current buffer, then yy_init_buffer was _probably_
3023      * called from yyrestart() or through yy_get_next_buffer.
3024      * In that case, we don't want to reset the lineno or column.
3025      */
3026     if (b != YY_CURRENT_BUFFER){
3027         b->yy_bs_lineno = 1;
3028         b->yy_bs_column = 0;
3029     }
3030 
3031         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3032 
3033 	errno = oerrno;
3034 }
3035 
3036 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3037  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3038  *
3039  */
yy_flush_buffer(YY_BUFFER_STATE b)3040     void yy_flush_buffer (YY_BUFFER_STATE  b )
3041 {
3042     	if ( ! b )
3043 		return;
3044 
3045 	b->yy_n_chars = 0;
3046 
3047 	/* We always need two end-of-buffer characters.  The first causes
3048 	 * a transition to the end-of-buffer state.  The second causes
3049 	 * a jam in that state.
3050 	 */
3051 	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3052 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3053 
3054 	b->yy_buf_pos = &b->yy_ch_buf[0];
3055 
3056 	b->yy_at_bol = 1;
3057 	b->yy_buffer_status = YY_BUFFER_NEW;
3058 
3059 	if ( b == YY_CURRENT_BUFFER )
3060 		yy_load_buffer_state(  );
3061 }
3062 
3063 /** Pushes the new state onto the stack. The new state becomes
3064  *  the current state. This function will allocate the stack
3065  *  if necessary.
3066  *  @param new_buffer The new state.
3067  *
3068  */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)3069 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
3070 {
3071     	if (new_buffer == NULL)
3072 		return;
3073 
3074 	yyensure_buffer_stack();
3075 
3076 	/* This block is copied from yy_switch_to_buffer. */
3077 	if ( YY_CURRENT_BUFFER )
3078 		{
3079 		/* Flush out information for old buffer. */
3080 		*(yy_c_buf_p) = (yy_hold_char);
3081 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3082 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3083 		}
3084 
3085 	/* Only push if top exists. Otherwise, replace top. */
3086 	if (YY_CURRENT_BUFFER)
3087 		(yy_buffer_stack_top)++;
3088 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
3089 
3090 	/* copied from yy_switch_to_buffer. */
3091 	yy_load_buffer_state(  );
3092 	(yy_did_buffer_switch_on_eof) = 1;
3093 }
3094 
3095 /** Removes and deletes the top of the stack, if present.
3096  *  The next element becomes the new top.
3097  *
3098  */
yypop_buffer_state(void)3099 void yypop_buffer_state (void)
3100 {
3101     	if (!YY_CURRENT_BUFFER)
3102 		return;
3103 
3104 	yy_delete_buffer(YY_CURRENT_BUFFER );
3105 	YY_CURRENT_BUFFER_LVALUE = NULL;
3106 	if ((yy_buffer_stack_top) > 0)
3107 		--(yy_buffer_stack_top);
3108 
3109 	if (YY_CURRENT_BUFFER) {
3110 		yy_load_buffer_state(  );
3111 		(yy_did_buffer_switch_on_eof) = 1;
3112 	}
3113 }
3114 
3115 /* Allocates the stack if it does not exist.
3116  *  Guarantees space for at least one push.
3117  */
yyensure_buffer_stack(void)3118 static void yyensure_buffer_stack (void)
3119 {
3120 	yy_size_t num_to_alloc;
3121 
3122 	if (!(yy_buffer_stack)) {
3123 
3124 		/* First allocation is just for 2 elements, since we don't know if this
3125 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3126 		 * immediate realloc on the next call.
3127          */
3128       num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
3129 		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
3130 								(num_to_alloc * sizeof(struct yy_buffer_state*)
3131 								);
3132 		if ( ! (yy_buffer_stack) )
3133 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3134 
3135 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3136 
3137 		(yy_buffer_stack_max) = num_to_alloc;
3138 		(yy_buffer_stack_top) = 0;
3139 		return;
3140 	}
3141 
3142 	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3143 
3144 		/* Increase the buffer to prepare for a possible push. */
3145 		yy_size_t grow_size = 8 /* arbitrary grow size */;
3146 
3147 		num_to_alloc = (yy_buffer_stack_max) + grow_size;
3148 		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
3149 								((yy_buffer_stack),
3150 								num_to_alloc * sizeof(struct yy_buffer_state*)
3151 								);
3152 		if ( ! (yy_buffer_stack) )
3153 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3154 
3155 		/* zero only the new slots.*/
3156 		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3157 		(yy_buffer_stack_max) = num_to_alloc;
3158 	}
3159 }
3160 
3161 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3162  * @param base the character buffer
3163  * @param size the size in bytes of the character buffer
3164  *
3165  * @return the newly allocated buffer state object.
3166  */
yy_scan_buffer(char * base,yy_size_t size)3167 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
3168 {
3169 	YY_BUFFER_STATE b;
3170 
3171 	if ( size < 2 ||
3172 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
3173 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
3174 		/* They forgot to leave room for the EOB's. */
3175 		return NULL;
3176 
3177 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
3178 	if ( ! b )
3179 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3180 
3181 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
3182 	b->yy_buf_pos = b->yy_ch_buf = base;
3183 	b->yy_is_our_buffer = 0;
3184 	b->yy_input_file = NULL;
3185 	b->yy_n_chars = b->yy_buf_size;
3186 	b->yy_is_interactive = 0;
3187 	b->yy_at_bol = 1;
3188 	b->yy_fill_buffer = 0;
3189 	b->yy_buffer_status = YY_BUFFER_NEW;
3190 
3191 	yy_switch_to_buffer( b  );
3192 
3193 	return b;
3194 }
3195 
3196 /** Setup the input buffer state to scan a string. The next call to yylex() will
3197  * scan from a @e copy of @a str.
3198  * @param yystr a NUL-terminated string to scan
3199  *
3200  * @return the newly allocated buffer state object.
3201  * @note If you want to scan bytes that may contain NUL values, then use
3202  *       yy_scan_bytes() instead.
3203  */
yy_scan_string(const char * yystr)3204 YY_BUFFER_STATE yy_scan_string (const char * yystr )
3205 {
3206 
3207 	return yy_scan_bytes( yystr, (int) strlen(yystr) );
3208 }
3209 
3210 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
3211  * scan from a @e copy of @a bytes.
3212  * @param yybytes the byte buffer to scan
3213  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
3214  *
3215  * @return the newly allocated buffer state object.
3216  */
yy_scan_bytes(const char * yybytes,int _yybytes_len)3217 YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len )
3218 {
3219 	YY_BUFFER_STATE b;
3220 	char *buf;
3221 	yy_size_t n;
3222 	int i;
3223 
3224 	/* Get memory for full buffer, including space for trailing EOB's. */
3225 	n = (yy_size_t) (_yybytes_len + 2);
3226 	buf = (char *) yyalloc( n  );
3227 	if ( ! buf )
3228 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3229 
3230 	for ( i = 0; i < _yybytes_len; ++i )
3231 		buf[i] = yybytes[i];
3232 
3233 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3234 
3235 	b = yy_scan_buffer( buf, n );
3236 	if ( ! b )
3237 		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3238 
3239 	/* It's okay to grow etc. this buffer, and we should throw it
3240 	 * away when we're done.
3241 	 */
3242 	b->yy_is_our_buffer = 1;
3243 
3244 	return b;
3245 }
3246 
3247 #ifndef YY_EXIT_FAILURE
3248 #define YY_EXIT_FAILURE 2
3249 #endif
3250 
yy_fatal_error(const char * msg)3251 static void yynoreturn yy_fatal_error (const char* msg )
3252 {
3253 			fprintf( stderr, "%s\n", msg );
3254 	exit( YY_EXIT_FAILURE );
3255 }
3256 
3257 /* Redefine yyless() so it works in section 3 code. */
3258 
3259 #undef yyless
3260 #define yyless(n) \
3261 	do \
3262 		{ \
3263 		/* Undo effects of setting up yytext. */ \
3264         int yyless_macro_arg = (n); \
3265         YY_LESS_LINENO(yyless_macro_arg);\
3266 		yytext[yyleng] = (yy_hold_char); \
3267 		(yy_c_buf_p) = yytext + yyless_macro_arg; \
3268 		(yy_hold_char) = *(yy_c_buf_p); \
3269 		*(yy_c_buf_p) = '\0'; \
3270 		yyleng = yyless_macro_arg; \
3271 		} \
3272 	while ( 0 )
3273 
3274 /* Accessor  methods (get/set functions) to struct members. */
3275 
3276 /** Get the current line number.
3277  *
3278  */
yyget_lineno(void)3279 int yyget_lineno  (void)
3280 {
3281 
3282     return yylineno;
3283 }
3284 
3285 /** Get the input stream.
3286  *
3287  */
yyget_in(void)3288 FILE *yyget_in  (void)
3289 {
3290         return yyin;
3291 }
3292 
3293 /** Get the output stream.
3294  *
3295  */
yyget_out(void)3296 FILE *yyget_out  (void)
3297 {
3298         return yyout;
3299 }
3300 
3301 /** Get the length of the current token.
3302  *
3303  */
yyget_leng(void)3304 int yyget_leng  (void)
3305 {
3306         return yyleng;
3307 }
3308 
3309 /** Get the current token.
3310  *
3311  */
3312 
yyget_text(void)3313 char *yyget_text  (void)
3314 {
3315         return yytext;
3316 }
3317 
3318 /** Set the current line number.
3319  * @param _line_number line number
3320  *
3321  */
yyset_lineno(int _line_number)3322 void yyset_lineno (int  _line_number )
3323 {
3324 
3325     yylineno = _line_number;
3326 }
3327 
3328 /** Set the input stream. This does not discard the current
3329  * input buffer.
3330  * @param _in_str A readable stream.
3331  *
3332  * @see yy_switch_to_buffer
3333  */
yyset_in(FILE * _in_str)3334 void yyset_in (FILE *  _in_str )
3335 {
3336         yyin = _in_str ;
3337 }
3338 
yyset_out(FILE * _out_str)3339 void yyset_out (FILE *  _out_str )
3340 {
3341         yyout = _out_str ;
3342 }
3343 
yyget_debug(void)3344 int yyget_debug  (void)
3345 {
3346         return yy_flex_debug;
3347 }
3348 
yyset_debug(int _bdebug)3349 void yyset_debug (int  _bdebug )
3350 {
3351         yy_flex_debug = _bdebug ;
3352 }
3353 
yy_init_globals(void)3354 static int yy_init_globals (void)
3355 {
3356         /* Initialization is the same as for the non-reentrant scanner.
3357      * This function is called from yylex_destroy(), so don't allocate here.
3358      */
3359 
3360     /* We do not touch yylineno unless the option is enabled. */
3361     yylineno =  1;
3362 
3363     (yy_buffer_stack) = NULL;
3364     (yy_buffer_stack_top) = 0;
3365     (yy_buffer_stack_max) = 0;
3366     (yy_c_buf_p) = NULL;
3367     (yy_init) = 0;
3368     (yy_start) = 0;
3369 
3370 /* Defined in main.c */
3371 #ifdef YY_STDINIT
3372     yyin = stdin;
3373     yyout = stdout;
3374 #else
3375     yyin = NULL;
3376     yyout = NULL;
3377 #endif
3378 
3379     /* For future reference: Set errno on error, since we are called by
3380      * yylex_init()
3381      */
3382     return 0;
3383 }
3384 
3385 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)3386 int yylex_destroy  (void)
3387 {
3388 
3389     /* Pop the buffer stack, destroying each element. */
3390 	while(YY_CURRENT_BUFFER){
3391 		yy_delete_buffer( YY_CURRENT_BUFFER  );
3392 		YY_CURRENT_BUFFER_LVALUE = NULL;
3393 		yypop_buffer_state();
3394 	}
3395 
3396 	/* Destroy the stack itself. */
3397 	yyfree((yy_buffer_stack) );
3398 	(yy_buffer_stack) = NULL;
3399 
3400     /* Reset the globals. This is important in a non-reentrant scanner so the next time
3401      * yylex() is called, initialization will occur. */
3402     yy_init_globals( );
3403 
3404     return 0;
3405 }
3406 
3407 /*
3408  * Internal utility routines.
3409  */
3410 
3411 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n)3412 static void yy_flex_strncpy (char* s1, const char * s2, int n )
3413 {
3414 
3415 	int i;
3416 	for ( i = 0; i < n; ++i )
3417 		s1[i] = s2[i];
3418 }
3419 #endif
3420 
3421 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s)3422 static int yy_flex_strlen (const char * s )
3423 {
3424 	int n;
3425 	for ( n = 0; s[n]; ++n )
3426 		;
3427 
3428 	return n;
3429 }
3430 #endif
3431 
yyalloc(yy_size_t size)3432 void *yyalloc (yy_size_t  size )
3433 {
3434 			return malloc(size);
3435 }
3436 
yyrealloc(void * ptr,yy_size_t size)3437 void *yyrealloc  (void * ptr, yy_size_t  size )
3438 {
3439 
3440 	/* The cast to (char *) in the following accommodates both
3441 	 * implementations that use char* generic pointers, and those
3442 	 * that use void* generic pointers.  It works with the latter
3443 	 * because both ANSI C and C++ allow castless assignment from
3444 	 * any pointer type to void*, and deal with argument conversions
3445 	 * as though doing an assignment.
3446 	 */
3447 	return realloc(ptr, size);
3448 }
3449 
yyfree(void * ptr)3450 void yyfree (void * ptr )
3451 {
3452 			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
3453 }
3454 
3455 #define YYTABLES_NAME "yytables"
3456 
3457 #line 401 "sieve/sieve-lex.l"
3458 
3459 
3460 /* convert numerical string w/units to unsigned long */
tonum(const char * str)3461 static unsigned long long tonum(const char *str)
3462 {
3463     char *units;
3464     unsigned long long val = strtoull(str, &units, 10);
3465 
3466     if (*units && errno != ERANGE) {
3467         switch (toupper(*units)) {
3468         case 'K': val *= (1ULL << 10); break;
3469         case 'M': val *= (1ULL << 20); break;
3470         case 'G': val *= (1ULL << 30); break;
3471             /* for future use */
3472         case 'T': val *= (1ULL << 40); break;
3473         case 'P': val *= (1ULL << 50); break;
3474         case 'E': val *= (1ULL << 60); break;
3475         default: break;
3476         }
3477     }
3478 
3479     return val;
3480 }
3481 
3482 /* convert unicode to sequence of UTF-8 characters */
unicode_to_utf8(unsigned char buf[],unsigned int code)3483 static size_t unicode_to_utf8(unsigned char buf[], unsigned int code)
3484 {
3485     if (code <= 0x7F) {
3486         buf[0] = code;
3487         return 1;
3488     }
3489     if (code <= 0x7FF) {
3490         buf[0] = 0xC0 | (code >> 6);            /* 110xxxxx */
3491         buf[1] = 0x80 | (code & 0x3F);          /* 10xxxxxx */
3492         return 2;
3493     }
3494     if (code < 0xE000 && code > 0xD7FF) return 0;
3495     if (code <= 0xFFFF) {
3496         buf[0] = 0xE0 | (code >> 12);           /* 1110xxxx */
3497         buf[1] = 0x80 | ((code >> 6) & 0x3F);   /* 10xxxxxx */
3498         buf[2] = 0x80 | (code & 0x3F);          /* 10xxxxxx */
3499         return 3;
3500     }
3501     if (code <= 0x10FFFF) {
3502         buf[0] = 0xF0 | (code >> 18);           /* 11110xxx */
3503         buf[1] = 0x80 | ((code >> 12) & 0x3F);  /* 10xxxxxx */
3504         buf[2] = 0x80 | ((code >> 6) & 0x3F);   /* 10xxxxxx */
3505         buf[3] = 0x80 | (code & 0x3F);          /* 10xxxxxx */
3506         return 4;
3507     }
3508     return 0;
3509 }
3510 
3511 /*
3512   Decode "encoded-character" strings having one of the following two forms:
3513 
3514   encoded-arb-octets   =  "${hex:" hex-pair-seq "}"
3515   hex-pair-seq         =  *blank hex-pair *(1*blank hex-pair) *blank
3516   hex-pair             =  1*2HEXDIG
3517 
3518   encoded-unicode-char =  "${unicode:" unicode-hex-seq "}"
3519   unicode-hex-seq      =  *blank unicode-hex *(1*blank unicode-hex) *blank
3520   unicode-hex          =  1*HEXDIG
3521 
3522   blank                =  WSP / CRLF
3523   WSP                  =  SP / HTAB
3524   HEXDIG               =  DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
3525 */
decode_string(struct buf * buf)3526 static int decode_string(struct buf *buf)
3527 {
3528     static struct buf decode_buf = BUF_INITIALIZER;
3529     const char *cp, *enc_start;
3530 
3531     for (cp = buf_cstring(buf); (enc_start = strstr(cp, "${")); ) {
3532         unsigned is_unicode = 0;
3533         size_t len;
3534 
3535         cp = enc_start + 2;
3536 
3537         if (!strncasecmp(cp, "hex:", 4)) {
3538             cp += 4;
3539         }
3540         else if (!strncasecmp(cp, "unicode:", 8)) {
3541             is_unicode = 1;
3542             cp += 8;
3543         }
3544         else {
3545             /* not coded */
3546             continue;
3547         }
3548 
3549         /* eat leading whitespace */
3550         while (isspace(*cp)) cp++;
3551 
3552         /* sanity check "encoded" data (being liberal in accepting 'a' - 'f') */
3553         len = strspn(cp, "0123456789ABCDEFabcdef \t\r\n");
3554         if (!isxdigit(*cp) || cp[len] != '}') continue;
3555 
3556         /* decode characters */
3557         buf_reset(&decode_buf);
3558         do {
3559             unsigned int ndigits, code;
3560 
3561             for (ndigits = 0, code = 0; isxdigit(*cp); ndigits++, cp++) {
3562                 unsigned int digit =
3563                     (*cp > '9') ? 10 + toupper(*cp) - 'A' : *cp - '0';
3564 
3565                 code = (code << 4) + digit;
3566             }
3567 
3568             if (is_unicode) {
3569                 unsigned char utf8[4];
3570 
3571                 len = unicode_to_utf8(utf8, code);
3572                 if (!len) {
3573                     /* invalid UTF-8 encoding - error */
3574                     return 0;
3575                 }
3576 
3577                 /* append decoded unicode char(s) to buffer */
3578                 buf_appendmap(&decode_buf, (char *) utf8, len);
3579             }
3580             else if (ndigits > 2) {
3581                 /* too many hex digits - treat as not coded */
3582                 buf_reset(&decode_buf);
3583                 cp += len + 1;
3584                 break;
3585             }
3586             else {
3587                 /* append decoded hex char to buffer */
3588                 buf_putc(&decode_buf, code);
3589             }
3590 
3591             /* eat trailing whitespace */
3592             while (isspace(*cp)) cp++;
3593 
3594         } while (*cp != '}');
3595 
3596         if ((len = buf_len(&decode_buf))) {
3597             /* replace the encoded string with its decoded value */
3598             size_t offset = enc_start - buf_base(buf);
3599 
3600             buf_remove(buf, offset, cp - enc_start + 1);
3601             buf_insert(buf, offset, &decode_buf);
3602 
3603             /* buffer may have been reallocated - reposition our pointer */
3604             cp = buf_cstring(buf) + offset + len;
3605         }
3606     }
3607 
3608     return 1;
3609 }
3610 
3611