| OLD | NEW |
| 1 #line 2 "ada-lex.c" | 1 #line 2 "ada-lex.c" |
| 2 /* A lexical scanner generated by flex */ | 2 /* A lexical scanner generated by flex */ |
| 3 | 3 |
| 4 /* Scanner skeleton version: | 4 /* Scanner skeleton version: |
| 5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern
Exp $ | 5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern
Exp $ |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #define FLEX_SCANNER | 8 #define FLEX_SCANNER |
| 9 #define YY_FLEX_MAJOR_VERSION 2 | 9 #define YY_FLEX_MAJOR_VERSION 2 |
| 10 #define YY_FLEX_MINOR_VERSION 5 | 10 #define YY_FLEX_MINOR_VERSION 5 |
| (...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2166 } | 2166 } |
| 2167 #endif | 2167 #endif |
| 2168 #line 289 "ada-lex.l" | 2168 #line 289 "ada-lex.l" |
| 2169 | 2169 |
| 2170 | 2170 |
| 2171 #include <ctype.h> | 2171 #include <ctype.h> |
| 2172 #include "gdb_string.h" | 2172 #include "gdb_string.h" |
| 2173 | 2173 |
| 2174 /* Initialize the lexer for processing new expression. */ | 2174 /* Initialize the lexer for processing new expression. */ |
| 2175 | 2175 |
| 2176 void | 2176 static void |
| 2177 lexer_init (FILE *inp) | 2177 lexer_init (FILE *inp) |
| 2178 { | 2178 { |
| 2179 BEGIN INITIAL; | 2179 BEGIN INITIAL; |
| 2180 yyrestart (inp); | 2180 yyrestart (inp); |
| 2181 } | 2181 } |
| 2182 | 2182 |
| 2183 | 2183 |
| 2184 /* Copy S2 to S1, removing all underscores, and downcasing all letters. */ | 2184 /* Copy S2 to S1, removing all underscores, and downcasing all letters. */ |
| 2185 | 2185 |
| 2186 static void | 2186 static void |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 yylval.typed_val_float.type = type_double (); | 2283 yylval.typed_val_float.type = type_double (); |
| 2284 if (sizeof(DOUBLEST) >= gdbarch_long_double_bit (parse_gdbarch) | 2284 if (sizeof(DOUBLEST) >= gdbarch_long_double_bit (parse_gdbarch) |
| 2285 / TARGET_CHAR_BIT) | 2285 / TARGET_CHAR_BIT) |
| 2286 yylval.typed_val_float.type = type_long_double (); | 2286 yylval.typed_val_float.type = type_long_double (); |
| 2287 | 2287 |
| 2288 return FLOAT; | 2288 return FLOAT; |
| 2289 } | 2289 } |
| 2290 | 2290 |
| 2291 | 2291 |
| 2292 /* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym. The | 2292 /* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym. The |
| 2293 resulting string is valid until the next call to ada_parse. It differs | 2293 resulting string is valid until the next call to ada_parse. If |
| 2294 NAME0 contains the substring "___", it is assumed to be already |
| 2295 encoded and the resulting name is equal to it. Otherwise, it differs |
| 2294 from NAME0 in that: | 2296 from NAME0 in that: |
| 2295 + Characters between '...' or <...> are transfered verbatim to | 2297 + Characters between '...' or <...> are transfered verbatim to |
| 2296 yylval.ssym. | 2298 yylval.ssym. |
| 2297 + <, >, and trailing "'" characters in quoted sequences are removed | 2299 + <, >, and trailing "'" characters in quoted sequences are removed |
| 2298 (a leading quote is preserved to indicate that the name is not to be | 2300 (a leading quote is preserved to indicate that the name is not to be |
| 2299 GNAT-encoded). | 2301 GNAT-encoded). |
| 2300 + Unquoted whitespace is removed. | 2302 + Unquoted whitespace is removed. |
| 2301 + Unquoted alphabetic characters are mapped to lower case. | 2303 + Unquoted alphabetic characters are mapped to lower case. |
| 2302 Result is returned as a struct stoken, but for convenience, the string | 2304 Result is returned as a struct stoken, but for convenience, the string |
| 2303 is also null-terminated. Result string valid until the next call of | 2305 is also null-terminated. Result string valid until the next call of |
| 2304 ada_parse. | 2306 ada_parse. |
| 2305 */ | 2307 */ |
| 2306 static struct stoken | 2308 static struct stoken |
| 2307 processId (const char *name0, int len) | 2309 processId (const char *name0, int len) |
| 2308 { | 2310 { |
| 2309 char *name = obstack_alloc (&temp_parse_space, len + 11); | 2311 char *name = obstack_alloc (&temp_parse_space, len + 11); |
| 2310 int i0, i; | 2312 int i0, i; |
| 2311 struct stoken result; | 2313 struct stoken result; |
| 2312 | 2314 |
| 2315 result.ptr = name; |
| 2313 while (len > 0 && isspace (name0[len-1])) | 2316 while (len > 0 && isspace (name0[len-1])) |
| 2314 len -= 1; | 2317 len -= 1; |
| 2318 |
| 2319 if (strstr (name0, "___") != NULL) |
| 2320 { |
| 2321 strncpy (name, name0, len); |
| 2322 name[len] = '\000'; |
| 2323 result.length = len; |
| 2324 return result; |
| 2325 } |
| 2326 |
| 2315 i = i0 = 0; | 2327 i = i0 = 0; |
| 2316 while (i0 < len) | 2328 while (i0 < len) |
| 2317 { | 2329 { |
| 2318 if (isalnum (name0[i0])) | 2330 if (isalnum (name0[i0])) |
| 2319 { | 2331 { |
| 2320 name[i] = tolower (name0[i0]); | 2332 name[i] = tolower (name0[i0]); |
| 2321 i += 1; i0 += 1; | 2333 i += 1; i0 += 1; |
| 2322 } | 2334 } |
| 2323 else switch (name0[i0]) | 2335 else switch (name0[i0]) |
| 2324 { | 2336 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2344 { | 2356 { |
| 2345 name[i] = name0[i0]; | 2357 name[i] = name0[i0]; |
| 2346 i += 1; i0 += 1; | 2358 i += 1; i0 += 1; |
| 2347 } | 2359 } |
| 2348 i0 += 1; | 2360 i0 += 1; |
| 2349 break; | 2361 break; |
| 2350 } | 2362 } |
| 2351 } | 2363 } |
| 2352 name[i] = '\000'; | 2364 name[i] = '\000'; |
| 2353 | 2365 |
| 2354 result.ptr = name; | |
| 2355 result.length = i; | 2366 result.length = i; |
| 2356 return result; | 2367 return result; |
| 2357 } | 2368 } |
| 2358 | 2369 |
| 2359 /* Return TEXT[0..LEN-1], a string literal without surrounding quotes, | 2370 /* Return TEXT[0..LEN-1], a string literal without surrounding quotes, |
| 2360 with special hex character notations replaced with characters. | 2371 with special hex character notations replaced with characters. |
| 2361 Result valid until the next call to ada_parse. */ | 2372 Result valid until the next call to ada_parse. */ |
| 2362 | 2373 |
| 2363 static struct stoken | 2374 static struct stoken |
| 2364 processString (const char *text, int len) | 2375 processString (const char *text, int len) |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 { | 2502 { |
| 2492 return 1; | 2503 return 1; |
| 2493 } | 2504 } |
| 2494 | 2505 |
| 2495 /* Dummy definition to suppress warnings about unused static definitions. */ | 2506 /* Dummy definition to suppress warnings about unused static definitions. */ |
| 2496 typedef void (*dummy_function) (); | 2507 typedef void (*dummy_function) (); |
| 2497 dummy_function ada_flex_use[] = | 2508 dummy_function ada_flex_use[] = |
| 2498 { | 2509 { |
| 2499 (dummy_function) yyunput | 2510 (dummy_function) yyunput |
| 2500 }; | 2511 }; |
| OLD | NEW |