Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 2 | #line 3 "scripts/genksyms/lex.lex.c_shipped" |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 3 | |
| 4 | #define YY_INT_ALIGNED short int |
| 5 | |
| 6 | /* A lexical scanner generated by flex */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
| 8 | #define FLEX_SCANNER |
| 9 | #define YY_FLEX_MAJOR_VERSION 2 |
| 10 | #define YY_FLEX_MINOR_VERSION 5 |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 11 | #define YY_FLEX_SUBMINOR_VERSION 35 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 12 | #if YY_FLEX_SUBMINOR_VERSION > 0 |
| 13 | #define FLEX_BETA |
| 14 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 16 | /* First, we deal with platform-specific or compiler-specific issues. */ |
| 17 | |
| 18 | /* begin standard C headers. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <stdio.h> |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 20 | #include <string.h> |
| 21 | #include <errno.h> |
| 22 | #include <stdlib.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 24 | /* end standard C headers. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 26 | /* flex integer type definitions */ |
| 27 | |
| 28 | #ifndef FLEXINT_H |
| 29 | #define FLEXINT_H |
| 30 | |
| 31 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
| 32 | |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 33 | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 34 | |
| 35 | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, |
| 36 | * if you want the limit (max/min) macros for int types. |
| 37 | */ |
| 38 | #ifndef __STDC_LIMIT_MACROS |
| 39 | #define __STDC_LIMIT_MACROS 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #endif |
| 41 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 42 | #include <inttypes.h> |
| 43 | typedef int8_t flex_int8_t; |
| 44 | typedef uint8_t flex_uint8_t; |
| 45 | typedef int16_t flex_int16_t; |
| 46 | typedef uint16_t flex_uint16_t; |
| 47 | typedef int32_t flex_int32_t; |
| 48 | typedef uint32_t flex_uint32_t; |
| 49 | #else |
| 50 | typedef signed char flex_int8_t; |
| 51 | typedef short int flex_int16_t; |
| 52 | typedef int flex_int32_t; |
| 53 | typedef unsigned char flex_uint8_t; |
| 54 | typedef unsigned short int flex_uint16_t; |
| 55 | typedef unsigned int flex_uint32_t; |
Michal Marek | 9c281f1 | 2011-01-20 15:23:08 +0100 | [diff] [blame] | 56 | #endif /* ! C99 */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 57 | |
| 58 | /* Limits of integral types. */ |
| 59 | #ifndef INT8_MIN |
| 60 | #define INT8_MIN (-128) |
| 61 | #endif |
| 62 | #ifndef INT16_MIN |
| 63 | #define INT16_MIN (-32767-1) |
| 64 | #endif |
| 65 | #ifndef INT32_MIN |
| 66 | #define INT32_MIN (-2147483647-1) |
| 67 | #endif |
| 68 | #ifndef INT8_MAX |
| 69 | #define INT8_MAX (127) |
| 70 | #endif |
| 71 | #ifndef INT16_MAX |
| 72 | #define INT16_MAX (32767) |
| 73 | #endif |
| 74 | #ifndef INT32_MAX |
| 75 | #define INT32_MAX (2147483647) |
| 76 | #endif |
| 77 | #ifndef UINT8_MAX |
| 78 | #define UINT8_MAX (255U) |
| 79 | #endif |
| 80 | #ifndef UINT16_MAX |
| 81 | #define UINT16_MAX (65535U) |
| 82 | #endif |
| 83 | #ifndef UINT32_MAX |
| 84 | #define UINT32_MAX (4294967295U) |
| 85 | #endif |
| 86 | |
| 87 | #endif /* ! FLEXINT_H */ |
| 88 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | #ifdef __cplusplus |
| 90 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | /* The "const" storage-class-modifier is valid. */ |
| 92 | #define YY_USE_CONST |
| 93 | |
| 94 | #else /* ! __cplusplus */ |
| 95 | |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 96 | /* C99 requires __STDC__ to be defined as 1. */ |
| 97 | #if defined (__STDC__) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | #define YY_USE_CONST |
| 100 | |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 101 | #endif /* defined (__STDC__) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | #endif /* ! __cplusplus */ |
| 103 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | #ifdef YY_USE_CONST |
| 105 | #define yyconst const |
| 106 | #else |
| 107 | #define yyconst |
| 108 | #endif |
| 109 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | /* Returned upon end-of-file. */ |
| 111 | #define YY_NULL 0 |
| 112 | |
| 113 | /* Promotes a possibly negative, possibly signed char to an unsigned |
| 114 | * integer for use as an array index. If the signed char is negative, |
| 115 | * we want to instead treat it as an 8-bit unsigned char, hence the |
| 116 | * double cast. |
| 117 | */ |
| 118 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
| 119 | |
| 120 | /* Enter a start condition. This macro really ought to take a parameter, |
| 121 | * but we do it the disgusting crufty way forced on us by the ()-less |
| 122 | * definition of BEGIN. |
| 123 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 124 | #define BEGIN (yy_start) = 1 + 2 * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | |
| 126 | /* Translate the current start state into a value that can be later handed |
| 127 | * to BEGIN to return to the state. The YYSTATE alias is for lex |
| 128 | * compatibility. |
| 129 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 130 | #define YY_START (((yy_start) - 1) / 2) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | #define YYSTATE YY_START |
| 132 | |
| 133 | /* Action number for EOF rule of a given start state. */ |
| 134 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
| 135 | |
| 136 | /* Special action meaning "start processing a new file". */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 137 | #define YY_NEW_FILE yyrestart(yyin ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | |
| 139 | #define YY_END_OF_BUFFER_CHAR 0 |
| 140 | |
| 141 | /* Size of default input buffer. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 142 | #ifndef YY_BUF_SIZE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | #define YY_BUF_SIZE 16384 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 144 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 146 | /* The state buf must be large enough to hold one state per character in the main buffer. |
| 147 | */ |
| 148 | #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
| 149 | |
| 150 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
| 151 | #define YY_TYPEDEF_YY_BUFFER_STATE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 153 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | |
| 155 | extern int yyleng; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 156 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | extern FILE *yyin, *yyout; |
| 158 | |
| 159 | #define EOB_ACT_CONTINUE_SCAN 0 |
| 160 | #define EOB_ACT_END_OF_FILE 1 |
| 161 | #define EOB_ACT_LAST_MATCH 2 |
| 162 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 163 | #define YY_LESS_LINENO(n) |
| 164 | |
| 165 | /* Return all but the first "n" matched characters back to the input stream. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | #define yyless(n) \ |
| 167 | do \ |
| 168 | { \ |
| 169 | /* Undo effects of setting up yytext. */ \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 170 | int yyless_macro_arg = (n); \ |
| 171 | YY_LESS_LINENO(yyless_macro_arg);\ |
| 172 | *yy_cp = (yy_hold_char); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | YY_RESTORE_YY_MORE_OFFSET \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 174 | (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
| 176 | } \ |
| 177 | while ( 0 ) |
| 178 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 179 | #define unput(c) yyunput( c, (yytext_ptr) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 181 | #ifndef YY_TYPEDEF_YY_SIZE_T |
| 182 | #define YY_TYPEDEF_YY_SIZE_T |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 183 | typedef size_t yy_size_t; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 184 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 186 | #ifndef YY_STRUCT_YY_BUFFER_STATE |
| 187 | #define YY_STRUCT_YY_BUFFER_STATE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | struct yy_buffer_state |
| 189 | { |
| 190 | FILE *yy_input_file; |
| 191 | |
| 192 | char *yy_ch_buf; /* input buffer */ |
| 193 | char *yy_buf_pos; /* current position in input buffer */ |
| 194 | |
| 195 | /* Size of input buffer in bytes, not including room for EOB |
| 196 | * characters. |
| 197 | */ |
| 198 | yy_size_t yy_buf_size; |
| 199 | |
| 200 | /* Number of characters read into yy_ch_buf, not including EOB |
| 201 | * characters. |
| 202 | */ |
| 203 | int yy_n_chars; |
| 204 | |
| 205 | /* Whether we "own" the buffer - i.e., we know we created it, |
| 206 | * and can realloc() it to grow it, and should free() it to |
| 207 | * delete it. |
| 208 | */ |
| 209 | int yy_is_our_buffer; |
| 210 | |
| 211 | /* Whether this is an "interactive" input source; if so, and |
| 212 | * if we're using stdio for input, then we want to use getc() |
| 213 | * instead of fread(), to make sure we stop fetching input after |
| 214 | * each newline. |
| 215 | */ |
| 216 | int yy_is_interactive; |
| 217 | |
| 218 | /* Whether we're considered to be at the beginning of a line. |
| 219 | * If so, '^' rules will be active on the next match, otherwise |
| 220 | * not. |
| 221 | */ |
| 222 | int yy_at_bol; |
| 223 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 224 | int yy_bs_lineno; /**< The line count. */ |
| 225 | int yy_bs_column; /**< The column count. */ |
| 226 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | /* Whether to try to fill the input buffer when we reach the |
| 228 | * end of it. |
| 229 | */ |
| 230 | int yy_fill_buffer; |
| 231 | |
| 232 | int yy_buffer_status; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 233 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | #define YY_BUFFER_NEW 0 |
| 235 | #define YY_BUFFER_NORMAL 1 |
| 236 | /* When an EOF's been seen but there's still some text to process |
| 237 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
| 238 | * shouldn't try reading from the input source any more. We might |
| 239 | * still have a bunch of tokens to match, though, because of |
| 240 | * possible backing-up. |
| 241 | * |
| 242 | * When we actually see the EOF, we change the status to "new" |
| 243 | * (via yyrestart()), so that the user can continue scanning by |
| 244 | * just pointing yyin at a new input file. |
| 245 | */ |
| 246 | #define YY_BUFFER_EOF_PENDING 2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 248 | }; |
| 249 | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ |
| 250 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 251 | /* Stack of input buffers. */ |
| 252 | static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ |
| 253 | static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ |
| 254 | static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | |
| 256 | /* We provide macros for accessing buffer states in case in the |
| 257 | * future we want to put the buffer states in a more general |
| 258 | * "scanner state". |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 259 | * |
| 260 | * Returns the top of the stack, or NULL. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 262 | #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ |
| 263 | ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ |
| 264 | : NULL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 266 | /* Same as previous macro, but useful when we know that the buffer stack is not |
| 267 | * NULL or when we need an lvalue. For internal use only. |
| 268 | */ |
| 269 | #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
| 270 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | /* yy_hold_char holds the character lost when yytext is formed. */ |
| 272 | static char yy_hold_char; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 273 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | int yyleng; |
| 275 | |
| 276 | /* Points to current character in buffer. */ |
| 277 | static char *yy_c_buf_p = (char *) 0; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 278 | static int yy_init = 0; /* whether we need to initialize */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | static int yy_start = 0; /* start state number */ |
| 280 | |
| 281 | /* Flag which is used to allow yywrap()'s to do buffer switches |
| 282 | * instead of setting up a fresh yyin. A bit of a hack ... |
| 283 | */ |
| 284 | static int yy_did_buffer_switch_on_eof; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 286 | void yyrestart (FILE *input_file ); |
| 287 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); |
| 288 | YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); |
| 289 | void yy_delete_buffer (YY_BUFFER_STATE b ); |
| 290 | void yy_flush_buffer (YY_BUFFER_STATE b ); |
| 291 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); |
| 292 | void yypop_buffer_state (void ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 294 | static void yyensure_buffer_stack (void ); |
| 295 | static void yy_load_buffer_state (void ); |
| 296 | static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 298 | #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) |
| 299 | |
| 300 | YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); |
| 301 | YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); |
| 302 | YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); |
| 303 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 304 | void *yyalloc (yy_size_t ); |
| 305 | void *yyrealloc (void *,yy_size_t ); |
| 306 | void yyfree (void * ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 307 | |
| 308 | #define yy_new_buffer yy_create_buffer |
| 309 | |
| 310 | #define yy_set_interactive(is_interactive) \ |
| 311 | { \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 312 | if ( ! YY_CURRENT_BUFFER ){ \ |
| 313 | yyensure_buffer_stack (); \ |
| 314 | YY_CURRENT_BUFFER_LVALUE = \ |
| 315 | yy_create_buffer(yyin,YY_BUF_SIZE ); \ |
| 316 | } \ |
| 317 | YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | #define yy_set_bol(at_bol) \ |
| 321 | { \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 322 | if ( ! YY_CURRENT_BUFFER ){\ |
| 323 | yyensure_buffer_stack (); \ |
| 324 | YY_CURRENT_BUFFER_LVALUE = \ |
| 325 | yy_create_buffer(yyin,YY_BUF_SIZE ); \ |
| 326 | } \ |
| 327 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 328 | } |
| 329 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 330 | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 332 | /* Begin user sect3 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 334 | #define yywrap(n) 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | #define YY_SKIP_YYWRAP |
| 336 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | typedef unsigned char YY_CHAR; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 338 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 340 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 341 | typedef int yy_state_type; |
| 342 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 343 | extern int yylineno; |
| 344 | |
| 345 | int yylineno = 1; |
| 346 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 347 | extern char *yytext; |
| 348 | #define yytext_ptr yytext |
| 349 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 350 | static yy_state_type yy_get_previous_state (void ); |
| 351 | static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); |
| 352 | static int yy_get_next_buffer (void ); |
| 353 | static void yy_fatal_error (yyconst char msg[] ); |
| 354 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | /* Done after the current pattern has been matched and before the |
| 356 | * corresponding action - sets up yytext. |
| 357 | */ |
| 358 | #define YY_DO_BEFORE_ACTION \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 359 | (yytext_ptr) = yy_bp; \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 360 | yyleng = (size_t) (yy_cp - yy_bp); \ |
| 361 | (yy_hold_char) = *yy_cp; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | *yy_cp = '\0'; \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 363 | (yy_c_buf_p) = yy_cp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | |
| 365 | #define YY_NUM_RULES 13 |
| 366 | #define YY_END_OF_BUFFER 14 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 367 | /* This struct is not used in this scanner, |
| 368 | but its presence is necessary. */ |
| 369 | struct yy_trans_info |
| 370 | { |
| 371 | flex_int32_t yy_verify; |
| 372 | flex_int32_t yy_nxt; |
| 373 | }; |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 374 | static yyconst flex_int16_t yy_accept[73] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | { 0, |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 376 | 0, 0, 14, 12, 4, 3, 12, 7, 12, 12, |
| 377 | 12, 12, 12, 9, 9, 12, 12, 7, 12, 12, |
| 378 | 4, 0, 5, 0, 7, 8, 0, 6, 0, 0, |
| 379 | 10, 10, 9, 0, 0, 9, 9, 0, 9, 0, |
| 380 | 0, 0, 0, 2, 0, 0, 11, 0, 10, 0, |
| 381 | 10, 9, 9, 0, 0, 0, 10, 10, 0, 0, |
| 382 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 383 | 1, 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 384 | } ; |
| 385 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 386 | static yyconst flex_int32_t yy_ec[256] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 387 | { 0, |
| 388 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
| 389 | 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, |
| 390 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 391 | 1, 2, 1, 5, 6, 7, 8, 9, 10, 1, |
| 392 | 1, 8, 11, 1, 12, 13, 8, 14, 15, 15, |
| 393 | 15, 15, 15, 15, 15, 16, 16, 1, 1, 17, |
| 394 | 18, 19, 1, 1, 20, 20, 20, 20, 21, 22, |
| 395 | 7, 7, 7, 7, 7, 23, 7, 7, 7, 7, |
| 396 | 7, 7, 7, 7, 24, 7, 7, 25, 7, 7, |
| 397 | 1, 26, 1, 8, 7, 1, 20, 20, 20, 20, |
| 398 | |
| 399 | 21, 22, 7, 7, 7, 7, 7, 27, 7, 7, |
| 400 | 7, 7, 7, 7, 7, 7, 24, 7, 7, 25, |
| 401 | 7, 7, 1, 28, 1, 8, 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, 1, 1, 1, 1, 1, 1, 1, 1, |
| 407 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 408 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 409 | |
| 410 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 411 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 412 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 413 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 414 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 415 | 1, 1, 1, 1, 1 |
| 416 | } ; |
| 417 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 418 | static yyconst flex_int32_t yy_meta[29] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 419 | { 0, |
| 420 | 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, |
| 421 | 4, 4, 5, 6, 6, 6, 1, 1, 1, 7, |
| 422 | 8, 7, 3, 3, 3, 1, 3, 1 |
| 423 | } ; |
| 424 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 425 | static yyconst flex_int16_t yy_base[85] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 426 | { 0, |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 427 | 0, 145, 150, 266, 27, 266, 25, 0, 131, 23, |
| 428 | 23, 16, 23, 39, 31, 25, 39, 60, 22, 65, |
| 429 | 57, 43, 266, 0, 0, 266, 61, 266, 0, 128, |
| 430 | 74, 0, 113, 59, 62, 113, 52, 0, 0, 72, |
| 431 | 66, 110, 100, 266, 73, 74, 266, 70, 266, 90, |
| 432 | 103, 266, 84, 129, 108, 113, 143, 266, 107, 66, |
| 433 | 118, 137, 168, 120, 80, 91, 145, 143, 83, 41, |
| 434 | 266, 266, 190, 196, 204, 212, 220, 228, 232, 237, |
| 435 | 238, 243, 249, 257 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | } ; |
| 437 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 438 | static yyconst flex_int16_t yy_def[85] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | { 0, |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 440 | 72, 1, 72, 72, 72, 72, 73, 74, 72, 72, |
| 441 | 75, 72, 72, 72, 14, 72, 72, 74, 72, 76, |
| 442 | 72, 73, 72, 77, 74, 72, 75, 72, 78, 72, |
| 443 | 72, 31, 14, 79, 80, 72, 72, 81, 15, 73, |
| 444 | 75, 76, 76, 72, 73, 75, 72, 82, 72, 72, |
| 445 | 72, 72, 81, 76, 54, 72, 72, 72, 76, 54, |
| 446 | 76, 76, 76, 54, 83, 76, 63, 83, 84, 84, |
| 447 | 72, 0, 72, 72, 72, 72, 72, 72, 72, 72, |
| 448 | 72, 72, 72, 72 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 449 | } ; |
| 450 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 451 | static yyconst flex_int16_t yy_nxt[295] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 452 | { 0, |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 453 | 4, 5, 6, 5, 7, 4, 8, 9, 10, 11, |
| 454 | 9, 12, 13, 14, 15, 15, 16, 9, 17, 8, |
| 455 | 8, 8, 18, 8, 8, 4, 8, 19, 21, 23, |
| 456 | 21, 26, 28, 26, 26, 30, 31, 31, 31, 26, |
| 457 | 26, 26, 26, 71, 39, 39, 39, 23, 29, 26, |
| 458 | 24, 32, 33, 33, 34, 72, 26, 26, 21, 35, |
| 459 | 21, 36, 37, 38, 40, 36, 43, 44, 24, 41, |
| 460 | 28, 32, 50, 50, 52, 28, 23, 23, 52, 35, |
| 461 | 56, 56, 44, 28, 42, 71, 29, 31, 31, 31, |
| 462 | 42, 29, 59, 44, 48, 49, 49, 24, 24, 29, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 463 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 464 | 49, 43, 44, 51, 51, 51, 36, 37, 59, 44, |
| 465 | 36, 65, 44, 54, 55, 55, 51, 51, 51, 59, |
| 466 | 44, 64, 64, 64, 58, 58, 57, 57, 57, 58, |
| 467 | 59, 44, 42, 64, 64, 64, 52, 72, 59, 44, |
| 468 | 47, 66, 60, 60, 42, 44, 59, 69, 26, 72, |
| 469 | 20, 61, 62, 63, 72, 61, 57, 57, 57, 66, |
| 470 | 72, 72, 72, 66, 49, 49, 72, 61, 62, 49, |
| 471 | 44, 61, 72, 72, 72, 72, 72, 72, 72, 72, |
| 472 | 72, 67, 67, 67, 72, 72, 72, 67, 67, 67, |
| 473 | 22, 22, 22, 22, 22, 22, 22, 22, 25, 72, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 474 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 475 | 72, 25, 25, 25, 27, 27, 27, 27, 27, 27, |
| 476 | 27, 27, 42, 42, 42, 42, 42, 42, 42, 42, |
| 477 | 45, 72, 45, 45, 45, 45, 45, 45, 46, 72, |
| 478 | 46, 46, 46, 46, 46, 46, 34, 34, 72, 34, |
| 479 | 51, 72, 51, 53, 53, 53, 57, 72, 57, 68, |
| 480 | 68, 68, 68, 68, 68, 68, 68, 70, 70, 70, |
| 481 | 70, 70, 70, 70, 70, 3, 72, 72, 72, 72, |
| 482 | 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, |
| 483 | 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, |
| 484 | 72, 72, 72, 72 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 485 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 486 | } ; |
| 487 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 488 | static yyconst flex_int16_t yy_chk[295] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 489 | { 0, |
| 490 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 491 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 492 | 1, 1, 1, 1, 1, 1, 1, 1, 5, 7, |
| 493 | 5, 10, 11, 12, 12, 13, 13, 13, 13, 19, |
| 494 | 10, 16, 16, 70, 15, 15, 15, 22, 11, 19, |
| 495 | 7, 14, 14, 14, 14, 15, 17, 17, 21, 14, |
| 496 | 21, 14, 14, 14, 18, 14, 20, 20, 22, 18, |
| 497 | 27, 34, 35, 35, 37, 41, 40, 45, 37, 34, |
| 498 | 48, 48, 65, 46, 65, 69, 27, 31, 31, 31, |
| 499 | 60, 41, 66, 66, 31, 31, 31, 40, 45, 46, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 500 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 501 | 31, 43, 43, 50, 50, 50, 53, 53, 59, 59, |
| 502 | 53, 59, 42, 43, 43, 43, 51, 51, 51, 61, |
| 503 | 61, 55, 55, 55, 51, 51, 56, 56, 56, 51, |
| 504 | 54, 54, 55, 64, 64, 64, 36, 33, 62, 62, |
| 505 | 30, 61, 54, 54, 64, 68, 67, 68, 9, 3, |
| 506 | 2, 54, 54, 54, 0, 54, 57, 57, 57, 62, |
| 507 | 0, 0, 0, 62, 57, 57, 0, 67, 67, 57, |
| 508 | 63, 67, 0, 0, 0, 0, 0, 0, 0, 0, |
| 509 | 0, 63, 63, 63, 0, 0, 0, 63, 63, 63, |
| 510 | 73, 73, 73, 73, 73, 73, 73, 73, 74, 0, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 511 | |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 512 | 0, 74, 74, 74, 75, 75, 75, 75, 75, 75, |
| 513 | 75, 75, 76, 76, 76, 76, 76, 76, 76, 76, |
| 514 | 77, 0, 77, 77, 77, 77, 77, 77, 78, 0, |
| 515 | 78, 78, 78, 78, 78, 78, 79, 79, 0, 79, |
| 516 | 80, 0, 80, 81, 81, 81, 82, 0, 82, 83, |
| 517 | 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, |
| 518 | 84, 84, 84, 84, 84, 72, 72, 72, 72, 72, |
| 519 | 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, |
| 520 | 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, |
| 521 | 72, 72, 72, 72 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 523 | } ; |
| 524 | |
| 525 | static yy_state_type yy_last_accepting_state; |
| 526 | static char *yy_last_accepting_cpos; |
| 527 | |
| 528 | extern int yy_flex_debug; |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 529 | int yy_flex_debug = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 530 | |
| 531 | /* The intent behind this definition is that it'll catch |
| 532 | * any uses of REJECT which flex missed. |
| 533 | */ |
| 534 | #define REJECT reject_used_but_not_detected |
| 535 | #define yymore() yymore_used_but_not_detected |
| 536 | #define YY_MORE_ADJ 0 |
| 537 | #define YY_RESTORE_YY_MORE_OFFSET |
| 538 | char *yytext; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 539 | /* Lexical analysis for genksyms. |
| 540 | Copyright 1996, 1997 Linux International. |
| 541 | |
| 542 | New implementation contributed by Richard Henderson <rth@tamu.edu> |
| 543 | Based on original work by Bjorn Ekwall <bj0rn@blox.se> |
| 544 | |
| 545 | Taken from Linux modutils 2.4.22. |
| 546 | |
| 547 | This program is free software; you can redistribute it and/or modify it |
| 548 | under the terms of the GNU General Public License as published by the |
| 549 | Free Software Foundation; either version 2 of the License, or (at your |
| 550 | option) any later version. |
| 551 | |
| 552 | This program is distributed in the hope that it will be useful, but |
| 553 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 554 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 555 | General Public License for more details. |
| 556 | |
| 557 | You should have received a copy of the GNU General Public License |
| 558 | along with this program; if not, write to the Free Software Foundation, |
| 559 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 560 | |
| 561 | #include <limits.h> |
| 562 | #include <stdlib.h> |
| 563 | #include <string.h> |
| 564 | #include <ctype.h> |
| 565 | |
| 566 | #include "genksyms.h" |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 567 | #include "parse.tab.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 568 | |
| 569 | /* We've got a two-level lexer here. We let flex do basic tokenization |
| 570 | and then we categorize those basic tokens in the second stage. */ |
| 571 | #define YY_DECL static int yylex1(void) |
| 572 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 573 | /* We don't do multiple input files. */ |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 574 | #define YY_NO_INPUT 1 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 575 | |
| 576 | #define INITIAL 0 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 577 | |
| 578 | #ifndef YY_NO_UNISTD_H |
| 579 | /* Special case for "unistd.h", since it is non-ANSI. We include it way |
| 580 | * down here because we want the user's section 1 to have been scanned first. |
| 581 | * The user has a chance to override it with an option. |
| 582 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 583 | #include <unistd.h> |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 584 | #endif |
| 585 | |
| 586 | #ifndef YY_EXTRA_TYPE |
| 587 | #define YY_EXTRA_TYPE void * |
| 588 | #endif |
| 589 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 590 | static int yy_init_globals (void ); |
| 591 | |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 592 | /* Accessor methods to globals. |
| 593 | These are made visible to non-reentrant scanners for convenience. */ |
| 594 | |
| 595 | int yylex_destroy (void ); |
| 596 | |
| 597 | int yyget_debug (void ); |
| 598 | |
| 599 | void yyset_debug (int debug_flag ); |
| 600 | |
| 601 | YY_EXTRA_TYPE yyget_extra (void ); |
| 602 | |
| 603 | void yyset_extra (YY_EXTRA_TYPE user_defined ); |
| 604 | |
| 605 | FILE *yyget_in (void ); |
| 606 | |
| 607 | void yyset_in (FILE * in_str ); |
| 608 | |
| 609 | FILE *yyget_out (void ); |
| 610 | |
| 611 | void yyset_out (FILE * out_str ); |
| 612 | |
| 613 | int yyget_leng (void ); |
| 614 | |
| 615 | char *yyget_text (void ); |
| 616 | |
| 617 | int yyget_lineno (void ); |
| 618 | |
| 619 | void yyset_lineno (int line_number ); |
| 620 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 621 | /* Macros after this point can all be overridden by user definitions in |
| 622 | * section 1. |
| 623 | */ |
| 624 | |
| 625 | #ifndef YY_SKIP_YYWRAP |
| 626 | #ifdef __cplusplus |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 627 | extern "C" int yywrap (void ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 628 | #else |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 629 | extern int yywrap (void ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 630 | #endif |
| 631 | #endif |
| 632 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 633 | static void yyunput (int c,char *buf_ptr ); |
| 634 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 635 | #ifndef yytext_ptr |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 636 | static void yy_flex_strncpy (char *,yyconst char *,int ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 637 | #endif |
| 638 | |
| 639 | #ifdef YY_NEED_STRLEN |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 640 | static int yy_flex_strlen (yyconst char * ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 641 | #endif |
| 642 | |
| 643 | #ifndef YY_NO_INPUT |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 644 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 645 | #ifdef __cplusplus |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 646 | static int yyinput (void ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 647 | #else |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 648 | static int input (void ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 649 | #endif |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 650 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 651 | #endif |
| 652 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 653 | /* Amount of stuff to slurp up with each read. */ |
| 654 | #ifndef YY_READ_BUF_SIZE |
| 655 | #define YY_READ_BUF_SIZE 8192 |
| 656 | #endif |
| 657 | |
| 658 | /* Copy whatever the last rule matched to the standard output. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 659 | #ifndef ECHO |
| 660 | /* This used to be an fputs(), but since the string might contain NUL's, |
| 661 | * we now use fwrite(). |
| 662 | */ |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame^] | 663 | #define ECHO fwrite( yytext, yyleng, 1, yyout ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 664 | #endif |
| 665 | |
| 666 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
| 667 | * is returned in "result". |
| 668 | */ |
| 669 | #ifndef YY_INPUT |
| 670 | #define YY_INPUT(buf,result,max_size) \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 671 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 672 | { \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 673 | int c = '*'; \ |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame^] | 674 | int n; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 675 | for ( n = 0; n < max_size && \ |
| 676 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
| 677 | buf[n] = (char) c; \ |
| 678 | if ( c == '\n' ) \ |
| 679 | buf[n++] = (char) c; \ |
| 680 | if ( c == EOF && ferror( yyin ) ) \ |
| 681 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
| 682 | result = n; \ |
| 683 | } \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 684 | else \ |
| 685 | { \ |
| 686 | errno=0; \ |
| 687 | while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ |
| 688 | { \ |
| 689 | if( errno != EINTR) \ |
| 690 | { \ |
| 691 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
| 692 | break; \ |
| 693 | } \ |
| 694 | errno=0; \ |
| 695 | clearerr(yyin); \ |
| 696 | } \ |
| 697 | }\ |
| 698 | \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 699 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 700 | #endif |
| 701 | |
| 702 | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
| 703 | * we don't want an extra ';' after the "return" because that will cause |
| 704 | * some compilers to complain about unreachable statements. |
| 705 | */ |
| 706 | #ifndef yyterminate |
| 707 | #define yyterminate() return YY_NULL |
| 708 | #endif |
| 709 | |
| 710 | /* Number of entries by which start-condition stack grows. */ |
| 711 | #ifndef YY_START_STACK_INCR |
| 712 | #define YY_START_STACK_INCR 25 |
| 713 | #endif |
| 714 | |
| 715 | /* Report a fatal error. */ |
| 716 | #ifndef YY_FATAL_ERROR |
| 717 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
| 718 | #endif |
| 719 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 720 | /* end tables serialization structures and prototypes */ |
| 721 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 722 | /* Default declaration of generated scanner - a define so the user can |
| 723 | * easily add parameters. |
| 724 | */ |
| 725 | #ifndef YY_DECL |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 726 | #define YY_DECL_IS_OURS 1 |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 727 | |
| 728 | extern int yylex (void); |
| 729 | |
| 730 | #define YY_DECL int yylex (void) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 731 | #endif /* !YY_DECL */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 732 | |
| 733 | /* Code executed at the beginning of each rule, after yytext and yyleng |
| 734 | * have been set up. |
| 735 | */ |
| 736 | #ifndef YY_USER_ACTION |
| 737 | #define YY_USER_ACTION |
| 738 | #endif |
| 739 | |
| 740 | /* Code executed at the end of each rule. */ |
| 741 | #ifndef YY_BREAK |
| 742 | #define YY_BREAK break; |
| 743 | #endif |
| 744 | |
| 745 | #define YY_RULE_SETUP \ |
| 746 | if ( yyleng > 0 ) \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 747 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 748 | (yytext[yyleng - 1] == '\n'); \ |
| 749 | YY_USER_ACTION |
| 750 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 751 | /** The main scanner function which does all the work. |
| 752 | */ |
| 753 | YY_DECL |
| 754 | { |
| 755 | register yy_state_type yy_current_state; |
| 756 | register char *yy_cp, *yy_bp; |
| 757 | register int yy_act; |
| 758 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 759 | /* Keep track of our location in the original source files. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 760 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 761 | if ( !(yy_init) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 762 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 763 | (yy_init) = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 764 | |
| 765 | #ifdef YY_USER_INIT |
| 766 | YY_USER_INIT; |
| 767 | #endif |
| 768 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 769 | if ( ! (yy_start) ) |
| 770 | (yy_start) = 1; /* first start state */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 771 | |
| 772 | if ( ! yyin ) |
| 773 | yyin = stdin; |
| 774 | |
| 775 | if ( ! yyout ) |
| 776 | yyout = stdout; |
| 777 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 778 | if ( ! YY_CURRENT_BUFFER ) { |
| 779 | yyensure_buffer_stack (); |
| 780 | YY_CURRENT_BUFFER_LVALUE = |
| 781 | yy_create_buffer(yyin,YY_BUF_SIZE ); |
| 782 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 783 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 784 | yy_load_buffer_state( ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 785 | } |
| 786 | |
| 787 | while ( 1 ) /* loops until end-of-file is reached */ |
| 788 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 789 | yy_cp = (yy_c_buf_p); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 790 | |
| 791 | /* Support of yytext. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 792 | *yy_cp = (yy_hold_char); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 793 | |
| 794 | /* yy_bp points to the position in yy_ch_buf of the start of |
| 795 | * the current run. |
| 796 | */ |
| 797 | yy_bp = yy_cp; |
| 798 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 799 | yy_current_state = (yy_start); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 800 | yy_current_state += YY_AT_BOL(); |
| 801 | yy_match: |
| 802 | do |
| 803 | { |
| 804 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
| 805 | if ( yy_accept[yy_current_state] ) |
| 806 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 807 | (yy_last_accepting_state) = yy_current_state; |
| 808 | (yy_last_accepting_cpos) = yy_cp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 809 | } |
| 810 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 811 | { |
| 812 | yy_current_state = (int) yy_def[yy_current_state]; |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 813 | if ( yy_current_state >= 73 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 814 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 815 | } |
| 816 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
| 817 | ++yy_cp; |
| 818 | } |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 819 | while ( yy_base[yy_current_state] != 266 ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 820 | |
| 821 | yy_find_action: |
| 822 | yy_act = yy_accept[yy_current_state]; |
| 823 | if ( yy_act == 0 ) |
| 824 | { /* have to back up */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 825 | yy_cp = (yy_last_accepting_cpos); |
| 826 | yy_current_state = (yy_last_accepting_state); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 827 | yy_act = yy_accept[yy_current_state]; |
| 828 | } |
| 829 | |
| 830 | YY_DO_BEFORE_ACTION; |
| 831 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 832 | do_action: /* This label is used only to access EOF actions. */ |
| 833 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 834 | switch ( yy_act ) |
| 835 | { /* beginning of action switch */ |
| 836 | case 0: /* must back up */ |
| 837 | /* undo the effects of YY_DO_BEFORE_ACTION */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 838 | *yy_cp = (yy_hold_char); |
| 839 | yy_cp = (yy_last_accepting_cpos); |
| 840 | yy_current_state = (yy_last_accepting_state); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 841 | goto yy_find_action; |
| 842 | |
| 843 | case 1: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 844 | /* rule 1 can match eol */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 845 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 846 | return FILENAME; |
| 847 | YY_BREAK |
| 848 | case 2: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 849 | /* rule 2 can match eol */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 850 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 851 | cur_line++; |
| 852 | YY_BREAK |
| 853 | case 3: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 854 | /* rule 3 can match eol */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 855 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 856 | cur_line++; |
| 857 | YY_BREAK |
| 858 | /* Ignore all other whitespace. */ |
| 859 | case 4: |
| 860 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 861 | ; |
| 862 | YY_BREAK |
| 863 | case 5: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 864 | /* rule 5 can match eol */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 865 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 866 | return STRING; |
| 867 | YY_BREAK |
| 868 | case 6: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 869 | /* rule 6 can match eol */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 870 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 871 | return CHAR; |
| 872 | YY_BREAK |
| 873 | case 7: |
| 874 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 875 | return IDENT; |
| 876 | YY_BREAK |
| 877 | /* The Pedant requires that the other C multi-character tokens be |
| 878 | recognized as tokens. We don't actually use them since we don't |
| 879 | parse expressions, but we do want whitespace to be arranged |
| 880 | around them properly. */ |
| 881 | case 8: |
| 882 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 883 | return OTHER; |
| 884 | YY_BREAK |
| 885 | case 9: |
| 886 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 887 | return INT; |
| 888 | YY_BREAK |
| 889 | case 10: |
| 890 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 891 | return REAL; |
| 892 | YY_BREAK |
| 893 | case 11: |
| 894 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 895 | return DOTS; |
| 896 | YY_BREAK |
| 897 | /* All other tokens are single characters. */ |
| 898 | case 12: |
| 899 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 900 | return yytext[0]; |
| 901 | YY_BREAK |
| 902 | case 13: |
| 903 | YY_RULE_SETUP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 904 | ECHO; |
| 905 | YY_BREAK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 906 | case YY_STATE_EOF(INITIAL): |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 907 | yyterminate(); |
| 908 | |
| 909 | case YY_END_OF_BUFFER: |
| 910 | { |
| 911 | /* Amount of text matched not including the EOB char. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 912 | int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 913 | |
| 914 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 915 | *yy_cp = (yy_hold_char); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 916 | YY_RESTORE_YY_MORE_OFFSET |
| 917 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 918 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 919 | { |
| 920 | /* We're scanning a new file or input source. It's |
| 921 | * possible that this happened because the user |
| 922 | * just pointed yyin at a new source and called |
| 923 | * yylex(). If so, then we have to assure |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 924 | * consistency between YY_CURRENT_BUFFER and our |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 925 | * globals. Here is the right place to do so, because |
| 926 | * this is the first action (other than possibly a |
| 927 | * back-up) that will match for the new input source. |
| 928 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 929 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
| 930 | YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; |
| 931 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 932 | } |
| 933 | |
| 934 | /* Note that here we test for yy_c_buf_p "<=" to the position |
| 935 | * of the first EOB in the buffer, since yy_c_buf_p will |
| 936 | * already have been incremented past the NUL character |
| 937 | * (since all states make transitions on EOB to the |
| 938 | * end-of-buffer state). Contrast this with the test |
| 939 | * in input(). |
| 940 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 941 | if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 942 | { /* This was really a NUL. */ |
| 943 | yy_state_type yy_next_state; |
| 944 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 945 | (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 946 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 947 | yy_current_state = yy_get_previous_state( ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 948 | |
| 949 | /* Okay, we're now positioned to make the NUL |
| 950 | * transition. We couldn't have |
| 951 | * yy_get_previous_state() go ahead and do it |
| 952 | * for us because it doesn't know how to deal |
| 953 | * with the possibility of jamming (and we don't |
| 954 | * want to build jamming into it because then it |
| 955 | * will run more slowly). |
| 956 | */ |
| 957 | |
| 958 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
| 959 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 960 | yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 961 | |
| 962 | if ( yy_next_state ) |
| 963 | { |
| 964 | /* Consume the NUL. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 965 | yy_cp = ++(yy_c_buf_p); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 966 | yy_current_state = yy_next_state; |
| 967 | goto yy_match; |
| 968 | } |
| 969 | |
| 970 | else |
| 971 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 972 | yy_cp = (yy_c_buf_p); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 973 | goto yy_find_action; |
| 974 | } |
| 975 | } |
| 976 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 977 | else switch ( yy_get_next_buffer( ) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 978 | { |
| 979 | case EOB_ACT_END_OF_FILE: |
| 980 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 981 | (yy_did_buffer_switch_on_eof) = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 982 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 983 | if ( yywrap( ) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 984 | { |
| 985 | /* Note: because we've taken care in |
| 986 | * yy_get_next_buffer() to have set up |
| 987 | * yytext, we can now set up |
| 988 | * yy_c_buf_p so that if some total |
| 989 | * hoser (like flex itself) wants to |
| 990 | * call the scanner after we return the |
| 991 | * YY_NULL, it'll still work - another |
| 992 | * YY_NULL will get returned. |
| 993 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 994 | (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 995 | |
| 996 | yy_act = YY_STATE_EOF(YY_START); |
| 997 | goto do_action; |
| 998 | } |
| 999 | |
| 1000 | else |
| 1001 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1002 | if ( ! (yy_did_buffer_switch_on_eof) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1003 | YY_NEW_FILE; |
| 1004 | } |
| 1005 | break; |
| 1006 | } |
| 1007 | |
| 1008 | case EOB_ACT_CONTINUE_SCAN: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1009 | (yy_c_buf_p) = |
| 1010 | (yytext_ptr) + yy_amount_of_matched_text; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1011 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1012 | yy_current_state = yy_get_previous_state( ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1013 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1014 | yy_cp = (yy_c_buf_p); |
| 1015 | yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1016 | goto yy_match; |
| 1017 | |
| 1018 | case EOB_ACT_LAST_MATCH: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1019 | (yy_c_buf_p) = |
| 1020 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1021 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1022 | yy_current_state = yy_get_previous_state( ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1023 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1024 | yy_cp = (yy_c_buf_p); |
| 1025 | yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1026 | goto yy_find_action; |
| 1027 | } |
| 1028 | break; |
| 1029 | } |
| 1030 | |
| 1031 | default: |
| 1032 | YY_FATAL_ERROR( |
| 1033 | "fatal flex scanner internal error--no action found" ); |
| 1034 | } /* end of action switch */ |
| 1035 | } /* end of scanning one token */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1036 | } /* end of yylex */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1037 | |
| 1038 | /* yy_get_next_buffer - try to read in a new buffer |
| 1039 | * |
| 1040 | * Returns a code representing an action: |
| 1041 | * EOB_ACT_LAST_MATCH - |
| 1042 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
| 1043 | * EOB_ACT_END_OF_FILE - end of file |
| 1044 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1045 | static int yy_get_next_buffer (void) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1046 | { |
| 1047 | register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
| 1048 | register char *source = (yytext_ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1049 | register int number_to_move, i; |
| 1050 | int ret_val; |
| 1051 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1052 | if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1053 | YY_FATAL_ERROR( |
| 1054 | "fatal flex scanner internal error--end of buffer missed" ); |
| 1055 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1056 | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1057 | { /* Don't try to fill the buffer, so this is an EOF. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1058 | if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1059 | { |
| 1060 | /* We matched a single character, the EOB, so |
| 1061 | * treat this as a final EOF. |
| 1062 | */ |
| 1063 | return EOB_ACT_END_OF_FILE; |
| 1064 | } |
| 1065 | |
| 1066 | else |
| 1067 | { |
| 1068 | /* We matched some text prior to the EOB, first |
| 1069 | * process it. |
| 1070 | */ |
| 1071 | return EOB_ACT_LAST_MATCH; |
| 1072 | } |
| 1073 | } |
| 1074 | |
| 1075 | /* Try to read more data. */ |
| 1076 | |
| 1077 | /* First move last chars to start of buffer. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1078 | number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1079 | |
| 1080 | for ( i = 0; i < number_to_move; ++i ) |
| 1081 | *(dest++) = *(source++); |
| 1082 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1083 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1084 | /* don't do the read, it's not guaranteed to return an EOF, |
| 1085 | * just force an EOF |
| 1086 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1087 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1088 | |
| 1089 | else |
| 1090 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1091 | int num_to_read = |
| 1092 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1093 | |
| 1094 | while ( num_to_read <= 0 ) |
| 1095 | { /* Not enough room in the buffer - grow it. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1096 | |
| 1097 | /* just a shorter name for the current buffer */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1098 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1099 | |
| 1100 | int yy_c_buf_p_offset = |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1101 | (int) ((yy_c_buf_p) - b->yy_ch_buf); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1102 | |
| 1103 | if ( b->yy_is_our_buffer ) |
| 1104 | { |
| 1105 | int new_size = b->yy_buf_size * 2; |
| 1106 | |
| 1107 | if ( new_size <= 0 ) |
| 1108 | b->yy_buf_size += b->yy_buf_size / 8; |
| 1109 | else |
| 1110 | b->yy_buf_size *= 2; |
| 1111 | |
| 1112 | b->yy_ch_buf = (char *) |
| 1113 | /* Include room in for 2 EOB chars. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1114 | yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1115 | } |
| 1116 | else |
| 1117 | /* Can't grow it, we don't own it. */ |
| 1118 | b->yy_ch_buf = 0; |
| 1119 | |
| 1120 | if ( ! b->yy_ch_buf ) |
| 1121 | YY_FATAL_ERROR( |
| 1122 | "fatal error - scanner input buffer overflow" ); |
| 1123 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1124 | (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1125 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1126 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1127 | number_to_move - 1; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1128 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1129 | } |
| 1130 | |
| 1131 | if ( num_to_read > YY_READ_BUF_SIZE ) |
| 1132 | num_to_read = YY_READ_BUF_SIZE; |
| 1133 | |
| 1134 | /* Read in more data. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1135 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), |
| 1136 | (yy_n_chars), (size_t) num_to_read ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1137 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1138 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1139 | } |
| 1140 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1141 | if ( (yy_n_chars) == 0 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1142 | { |
| 1143 | if ( number_to_move == YY_MORE_ADJ ) |
| 1144 | { |
| 1145 | ret_val = EOB_ACT_END_OF_FILE; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1146 | yyrestart(yyin ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1147 | } |
| 1148 | |
| 1149 | else |
| 1150 | { |
| 1151 | ret_val = EOB_ACT_LAST_MATCH; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1152 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1153 | YY_BUFFER_EOF_PENDING; |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | else |
| 1158 | ret_val = EOB_ACT_CONTINUE_SCAN; |
| 1159 | |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 1160 | if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
| 1161 | /* Extend the array by 50%, plus the number we really need. */ |
| 1162 | yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); |
| 1163 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); |
| 1164 | if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
| 1165 | YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); |
| 1166 | } |
| 1167 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1168 | (yy_n_chars) += number_to_move; |
| 1169 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; |
| 1170 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1171 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1172 | (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1173 | |
| 1174 | return ret_val; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1175 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1176 | |
| 1177 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
| 1178 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1179 | static yy_state_type yy_get_previous_state (void) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1180 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1181 | register yy_state_type yy_current_state; |
| 1182 | register char *yy_cp; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1183 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1184 | yy_current_state = (yy_start); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1185 | yy_current_state += YY_AT_BOL(); |
| 1186 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1187 | for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1188 | { |
| 1189 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
| 1190 | if ( yy_accept[yy_current_state] ) |
| 1191 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1192 | (yy_last_accepting_state) = yy_current_state; |
| 1193 | (yy_last_accepting_cpos) = yy_cp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1194 | } |
| 1195 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 1196 | { |
| 1197 | yy_current_state = (int) yy_def[yy_current_state]; |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 1198 | if ( yy_current_state >= 73 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1199 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1200 | } |
| 1201 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
| 1202 | } |
| 1203 | |
| 1204 | return yy_current_state; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1205 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1206 | |
| 1207 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
| 1208 | * |
| 1209 | * synopsis |
| 1210 | * next_state = yy_try_NUL_trans( current_state ); |
| 1211 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1212 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1213 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1214 | register int yy_is_jam; |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 1215 | register char *yy_cp = (yy_c_buf_p); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1216 | |
| 1217 | register YY_CHAR yy_c = 1; |
| 1218 | if ( yy_accept[yy_current_state] ) |
| 1219 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1220 | (yy_last_accepting_state) = yy_current_state; |
| 1221 | (yy_last_accepting_cpos) = yy_cp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1222 | } |
| 1223 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 1224 | { |
| 1225 | yy_current_state = (int) yy_def[yy_current_state]; |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 1226 | if ( yy_current_state >= 73 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1227 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1228 | } |
| 1229 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
Michal Marek | 95f1d63 | 2011-01-20 16:19:58 +0100 | [diff] [blame] | 1230 | yy_is_jam = (yy_current_state == 72); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1231 | |
| 1232 | return yy_is_jam ? 0 : yy_current_state; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1233 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1234 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1235 | static void yyunput (int c, register char * yy_bp ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1236 | { |
| 1237 | register char *yy_cp; |
| 1238 | |
| 1239 | yy_cp = (yy_c_buf_p); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1240 | |
| 1241 | /* undo effects of setting up yytext */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1242 | *yy_cp = (yy_hold_char); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1243 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1244 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1245 | { /* need to shift things up to make room */ |
| 1246 | /* +2 for EOB chars. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1247 | register int number_to_move = (yy_n_chars) + 2; |
| 1248 | register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ |
| 1249 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1250 | register char *source = |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1251 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1252 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1253 | while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1254 | *--dest = *--source; |
| 1255 | |
| 1256 | yy_cp += (int) (dest - source); |
| 1257 | yy_bp += (int) (dest - source); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1258 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = |
| 1259 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1260 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1261 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1262 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
| 1263 | } |
| 1264 | |
| 1265 | *--yy_cp = (char) c; |
| 1266 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1267 | (yytext_ptr) = yy_bp; |
| 1268 | (yy_hold_char) = *yy_cp; |
| 1269 | (yy_c_buf_p) = yy_cp; |
| 1270 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1271 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1272 | #ifndef YY_NO_INPUT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1273 | #ifdef __cplusplus |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1274 | static int yyinput (void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1275 | #else |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1276 | static int input (void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1277 | #endif |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1278 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1279 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1280 | int c; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1281 | |
| 1282 | *(yy_c_buf_p) = (yy_hold_char); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1283 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1284 | if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1285 | { |
| 1286 | /* yy_c_buf_p now points to the character we want to return. |
| 1287 | * If this occurs *before* the EOB characters, then it's a |
| 1288 | * valid NUL; if not, then we've hit the end of the buffer. |
| 1289 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1290 | if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1291 | /* This was really a NUL. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1292 | *(yy_c_buf_p) = '\0'; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1293 | |
| 1294 | else |
| 1295 | { /* need more input */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1296 | int offset = (yy_c_buf_p) - (yytext_ptr); |
| 1297 | ++(yy_c_buf_p); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1298 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1299 | switch ( yy_get_next_buffer( ) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1300 | { |
| 1301 | case EOB_ACT_LAST_MATCH: |
| 1302 | /* This happens because yy_g_n_b() |
| 1303 | * sees that we've accumulated a |
| 1304 | * token and flags that we need to |
| 1305 | * try matching the token before |
| 1306 | * proceeding. But for input(), |
| 1307 | * there's no matching to consider. |
| 1308 | * So convert the EOB_ACT_LAST_MATCH |
| 1309 | * to EOB_ACT_END_OF_FILE. |
| 1310 | */ |
| 1311 | |
| 1312 | /* Reset buffer status. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1313 | yyrestart(yyin ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1314 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1315 | /*FALLTHROUGH*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1316 | |
| 1317 | case EOB_ACT_END_OF_FILE: |
| 1318 | { |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1319 | if ( yywrap( ) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1320 | return EOF; |
| 1321 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1322 | if ( ! (yy_did_buffer_switch_on_eof) ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1323 | YY_NEW_FILE; |
| 1324 | #ifdef __cplusplus |
| 1325 | return yyinput(); |
| 1326 | #else |
| 1327 | return input(); |
| 1328 | #endif |
| 1329 | } |
| 1330 | |
| 1331 | case EOB_ACT_CONTINUE_SCAN: |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1332 | (yy_c_buf_p) = (yytext_ptr) + offset; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1333 | break; |
| 1334 | } |
| 1335 | } |
| 1336 | } |
| 1337 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1338 | c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ |
| 1339 | *(yy_c_buf_p) = '\0'; /* preserve yytext */ |
| 1340 | (yy_hold_char) = *++(yy_c_buf_p); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1341 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1342 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1343 | |
| 1344 | return c; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1345 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1346 | #endif /* ifndef YY_NO_INPUT */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1347 | |
| 1348 | /** Immediately switch to a different input stream. |
| 1349 | * @param input_file A readable stream. |
| 1350 | * |
| 1351 | * @note This function does not reset the start condition to @c INITIAL . |
| 1352 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1353 | void yyrestart (FILE * input_file ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1354 | { |
| 1355 | |
| 1356 | if ( ! YY_CURRENT_BUFFER ){ |
| 1357 | yyensure_buffer_stack (); |
| 1358 | YY_CURRENT_BUFFER_LVALUE = |
| 1359 | yy_create_buffer(yyin,YY_BUF_SIZE ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1360 | } |
| 1361 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1362 | yy_init_buffer(YY_CURRENT_BUFFER,input_file ); |
| 1363 | yy_load_buffer_state( ); |
| 1364 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1365 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1366 | /** Switch to a different input buffer. |
| 1367 | * @param new_buffer The new input buffer. |
| 1368 | * |
| 1369 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1370 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1371 | { |
| 1372 | |
| 1373 | /* TODO. We should be able to replace this entire function body |
| 1374 | * with |
| 1375 | * yypop_buffer_state(); |
| 1376 | * yypush_buffer_state(new_buffer); |
| 1377 | */ |
| 1378 | yyensure_buffer_stack (); |
| 1379 | if ( YY_CURRENT_BUFFER == new_buffer ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1380 | return; |
| 1381 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1382 | if ( YY_CURRENT_BUFFER ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1383 | { |
| 1384 | /* Flush out information for old buffer. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1385 | *(yy_c_buf_p) = (yy_hold_char); |
| 1386 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); |
| 1387 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1388 | } |
| 1389 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1390 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
| 1391 | yy_load_buffer_state( ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1392 | |
| 1393 | /* We don't actually know whether we did this switch during |
| 1394 | * EOF (yywrap()) processing, but the only time this flag |
| 1395 | * is looked at is after yywrap() is called, so it's safe |
| 1396 | * to go ahead and always set it. |
| 1397 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1398 | (yy_did_buffer_switch_on_eof) = 1; |
| 1399 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1400 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1401 | static void yy_load_buffer_state (void) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1402 | { |
| 1403 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
| 1404 | (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; |
| 1405 | yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; |
| 1406 | (yy_hold_char) = *(yy_c_buf_p); |
| 1407 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1408 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1409 | /** Allocate and initialize an input buffer state. |
| 1410 | * @param file A readable stream. |
| 1411 | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. |
| 1412 | * |
| 1413 | * @return the allocated buffer state. |
| 1414 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1415 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1416 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1417 | YY_BUFFER_STATE b; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1418 | |
| 1419 | b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1420 | if ( ! b ) |
| 1421 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
| 1422 | |
| 1423 | b->yy_buf_size = size; |
| 1424 | |
| 1425 | /* yy_ch_buf has to be 2 characters longer than the size given because |
| 1426 | * we need to put in 2 end-of-buffer characters. |
| 1427 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1428 | b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1429 | if ( ! b->yy_ch_buf ) |
| 1430 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
| 1431 | |
| 1432 | b->yy_is_our_buffer = 1; |
| 1433 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1434 | yy_init_buffer(b,file ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1435 | |
| 1436 | return b; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1437 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1438 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1439 | /** Destroy the buffer. |
| 1440 | * @param b a buffer created with yy_create_buffer() |
| 1441 | * |
| 1442 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1443 | void yy_delete_buffer (YY_BUFFER_STATE b ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1444 | { |
| 1445 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1446 | if ( ! b ) |
| 1447 | return; |
| 1448 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1449 | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ |
| 1450 | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1451 | |
| 1452 | if ( b->yy_is_our_buffer ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1453 | yyfree((void *) b->yy_ch_buf ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1454 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1455 | yyfree((void *) b ); |
| 1456 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1457 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1458 | #ifndef __cplusplus |
| 1459 | extern int isatty (int ); |
| 1460 | #endif /* __cplusplus */ |
| 1461 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1462 | /* Initializes or reinitializes a buffer. |
| 1463 | * This function is sometimes called more than once on the same buffer, |
| 1464 | * such as during a yyrestart() or at EOF. |
| 1465 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1466 | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1467 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1468 | { |
| 1469 | int oerrno = errno; |
| 1470 | |
| 1471 | yy_flush_buffer(b ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1472 | |
| 1473 | b->yy_input_file = file; |
| 1474 | b->yy_fill_buffer = 1; |
| 1475 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1476 | /* If b is the current buffer, then yy_init_buffer was _probably_ |
| 1477 | * called from yyrestart() or through yy_get_next_buffer. |
| 1478 | * In that case, we don't want to reset the lineno or column. |
| 1479 | */ |
| 1480 | if (b != YY_CURRENT_BUFFER){ |
| 1481 | b->yy_bs_lineno = 1; |
| 1482 | b->yy_bs_column = 0; |
| 1483 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1484 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1485 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
| 1486 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1487 | errno = oerrno; |
| 1488 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1489 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1490 | /** Discard all buffered characters. On the next scan, YY_INPUT will be called. |
| 1491 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
| 1492 | * |
| 1493 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1494 | void yy_flush_buffer (YY_BUFFER_STATE b ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1495 | { |
| 1496 | if ( ! b ) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1497 | return; |
| 1498 | |
| 1499 | b->yy_n_chars = 0; |
| 1500 | |
| 1501 | /* We always need two end-of-buffer characters. The first causes |
| 1502 | * a transition to the end-of-buffer state. The second causes |
| 1503 | * a jam in that state. |
| 1504 | */ |
| 1505 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
| 1506 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
| 1507 | |
| 1508 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
| 1509 | |
| 1510 | b->yy_at_bol = 1; |
| 1511 | b->yy_buffer_status = YY_BUFFER_NEW; |
| 1512 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1513 | if ( b == YY_CURRENT_BUFFER ) |
| 1514 | yy_load_buffer_state( ); |
| 1515 | } |
| 1516 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1517 | /** Pushes the new state onto the stack. The new state becomes |
| 1518 | * the current state. This function will allocate the stack |
| 1519 | * if necessary. |
| 1520 | * @param new_buffer The new state. |
| 1521 | * |
| 1522 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1523 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1524 | { |
| 1525 | if (new_buffer == NULL) |
| 1526 | return; |
| 1527 | |
| 1528 | yyensure_buffer_stack(); |
| 1529 | |
| 1530 | /* This block is copied from yy_switch_to_buffer. */ |
| 1531 | if ( YY_CURRENT_BUFFER ) |
| 1532 | { |
| 1533 | /* Flush out information for old buffer. */ |
| 1534 | *(yy_c_buf_p) = (yy_hold_char); |
| 1535 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); |
| 1536 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
| 1537 | } |
| 1538 | |
| 1539 | /* Only push if top exists. Otherwise, replace top. */ |
| 1540 | if (YY_CURRENT_BUFFER) |
| 1541 | (yy_buffer_stack_top)++; |
| 1542 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
| 1543 | |
| 1544 | /* copied from yy_switch_to_buffer. */ |
| 1545 | yy_load_buffer_state( ); |
| 1546 | (yy_did_buffer_switch_on_eof) = 1; |
| 1547 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1548 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1549 | /** Removes and deletes the top of the stack, if present. |
| 1550 | * The next element becomes the new top. |
| 1551 | * |
| 1552 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1553 | void yypop_buffer_state (void) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1554 | { |
| 1555 | if (!YY_CURRENT_BUFFER) |
| 1556 | return; |
| 1557 | |
| 1558 | yy_delete_buffer(YY_CURRENT_BUFFER ); |
| 1559 | YY_CURRENT_BUFFER_LVALUE = NULL; |
| 1560 | if ((yy_buffer_stack_top) > 0) |
| 1561 | --(yy_buffer_stack_top); |
| 1562 | |
| 1563 | if (YY_CURRENT_BUFFER) { |
| 1564 | yy_load_buffer_state( ); |
| 1565 | (yy_did_buffer_switch_on_eof) = 1; |
| 1566 | } |
| 1567 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1568 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1569 | /* Allocates the stack if it does not exist. |
| 1570 | * Guarantees space for at least one push. |
| 1571 | */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1572 | static void yyensure_buffer_stack (void) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1573 | { |
| 1574 | int num_to_alloc; |
| 1575 | |
| 1576 | if (!(yy_buffer_stack)) { |
| 1577 | |
| 1578 | /* First allocation is just for 2 elements, since we don't know if this |
| 1579 | * scanner will even need a stack. We use 2 instead of 1 to avoid an |
| 1580 | * immediate realloc on the next call. |
| 1581 | */ |
| 1582 | num_to_alloc = 1; |
| 1583 | (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc |
| 1584 | (num_to_alloc * sizeof(struct yy_buffer_state*) |
| 1585 | ); |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 1586 | if ( ! (yy_buffer_stack) ) |
| 1587 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
| 1588 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1589 | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
| 1590 | |
| 1591 | (yy_buffer_stack_max) = num_to_alloc; |
| 1592 | (yy_buffer_stack_top) = 0; |
| 1593 | return; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1594 | } |
| 1595 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1596 | if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1597 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1598 | /* Increase the buffer to prepare for a possible push. */ |
| 1599 | int grow_size = 8 /* arbitrary grow size */; |
| 1600 | |
| 1601 | num_to_alloc = (yy_buffer_stack_max) + grow_size; |
| 1602 | (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc |
| 1603 | ((yy_buffer_stack), |
| 1604 | num_to_alloc * sizeof(struct yy_buffer_state*) |
| 1605 | ); |
Adrian Bunk | 11ddad3 | 2008-07-17 02:08:12 +0300 | [diff] [blame] | 1606 | if ( ! (yy_buffer_stack) ) |
| 1607 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1608 | |
| 1609 | /* zero only the new slots.*/ |
| 1610 | memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); |
| 1611 | (yy_buffer_stack_max) = num_to_alloc; |
| 1612 | } |
| 1613 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1614 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1615 | /** Setup the input buffer state to scan directly from a user-specified character buffer. |
| 1616 | * @param base the character buffer |
| 1617 | * @param size the size in bytes of the character buffer |
| 1618 | * |
| 1619 | * @return the newly allocated buffer state object. |
| 1620 | */ |
| 1621 | YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) |
| 1622 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1623 | YY_BUFFER_STATE b; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1624 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1625 | if ( size < 2 || |
| 1626 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
| 1627 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
| 1628 | /* They forgot to leave room for the EOB's. */ |
| 1629 | return 0; |
| 1630 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1631 | b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1632 | if ( ! b ) |
| 1633 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
| 1634 | |
| 1635 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
| 1636 | b->yy_buf_pos = b->yy_ch_buf = base; |
| 1637 | b->yy_is_our_buffer = 0; |
| 1638 | b->yy_input_file = 0; |
| 1639 | b->yy_n_chars = b->yy_buf_size; |
| 1640 | b->yy_is_interactive = 0; |
| 1641 | b->yy_at_bol = 1; |
| 1642 | b->yy_fill_buffer = 0; |
| 1643 | b->yy_buffer_status = YY_BUFFER_NEW; |
| 1644 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1645 | yy_switch_to_buffer(b ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1646 | |
| 1647 | return b; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1648 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1649 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1650 | /** Setup the input buffer state to scan a string. The next call to yylex() will |
| 1651 | * scan from a @e copy of @a str. |
| 1652 | * @param yystr a NUL-terminated string to scan |
| 1653 | * |
| 1654 | * @return the newly allocated buffer state object. |
| 1655 | * @note If you want to scan bytes that may contain NUL values, then use |
| 1656 | * yy_scan_bytes() instead. |
| 1657 | */ |
| 1658 | YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) |
| 1659 | { |
| 1660 | |
| 1661 | return yy_scan_bytes(yystr,strlen(yystr) ); |
| 1662 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1663 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1664 | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will |
| 1665 | * scan from a @e copy of @a bytes. |
| 1666 | * @param bytes the byte buffer to scan |
| 1667 | * @param len the number of bytes in the buffer pointed to by @a bytes. |
| 1668 | * |
| 1669 | * @return the newly allocated buffer state object. |
| 1670 | */ |
| 1671 | YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) |
| 1672 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1673 | YY_BUFFER_STATE b; |
| 1674 | char *buf; |
| 1675 | yy_size_t n; |
| 1676 | int i; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1677 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1678 | /* Get memory for full buffer, including space for trailing EOB's. */ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1679 | n = _yybytes_len + 2; |
| 1680 | buf = (char *) yyalloc(n ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1681 | if ( ! buf ) |
| 1682 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
| 1683 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1684 | for ( i = 0; i < _yybytes_len; ++i ) |
| 1685 | buf[i] = yybytes[i]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1686 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1687 | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1688 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1689 | b = yy_scan_buffer(buf,n ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1690 | if ( ! b ) |
| 1691 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
| 1692 | |
| 1693 | /* It's okay to grow etc. this buffer, and we should throw it |
| 1694 | * away when we're done. |
| 1695 | */ |
| 1696 | b->yy_is_our_buffer = 1; |
| 1697 | |
| 1698 | return b; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1699 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1700 | |
| 1701 | #ifndef YY_EXIT_FAILURE |
| 1702 | #define YY_EXIT_FAILURE 2 |
| 1703 | #endif |
| 1704 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1705 | static void yy_fatal_error (yyconst char* msg ) |
| 1706 | { |
| 1707 | (void) fprintf( stderr, "%s\n", msg ); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1708 | exit( YY_EXIT_FAILURE ); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1709 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1710 | |
| 1711 | /* Redefine yyless() so it works in section 3 code. */ |
| 1712 | |
| 1713 | #undef yyless |
| 1714 | #define yyless(n) \ |
| 1715 | do \ |
| 1716 | { \ |
| 1717 | /* Undo effects of setting up yytext. */ \ |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1718 | int yyless_macro_arg = (n); \ |
| 1719 | YY_LESS_LINENO(yyless_macro_arg);\ |
| 1720 | yytext[yyleng] = (yy_hold_char); \ |
| 1721 | (yy_c_buf_p) = yytext + yyless_macro_arg; \ |
| 1722 | (yy_hold_char) = *(yy_c_buf_p); \ |
| 1723 | *(yy_c_buf_p) = '\0'; \ |
| 1724 | yyleng = yyless_macro_arg; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1725 | } \ |
| 1726 | while ( 0 ) |
| 1727 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1728 | /* Accessor methods (get/set functions) to struct members. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1729 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1730 | /** Get the current line number. |
| 1731 | * |
| 1732 | */ |
| 1733 | int yyget_lineno (void) |
| 1734 | { |
| 1735 | |
| 1736 | return yylineno; |
| 1737 | } |
| 1738 | |
| 1739 | /** Get the input stream. |
| 1740 | * |
| 1741 | */ |
| 1742 | FILE *yyget_in (void) |
| 1743 | { |
| 1744 | return yyin; |
| 1745 | } |
| 1746 | |
| 1747 | /** Get the output stream. |
| 1748 | * |
| 1749 | */ |
| 1750 | FILE *yyget_out (void) |
| 1751 | { |
| 1752 | return yyout; |
| 1753 | } |
| 1754 | |
| 1755 | /** Get the length of the current token. |
| 1756 | * |
| 1757 | */ |
| 1758 | int yyget_leng (void) |
| 1759 | { |
| 1760 | return yyleng; |
| 1761 | } |
| 1762 | |
| 1763 | /** Get the current token. |
| 1764 | * |
| 1765 | */ |
| 1766 | |
| 1767 | char *yyget_text (void) |
| 1768 | { |
| 1769 | return yytext; |
| 1770 | } |
| 1771 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1772 | /** Set the current line number. |
| 1773 | * @param line_number |
| 1774 | * |
| 1775 | */ |
| 1776 | void yyset_lineno (int line_number ) |
| 1777 | { |
| 1778 | |
| 1779 | yylineno = line_number; |
| 1780 | } |
| 1781 | |
| 1782 | /** Set the input stream. This does not discard the current |
| 1783 | * input buffer. |
| 1784 | * @param in_str A readable stream. |
| 1785 | * |
| 1786 | * @see yy_switch_to_buffer |
| 1787 | */ |
| 1788 | void yyset_in (FILE * in_str ) |
| 1789 | { |
| 1790 | yyin = in_str ; |
| 1791 | } |
| 1792 | |
| 1793 | void yyset_out (FILE * out_str ) |
| 1794 | { |
| 1795 | yyout = out_str ; |
| 1796 | } |
| 1797 | |
| 1798 | int yyget_debug (void) |
| 1799 | { |
| 1800 | return yy_flex_debug; |
| 1801 | } |
| 1802 | |
| 1803 | void yyset_debug (int bdebug ) |
| 1804 | { |
| 1805 | yy_flex_debug = bdebug ; |
| 1806 | } |
| 1807 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1808 | static int yy_init_globals (void) |
| 1809 | { |
| 1810 | /* Initialization is the same as for the non-reentrant scanner. |
| 1811 | * This function is called from yylex_destroy(), so don't allocate here. |
| 1812 | */ |
| 1813 | |
| 1814 | (yy_buffer_stack) = 0; |
| 1815 | (yy_buffer_stack_top) = 0; |
| 1816 | (yy_buffer_stack_max) = 0; |
| 1817 | (yy_c_buf_p) = (char *) 0; |
| 1818 | (yy_init) = 0; |
| 1819 | (yy_start) = 0; |
| 1820 | |
| 1821 | /* Defined in main.c */ |
| 1822 | #ifdef YY_STDINIT |
| 1823 | yyin = stdin; |
| 1824 | yyout = stdout; |
| 1825 | #else |
| 1826 | yyin = (FILE *) 0; |
| 1827 | yyout = (FILE *) 0; |
| 1828 | #endif |
| 1829 | |
| 1830 | /* For future reference: Set errno on error, since we are called by |
| 1831 | * yylex_init() |
| 1832 | */ |
| 1833 | return 0; |
| 1834 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1835 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1836 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ |
| 1837 | int yylex_destroy (void) |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1838 | { |
| 1839 | |
| 1840 | /* Pop the buffer stack, destroying each element. */ |
| 1841 | while(YY_CURRENT_BUFFER){ |
| 1842 | yy_delete_buffer(YY_CURRENT_BUFFER ); |
| 1843 | YY_CURRENT_BUFFER_LVALUE = NULL; |
| 1844 | yypop_buffer_state(); |
| 1845 | } |
| 1846 | |
| 1847 | /* Destroy the stack itself. */ |
| 1848 | yyfree((yy_buffer_stack) ); |
| 1849 | (yy_buffer_stack) = NULL; |
| 1850 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1851 | /* Reset the globals. This is important in a non-reentrant scanner so the next time |
| 1852 | * yylex() is called, initialization will occur. */ |
| 1853 | yy_init_globals( ); |
| 1854 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1855 | return 0; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1856 | } |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1857 | |
| 1858 | /* |
| 1859 | * Internal utility routines. |
| 1860 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1861 | |
| 1862 | #ifndef yytext_ptr |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1863 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) |
| 1864 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1865 | register int i; |
| 1866 | for ( i = 0; i < n; ++i ) |
| 1867 | s1[i] = s2[i]; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1868 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1869 | #endif |
| 1870 | |
| 1871 | #ifdef YY_NEED_STRLEN |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1872 | static int yy_flex_strlen (yyconst char * s ) |
| 1873 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1874 | register int n; |
| 1875 | for ( n = 0; s[n]; ++n ) |
| 1876 | ; |
| 1877 | |
| 1878 | return n; |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1879 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1880 | #endif |
| 1881 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1882 | void *yyalloc (yy_size_t size ) |
| 1883 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1884 | return (void *) malloc( size ); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1885 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1886 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1887 | void *yyrealloc (void * ptr, yy_size_t size ) |
| 1888 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1889 | /* The cast to (char *) in the following accommodates both |
| 1890 | * implementations that use char* generic pointers, and those |
| 1891 | * that use void* generic pointers. It works with the latter |
| 1892 | * because both ANSI C and C++ allow castless assignment from |
| 1893 | * any pointer type to void*, and deal with argument conversions |
| 1894 | * as though doing an assignment. |
| 1895 | */ |
| 1896 | return (void *) realloc( (char *) ptr, size ); |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1897 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1898 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1899 | void yyfree (void * ptr ) |
| 1900 | { |
| 1901 | free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ |
| 1902 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1903 | |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1904 | #define YYTABLES_NAME "yytables" |
Sam Ravnborg | 70f7524 | 2007-09-01 10:26:32 +0200 | [diff] [blame] | 1905 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1906 | /* Bring in the keyword recognizer. */ |
| 1907 | |
Arnaud Lacombe | 58ef81c | 2011-05-23 01:52:59 -0400 | [diff] [blame] | 1908 | #include "keywords.hash.c" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1909 | |
| 1910 | /* Macros to append to our phrase collection list. */ |
| 1911 | |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1912 | /* |
| 1913 | * We mark any token, that that equals to a known enumerator, as |
| 1914 | * SYM_ENUM_CONST. The parser will change this for struct and union tags later, |
| 1915 | * the only problem is struct and union members: |
| 1916 | * enum e { a, b }; struct s { int a, b; } |
| 1917 | * but in this case, the only effect will be, that the ABI checksums become |
| 1918 | * more volatile, which is acceptable. Also, such collisions are quite rare, |
| 1919 | * so far it was only observed in include/linux/telephony.h. |
| 1920 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1921 | #define _APP(T,L) do { \ |
| 1922 | cur_node = next_node; \ |
| 1923 | next_node = xmalloc(sizeof(*next_node)); \ |
| 1924 | next_node->next = cur_node; \ |
| 1925 | cur_node->string = memcpy(xmalloc(L+1), T, L+1); \ |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 1926 | cur_node->tag = \ |
| 1927 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ |
| 1928 | SYM_ENUM_CONST : SYM_NORMAL ; \ |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame^] | 1929 | cur_node->in_source_file = in_source_file; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1930 | } while (0) |
| 1931 | |
| 1932 | #define APP _APP(yytext, yyleng) |
| 1933 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1934 | /* The second stage lexer. Here we incorporate knowledge of the state |
| 1935 | of the parser to tailor the tokens that are returned. */ |
| 1936 | |
| 1937 | int |
| 1938 | yylex(void) |
| 1939 | { |
| 1940 | static enum { |
| 1941 | ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE, |
| 1942 | ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4, |
| 1943 | ST_TABLE_5, ST_TABLE_6 |
| 1944 | } lexstate = ST_NOTSTARTED; |
| 1945 | |
| 1946 | static int suppress_type_lookup, dont_want_brace_phrase; |
| 1947 | static struct string_list *next_node; |
| 1948 | |
| 1949 | int token, count = 0; |
| 1950 | struct string_list *cur_node; |
| 1951 | |
| 1952 | if (lexstate == ST_NOTSTARTED) |
| 1953 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1954 | next_node = xmalloc(sizeof(*next_node)); |
| 1955 | next_node->next = NULL; |
| 1956 | lexstate = ST_NORMAL; |
| 1957 | } |
| 1958 | |
| 1959 | repeat: |
| 1960 | token = yylex1(); |
| 1961 | |
| 1962 | if (token == 0) |
| 1963 | return 0; |
| 1964 | else if (token == FILENAME) |
| 1965 | { |
| 1966 | char *file, *e; |
| 1967 | |
| 1968 | /* Save the filename and line number for later error messages. */ |
| 1969 | |
| 1970 | if (cur_filename) |
| 1971 | free(cur_filename); |
| 1972 | |
| 1973 | file = strchr(yytext, '\"')+1; |
| 1974 | e = strchr(file, '\"'); |
| 1975 | *e = '\0'; |
| 1976 | cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); |
| 1977 | cur_line = atoi(yytext+2); |
| 1978 | |
Michal Marek | 0359de7 | 2011-10-11 12:07:05 +0200 | [diff] [blame^] | 1979 | if (!source_file) { |
| 1980 | source_file = xstrdup(cur_filename); |
| 1981 | in_source_file = 1; |
| 1982 | } else { |
| 1983 | in_source_file = (strcmp(cur_filename, source_file) == 0); |
| 1984 | } |
| 1985 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1986 | goto repeat; |
| 1987 | } |
| 1988 | |
| 1989 | switch (lexstate) |
| 1990 | { |
| 1991 | case ST_NORMAL: |
| 1992 | switch (token) |
| 1993 | { |
| 1994 | case IDENT: |
| 1995 | APP; |
| 1996 | { |
| 1997 | const struct resword *r = is_reserved_word(yytext, yyleng); |
| 1998 | if (r) |
| 1999 | { |
| 2000 | switch (token = r->token) |
| 2001 | { |
| 2002 | case ATTRIBUTE_KEYW: |
| 2003 | lexstate = ST_ATTRIBUTE; |
| 2004 | count = 0; |
| 2005 | goto repeat; |
| 2006 | case ASM_KEYW: |
| 2007 | lexstate = ST_ASM; |
| 2008 | count = 0; |
| 2009 | goto repeat; |
| 2010 | |
| 2011 | case STRUCT_KEYW: |
| 2012 | case UNION_KEYW: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2013 | case ENUM_KEYW: |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2014 | dont_want_brace_phrase = 3; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2015 | suppress_type_lookup = 2; |
| 2016 | goto fini; |
| 2017 | |
| 2018 | case EXPORT_SYMBOL_KEYW: |
| 2019 | goto fini; |
| 2020 | } |
| 2021 | } |
| 2022 | if (!suppress_type_lookup) |
| 2023 | { |
Michal Marek | 01762c4 | 2011-02-15 15:11:36 +0100 | [diff] [blame] | 2024 | if (find_symbol(yytext, SYM_TYPEDEF, 1)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2025 | token = TYPE; |
| 2026 | } |
| 2027 | } |
| 2028 | break; |
| 2029 | |
| 2030 | case '[': |
| 2031 | APP; |
| 2032 | lexstate = ST_BRACKET; |
| 2033 | count = 1; |
| 2034 | goto repeat; |
| 2035 | |
| 2036 | case '{': |
| 2037 | APP; |
| 2038 | if (dont_want_brace_phrase) |
| 2039 | break; |
| 2040 | lexstate = ST_BRACE; |
| 2041 | count = 1; |
| 2042 | goto repeat; |
| 2043 | |
| 2044 | case '=': case ':': |
| 2045 | APP; |
| 2046 | lexstate = ST_EXPRESSION; |
| 2047 | break; |
| 2048 | |
| 2049 | case DOTS: |
| 2050 | default: |
| 2051 | APP; |
| 2052 | break; |
| 2053 | } |
| 2054 | break; |
| 2055 | |
| 2056 | case ST_ATTRIBUTE: |
| 2057 | APP; |
| 2058 | switch (token) |
| 2059 | { |
| 2060 | case '(': |
| 2061 | ++count; |
| 2062 | goto repeat; |
| 2063 | case ')': |
| 2064 | if (--count == 0) |
| 2065 | { |
| 2066 | lexstate = ST_NORMAL; |
| 2067 | token = ATTRIBUTE_PHRASE; |
| 2068 | break; |
| 2069 | } |
| 2070 | goto repeat; |
| 2071 | default: |
| 2072 | goto repeat; |
| 2073 | } |
| 2074 | break; |
| 2075 | |
| 2076 | case ST_ASM: |
| 2077 | APP; |
| 2078 | switch (token) |
| 2079 | { |
| 2080 | case '(': |
| 2081 | ++count; |
| 2082 | goto repeat; |
| 2083 | case ')': |
| 2084 | if (--count == 0) |
| 2085 | { |
| 2086 | lexstate = ST_NORMAL; |
| 2087 | token = ASM_PHRASE; |
| 2088 | break; |
| 2089 | } |
| 2090 | goto repeat; |
| 2091 | default: |
| 2092 | goto repeat; |
| 2093 | } |
| 2094 | break; |
| 2095 | |
| 2096 | case ST_BRACKET: |
| 2097 | APP; |
| 2098 | switch (token) |
| 2099 | { |
| 2100 | case '[': |
| 2101 | ++count; |
| 2102 | goto repeat; |
| 2103 | case ']': |
| 2104 | if (--count == 0) |
| 2105 | { |
| 2106 | lexstate = ST_NORMAL; |
| 2107 | token = BRACKET_PHRASE; |
| 2108 | break; |
| 2109 | } |
| 2110 | goto repeat; |
| 2111 | default: |
| 2112 | goto repeat; |
| 2113 | } |
| 2114 | break; |
| 2115 | |
| 2116 | case ST_BRACE: |
| 2117 | APP; |
| 2118 | switch (token) |
| 2119 | { |
| 2120 | case '{': |
| 2121 | ++count; |
| 2122 | goto repeat; |
| 2123 | case '}': |
| 2124 | if (--count == 0) |
| 2125 | { |
| 2126 | lexstate = ST_NORMAL; |
| 2127 | token = BRACE_PHRASE; |
| 2128 | break; |
| 2129 | } |
| 2130 | goto repeat; |
| 2131 | default: |
| 2132 | goto repeat; |
| 2133 | } |
| 2134 | break; |
| 2135 | |
| 2136 | case ST_EXPRESSION: |
| 2137 | switch (token) |
| 2138 | { |
| 2139 | case '(': case '[': case '{': |
| 2140 | ++count; |
| 2141 | APP; |
| 2142 | goto repeat; |
Michal Marek | 303fc01 | 2011-02-15 16:04:35 +0100 | [diff] [blame] | 2143 | case '}': |
| 2144 | /* is this the last line of an enum declaration? */ |
| 2145 | if (count == 0) |
| 2146 | { |
| 2147 | /* Put back the token we just read so's we can find it again |
| 2148 | after registering the expression. */ |
| 2149 | unput(token); |
| 2150 | |
| 2151 | lexstate = ST_NORMAL; |
| 2152 | token = EXPRESSION_PHRASE; |
| 2153 | break; |
| 2154 | } |
| 2155 | /* FALLTHRU */ |
| 2156 | case ')': case ']': |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2157 | --count; |
| 2158 | APP; |
| 2159 | goto repeat; |
| 2160 | case ',': case ';': |
| 2161 | if (count == 0) |
| 2162 | { |
| 2163 | /* Put back the token we just read so's we can find it again |
| 2164 | after registering the expression. */ |
| 2165 | unput(token); |
| 2166 | |
| 2167 | lexstate = ST_NORMAL; |
| 2168 | token = EXPRESSION_PHRASE; |
| 2169 | break; |
| 2170 | } |
| 2171 | APP; |
| 2172 | goto repeat; |
| 2173 | default: |
| 2174 | APP; |
| 2175 | goto repeat; |
| 2176 | } |
| 2177 | break; |
| 2178 | |
| 2179 | case ST_TABLE_1: |
| 2180 | goto repeat; |
| 2181 | |
| 2182 | case ST_TABLE_2: |
| 2183 | if (token == IDENT && yyleng == 1 && yytext[0] == 'X') |
| 2184 | { |
| 2185 | token = EXPORT_SYMBOL_KEYW; |
| 2186 | lexstate = ST_TABLE_5; |
| 2187 | APP; |
| 2188 | break; |
| 2189 | } |
| 2190 | lexstate = ST_TABLE_6; |
| 2191 | /* FALLTHRU */ |
| 2192 | |
| 2193 | case ST_TABLE_6: |
| 2194 | switch (token) |
| 2195 | { |
| 2196 | case '{': case '[': case '(': |
| 2197 | ++count; |
| 2198 | break; |
| 2199 | case '}': case ']': case ')': |
| 2200 | --count; |
| 2201 | break; |
| 2202 | case ',': |
| 2203 | if (count == 0) |
| 2204 | lexstate = ST_TABLE_2; |
| 2205 | break; |
| 2206 | }; |
| 2207 | goto repeat; |
| 2208 | |
| 2209 | case ST_TABLE_3: |
| 2210 | goto repeat; |
| 2211 | |
| 2212 | case ST_TABLE_4: |
| 2213 | if (token == ';') |
| 2214 | lexstate = ST_NORMAL; |
| 2215 | goto repeat; |
| 2216 | |
| 2217 | case ST_TABLE_5: |
| 2218 | switch (token) |
| 2219 | { |
| 2220 | case ',': |
| 2221 | token = ';'; |
| 2222 | lexstate = ST_TABLE_2; |
| 2223 | APP; |
| 2224 | break; |
| 2225 | default: |
| 2226 | APP; |
| 2227 | break; |
| 2228 | } |
| 2229 | break; |
| 2230 | |
| 2231 | default: |
Sam Ravnborg | 6803dc0 | 2006-06-24 23:46:54 +0200 | [diff] [blame] | 2232 | exit(1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2233 | } |
| 2234 | fini: |
| 2235 | |
| 2236 | if (suppress_type_lookup > 0) |
| 2237 | --suppress_type_lookup; |
| 2238 | if (dont_want_brace_phrase > 0) |
| 2239 | --dont_want_brace_phrase; |
| 2240 | |
| 2241 | yylval = &next_node->next; |
| 2242 | |
| 2243 | return token; |
| 2244 | } |
Sam Ravnborg | c40f564 | 2005-12-26 22:53:25 +0100 | [diff] [blame] | 2245 | |