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