1 #line 2 "xslpattern.yy.c"
3 #line 4 "xslpattern.yy.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t
;
45 typedef uint8_t flex_uint8_t
;
46 typedef int16_t flex_int16_t
;
47 typedef uint16_t flex_uint16_t
;
48 typedef int32_t flex_int32_t
;
49 typedef uint32_t flex_uint32_t
;
51 typedef signed char flex_int8_t
;
52 typedef short int flex_int16_t
;
53 typedef int flex_int32_t
;
54 typedef unsigned char flex_uint8_t
;
55 typedef unsigned short int flex_uint16_t
;
56 typedef unsigned int flex_uint32_t
;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
89 #endif /* ! FLEXINT_H */
93 /* The "const" storage-class-modifier is valid. */
96 #else /* ! __cplusplus */
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
107 #define yyconst const
112 /* Returned upon end-of-file. */
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index. If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122 /* An opaque pointer. */
123 #ifndef YY_TYPEDEF_YY_SCANNER_T
124 #define YY_TYPEDEF_YY_SCANNER_T
125 typedef void* yyscan_t
;
128 /* For convenience, these vars (plus the bison vars far below)
129 are macros in the reentrant scanner. */
130 #define yyin yyg->yyin_r
131 #define yyout yyg->yyout_r
132 #define yyextra yyg->yyextra_r
133 #define yyleng yyg->yyleng_r
134 #define yytext yyg->yytext_r
135 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137 #define yy_flex_debug yyg->yy_flex_debug_r
139 /* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
143 #define BEGIN yyg->yy_start = 1 + 2 *
145 /* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
149 #define YY_START ((yyg->yy_start - 1) / 2)
150 #define YYSTATE YY_START
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE xslpattern_restart(yyin ,yyscanner )
158 #define YY_END_OF_BUFFER_CHAR 0
160 /* Size of default input buffer. */
163 /* On IA-64, the buffer size is 16k, not 8k.
164 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
165 * Ditto for the __ia64__ case accordingly.
167 #define YY_BUF_SIZE 32768
169 #define YY_BUF_SIZE 16384
170 #endif /* __ia64__ */
173 /* The state buf must be large enough to hold one state per character in the main buffer.
175 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
177 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
178 #define YY_TYPEDEF_YY_BUFFER_STATE
179 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
182 #define EOB_ACT_CONTINUE_SCAN 0
183 #define EOB_ACT_END_OF_FILE 1
184 #define EOB_ACT_LAST_MATCH 2
186 #define YY_LESS_LINENO(n)
188 /* Return all but the first "n" matched characters back to the input stream. */
192 /* Undo effects of setting up yytext. */ \
193 int yyless_macro_arg = (n); \
194 YY_LESS_LINENO(yyless_macro_arg);\
195 *yy_cp = yyg->yy_hold_char; \
196 YY_RESTORE_YY_MORE_OFFSET \
197 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
202 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
204 #ifndef YY_TYPEDEF_YY_SIZE_T
205 #define YY_TYPEDEF_YY_SIZE_T
206 typedef size_t yy_size_t
;
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
215 char *yy_ch_buf
; /* input buffer */
216 char *yy_buf_pos
; /* current position in input buffer */
218 /* Size of input buffer in bytes, not including room for EOB
221 yy_size_t yy_buf_size
;
223 /* Number of characters read into yy_ch_buf, not including EOB
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
232 int yy_is_our_buffer
;
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
239 int yy_is_interactive
;
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
247 int yy_bs_lineno
; /**< The line count. */
248 int yy_bs_column
; /**< The column count. */
250 /* Whether to try to fill the input buffer when we reach the
255 int yy_buffer_status
;
257 #define YY_BUFFER_NEW 0
258 #define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
265 * When we actually see the EOF, we change the status to "new"
266 * (via xslpattern_restart()), so that the user can continue scanning by
267 * just pointing yyin at a new input file.
269 #define YY_BUFFER_EOF_PENDING 2
272 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
274 /* We provide macros for accessing buffer states in case in the
275 * future we want to put the buffer states in a more general
278 * Returns the top of the stack, or NULL.
280 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
284 /* Same as previous macro, but useful when we know that the buffer stack is not
285 * NULL or when we need an lvalue. For internal use only.
287 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
289 void xslpattern_restart (FILE *input_file
,yyscan_t yyscanner
);
290 void xslpattern__switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
291 YY_BUFFER_STATE
xslpattern__create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
292 void xslpattern__delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
293 void xslpattern__flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
294 void xslpattern_push_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
295 void xslpattern_pop_buffer_state (yyscan_t yyscanner
);
297 static void xslpattern_ensure_buffer_stack (yyscan_t yyscanner
);
298 static void xslpattern__load_buffer_state (yyscan_t yyscanner
);
299 static void xslpattern__init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
301 #define YY_FLUSH_BUFFER xslpattern__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
303 YY_BUFFER_STATE
xslpattern__scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
304 YY_BUFFER_STATE
xslpattern__scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
305 YY_BUFFER_STATE
xslpattern__scan_bytes (yyconst
char *bytes
,int len
,yyscan_t yyscanner
);
307 void *xslpattern_alloc (yy_size_t
,yyscan_t yyscanner
);
308 void *xslpattern_realloc (void *,yy_size_t
,yyscan_t yyscanner
);
309 void xslpattern_free (void * ,yyscan_t yyscanner
);
311 #define yy_new_buffer xslpattern__create_buffer
313 #define yy_set_interactive(is_interactive) \
315 if ( ! YY_CURRENT_BUFFER ){ \
316 xslpattern_ensure_buffer_stack (yyscanner); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 xslpattern__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
320 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
323 #define yy_set_bol(at_bol) \
325 if ( ! YY_CURRENT_BUFFER ){\
326 xslpattern_ensure_buffer_stack (yyscanner); \
327 YY_CURRENT_BUFFER_LVALUE = \
328 xslpattern__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
330 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
333 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
335 /* Begin user sect3 */
337 #define xslpattern_wrap(n) 1
338 #define YY_SKIP_YYWRAP
340 typedef unsigned char YY_CHAR
;
342 typedef int yy_state_type
;
344 #define yytext_ptr yytext_r
346 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
347 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
348 static int yy_get_next_buffer (yyscan_t yyscanner
);
349 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
351 /* Done after the current pattern has been matched and before the
352 * corresponding action - sets up yytext.
354 #define YY_DO_BEFORE_ACTION \
355 yyg->yytext_ptr = yy_bp; \
356 yyleng = (size_t) (yy_cp - yy_bp); \
357 yyg->yy_hold_char = *yy_cp; \
359 yyg->yy_c_buf_p = yy_cp;
361 #define YY_NUM_RULES 38
362 #define YY_END_OF_BUFFER 39
363 /* This struct is not used in this scanner,
364 but its presence is necessary. */
367 flex_int32_t yy_verify
;
370 static yyconst flex_int16_t yy_accept
[96] =
372 0, 0, 39, 37, 1, 1, 34, 37, 37, 37,
373 37, 9, 10, 15, 14, 6, 4, 36, 8, 23,
374 19, 25, 13, 35, 11, 12, 35, 35, 33, 1,
375 21, 0, 2, 0, 0, 0, 0, 0, 0, 0,
376 16, 0, 5, 36, 3, 36, 36, 7, 27, 29,
377 35, 35, 35, 35, 17, 17, 0, 0, 0, 0,
378 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
379 36, 16, 0, 0, 0, 19, 25, 0, 0, 0,
380 0, 0, 0, 23, 0, 31, 32, 20, 30, 26,
385 static yyconst flex_int32_t yy_ec
[256] =
387 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
388 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 2, 4, 5, 1, 6, 1, 7, 8, 9,
391 10, 11, 1, 12, 13, 14, 15, 16, 16, 16,
392 16, 16, 16, 16, 16, 16, 16, 17, 1, 18,
393 19, 20, 1, 21, 22, 22, 22, 22, 22, 22,
394 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
395 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
396 23, 1, 24, 1, 25, 1, 26, 22, 22, 27,
398 28, 22, 29, 22, 30, 22, 22, 31, 22, 32,
399 33, 22, 34, 35, 22, 36, 22, 22, 22, 22,
400 37, 22, 1, 38, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 13, 1, 1, 1, 1, 1, 1, 1,
407 1, 39, 39, 39, 39, 39, 39, 39, 39, 39,
409 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
410 39, 39, 39, 39, 1, 39, 39, 39, 39, 39,
411 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
412 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
413 39, 39, 39, 39, 39, 39, 1, 39, 39, 39,
417 static yyconst flex_int32_t yy_meta
[40] =
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 2, 2, 1, 2, 1, 1, 1, 1,
421 1, 2, 1, 1, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 1, 2
425 static yyconst flex_int16_t yy_base
[99] =
427 0, 0, 137, 138, 38, 40, 117, 130, 18, 127,
428 125, 138, 138, 138, 138, 38, 117, 39, 114, 111,
429 138, 110, 138, 43, 138, 138, 47, 30, 90, 64,
430 138, 122, 138, 38, 92, 45, 46, 48, 52, 90,
431 138, 116, 138, 107, 138, 106, 72, 138, 138, 138,
432 89, 88, 87, 55, 86, 138, 86, 56, 110, 109,
433 108, 79, 61, 62, 84, 105, 104, 103, 72, 101,
434 90, 73, 98, 97, 90, 138, 138, 89, 88, 86,
435 85, 65, 58, 138, 52, 138, 138, 138, 138, 138,
436 138, 138, 138, 138, 138, 98, 100, 43
440 static yyconst flex_int16_t yy_def
[99] =
442 95, 1, 95, 95, 95, 95, 95, 96, 95, 95,
443 97, 95, 95, 95, 95, 95, 95, 95, 95, 95,
444 95, 95, 95, 98, 95, 95, 98, 27, 95, 95,
445 95, 96, 95, 95, 95, 95, 95, 95, 95, 95,
446 95, 97, 95, 95, 95, 95, 95, 95, 95, 95,
447 27, 27, 27, 27, 27, 95, 95, 95, 95, 95,
448 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
449 95, 27, 95, 95, 95, 95, 95, 95, 95, 95,
450 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
451 95, 95, 95, 95, 0, 95, 95, 95
455 static yyconst flex_int16_t yy_nxt
[178] =
457 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
458 14, 15, 4, 16, 17, 18, 19, 20, 21, 22,
459 23, 24, 25, 26, 24, 27, 24, 24, 24, 24,
460 24, 24, 28, 24, 24, 24, 24, 29, 24, 30,
461 30, 30, 30, 34, 52, 35, 36, 37, 38, 39,
462 40, 43, 46, 44, 47, 51, 51, 94, 51, 51,
463 51, 52, 51, 93, 55, 30, 30, 53, 57, 58,
464 92, 53, 60, 62, 63, 66, 64, 65, 54, 68,
465 61, 72, 74, 67, 69, 46, 52, 47, 79, 81,
466 91, 90, 75, 89, 88, 87, 80, 82, 32, 32,
468 42, 42, 41, 86, 52, 71, 56, 85, 31, 84,
469 49, 83, 78, 77, 50, 76, 73, 52, 52, 52,
470 52, 71, 44, 33, 70, 59, 33, 56, 50, 49,
471 48, 45, 33, 41, 33, 31, 95, 3, 95, 95,
472 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
473 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
474 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
475 95, 95, 95, 95, 95, 95, 95
478 static yyconst flex_int16_t yy_chk
[178] =
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
484 5, 6, 6, 9, 98, 9, 9, 9, 9, 9,
485 9, 16, 18, 16, 18, 24, 24, 85, 24, 27,
486 27, 28, 27, 83, 28, 30, 30, 24, 34, 34,
487 82, 27, 36, 37, 37, 38, 37, 37, 27, 39,
488 36, 54, 58, 38, 39, 47, 54, 47, 63, 64,
489 81, 80, 58, 79, 78, 75, 63, 64, 96, 96,
491 97, 97, 74, 73, 72, 71, 70, 69, 68, 67,
492 66, 65, 62, 61, 60, 59, 57, 55, 53, 52,
493 51, 46, 44, 42, 40, 35, 32, 29, 22, 20,
494 19, 17, 11, 10, 8, 7, 3, 95, 95, 95,
495 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
496 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
497 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
498 95, 95, 95, 95, 95, 95, 95
501 /* The intent behind this definition is that it'll catch
502 * any uses of REJECT which flex missed.
504 #define REJECT reject_used_but_not_detected
505 #define yymore() yymore_used_but_not_detected
506 #define YY_MORE_ADJ 0
507 #define YY_RESTORE_YY_MORE_OFFSET
508 #line 1 "xslpattern.l"
512 * Copyright 2010 Adam Martinson for CodeWeavers
514 * This library is free software; you can redistribute it and/or
515 * modify it under the terms of the GNU Lesser General Public
516 * License as published by the Free Software Foundation; either
517 * version 2.1 of the License, or (at your option) any later version.
519 * This library is distributed in the hope that it will be useful,
520 * but WITHOUT ANY WARRANTY; without even the implied warranty of
521 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
522 * Lesser General Public License for more details.
524 * You should have received a copy of the GNU Lesser General Public
525 * License along with this library; if not, write to the Free Software
526 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
528 #line 22 "xslpattern.l"
530 #include "wine/port.h"
534 #include "xslpattern.h"
535 #include "xslpattern.tab.h"
537 #define SCAN xslpattern_get_extra(yyscanner)
539 #define YY_INPUT(tok_buf, tok_len, max) \
541 if (SCAN->pos <= SCAN->len) \
543 tok_len = SCAN->len - SCAN->pos; \
544 if (tok_len > max) tok_len = max; \
545 memcpy(tok_buf, SCAN->in + SCAN->pos, tok_len); \
546 SCAN->pos += tok_len; \
554 #define TOK(tok) TRACE("token: %s : %s\n", #tok, yytext); return tok
555 #define OP(tok) *yylval=NULL; TOK(tok)
556 #define SYM(tok) *yylval=NULL; TOK(tok)
557 #define STR(tok) *yylval=xmlStrdup(BAD_CAST yytext); TOK(tok)
560 #define YY_NO_INPUT 1
561 /* From the w3c XML standard
562 * <http://www.w3.org/TR/REC-xml/> */
563 /* [2.3] Common Syntactic Constructs */
564 /* From the w3c XML Namespace standard
565 * <http://www.w3.org/TR/REC-xml-names/> */
566 /* [3] Declaring Namespaces*/
567 /* Mostly verbatim from the w3c XPath standard.
568 * <http://www.w3.org/TR/xpath/> */
570 * ||, &&, $foo$ are XSLPattern only */
571 /* [3.7] Lexical Structure */
572 #line 576 "xslpattern.yy.c"
576 #ifndef YY_NO_UNISTD_H
577 /* Special case for "unistd.h", since it is non-ANSI. We include it way
578 * down here because we want the user's section 1 to have been scanned first.
579 * The user has a chance to override it with an option.
584 #ifndef YY_EXTRA_TYPE
585 #define YY_EXTRA_TYPE void *
588 /* Holds the entire state of the reentrant scanner. */
592 /* User-defined. Not touched by flex. */
593 YY_EXTRA_TYPE yyextra_r
;
595 /* The rest are the same as the globals declared in the non-reentrant scanner. */
596 FILE *yyin_r
, *yyout_r
;
597 size_t yy_buffer_stack_top
; /**< index of top of stack. */
598 size_t yy_buffer_stack_max
; /**< capacity of stack. */
599 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
606 int yy_did_buffer_switch_on_eof
;
607 int yy_start_stack_ptr
;
608 int yy_start_stack_depth
;
610 yy_state_type yy_last_accepting_state
;
611 char* yy_last_accepting_cpos
;
622 }; /* end struct yyguts_t */
624 static int yy_init_globals (yyscan_t yyscanner
);
626 /* This must go here because YYSTYPE and YYLTYPE are included
627 * from bison output in section 1.*/
628 # define yylval yyg->yylval_r
630 int xslpattern_lex_init (yyscan_t
* scanner
);
632 int xslpattern_lex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
634 /* Accessor methods to globals.
635 These are made visible to non-reentrant scanners for convenience. */
637 int xslpattern_lex_destroy (yyscan_t yyscanner
);
639 int xslpattern_get_debug (yyscan_t yyscanner
);
641 void xslpattern_set_debug (int debug_flag
,yyscan_t yyscanner
);
643 YY_EXTRA_TYPE
xslpattern_get_extra (yyscan_t yyscanner
);
645 void xslpattern_set_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
647 FILE *xslpattern_get_in (yyscan_t yyscanner
);
649 void xslpattern_set_in (FILE * in_str
,yyscan_t yyscanner
);
651 FILE *xslpattern_get_out (yyscan_t yyscanner
);
653 void xslpattern_set_out (FILE * out_str
,yyscan_t yyscanner
);
655 int xslpattern_get_leng (yyscan_t yyscanner
);
657 char *xslpattern_get_text (yyscan_t yyscanner
);
659 int xslpattern_get_lineno (yyscan_t yyscanner
);
661 void xslpattern_set_lineno (int line_number
,yyscan_t yyscanner
);
663 YYSTYPE
* xslpattern_get_lval (yyscan_t yyscanner
);
665 void xslpattern_set_lval (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
667 /* Macros after this point can all be overridden by user definitions in
671 #ifndef YY_SKIP_YYWRAP
673 extern "C" int xslpattern_wrap (yyscan_t yyscanner
);
675 extern int xslpattern_wrap (yyscan_t yyscanner
);
680 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
683 #ifdef YY_NEED_STRLEN
684 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
690 static int yyinput (yyscan_t yyscanner
);
692 static int input (yyscan_t yyscanner
);
697 /* Amount of stuff to slurp up with each read. */
698 #ifndef YY_READ_BUF_SIZE
700 /* On IA-64, the buffer size is 16k, not 8k */
701 #define YY_READ_BUF_SIZE 16384
703 #define YY_READ_BUF_SIZE 8192
704 #endif /* __ia64__ */
707 /* Copy whatever the last rule matched to the standard output. */
709 /* This used to be an fputs(), but since the string might contain NUL's,
710 * we now use fwrite().
712 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
715 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
716 * is returned in "result".
719 #define YY_INPUT(buf,result,max_size) \
720 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
724 for ( n = 0; n < max_size && \
725 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
728 buf[n++] = (char) c; \
729 if ( c == EOF && ferror( yyin ) ) \
730 YY_FATAL_ERROR( "input in flex scanner failed" ); \
736 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
738 if( errno != EINTR) \
740 YY_FATAL_ERROR( "input in flex scanner failed" ); \
751 /* No semi-colon after return; correct usage is to write "yyterminate();" -
752 * we don't want an extra ';' after the "return" because that will cause
753 * some compilers to complain about unreachable statements.
756 #define yyterminate() return YY_NULL
759 /* Number of entries by which start-condition stack grows. */
760 #ifndef YY_START_STACK_INCR
761 #define YY_START_STACK_INCR 25
764 /* Report a fatal error. */
765 #ifndef YY_FATAL_ERROR
766 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
769 /* end tables serialization structures and prototypes */
771 /* Default declaration of generated scanner - a define so the user can
772 * easily add parameters.
775 #define YY_DECL_IS_OURS 1
777 extern int xslpattern_lex \
778 (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
780 #define YY_DECL int xslpattern_lex \
781 (YYSTYPE * yylval_param , yyscan_t yyscanner)
782 #endif /* !YY_DECL */
784 /* Code executed at the beginning of each rule, after yytext and yyleng
787 #ifndef YY_USER_ACTION
788 #define YY_USER_ACTION
791 /* Code executed at the end of each rule. */
793 #define YY_BREAK break;
796 #define YY_RULE_SETUP \
799 /** The main scanner function which does all the work.
803 register yy_state_type yy_current_state
;
804 register char *yy_cp
, *yy_bp
;
806 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
808 #line 113 "xslpattern.l"
811 #line 815 "xslpattern.yy.c"
813 yylval
= yylval_param
;
823 if ( ! yyg
->yy_start
)
824 yyg
->yy_start
= 1; /* first start state */
832 if ( ! YY_CURRENT_BUFFER
) {
833 xslpattern_ensure_buffer_stack (yyscanner
);
834 YY_CURRENT_BUFFER_LVALUE
=
835 xslpattern__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
838 xslpattern__load_buffer_state(yyscanner
);
841 while ( 1 ) /* loops until end-of-file is reached */
843 yy_cp
= yyg
->yy_c_buf_p
;
845 /* Support of yytext. */
846 *yy_cp
= yyg
->yy_hold_char
;
848 /* yy_bp points to the position in yy_ch_buf of the start of
853 yy_current_state
= yyg
->yy_start
;
857 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
858 if ( yy_accept
[yy_current_state
] )
860 yyg
->yy_last_accepting_state
= yy_current_state
;
861 yyg
->yy_last_accepting_cpos
= yy_cp
;
863 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
865 yy_current_state
= (int) yy_def
[yy_current_state
];
866 if ( yy_current_state
>= 96 )
867 yy_c
= yy_meta
[(unsigned int) yy_c
];
869 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
872 while ( yy_current_state
!= 95 );
873 yy_cp
= yyg
->yy_last_accepting_cpos
;
874 yy_current_state
= yyg
->yy_last_accepting_state
;
877 yy_act
= yy_accept
[yy_current_state
];
881 do_action
: /* This label is used only to access EOF actions. */
884 { /* beginning of action switch */
885 case 0: /* must back up */
886 /* undo the effects of YY_DO_BEFORE_ACTION */
887 *yy_cp
= yyg
->yy_hold_char
;
888 yy_cp
= yyg
->yy_last_accepting_cpos
;
889 yy_current_state
= yyg
->yy_last_accepting_state
;
893 /* rule 1 can match eol */
895 #line 115 "xslpattern.l"
899 /* rule 2 can match eol */
901 #line 116 "xslpattern.l"
902 { STR(TOK_Literal
); }
906 #line 117 "xslpattern.l"
907 { SYM(TOK_DblFSlash
); }
911 #line 118 "xslpattern.l"
916 #line 119 "xslpattern.l"
921 #line 120 "xslpattern.l"
926 #line 121 "xslpattern.l"
931 #line 122 "xslpattern.l"
936 #line 123 "xslpattern.l"
941 #line 124 "xslpattern.l"
946 #line 125 "xslpattern.l"
951 #line 126 "xslpattern.l"
956 #line 127 "xslpattern.l"
961 #line 128 "xslpattern.l"
966 #line 129 "xslpattern.l"
971 #line 130 "xslpattern.l"
976 #line 131 "xslpattern.l"
981 #line 132 "xslpattern.l"
986 #line 133 "xslpattern.l"
991 #line 134 "xslpattern.l"
996 #line 135 "xslpattern.l"
1001 #line 136 "xslpattern.l"
1006 #line 137 "xslpattern.l"
1011 #line 138 "xslpattern.l"
1016 #line 139 "xslpattern.l"
1021 #line 140 "xslpattern.l"
1026 #line 141 "xslpattern.l"
1031 #line 142 "xslpattern.l"
1036 #line 143 "xslpattern.l"
1041 #line 144 "xslpattern.l"
1046 #line 145 "xslpattern.l"
1051 #line 146 "xslpattern.l"
1056 #line 147 "xslpattern.l"
1061 #line 148 "xslpattern.l"
1066 #line 149 "xslpattern.l"
1067 { STR(TOK_NCName
); }
1071 #line 150 "xslpattern.l"
1072 { STR(TOK_Number
); }
1076 #line 151 "xslpattern.l"
1077 { FIXME("Unexpected character '%s'.\n",yytext
); }
1081 #line 153 "xslpattern.l"
1084 #line 1088 "xslpattern.yy.c"
1085 case YY_STATE_EOF(INITIAL
):
1088 case YY_END_OF_BUFFER
:
1090 /* Amount of text matched not including the EOB char. */
1091 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
1093 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1094 *yy_cp
= yyg
->yy_hold_char
;
1095 YY_RESTORE_YY_MORE_OFFSET
1097 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1099 /* We're scanning a new file or input source. It's
1100 * possible that this happened because the user
1101 * just pointed yyin at a new source and called
1102 * xslpattern_lex(). If so, then we have to assure
1103 * consistency between YY_CURRENT_BUFFER and our
1104 * globals. Here is the right place to do so, because
1105 * this is the first action (other than possibly a
1106 * back-up) that will match for the new input source.
1108 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1109 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
1110 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1113 /* Note that here we test for yy_c_buf_p "<=" to the position
1114 * of the first EOB in the buffer, since yy_c_buf_p will
1115 * already have been incremented past the NUL character
1116 * (since all states make transitions on EOB to the
1117 * end-of-buffer state). Contrast this with the test
1120 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1121 { /* This was really a NUL. */
1122 yy_state_type yy_next_state
;
1124 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1126 yy_current_state
= yy_get_previous_state( yyscanner
);
1128 /* Okay, we're now positioned to make the NUL
1129 * transition. We couldn't have
1130 * yy_get_previous_state() go ahead and do it
1131 * for us because it doesn't know how to deal
1132 * with the possibility of jamming (and we don't
1133 * want to build jamming into it because then it
1134 * will run more slowly).
1137 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
1139 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1141 if ( yy_next_state
)
1143 /* Consume the NUL. */
1144 yy_cp
= ++yyg
->yy_c_buf_p
;
1145 yy_current_state
= yy_next_state
;
1151 yy_cp
= yyg
->yy_last_accepting_cpos
;
1152 yy_current_state
= yyg
->yy_last_accepting_state
;
1153 goto yy_find_action
;
1157 else switch ( yy_get_next_buffer( yyscanner
) )
1159 case EOB_ACT_END_OF_FILE
:
1161 yyg
->yy_did_buffer_switch_on_eof
= 0;
1163 if ( xslpattern_wrap(yyscanner
) )
1165 /* Note: because we've taken care in
1166 * yy_get_next_buffer() to have set up
1167 * yytext, we can now set up
1168 * yy_c_buf_p so that if some total
1169 * hoser (like flex itself) wants to
1170 * call the scanner after we return the
1171 * YY_NULL, it'll still work - another
1172 * YY_NULL will get returned.
1174 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1176 yy_act
= YY_STATE_EOF(YY_START
);
1182 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1188 case EOB_ACT_CONTINUE_SCAN
:
1190 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1192 yy_current_state
= yy_get_previous_state( yyscanner
);
1194 yy_cp
= yyg
->yy_c_buf_p
;
1195 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1198 case EOB_ACT_LAST_MATCH
:
1200 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
1202 yy_current_state
= yy_get_previous_state( yyscanner
);
1204 yy_cp
= yyg
->yy_c_buf_p
;
1205 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1206 goto yy_find_action
;
1213 "fatal flex scanner internal error--no action found" );
1214 } /* end of action switch */
1215 } /* end of scanning one token */
1216 } /* end of xslpattern_lex */
1218 /* yy_get_next_buffer - try to read in a new buffer
1220 * Returns a code representing an action:
1221 * EOB_ACT_LAST_MATCH -
1222 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1223 * EOB_ACT_END_OF_FILE - end of file
1225 static int yy_get_next_buffer (yyscan_t yyscanner
)
1227 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1228 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1229 register char *source
= yyg
->yytext_ptr
;
1230 register int number_to_move
, i
;
1233 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
1235 "fatal flex scanner internal error--end of buffer missed" );
1237 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1238 { /* Don't try to fill the buffer, so this is an EOF. */
1239 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
1241 /* We matched a single character, the EOB, so
1242 * treat this as a final EOF.
1244 return EOB_ACT_END_OF_FILE
;
1249 /* We matched some text prior to the EOB, first
1252 return EOB_ACT_LAST_MATCH
;
1256 /* Try to read more data. */
1258 /* First move last chars to start of buffer. */
1259 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
1261 for ( i
= 0; i
< number_to_move
; ++i
)
1262 *(dest
++) = *(source
++);
1264 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1265 /* don't do the read, it's not guaranteed to return an EOF,
1268 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
1273 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1275 while ( num_to_read
<= 0 )
1276 { /* Not enough room in the buffer - grow it. */
1278 /* just a shorter name for the current buffer */
1279 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1281 int yy_c_buf_p_offset
=
1282 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
1284 if ( b
->yy_is_our_buffer
)
1286 int new_size
= b
->yy_buf_size
* 2;
1288 if ( new_size
<= 0 )
1289 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1291 b
->yy_buf_size
*= 2;
1293 b
->yy_ch_buf
= (char *)
1294 /* Include room in for 2 EOB chars. */
1295 xslpattern_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
1298 /* Can't grow it, we don't own it. */
1301 if ( ! b
->yy_ch_buf
)
1303 "fatal error - scanner input buffer overflow" );
1305 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1307 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1312 if ( num_to_read
> YY_READ_BUF_SIZE
)
1313 num_to_read
= YY_READ_BUF_SIZE
;
1315 /* Read in more data. */
1316 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1317 yyg
->yy_n_chars
, (size_t) num_to_read
);
1319 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1322 if ( yyg
->yy_n_chars
== 0 )
1324 if ( number_to_move
== YY_MORE_ADJ
)
1326 ret_val
= EOB_ACT_END_OF_FILE
;
1327 xslpattern_restart(yyin
,yyscanner
);
1332 ret_val
= EOB_ACT_LAST_MATCH
;
1333 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1334 YY_BUFFER_EOF_PENDING
;
1339 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1341 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1342 /* Extend the array by 50%, plus the number we really need. */
1343 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
1344 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) xslpattern_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
1345 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1346 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1349 yyg
->yy_n_chars
+= number_to_move
;
1350 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1351 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1353 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1358 /* yy_get_previous_state - get the state just before the EOB char was reached */
1360 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
1362 register yy_state_type yy_current_state
;
1363 register char *yy_cp
;
1364 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1366 yy_current_state
= yyg
->yy_start
;
1368 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
1370 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1371 if ( yy_accept
[yy_current_state
] )
1373 yyg
->yy_last_accepting_state
= yy_current_state
;
1374 yyg
->yy_last_accepting_cpos
= yy_cp
;
1376 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1378 yy_current_state
= (int) yy_def
[yy_current_state
];
1379 if ( yy_current_state
>= 96 )
1380 yy_c
= yy_meta
[(unsigned int) yy_c
];
1382 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1385 return yy_current_state
;
1388 /* yy_try_NUL_trans - try to make a transition on the NUL character
1391 * next_state = yy_try_NUL_trans( current_state );
1393 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
1395 register int yy_is_jam
;
1396 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
1397 register char *yy_cp
= yyg
->yy_c_buf_p
;
1399 register YY_CHAR yy_c
= 1;
1400 if ( yy_accept
[yy_current_state
] )
1402 yyg
->yy_last_accepting_state
= yy_current_state
;
1403 yyg
->yy_last_accepting_cpos
= yy_cp
;
1405 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1407 yy_current_state
= (int) yy_def
[yy_current_state
];
1408 if ( yy_current_state
>= 96 )
1409 yy_c
= yy_meta
[(unsigned int) yy_c
];
1411 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1412 yy_is_jam
= (yy_current_state
== 95);
1414 return yy_is_jam
? 0 : yy_current_state
;
1419 static int yyinput (yyscan_t yyscanner
)
1421 static int input (yyscan_t yyscanner
)
1426 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1428 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1430 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1432 /* yy_c_buf_p now points to the character we want to return.
1433 * If this occurs *before* the EOB characters, then it's a
1434 * valid NUL; if not, then we've hit the end of the buffer.
1436 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1437 /* This was really a NUL. */
1438 *yyg
->yy_c_buf_p
= '\0';
1441 { /* need more input */
1442 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
1445 switch ( yy_get_next_buffer( yyscanner
) )
1447 case EOB_ACT_LAST_MATCH
:
1448 /* This happens because yy_g_n_b()
1449 * sees that we've accumulated a
1450 * token and flags that we need to
1451 * try matching the token before
1452 * proceeding. But for input(),
1453 * there's no matching to consider.
1454 * So convert the EOB_ACT_LAST_MATCH
1455 * to EOB_ACT_END_OF_FILE.
1458 /* Reset buffer status. */
1459 xslpattern_restart(yyin
,yyscanner
);
1463 case EOB_ACT_END_OF_FILE
:
1465 if ( xslpattern_wrap(yyscanner
) )
1468 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1471 return yyinput(yyscanner
);
1473 return input(yyscanner
);
1477 case EOB_ACT_CONTINUE_SCAN
:
1478 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
1484 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
1485 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
1486 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
1490 #endif /* ifndef YY_NO_INPUT */
1492 /** Immediately switch to a different input stream.
1493 * @param input_file A readable stream.
1494 * @param yyscanner The scanner object.
1495 * @note This function does not reset the start condition to @c INITIAL .
1497 void xslpattern_restart (FILE * input_file
, yyscan_t yyscanner
)
1499 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1501 if ( ! YY_CURRENT_BUFFER
){
1502 xslpattern_ensure_buffer_stack (yyscanner
);
1503 YY_CURRENT_BUFFER_LVALUE
=
1504 xslpattern__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1507 xslpattern__init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
1508 xslpattern__load_buffer_state(yyscanner
);
1511 /** Switch to a different input buffer.
1512 * @param new_buffer The new input buffer.
1513 * @param yyscanner The scanner object.
1515 void xslpattern__switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1517 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1519 /* TODO. We should be able to replace this entire function body
1521 * xslpattern_pop_buffer_state();
1522 * xslpattern_push_buffer_state(new_buffer);
1524 xslpattern_ensure_buffer_stack (yyscanner
);
1525 if ( YY_CURRENT_BUFFER
== new_buffer
)
1528 if ( YY_CURRENT_BUFFER
)
1530 /* Flush out information for old buffer. */
1531 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1532 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1533 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1536 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1537 xslpattern__load_buffer_state(yyscanner
);
1539 /* We don't actually know whether we did this switch during
1540 * EOF (xslpattern_wrap()) processing, but the only time this flag
1541 * is looked at is after xslpattern_wrap() is called, so it's safe
1542 * to go ahead and always set it.
1544 yyg
->yy_did_buffer_switch_on_eof
= 1;
1547 static void xslpattern__load_buffer_state (yyscan_t yyscanner
)
1549 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1550 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1551 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1552 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1553 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
1556 /** Allocate and initialize an input buffer state.
1557 * @param file A readable stream.
1558 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1559 * @param yyscanner The scanner object.
1560 * @return the allocated buffer state.
1562 YY_BUFFER_STATE
xslpattern__create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
1566 b
= (YY_BUFFER_STATE
) xslpattern_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1568 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__create_buffer()" );
1570 b
->yy_buf_size
= size
;
1572 /* yy_ch_buf has to be 2 characters longer than the size given because
1573 * we need to put in 2 end-of-buffer characters.
1575 b
->yy_ch_buf
= (char *) xslpattern_alloc(b
->yy_buf_size
+ 2 ,yyscanner
);
1576 if ( ! b
->yy_ch_buf
)
1577 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__create_buffer()" );
1579 b
->yy_is_our_buffer
= 1;
1581 xslpattern__init_buffer(b
,file
,yyscanner
);
1586 /** Destroy the buffer.
1587 * @param b a buffer created with xslpattern__create_buffer()
1588 * @param yyscanner The scanner object.
1590 void xslpattern__delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1592 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1597 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1598 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1600 if ( b
->yy_is_our_buffer
)
1601 xslpattern_free((void *) b
->yy_ch_buf
,yyscanner
);
1603 xslpattern_free((void *) b
,yyscanner
);
1606 /* Initializes or reinitializes a buffer.
1607 * This function is sometimes called more than once on the same buffer,
1608 * such as during a xslpattern_restart() or at EOF.
1610 static void xslpattern__init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
1614 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1616 xslpattern__flush_buffer(b
,yyscanner
);
1618 b
->yy_input_file
= file
;
1619 b
->yy_fill_buffer
= 1;
1621 /* If b is the current buffer, then xslpattern__init_buffer was _probably_
1622 * called from xslpattern_restart() or through yy_get_next_buffer.
1623 * In that case, we don't want to reset the lineno or column.
1625 if (b
!= YY_CURRENT_BUFFER
){
1626 b
->yy_bs_lineno
= 1;
1627 b
->yy_bs_column
= 0;
1630 b
->yy_is_interactive
= 0;
1635 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1636 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1637 * @param yyscanner The scanner object.
1639 void xslpattern__flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1641 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1647 /* We always need two end-of-buffer characters. The first causes
1648 * a transition to the end-of-buffer state. The second causes
1649 * a jam in that state.
1651 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1652 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1654 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1657 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1659 if ( b
== YY_CURRENT_BUFFER
)
1660 xslpattern__load_buffer_state(yyscanner
);
1663 /** Pushes the new state onto the stack. The new state becomes
1664 * the current state. This function will allocate the stack
1666 * @param new_buffer The new state.
1667 * @param yyscanner The scanner object.
1669 void xslpattern_push_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1671 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1672 if (new_buffer
== NULL
)
1675 xslpattern_ensure_buffer_stack(yyscanner
);
1677 /* This block is copied from xslpattern__switch_to_buffer. */
1678 if ( YY_CURRENT_BUFFER
)
1680 /* Flush out information for old buffer. */
1681 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1682 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1683 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1686 /* Only push if top exists. Otherwise, replace top. */
1687 if (YY_CURRENT_BUFFER
)
1688 yyg
->yy_buffer_stack_top
++;
1689 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1691 /* copied from xslpattern__switch_to_buffer. */
1692 xslpattern__load_buffer_state(yyscanner
);
1693 yyg
->yy_did_buffer_switch_on_eof
= 1;
1696 /** Removes and deletes the top of the stack, if present.
1697 * The next element becomes the new top.
1698 * @param yyscanner The scanner object.
1700 void xslpattern_pop_buffer_state (yyscan_t yyscanner
)
1702 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1703 if (!YY_CURRENT_BUFFER
)
1706 xslpattern__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1707 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1708 if (yyg
->yy_buffer_stack_top
> 0)
1709 --yyg
->yy_buffer_stack_top
;
1711 if (YY_CURRENT_BUFFER
) {
1712 xslpattern__load_buffer_state(yyscanner
);
1713 yyg
->yy_did_buffer_switch_on_eof
= 1;
1717 /* Allocates the stack if it does not exist.
1718 * Guarantees space for at least one push.
1720 static void xslpattern_ensure_buffer_stack (yyscan_t yyscanner
)
1723 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1725 if (!yyg
->yy_buffer_stack
) {
1727 /* First allocation is just for 2 elements, since we don't know if this
1728 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1729 * immediate realloc on the next call.
1732 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)xslpattern_alloc
1733 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1735 if ( ! yyg
->yy_buffer_stack
)
1736 YY_FATAL_ERROR( "out of dynamic memory in xslpattern_ensure_buffer_stack()" );
1738 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1740 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1741 yyg
->yy_buffer_stack_top
= 0;
1745 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
1747 /* Increase the buffer to prepare for a possible push. */
1748 int grow_size
= 8 /* arbitrary grow size */;
1750 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
1751 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)xslpattern_realloc
1752 (yyg
->yy_buffer_stack
,
1753 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1755 if ( ! yyg
->yy_buffer_stack
)
1756 YY_FATAL_ERROR( "out of dynamic memory in xslpattern_ensure_buffer_stack()" );
1758 /* zero only the new slots.*/
1759 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
1760 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1764 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1765 * @param base the character buffer
1766 * @param size the size in bytes of the character buffer
1767 * @param yyscanner The scanner object.
1768 * @return the newly allocated buffer state object.
1770 YY_BUFFER_STATE
xslpattern__scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
1775 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1776 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1777 /* They forgot to leave room for the EOB's. */
1780 b
= (YY_BUFFER_STATE
) xslpattern_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1782 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__scan_buffer()" );
1784 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1785 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1786 b
->yy_is_our_buffer
= 0;
1787 b
->yy_input_file
= 0;
1788 b
->yy_n_chars
= b
->yy_buf_size
;
1789 b
->yy_is_interactive
= 0;
1791 b
->yy_fill_buffer
= 0;
1792 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1794 xslpattern__switch_to_buffer(b
,yyscanner
);
1799 /** Setup the input buffer state to scan a string. The next call to xslpattern_lex() will
1800 * scan from a @e copy of @a str.
1801 * @param yystr a NUL-terminated string to scan
1802 * @param yyscanner The scanner object.
1803 * @return the newly allocated buffer state object.
1804 * @note If you want to scan bytes that may contain NUL values, then use
1805 * xslpattern__scan_bytes() instead.
1807 YY_BUFFER_STATE
xslpattern__scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
1810 return xslpattern__scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
1813 /** Setup the input buffer state to scan the given bytes. The next call to xslpattern_lex() will
1814 * scan from a @e copy of @a bytes.
1815 * @param yybytes the byte buffer to scan
1816 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1817 * @param yyscanner The scanner object.
1818 * @return the newly allocated buffer state object.
1820 YY_BUFFER_STATE
xslpattern__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
1827 /* Get memory for full buffer, including space for trailing EOB's. */
1828 n
= _yybytes_len
+ 2;
1829 buf
= (char *) xslpattern_alloc(n
,yyscanner
);
1831 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__scan_bytes()" );
1833 for ( i
= 0; i
< _yybytes_len
; ++i
)
1834 buf
[i
] = yybytes
[i
];
1836 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1838 b
= xslpattern__scan_buffer(buf
,n
,yyscanner
);
1840 YY_FATAL_ERROR( "bad buffer in xslpattern__scan_bytes()" );
1842 /* It's okay to grow etc. this buffer, and we should throw it
1843 * away when we're done.
1845 b
->yy_is_our_buffer
= 1;
1850 #ifndef YY_EXIT_FAILURE
1851 #define YY_EXIT_FAILURE 2
1854 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
1856 (void) fprintf( stderr
, "%s\n", msg
);
1857 exit( YY_EXIT_FAILURE
);
1860 /* Redefine yyless() so it works in section 3 code. */
1866 /* Undo effects of setting up yytext. */ \
1867 int yyless_macro_arg = (n); \
1868 YY_LESS_LINENO(yyless_macro_arg);\
1869 yytext[yyleng] = yyg->yy_hold_char; \
1870 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1871 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1872 *yyg->yy_c_buf_p = '\0'; \
1873 yyleng = yyless_macro_arg; \
1877 /* Accessor methods (get/set functions) to struct members. */
1879 /** Get the user-defined data for this scanner.
1880 * @param yyscanner The scanner object.
1882 YY_EXTRA_TYPE
xslpattern_get_extra (yyscan_t yyscanner
)
1884 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1888 /** Get the current line number.
1889 * @param yyscanner The scanner object.
1891 int xslpattern_get_lineno (yyscan_t yyscanner
)
1893 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1895 if (! YY_CURRENT_BUFFER
)
1901 /** Get the current column number.
1902 * @param yyscanner The scanner object.
1904 int xslpattern_get_column (yyscan_t yyscanner
)
1906 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1908 if (! YY_CURRENT_BUFFER
)
1914 /** Get the input stream.
1915 * @param yyscanner The scanner object.
1917 FILE *xslpattern_get_in (yyscan_t yyscanner
)
1919 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1923 /** Get the output stream.
1924 * @param yyscanner The scanner object.
1926 FILE *xslpattern_get_out (yyscan_t yyscanner
)
1928 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1932 /** Get the length of the current token.
1933 * @param yyscanner The scanner object.
1935 int xslpattern_get_leng (yyscan_t yyscanner
)
1937 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1941 /** Get the current token.
1942 * @param yyscanner The scanner object.
1945 char *xslpattern_get_text (yyscan_t yyscanner
)
1947 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1951 /** Set the user-defined data. This data is never touched by the scanner.
1952 * @param user_defined The data to be associated with this scanner.
1953 * @param yyscanner The scanner object.
1955 void xslpattern_set_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
1957 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1958 yyextra
= user_defined
;
1961 /** Set the current line number.
1962 * @param line_number
1963 * @param yyscanner The scanner object.
1965 void xslpattern_set_lineno (int line_number
, yyscan_t yyscanner
)
1967 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1969 /* lineno is only valid if an input buffer exists. */
1970 if (! YY_CURRENT_BUFFER
)
1971 yy_fatal_error( "xslpattern_set_lineno called with no buffer" , yyscanner
);
1973 yylineno
= line_number
;
1976 /** Set the current column.
1977 * @param line_number
1978 * @param yyscanner The scanner object.
1980 void xslpattern_set_column (int column_no
, yyscan_t yyscanner
)
1982 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1984 /* column is only valid if an input buffer exists. */
1985 if (! YY_CURRENT_BUFFER
)
1986 yy_fatal_error( "xslpattern_set_column called with no buffer" , yyscanner
);
1988 yycolumn
= column_no
;
1991 /** Set the input stream. This does not discard the current
1993 * @param in_str A readable stream.
1994 * @param yyscanner The scanner object.
1995 * @see xslpattern__switch_to_buffer
1997 void xslpattern_set_in (FILE * in_str
, yyscan_t yyscanner
)
1999 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2003 void xslpattern_set_out (FILE * out_str
, yyscan_t yyscanner
)
2005 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2009 int xslpattern_get_debug (yyscan_t yyscanner
)
2011 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2012 return yy_flex_debug
;
2015 void xslpattern_set_debug (int bdebug
, yyscan_t yyscanner
)
2017 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2018 yy_flex_debug
= bdebug
;
2021 /* Accessor methods for yylval and yylloc */
2023 YYSTYPE
* xslpattern_get_lval (yyscan_t yyscanner
)
2025 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2029 void xslpattern_set_lval (YYSTYPE
* yylval_param
, yyscan_t yyscanner
)
2031 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2032 yylval
= yylval_param
;
2035 /* User-visible API */
2037 /* xslpattern_lex_init is special because it creates the scanner itself, so it is
2038 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2039 * That's why we explicitly handle the declaration, instead of using our macros.
2042 int xslpattern_lex_init(yyscan_t
* ptr_yy_globals
)
2045 if (ptr_yy_globals
== NULL
){
2050 *ptr_yy_globals
= (yyscan_t
) xslpattern_alloc ( sizeof( struct yyguts_t
), NULL
);
2052 if (*ptr_yy_globals
== NULL
){
2057 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2058 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2060 return yy_init_globals ( *ptr_yy_globals
);
2063 /* xslpattern_lex_init_extra has the same functionality as xslpattern_lex_init, but follows the
2064 * convention of taking the scanner as the last argument. Note however, that
2065 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2066 * is the reason, too, why this function also must handle its own declaration).
2067 * The user defined value in the first argument will be available to xslpattern_alloc in
2068 * the yyextra field.
2071 int xslpattern_lex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
2074 struct yyguts_t dummy_yyguts
;
2076 xslpattern_set_extra (yy_user_defined
, &dummy_yyguts
);
2078 if (ptr_yy_globals
== NULL
){
2083 *ptr_yy_globals
= (yyscan_t
) xslpattern_alloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
2085 if (*ptr_yy_globals
== NULL
){
2090 /* By setting to 0xAA, we expose bugs in
2091 yy_init_globals. Leave at 0x00 for releases. */
2092 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2094 xslpattern_set_extra (yy_user_defined
, *ptr_yy_globals
);
2096 return yy_init_globals ( *ptr_yy_globals
);
2099 static int yy_init_globals (yyscan_t yyscanner
)
2101 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2102 /* Initialization is the same as for the non-reentrant scanner.
2103 * This function is called from xslpattern_lex_destroy(), so don't allocate here.
2106 yyg
->yy_buffer_stack
= 0;
2107 yyg
->yy_buffer_stack_top
= 0;
2108 yyg
->yy_buffer_stack_max
= 0;
2109 yyg
->yy_c_buf_p
= (char *) 0;
2113 yyg
->yy_start_stack_ptr
= 0;
2114 yyg
->yy_start_stack_depth
= 0;
2115 yyg
->yy_start_stack
= NULL
;
2117 /* Defined in main.c */
2126 /* For future reference: Set errno on error, since we are called by
2127 * xslpattern_lex_init()
2132 /* xslpattern_lex_destroy is for both reentrant and non-reentrant scanners. */
2133 int xslpattern_lex_destroy (yyscan_t yyscanner
)
2135 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2137 /* Pop the buffer stack, destroying each element. */
2138 while(YY_CURRENT_BUFFER
){
2139 xslpattern__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
2140 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2141 xslpattern_pop_buffer_state(yyscanner
);
2144 /* Destroy the stack itself. */
2145 xslpattern_free(yyg
->yy_buffer_stack
,yyscanner
);
2146 yyg
->yy_buffer_stack
= NULL
;
2148 /* Destroy the start condition stack. */
2149 xslpattern_free(yyg
->yy_start_stack
,yyscanner
);
2150 yyg
->yy_start_stack
= NULL
;
2152 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2153 * xslpattern_lex() is called, initialization will occur. */
2154 yy_init_globals( yyscanner
);
2156 /* Destroy the main struct (reentrant only). */
2157 xslpattern_free ( yyscanner
, yyscanner
);
2163 * Internal utility routines.
2167 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
2170 for ( i
= 0; i
< n
; ++i
)
2175 #ifdef YY_NEED_STRLEN
2176 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
2179 for ( n
= 0; s
[n
]; ++n
)
2186 void *xslpattern_alloc (yy_size_t size
, yyscan_t yyscanner
)
2188 return (void *) malloc( size
);
2191 void *xslpattern_realloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
2193 /* The cast to (char *) in the following accommodates both
2194 * implementations that use char* generic pointers, and those
2195 * that use void* generic pointers. It works with the latter
2196 * because both ANSI C and C++ allow castless assignment from
2197 * any pointer type to void*, and deal with argument conversions
2198 * as though doing an assignment.
2200 return (void *) realloc( (char *) ptr
, size
);
2203 void xslpattern_free (void * ptr
, yyscan_t yyscanner
)
2205 free( (char *) ptr
); /* see xslpattern_realloc() for (char *) cast */
2208 #define YYTABLES_NAME "yytables"
2210 #line 153 "xslpattern.l"
2214 xmlChar
* XSLPattern_to_XPath(xmlXPathContextPtr
, xmlChar
const*) DECLSPEC_HIDDEN
;
2215 xmlChar
* XSLPattern_to_XPath(xmlXPathContextPtr ctxt
, xmlChar
const* xslpat_str
)
2218 TRACE("(%s)\n", debugstr_a((char const*)xslpat_str
));
2219 memset(&p
, 0, sizeof(parser_param
));
2222 p
.len
= xmlStrlen(xslpat_str
);
2224 xslpattern_lex_init(&p
.yyscanner
);
2225 xslpattern_set_extra(&p
, p
.yyscanner
);
2227 xslpattern_parse(&p
, p
.yyscanner
);
2229 TRACE("=> %s\n", debugstr_a((char const*)p
.out
));
2230 xslpattern_lex_destroy(p
.yyscanner
);
2235 return xmlStrdup(xslpat_str
);
2244 #endif /* HAVE_LIBXML2 */