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