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"
536 #include "wine/debug.h"
538 WINE_DEFAULT_DEBUG_CHANNEL(msxml
);
540 #define SCAN xslpattern_get_extra(yyscanner)
542 #define YY_INPUT(tok_buf, tok_len, max) \
544 if (SCAN->pos <= SCAN->len) \
546 tok_len = SCAN->len - SCAN->pos; \
547 if (tok_len > max) tok_len = max; \
548 memcpy(tok_buf, SCAN->in + SCAN->pos, tok_len); \
549 SCAN->pos += tok_len; \
557 #define TOK(tok) TRACE("token: %s : %s\n", #tok, yytext); return tok
558 #define OP(tok) *yylval=NULL; TOK(tok)
559 #define SYM(tok) *yylval=NULL; TOK(tok)
560 #define STR(tok) *yylval=xmlStrdup(BAD_CAST yytext); TOK(tok)
563 #define YY_NO_INPUT 1
564 /* From the w3c XML standard
565 * <http://www.w3.org/TR/REC-xml/> */
566 /* [2.3] Common Syntactic Constructs */
567 /* From the w3c XML Namespace standard
568 * <http://www.w3.org/TR/REC-xml-names/> */
569 /* [3] Declaring Namespaces*/
570 /* Mostly verbatim from the w3c XPath standard.
571 * <http://www.w3.org/TR/xpath/> */
573 * ||, &&, $foo$ are XSLPattern only */
574 /* [3.7] Lexical Structure */
575 #line 576 "xslpattern.yy.c"
579 #ifndef YY_NO_UNISTD_H
580 /* Special case for "unistd.h", since it is non-ANSI. We include it way
581 * down here because we want the user's section 1 to have been scanned first.
582 * The user has a chance to override it with an option.
587 #ifndef YY_EXTRA_TYPE
588 #define YY_EXTRA_TYPE void *
591 /* Holds the entire state of the reentrant scanner. */
595 /* User-defined. Not touched by flex. */
596 YY_EXTRA_TYPE yyextra_r
;
598 /* The rest are the same as the globals declared in the non-reentrant scanner. */
599 FILE *yyin_r
, *yyout_r
;
600 size_t yy_buffer_stack_top
; /**< index of top of stack. */
601 size_t yy_buffer_stack_max
; /**< capacity of stack. */
602 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
609 int yy_did_buffer_switch_on_eof
;
610 int yy_start_stack_ptr
;
611 int yy_start_stack_depth
;
613 yy_state_type yy_last_accepting_state
;
614 char* yy_last_accepting_cpos
;
625 }; /* end struct yyguts_t */
627 static int yy_init_globals (yyscan_t yyscanner
);
629 /* This must go here because YYSTYPE and YYLTYPE are included
630 * from bison output in section 1.*/
631 # define yylval yyg->yylval_r
633 int xslpattern_lex_init (yyscan_t
* scanner
);
635 int xslpattern_lex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
637 /* Accessor methods to globals.
638 These are made visible to non-reentrant scanners for convenience. */
640 int xslpattern_lex_destroy (yyscan_t yyscanner
);
642 int xslpattern_get_debug (yyscan_t yyscanner
);
644 void xslpattern_set_debug (int debug_flag
,yyscan_t yyscanner
);
646 YY_EXTRA_TYPE
xslpattern_get_extra (yyscan_t yyscanner
);
648 void xslpattern_set_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
650 FILE *xslpattern_get_in (yyscan_t yyscanner
);
652 void xslpattern_set_in (FILE * in_str
,yyscan_t yyscanner
);
654 FILE *xslpattern_get_out (yyscan_t yyscanner
);
656 void xslpattern_set_out (FILE * out_str
,yyscan_t yyscanner
);
658 int xslpattern_get_leng (yyscan_t yyscanner
);
660 char *xslpattern_get_text (yyscan_t yyscanner
);
662 int xslpattern_get_lineno (yyscan_t yyscanner
);
664 void xslpattern_set_lineno (int line_number
,yyscan_t yyscanner
);
666 YYSTYPE
* xslpattern_get_lval (yyscan_t yyscanner
);
668 void xslpattern_set_lval (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
670 /* Macros after this point can all be overridden by user definitions in
674 #ifndef YY_SKIP_YYWRAP
676 extern "C" int xslpattern_wrap (yyscan_t yyscanner
);
678 extern int xslpattern_wrap (yyscan_t yyscanner
);
683 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
686 #ifdef YY_NEED_STRLEN
687 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
693 static int yyinput (yyscan_t yyscanner
);
695 static int input (yyscan_t yyscanner
);
700 /* Amount of stuff to slurp up with each read. */
701 #ifndef YY_READ_BUF_SIZE
703 /* On IA-64, the buffer size is 16k, not 8k */
704 #define YY_READ_BUF_SIZE 16384
706 #define YY_READ_BUF_SIZE 8192
707 #endif /* __ia64__ */
710 /* Copy whatever the last rule matched to the standard output. */
712 /* This used to be an fputs(), but since the string might contain NUL's,
713 * we now use fwrite().
715 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
718 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
719 * is returned in "result".
722 #define YY_INPUT(buf,result,max_size) \
723 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
727 for ( n = 0; n < max_size && \
728 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
731 buf[n++] = (char) c; \
732 if ( c == EOF && ferror( yyin ) ) \
733 YY_FATAL_ERROR( "input in flex scanner failed" ); \
739 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
741 if( errno != EINTR) \
743 YY_FATAL_ERROR( "input in flex scanner failed" ); \
754 /* No semi-colon after return; correct usage is to write "yyterminate();" -
755 * we don't want an extra ';' after the "return" because that will cause
756 * some compilers to complain about unreachable statements.
759 #define yyterminate() return YY_NULL
762 /* Number of entries by which start-condition stack grows. */
763 #ifndef YY_START_STACK_INCR
764 #define YY_START_STACK_INCR 25
767 /* Report a fatal error. */
768 #ifndef YY_FATAL_ERROR
769 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
772 /* end tables serialization structures and prototypes */
774 /* Default declaration of generated scanner - a define so the user can
775 * easily add parameters.
778 #define YY_DECL_IS_OURS 1
780 extern int xslpattern_lex \
781 (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
783 #define YY_DECL int xslpattern_lex \
784 (YYSTYPE * yylval_param , yyscan_t yyscanner)
785 #endif /* !YY_DECL */
787 /* Code executed at the beginning of each rule, after yytext and yyleng
790 #ifndef YY_USER_ACTION
791 #define YY_USER_ACTION
794 /* Code executed at the end of each rule. */
796 #define YY_BREAK break;
799 #define YY_RULE_SETUP \
802 /** The main scanner function which does all the work.
806 register yy_state_type yy_current_state
;
807 register char *yy_cp
, *yy_bp
;
809 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
811 #line 113 "xslpattern.l"
814 #line 815 "xslpattern.yy.c"
816 yylval
= yylval_param
;
826 if ( ! yyg
->yy_start
)
827 yyg
->yy_start
= 1; /* first start state */
835 if ( ! YY_CURRENT_BUFFER
) {
836 xslpattern_ensure_buffer_stack (yyscanner
);
837 YY_CURRENT_BUFFER_LVALUE
=
838 xslpattern__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
841 xslpattern__load_buffer_state(yyscanner
);
844 while ( 1 ) /* loops until end-of-file is reached */
846 yy_cp
= yyg
->yy_c_buf_p
;
848 /* Support of yytext. */
849 *yy_cp
= yyg
->yy_hold_char
;
851 /* yy_bp points to the position in yy_ch_buf of the start of
856 yy_current_state
= yyg
->yy_start
;
860 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
861 if ( yy_accept
[yy_current_state
] )
863 yyg
->yy_last_accepting_state
= yy_current_state
;
864 yyg
->yy_last_accepting_cpos
= yy_cp
;
866 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
868 yy_current_state
= (int) yy_def
[yy_current_state
];
869 if ( yy_current_state
>= 96 )
870 yy_c
= yy_meta
[(unsigned int) yy_c
];
872 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
875 while ( yy_current_state
!= 95 );
876 yy_cp
= yyg
->yy_last_accepting_cpos
;
877 yy_current_state
= yyg
->yy_last_accepting_state
;
880 yy_act
= yy_accept
[yy_current_state
];
884 do_action
: /* This label is used only to access EOF actions. */
887 { /* beginning of action switch */
888 case 0: /* must back up */
889 /* undo the effects of YY_DO_BEFORE_ACTION */
890 *yy_cp
= yyg
->yy_hold_char
;
891 yy_cp
= yyg
->yy_last_accepting_cpos
;
892 yy_current_state
= yyg
->yy_last_accepting_state
;
896 /* rule 1 can match eol */
898 #line 115 "xslpattern.l"
902 /* rule 2 can match eol */
904 #line 116 "xslpattern.l"
905 { STR(TOK_Literal
); }
909 #line 117 "xslpattern.l"
910 { SYM(TOK_DblFSlash
); }
914 #line 118 "xslpattern.l"
919 #line 119 "xslpattern.l"
924 #line 120 "xslpattern.l"
929 #line 121 "xslpattern.l"
934 #line 122 "xslpattern.l"
939 #line 123 "xslpattern.l"
944 #line 124 "xslpattern.l"
949 #line 125 "xslpattern.l"
954 #line 126 "xslpattern.l"
959 #line 127 "xslpattern.l"
964 #line 128 "xslpattern.l"
969 #line 129 "xslpattern.l"
974 #line 130 "xslpattern.l"
979 #line 131 "xslpattern.l"
984 #line 132 "xslpattern.l"
989 #line 133 "xslpattern.l"
994 #line 134 "xslpattern.l"
999 #line 135 "xslpattern.l"
1004 #line 136 "xslpattern.l"
1009 #line 137 "xslpattern.l"
1014 #line 138 "xslpattern.l"
1019 #line 139 "xslpattern.l"
1024 #line 140 "xslpattern.l"
1029 #line 141 "xslpattern.l"
1034 #line 142 "xslpattern.l"
1039 #line 143 "xslpattern.l"
1044 #line 144 "xslpattern.l"
1049 #line 145 "xslpattern.l"
1054 #line 146 "xslpattern.l"
1059 #line 147 "xslpattern.l"
1064 #line 148 "xslpattern.l"
1069 #line 149 "xslpattern.l"
1070 { STR(TOK_NCName
); }
1074 #line 150 "xslpattern.l"
1075 { STR(TOK_Number
); }
1079 #line 151 "xslpattern.l"
1080 { FIXME("Unexpected character '%s'.\n",yytext
); }
1084 #line 153 "xslpattern.l"
1087 #line 1088 "xslpattern.yy.c"
1088 case YY_STATE_EOF(INITIAL
):
1091 case YY_END_OF_BUFFER
:
1093 /* Amount of text matched not including the EOB char. */
1094 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
1096 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1097 *yy_cp
= yyg
->yy_hold_char
;
1098 YY_RESTORE_YY_MORE_OFFSET
1100 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1102 /* We're scanning a new file or input source. It's
1103 * possible that this happened because the user
1104 * just pointed yyin at a new source and called
1105 * xslpattern_lex(). If so, then we have to assure
1106 * consistency between YY_CURRENT_BUFFER and our
1107 * globals. Here is the right place to do so, because
1108 * this is the first action (other than possibly a
1109 * back-up) that will match for the new input source.
1111 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1112 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
1113 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1116 /* Note that here we test for yy_c_buf_p "<=" to the position
1117 * of the first EOB in the buffer, since yy_c_buf_p will
1118 * already have been incremented past the NUL character
1119 * (since all states make transitions on EOB to the
1120 * end-of-buffer state). Contrast this with the test
1123 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1124 { /* This was really a NUL. */
1125 yy_state_type yy_next_state
;
1127 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1129 yy_current_state
= yy_get_previous_state( yyscanner
);
1131 /* Okay, we're now positioned to make the NUL
1132 * transition. We couldn't have
1133 * yy_get_previous_state() go ahead and do it
1134 * for us because it doesn't know how to deal
1135 * with the possibility of jamming (and we don't
1136 * want to build jamming into it because then it
1137 * will run more slowly).
1140 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
1142 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1144 if ( yy_next_state
)
1146 /* Consume the NUL. */
1147 yy_cp
= ++yyg
->yy_c_buf_p
;
1148 yy_current_state
= yy_next_state
;
1154 yy_cp
= yyg
->yy_last_accepting_cpos
;
1155 yy_current_state
= yyg
->yy_last_accepting_state
;
1156 goto yy_find_action
;
1160 else switch ( yy_get_next_buffer( yyscanner
) )
1162 case EOB_ACT_END_OF_FILE
:
1164 yyg
->yy_did_buffer_switch_on_eof
= 0;
1166 if ( xslpattern_wrap(yyscanner
) )
1168 /* Note: because we've taken care in
1169 * yy_get_next_buffer() to have set up
1170 * yytext, we can now set up
1171 * yy_c_buf_p so that if some total
1172 * hoser (like flex itself) wants to
1173 * call the scanner after we return the
1174 * YY_NULL, it'll still work - another
1175 * YY_NULL will get returned.
1177 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1179 yy_act
= YY_STATE_EOF(YY_START
);
1185 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1191 case EOB_ACT_CONTINUE_SCAN
:
1193 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1195 yy_current_state
= yy_get_previous_state( yyscanner
);
1197 yy_cp
= yyg
->yy_c_buf_p
;
1198 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1201 case EOB_ACT_LAST_MATCH
:
1203 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
1205 yy_current_state
= yy_get_previous_state( yyscanner
);
1207 yy_cp
= yyg
->yy_c_buf_p
;
1208 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1209 goto yy_find_action
;
1216 "fatal flex scanner internal error--no action found" );
1217 } /* end of action switch */
1218 } /* end of scanning one token */
1219 } /* end of xslpattern_lex */
1221 /* yy_get_next_buffer - try to read in a new buffer
1223 * Returns a code representing an action:
1224 * EOB_ACT_LAST_MATCH -
1225 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1226 * EOB_ACT_END_OF_FILE - end of file
1228 static int yy_get_next_buffer (yyscan_t yyscanner
)
1230 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1231 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1232 register char *source
= yyg
->yytext_ptr
;
1233 register int number_to_move
, i
;
1236 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
1238 "fatal flex scanner internal error--end of buffer missed" );
1240 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1241 { /* Don't try to fill the buffer, so this is an EOF. */
1242 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
1244 /* We matched a single character, the EOB, so
1245 * treat this as a final EOF.
1247 return EOB_ACT_END_OF_FILE
;
1252 /* We matched some text prior to the EOB, first
1255 return EOB_ACT_LAST_MATCH
;
1259 /* Try to read more data. */
1261 /* First move last chars to start of buffer. */
1262 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
1264 for ( i
= 0; i
< number_to_move
; ++i
)
1265 *(dest
++) = *(source
++);
1267 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1268 /* don't do the read, it's not guaranteed to return an EOF,
1271 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
1276 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1278 while ( num_to_read
<= 0 )
1279 { /* Not enough room in the buffer - grow it. */
1281 /* just a shorter name for the current buffer */
1282 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1284 int yy_c_buf_p_offset
=
1285 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
1287 if ( b
->yy_is_our_buffer
)
1289 int new_size
= b
->yy_buf_size
* 2;
1291 if ( new_size
<= 0 )
1292 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1294 b
->yy_buf_size
*= 2;
1296 b
->yy_ch_buf
= (char *)
1297 /* Include room in for 2 EOB chars. */
1298 xslpattern_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
1301 /* Can't grow it, we don't own it. */
1304 if ( ! b
->yy_ch_buf
)
1306 "fatal error - scanner input buffer overflow" );
1308 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1310 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1315 if ( num_to_read
> YY_READ_BUF_SIZE
)
1316 num_to_read
= YY_READ_BUF_SIZE
;
1318 /* Read in more data. */
1319 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1320 yyg
->yy_n_chars
, (size_t) num_to_read
);
1322 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1325 if ( yyg
->yy_n_chars
== 0 )
1327 if ( number_to_move
== YY_MORE_ADJ
)
1329 ret_val
= EOB_ACT_END_OF_FILE
;
1330 xslpattern_restart(yyin
,yyscanner
);
1335 ret_val
= EOB_ACT_LAST_MATCH
;
1336 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1337 YY_BUFFER_EOF_PENDING
;
1342 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1344 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1345 /* Extend the array by 50%, plus the number we really need. */
1346 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
1347 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) xslpattern_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
1348 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1349 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1352 yyg
->yy_n_chars
+= number_to_move
;
1353 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1354 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1356 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1361 /* yy_get_previous_state - get the state just before the EOB char was reached */
1363 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
1365 register yy_state_type yy_current_state
;
1366 register char *yy_cp
;
1367 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1369 yy_current_state
= yyg
->yy_start
;
1371 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
1373 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1374 if ( yy_accept
[yy_current_state
] )
1376 yyg
->yy_last_accepting_state
= yy_current_state
;
1377 yyg
->yy_last_accepting_cpos
= yy_cp
;
1379 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1381 yy_current_state
= (int) yy_def
[yy_current_state
];
1382 if ( yy_current_state
>= 96 )
1383 yy_c
= yy_meta
[(unsigned int) yy_c
];
1385 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1388 return yy_current_state
;
1391 /* yy_try_NUL_trans - try to make a transition on the NUL character
1394 * next_state = yy_try_NUL_trans( current_state );
1396 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
1398 register int yy_is_jam
;
1399 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
1400 register char *yy_cp
= yyg
->yy_c_buf_p
;
1402 register YY_CHAR yy_c
= 1;
1403 if ( yy_accept
[yy_current_state
] )
1405 yyg
->yy_last_accepting_state
= yy_current_state
;
1406 yyg
->yy_last_accepting_cpos
= yy_cp
;
1408 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1410 yy_current_state
= (int) yy_def
[yy_current_state
];
1411 if ( yy_current_state
>= 96 )
1412 yy_c
= yy_meta
[(unsigned int) yy_c
];
1414 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1415 yy_is_jam
= (yy_current_state
== 95);
1417 return yy_is_jam
? 0 : yy_current_state
;
1422 static int yyinput (yyscan_t yyscanner
)
1424 static int input (yyscan_t yyscanner
)
1429 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1431 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1433 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1435 /* yy_c_buf_p now points to the character we want to return.
1436 * If this occurs *before* the EOB characters, then it's a
1437 * valid NUL; if not, then we've hit the end of the buffer.
1439 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1440 /* This was really a NUL. */
1441 *yyg
->yy_c_buf_p
= '\0';
1444 { /* need more input */
1445 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
1448 switch ( yy_get_next_buffer( yyscanner
) )
1450 case EOB_ACT_LAST_MATCH
:
1451 /* This happens because yy_g_n_b()
1452 * sees that we've accumulated a
1453 * token and flags that we need to
1454 * try matching the token before
1455 * proceeding. But for input(),
1456 * there's no matching to consider.
1457 * So convert the EOB_ACT_LAST_MATCH
1458 * to EOB_ACT_END_OF_FILE.
1461 /* Reset buffer status. */
1462 xslpattern_restart(yyin
,yyscanner
);
1466 case EOB_ACT_END_OF_FILE
:
1468 if ( xslpattern_wrap(yyscanner
) )
1471 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1474 return yyinput(yyscanner
);
1476 return input(yyscanner
);
1480 case EOB_ACT_CONTINUE_SCAN
:
1481 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
1487 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
1488 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
1489 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
1493 #endif /* ifndef YY_NO_INPUT */
1495 /** Immediately switch to a different input stream.
1496 * @param input_file A readable stream.
1497 * @param yyscanner The scanner object.
1498 * @note This function does not reset the start condition to @c INITIAL .
1500 void xslpattern_restart (FILE * input_file
, yyscan_t yyscanner
)
1502 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1504 if ( ! YY_CURRENT_BUFFER
){
1505 xslpattern_ensure_buffer_stack (yyscanner
);
1506 YY_CURRENT_BUFFER_LVALUE
=
1507 xslpattern__create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1510 xslpattern__init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
1511 xslpattern__load_buffer_state(yyscanner
);
1514 /** Switch to a different input buffer.
1515 * @param new_buffer The new input buffer.
1516 * @param yyscanner The scanner object.
1518 void xslpattern__switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1520 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1522 /* TODO. We should be able to replace this entire function body
1524 * xslpattern_pop_buffer_state();
1525 * xslpattern_push_buffer_state(new_buffer);
1527 xslpattern_ensure_buffer_stack (yyscanner
);
1528 if ( YY_CURRENT_BUFFER
== new_buffer
)
1531 if ( YY_CURRENT_BUFFER
)
1533 /* Flush out information for old buffer. */
1534 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1535 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1536 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1539 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1540 xslpattern__load_buffer_state(yyscanner
);
1542 /* We don't actually know whether we did this switch during
1543 * EOF (xslpattern_wrap()) processing, but the only time this flag
1544 * is looked at is after xslpattern_wrap() is called, so it's safe
1545 * to go ahead and always set it.
1547 yyg
->yy_did_buffer_switch_on_eof
= 1;
1550 static void xslpattern__load_buffer_state (yyscan_t yyscanner
)
1552 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1553 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1554 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1555 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1556 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
1559 /** Allocate and initialize an input buffer state.
1560 * @param file A readable stream.
1561 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1562 * @param yyscanner The scanner object.
1563 * @return the allocated buffer state.
1565 YY_BUFFER_STATE
xslpattern__create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
1569 b
= (YY_BUFFER_STATE
) xslpattern_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1571 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__create_buffer()" );
1573 b
->yy_buf_size
= size
;
1575 /* yy_ch_buf has to be 2 characters longer than the size given because
1576 * we need to put in 2 end-of-buffer characters.
1578 b
->yy_ch_buf
= (char *) xslpattern_alloc(b
->yy_buf_size
+ 2 ,yyscanner
);
1579 if ( ! b
->yy_ch_buf
)
1580 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__create_buffer()" );
1582 b
->yy_is_our_buffer
= 1;
1584 xslpattern__init_buffer(b
,file
,yyscanner
);
1589 /** Destroy the buffer.
1590 * @param b a buffer created with xslpattern__create_buffer()
1591 * @param yyscanner The scanner object.
1593 void xslpattern__delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1595 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1600 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1601 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1603 if ( b
->yy_is_our_buffer
)
1604 xslpattern_free((void *) b
->yy_ch_buf
,yyscanner
);
1606 xslpattern_free((void *) b
,yyscanner
);
1609 /* Initializes or reinitializes a buffer.
1610 * This function is sometimes called more than once on the same buffer,
1611 * such as during a xslpattern_restart() or at EOF.
1613 static void xslpattern__init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
1617 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1619 xslpattern__flush_buffer(b
,yyscanner
);
1621 b
->yy_input_file
= file
;
1622 b
->yy_fill_buffer
= 1;
1624 /* If b is the current buffer, then xslpattern__init_buffer was _probably_
1625 * called from xslpattern_restart() or through yy_get_next_buffer.
1626 * In that case, we don't want to reset the lineno or column.
1628 if (b
!= YY_CURRENT_BUFFER
){
1629 b
->yy_bs_lineno
= 1;
1630 b
->yy_bs_column
= 0;
1633 b
->yy_is_interactive
= 0;
1638 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1639 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1640 * @param yyscanner The scanner object.
1642 void xslpattern__flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1644 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1650 /* We always need two end-of-buffer characters. The first causes
1651 * a transition to the end-of-buffer state. The second causes
1652 * a jam in that state.
1654 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1655 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1657 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1660 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1662 if ( b
== YY_CURRENT_BUFFER
)
1663 xslpattern__load_buffer_state(yyscanner
);
1666 /** Pushes the new state onto the stack. The new state becomes
1667 * the current state. This function will allocate the stack
1669 * @param new_buffer The new state.
1670 * @param yyscanner The scanner object.
1672 void xslpattern_push_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1674 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1675 if (new_buffer
== NULL
)
1678 xslpattern_ensure_buffer_stack(yyscanner
);
1680 /* This block is copied from xslpattern__switch_to_buffer. */
1681 if ( YY_CURRENT_BUFFER
)
1683 /* Flush out information for old buffer. */
1684 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1685 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1686 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1689 /* Only push if top exists. Otherwise, replace top. */
1690 if (YY_CURRENT_BUFFER
)
1691 yyg
->yy_buffer_stack_top
++;
1692 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1694 /* copied from xslpattern__switch_to_buffer. */
1695 xslpattern__load_buffer_state(yyscanner
);
1696 yyg
->yy_did_buffer_switch_on_eof
= 1;
1699 /** Removes and deletes the top of the stack, if present.
1700 * The next element becomes the new top.
1701 * @param yyscanner The scanner object.
1703 void xslpattern_pop_buffer_state (yyscan_t yyscanner
)
1705 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1706 if (!YY_CURRENT_BUFFER
)
1709 xslpattern__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1710 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1711 if (yyg
->yy_buffer_stack_top
> 0)
1712 --yyg
->yy_buffer_stack_top
;
1714 if (YY_CURRENT_BUFFER
) {
1715 xslpattern__load_buffer_state(yyscanner
);
1716 yyg
->yy_did_buffer_switch_on_eof
= 1;
1720 /* Allocates the stack if it does not exist.
1721 * Guarantees space for at least one push.
1723 static void xslpattern_ensure_buffer_stack (yyscan_t yyscanner
)
1726 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1728 if (!yyg
->yy_buffer_stack
) {
1730 /* First allocation is just for 2 elements, since we don't know if this
1731 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1732 * immediate realloc on the next call.
1735 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)xslpattern_alloc
1736 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1738 if ( ! yyg
->yy_buffer_stack
)
1739 YY_FATAL_ERROR( "out of dynamic memory in xslpattern_ensure_buffer_stack()" );
1741 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1743 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1744 yyg
->yy_buffer_stack_top
= 0;
1748 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
1750 /* Increase the buffer to prepare for a possible push. */
1751 int grow_size
= 8 /* arbitrary grow size */;
1753 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
1754 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)xslpattern_realloc
1755 (yyg
->yy_buffer_stack
,
1756 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1758 if ( ! yyg
->yy_buffer_stack
)
1759 YY_FATAL_ERROR( "out of dynamic memory in xslpattern_ensure_buffer_stack()" );
1761 /* zero only the new slots.*/
1762 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
1763 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1767 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1768 * @param base the character buffer
1769 * @param size the size in bytes of the character buffer
1770 * @param yyscanner The scanner object.
1771 * @return the newly allocated buffer state object.
1773 YY_BUFFER_STATE
xslpattern__scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
1778 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1779 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1780 /* They forgot to leave room for the EOB's. */
1783 b
= (YY_BUFFER_STATE
) xslpattern_alloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1785 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__scan_buffer()" );
1787 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1788 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1789 b
->yy_is_our_buffer
= 0;
1790 b
->yy_input_file
= 0;
1791 b
->yy_n_chars
= b
->yy_buf_size
;
1792 b
->yy_is_interactive
= 0;
1794 b
->yy_fill_buffer
= 0;
1795 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1797 xslpattern__switch_to_buffer(b
,yyscanner
);
1802 /** Setup the input buffer state to scan a string. The next call to xslpattern_lex() will
1803 * scan from a @e copy of @a str.
1804 * @param yystr a NUL-terminated string to scan
1805 * @param yyscanner The scanner object.
1806 * @return the newly allocated buffer state object.
1807 * @note If you want to scan bytes that may contain NUL values, then use
1808 * xslpattern__scan_bytes() instead.
1810 YY_BUFFER_STATE
xslpattern__scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
1813 return xslpattern__scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
1816 /** Setup the input buffer state to scan the given bytes. The next call to xslpattern_lex() will
1817 * scan from a @e copy of @a bytes.
1818 * @param yybytes the byte buffer to scan
1819 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1820 * @param yyscanner The scanner object.
1821 * @return the newly allocated buffer state object.
1823 YY_BUFFER_STATE
xslpattern__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
1830 /* Get memory for full buffer, including space for trailing EOB's. */
1831 n
= _yybytes_len
+ 2;
1832 buf
= (char *) xslpattern_alloc(n
,yyscanner
);
1834 YY_FATAL_ERROR( "out of dynamic memory in xslpattern__scan_bytes()" );
1836 for ( i
= 0; i
< _yybytes_len
; ++i
)
1837 buf
[i
] = yybytes
[i
];
1839 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1841 b
= xslpattern__scan_buffer(buf
,n
,yyscanner
);
1843 YY_FATAL_ERROR( "bad buffer in xslpattern__scan_bytes()" );
1845 /* It's okay to grow etc. this buffer, and we should throw it
1846 * away when we're done.
1848 b
->yy_is_our_buffer
= 1;
1853 #ifndef YY_EXIT_FAILURE
1854 #define YY_EXIT_FAILURE 2
1857 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
1859 (void) fprintf( stderr
, "%s\n", msg
);
1860 exit( YY_EXIT_FAILURE
);
1863 /* Redefine yyless() so it works in section 3 code. */
1869 /* Undo effects of setting up yytext. */ \
1870 int yyless_macro_arg = (n); \
1871 YY_LESS_LINENO(yyless_macro_arg);\
1872 yytext[yyleng] = yyg->yy_hold_char; \
1873 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1874 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1875 *yyg->yy_c_buf_p = '\0'; \
1876 yyleng = yyless_macro_arg; \
1880 /* Accessor methods (get/set functions) to struct members. */
1882 /** Get the user-defined data for this scanner.
1883 * @param yyscanner The scanner object.
1885 YY_EXTRA_TYPE
xslpattern_get_extra (yyscan_t yyscanner
)
1887 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1891 /** Get the current line number.
1892 * @param yyscanner The scanner object.
1894 int xslpattern_get_lineno (yyscan_t yyscanner
)
1896 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1898 if (! YY_CURRENT_BUFFER
)
1904 /** Get the current column number.
1905 * @param yyscanner The scanner object.
1907 int xslpattern_get_column (yyscan_t yyscanner
)
1909 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1911 if (! YY_CURRENT_BUFFER
)
1917 /** Get the input stream.
1918 * @param yyscanner The scanner object.
1920 FILE *xslpattern_get_in (yyscan_t yyscanner
)
1922 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1926 /** Get the output stream.
1927 * @param yyscanner The scanner object.
1929 FILE *xslpattern_get_out (yyscan_t yyscanner
)
1931 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1935 /** Get the length of the current token.
1936 * @param yyscanner The scanner object.
1938 int xslpattern_get_leng (yyscan_t yyscanner
)
1940 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1944 /** Get the current token.
1945 * @param yyscanner The scanner object.
1948 char *xslpattern_get_text (yyscan_t yyscanner
)
1950 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1954 /** Set the user-defined data. This data is never touched by the scanner.
1955 * @param user_defined The data to be associated with this scanner.
1956 * @param yyscanner The scanner object.
1958 void xslpattern_set_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
1960 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1961 yyextra
= user_defined
;
1964 /** Set the current line number.
1965 * @param line_number
1966 * @param yyscanner The scanner object.
1968 void xslpattern_set_lineno (int line_number
, yyscan_t yyscanner
)
1970 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1972 /* lineno is only valid if an input buffer exists. */
1973 if (! YY_CURRENT_BUFFER
)
1974 yy_fatal_error( "xslpattern_set_lineno called with no buffer" , yyscanner
);
1976 yylineno
= line_number
;
1979 /** Set the current column.
1980 * @param line_number
1981 * @param yyscanner The scanner object.
1983 void xslpattern_set_column (int column_no
, yyscan_t yyscanner
)
1985 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1987 /* column is only valid if an input buffer exists. */
1988 if (! YY_CURRENT_BUFFER
)
1989 yy_fatal_error( "xslpattern_set_column called with no buffer" , yyscanner
);
1991 yycolumn
= column_no
;
1994 /** Set the input stream. This does not discard the current
1996 * @param in_str A readable stream.
1997 * @param yyscanner The scanner object.
1998 * @see xslpattern__switch_to_buffer
2000 void xslpattern_set_in (FILE * in_str
, yyscan_t yyscanner
)
2002 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2006 void xslpattern_set_out (FILE * out_str
, yyscan_t yyscanner
)
2008 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2012 int xslpattern_get_debug (yyscan_t yyscanner
)
2014 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2015 return yy_flex_debug
;
2018 void xslpattern_set_debug (int bdebug
, yyscan_t yyscanner
)
2020 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2021 yy_flex_debug
= bdebug
;
2024 /* Accessor methods for yylval and yylloc */
2026 YYSTYPE
* xslpattern_get_lval (yyscan_t yyscanner
)
2028 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2032 void xslpattern_set_lval (YYSTYPE
* yylval_param
, yyscan_t yyscanner
)
2034 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2035 yylval
= yylval_param
;
2038 /* User-visible API */
2040 /* xslpattern_lex_init is special because it creates the scanner itself, so it is
2041 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2042 * That's why we explicitly handle the declaration, instead of using our macros.
2045 int xslpattern_lex_init(yyscan_t
* ptr_yy_globals
)
2048 if (ptr_yy_globals
== NULL
){
2053 *ptr_yy_globals
= (yyscan_t
) xslpattern_alloc ( sizeof( struct yyguts_t
), NULL
);
2055 if (*ptr_yy_globals
== NULL
){
2060 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2061 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2063 return yy_init_globals ( *ptr_yy_globals
);
2066 /* xslpattern_lex_init_extra has the same functionality as xslpattern_lex_init, but follows the
2067 * convention of taking the scanner as the last argument. Note however, that
2068 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2069 * is the reason, too, why this function also must handle its own declaration).
2070 * The user defined value in the first argument will be available to xslpattern_alloc in
2071 * the yyextra field.
2074 int xslpattern_lex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
2077 struct yyguts_t dummy_yyguts
;
2079 xslpattern_set_extra (yy_user_defined
, &dummy_yyguts
);
2081 if (ptr_yy_globals
== NULL
){
2086 *ptr_yy_globals
= (yyscan_t
) xslpattern_alloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
2088 if (*ptr_yy_globals
== NULL
){
2093 /* By setting to 0xAA, we expose bugs in
2094 yy_init_globals. Leave at 0x00 for releases. */
2095 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2097 xslpattern_set_extra (yy_user_defined
, *ptr_yy_globals
);
2099 return yy_init_globals ( *ptr_yy_globals
);
2102 static int yy_init_globals (yyscan_t yyscanner
)
2104 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2105 /* Initialization is the same as for the non-reentrant scanner.
2106 * This function is called from xslpattern_lex_destroy(), so don't allocate here.
2109 yyg
->yy_buffer_stack
= 0;
2110 yyg
->yy_buffer_stack_top
= 0;
2111 yyg
->yy_buffer_stack_max
= 0;
2112 yyg
->yy_c_buf_p
= (char *) 0;
2116 yyg
->yy_start_stack_ptr
= 0;
2117 yyg
->yy_start_stack_depth
= 0;
2118 yyg
->yy_start_stack
= NULL
;
2120 /* Defined in main.c */
2129 /* For future reference: Set errno on error, since we are called by
2130 * xslpattern_lex_init()
2135 /* xslpattern_lex_destroy is for both reentrant and non-reentrant scanners. */
2136 int xslpattern_lex_destroy (yyscan_t yyscanner
)
2138 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2140 /* Pop the buffer stack, destroying each element. */
2141 while(YY_CURRENT_BUFFER
){
2142 xslpattern__delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
2143 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2144 xslpattern_pop_buffer_state(yyscanner
);
2147 /* Destroy the stack itself. */
2148 xslpattern_free(yyg
->yy_buffer_stack
,yyscanner
);
2149 yyg
->yy_buffer_stack
= NULL
;
2151 /* Destroy the start condition stack. */
2152 xslpattern_free(yyg
->yy_start_stack
,yyscanner
);
2153 yyg
->yy_start_stack
= NULL
;
2155 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2156 * xslpattern_lex() is called, initialization will occur. */
2157 yy_init_globals( yyscanner
);
2159 /* Destroy the main struct (reentrant only). */
2160 xslpattern_free ( yyscanner
, yyscanner
);
2166 * Internal utility routines.
2170 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
2173 for ( i
= 0; i
< n
; ++i
)
2178 #ifdef YY_NEED_STRLEN
2179 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
2182 for ( n
= 0; s
[n
]; ++n
)
2189 void *xslpattern_alloc (yy_size_t size
, yyscan_t yyscanner
)
2191 return (void *) malloc( size
);
2194 void *xslpattern_realloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
2196 /* The cast to (char *) in the following accommodates both
2197 * implementations that use char* generic pointers, and those
2198 * that use void* generic pointers. It works with the latter
2199 * because both ANSI C and C++ allow castless assignment from
2200 * any pointer type to void*, and deal with argument conversions
2201 * as though doing an assignment.
2203 return (void *) realloc( (char *) ptr
, size
);
2206 void xslpattern_free (void * ptr
, yyscan_t yyscanner
)
2208 free( (char *) ptr
); /* see xslpattern_realloc() for (char *) cast */
2211 #define YYTABLES_NAME "yytables"
2213 #line 153 "xslpattern.l"
2217 xmlChar
* XSLPattern_to_XPath(xmlXPathContextPtr ctxt
, xmlChar
const* xslpat_str
)
2220 TRACE("(%s)\n", debugstr_a((char const*)xslpat_str
));
2221 memset(&p
, 0, sizeof(parser_param
));
2224 p
.len
= xmlStrlen(xslpat_str
);
2226 xslpattern_lex_init(&p
.yyscanner
);
2227 xslpattern_set_extra(&p
, p
.yyscanner
);
2229 xslpattern_parse(&p
, p
.yyscanner
);
2231 TRACE("=> %s\n", debugstr_a((char const*)p
.out
));
2232 xslpattern_lex_destroy(p
.yyscanner
);
2237 return xmlStrdup(xslpat_str
);
2246 #endif /* HAVE_LIBXML2 */