1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/compiler/yaccParser/Attic/hslexer.c,v 1.4 1996/01/23 11:11:20 partain Exp $
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27 /* Use prototypes in function declarations. */
30 /* The "const" storage-class-modifier is valid. */
33 #else /* ! __cplusplus */
41 #endif /* ! __cplusplus */
60 #define YY_PROTO(proto) proto
62 #define YY_PROTO(proto) ()
65 /* Returned upon end-of-file. */
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102 extern FILE *yyin, *yyout;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
130 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
134 #define unput(c) yyunput( c, yytext_ptr )
136 /* The following is because we cannot portably get our hands on size_t
137 * (without autoconf's help, which isn't available because we want
138 * flex-generated scanners to compile on their own).
140 typedef unsigned int yy_size_t;
143 struct yy_buffer_state
147 char *yy_ch_buf; /* input buffer */
148 char *yy_buf_pos; /* current position in input buffer */
150 /* Size of input buffer in bytes, not including room for EOB
153 yy_size_t yy_buf_size;
155 /* Number of characters read into yy_ch_buf, not including EOB
160 /* Whether we "own" the buffer - i.e., we know we created it,
161 * and can realloc() it to grow it, and should free() it to
164 int yy_is_our_buffer;
166 /* Whether this is an "interactive" input source; if so, and
167 * if we're using stdio for input, then we want to use getc()
168 * instead of fread(), to make sure we stop fetching input after
171 int yy_is_interactive;
173 /* Whether we're considered to be at the beginning of a line.
174 * If so, '^' rules will be active on the next match, otherwise
179 /* Whether to try to fill the input buffer when we reach the
184 int yy_buffer_status;
185 #define YY_BUFFER_NEW 0
186 #define YY_BUFFER_NORMAL 1
187 /* When an EOF's been seen but there's still some text to process
188 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
189 * shouldn't try reading from the input source any more. We might
190 * still have a bunch of tokens to match, though, because of
191 * possible backing-up.
193 * When we actually see the EOF, we change the status to "new"
194 * (via yyrestart()), so that the user can continue scanning by
195 * just pointing yyin at a new input file.
197 #define YY_BUFFER_EOF_PENDING 2
200 static YY_BUFFER_STATE yy_current_buffer = 0;
202 /* We provide macros for accessing buffer states in case in the
203 * future we want to put the buffer states in a more general
206 #define YY_CURRENT_BUFFER yy_current_buffer
209 /* yy_hold_char holds the character lost when yytext is formed. */
210 static char yy_hold_char;
212 static int yy_n_chars; /* number of characters read into yy_ch_buf */
217 /* Points to current character in buffer. */
218 static char *yy_c_buf_p = (char *) 0;
219 static int yy_init = 1; /* whether we need to initialize */
220 static int yy_start = 0; /* start state number */
222 /* Flag which is used to allow yywrap()'s to do buffer switches
223 * instead of setting up a fresh yyin. A bit of a hack ...
225 static int yy_did_buffer_switch_on_eof;
227 void yyrestart YY_PROTO(( FILE *input_file ));
229 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
230 void yy_load_buffer_state YY_PROTO(( void ));
231 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
232 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
233 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
234 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
237 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
238 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
239 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
241 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
242 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
243 static void yy_flex_free YY_PROTO(( void * ));
245 #define yy_new_buffer yy_create_buffer
247 #define yy_set_interactive(is_interactive) \
249 if ( ! yy_current_buffer ) \
250 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
251 yy_current_buffer->yy_is_interactive = is_interactive; \
254 #define yy_set_bol(at_bol) \
256 if ( ! yy_current_buffer ) \
257 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
258 yy_current_buffer->yy_at_bol = at_bol; \
261 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
263 typedef unsigned char YY_CHAR;
264 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
265 typedef int yy_state_type;
267 #define yytext_ptr yytext
269 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
270 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
271 static int yy_get_next_buffer YY_PROTO(( void ));
272 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
274 /* Done after the current pattern has been matched and before the
275 * corresponding action - sets up yytext.
277 #define YY_DO_BEFORE_ACTION \
278 yytext_ptr = yy_bp; \
279 yyleng = (int) (yy_cp - yy_bp); \
280 yy_hold_char = *yy_cp; \
284 #define YY_NUM_RULES 202
285 #define YY_END_OF_BUFFER 203
286 static yyconst short int yy_accept[743] =
288 0, 0, 0, 0, 0, 0, 0, 0, 191, 191,
289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
290 203, 197, 198, 130, 129, 137, 199, 142, 185, 199,
291 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
292 199, 199, 199, 140, 199, 151, 153, 161, 157, 199,
293 163, 155, 159, 199, 189, 122, 133, 127, 92, 93,
294 98, 85, 105, 122, 111, 111, 122, 84, 122, 87,
295 99, 121, 94, 100, 95, 102, 103, 121, 121, 121,
296 121, 121, 121, 121, 121, 121, 121, 121, 96, 86,
297 97, 104, 122, 191, 196, 196, 133, 127, 105, 111,
299 111, 102, 103, 189, 127, 122, 111, 197, 121, 121,
300 121, 121, 121, 96, 122, 122, 122, 197, 197, 121,
301 121, 197, 200, 136, 135, 139, 201, 189, 142, 201,
302 185, 201, 201, 201, 201, 201, 201, 201, 201, 201,
303 201, 201, 201, 201, 201, 141, 201, 151, 153, 161,
304 157, 201, 163, 155, 159, 201, 201, 130, 129, 128,
305 185, 0, 0, 152, 0, 162, 0, 0, 0, 175,
306 0, 0, 0, 0, 160, 178, 179, 154, 156, 0,
307 0, 180, 165, 164, 182, 0, 0, 0, 181, 158,
308 184, 186, 187, 189, 122, 133, 132, 127, 126, 188,
310 89, 83, 0, 111, 0, 0, 91, 88, 90, 119,
311 121, 120, 0, 120, 121, 121, 121, 121, 121, 121,
312 61, 121, 75, 121, 121, 69, 121, 121, 72, 121,
313 121, 190, 0, 0, 191, 192, 0, 195, 193, 194,
314 0, 133, 132, 127, 0, 0, 110, 0, 111, 0,
315 0, 120, 0, 0, 0, 127, 0, 111, 0, 0,
316 0, 120, 120, 120, 120, 120, 120, 120, 120, 120,
317 120, 120, 120, 120, 120, 120, 120, 0, 121, 121,
318 75, 121, 69, 190, 0, 121, 136, 135, 134, 138,
319 149, 150, 174, 167, 168, 169, 170, 183, 166, 148,
321 147, 177, 173, 146, 171, 143, 144, 145, 176, 172,
322 127, 125, 188, 188, 188, 188, 114, 107, 109, 120,
323 120, 121, 121, 121, 121, 121, 121, 121, 121, 121,
324 121, 121, 76, 121, 121, 121, 121, 121, 0, 0,
325 1, 1, 0, 131, 125, 0, 0, 114, 107, 109,
326 120, 120, 0, 0, 0, 0, 0, 0, 18, 19,
327 0, 120, 120, 120, 120, 12, 120, 120, 120, 120,
328 120, 120, 17, 120, 15, 120, 120, 120, 11, 120,
329 120, 6, 120, 120, 120, 120, 14, 120, 120, 120,
330 13, 120, 120, 118, 121, 76, 53, 188, 0, 120,
332 54, 121, 56, 121, 121, 59, 121, 121, 121, 121,
333 121, 121, 121, 71, 73, 121, 0, 0, 52, 52,
334 52, 52, 52, 52, 0, 124, 0, 0, 113, 0,
335 106, 108, 120, 120, 123, 0, 46, 0, 101, 120,
336 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
337 120, 120, 120, 120, 16, 120, 7, 120, 120, 120,
338 120, 120, 120, 120, 120, 120, 120, 120, 120, 118,
339 54, 0, 114, 81, 55, 121, 121, 121, 121, 63,
340 121, 121, 121, 121, 74, 52, 52, 52, 52, 52,
341 52, 52, 0, 112, 0, 114, 120, 120, 115, 0,
343 0, 120, 22, 120, 120, 20, 120, 120, 120, 120,
344 120, 120, 120, 120, 120, 120, 120, 116, 120, 120,
345 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
346 121, 121, 60, 62, 64, 65, 121, 121, 68, 121,
347 52, 52, 52, 52, 52, 52, 52, 0, 79, 120,
348 120, 120, 120, 120, 120, 120, 35, 120, 36, 120,
349 120, 120, 120, 34, 120, 120, 40, 120, 23, 120,
350 120, 38, 117, 120, 120, 39, 120, 57, 121, 121,
351 121, 121, 52, 52, 52, 52, 52, 52, 52, 0,
352 2, 2, 120, 77, 120, 120, 120, 120, 120, 120,
354 120, 120, 120, 120, 120, 120, 120, 120, 33, 120,
355 21, 120, 120, 58, 66, 121, 70, 52, 52, 52,
356 52, 52, 52, 52, 120, 120, 120, 120, 41, 120,
357 32, 37, 120, 120, 120, 120, 25, 120, 120, 120,
358 120, 120, 120, 120, 82, 67, 52, 0, 52, 52,
359 48, 52, 52, 80, 120, 120, 120, 29, 120, 30,
360 31, 42, 43, 44, 45, 120, 120, 120, 28, 52,
361 0, 0, 52, 52, 52, 52, 78, 8, 120, 9,
362 24, 120, 120, 52, 0, 51, 50, 52, 52, 120,
363 120, 120, 52, 3, 3, 52, 52, 120, 120, 10,
365 52, 52, 47, 120, 120, 52, 52, 27, 120, 5,
366 52, 120, 0, 52, 120, 0, 52, 120, 0, 49,
367 26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
368 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
372 static yyconst int yy_ec[256] =
374 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
375 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 5, 6, 7, 8, 9, 10, 11, 12, 13,
378 14, 10, 15, 16, 17, 18, 19, 20, 21, 22,
379 23, 24, 25, 25, 25, 26, 26, 27, 28, 29,
380 30, 31, 10, 32, 33, 34, 35, 36, 37, 38,
381 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
382 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
383 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
385 69, 70, 71, 72, 73, 74, 74, 75, 76, 77,
386 78, 79, 74, 80, 81, 82, 83, 84, 85, 86,
387 87, 74, 88, 89, 90, 91, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 static yyconst int yy_meta[92] =
406 1, 2, 3, 2, 4, 5, 6, 7, 8, 5,
407 5, 9, 6, 6, 5, 6, 10, 5, 5, 11,
408 11, 11, 11, 11, 11, 11, 5, 6, 5, 5,
409 5, 12, 13, 13, 13, 13, 13, 13, 14, 14,
410 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
411 14, 14, 14, 14, 14, 14, 14, 14, 15, 16,
412 15, 12, 17, 18, 19, 19, 19, 19, 19, 19,
413 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
414 20, 20, 20, 20, 20, 20, 20, 21, 5, 22,
419 static yyconst short int yy_base[785] =
421 0, 0, 0, 4, 58, 138, 224, 2291, 0, 1,
422 3, 23, 311, 0, 396, 0, 50, 70, 487, 0,
423 2298, 2300, 2300, 2285, 2288, 2300, 2300, 2300, 131, 2260,
424 4, 0, 24, 54, 18, 2243, 2241, 2254, 5, 2240,
425 74, 2239, 2237, 2300, 0, 2300, 2300, 2300, 2300, 145,
426 2300, 2300, 2300, 0, 144, 0, 2281, 2275, 2300, 2300,
427 0, 2300, 5, 2268, 329, 338, 2258, 2300, 2267, 2252,
428 0, 2274, 2300, 0, 2300, 22, 2300, 54, 68, 105,
429 34, 109, 6, 117, 124, 133, 357, 135, 2264, 0,
430 2300, 0, 134, 0, 97, 2, 2273, 2267, 416, 571,
432 580, 130, 2214, 317, 0, 17, 591, 652, 197, 336,
433 333, 358, 330, 2260, 0, 2259, 2244, 2211, 2209, 340,
434 349, 2255, 2300, 2264, 2262, 2258, 2300, 366, 2300, 2251,
435 428, 2232, 159, 373, 146, 535, 161, 2215, 2213, 2226,
436 168, 2212, 577, 2211, 2209, 2300, 0, 2300, 2300, 2300,
437 2300, 615, 2300, 2300, 2300, 0, 2243, 2247, 2250, 2300,
438 621, 2214, 2212, 2300, 2209, 2300, 598, 2210, 2216, 2300,
439 2203, 2199, 2215, 290, 2300, 2300, 2300, 2300, 2300, 2206,
440 2204, 2300, 2300, 2207, 2300, 2190, 2211, 2198, 2300, 2300,
441 2300, 630, 0, 659, 0, 2236, 2300, 2230, 2300, 663,
443 0, 0, 652, 688, 659, 0, 0, 2300, 0, 2300,
444 2233, 0, 2177, 2172, 364, 365, 401, 648, 620, 602,
445 2230, 55, 661, 577, 618, 2229, 615, 404, 2228, 623,
446 625, 2227, 210, 2161, 0, 0, 2216, 2300, 0, 2300,
447 2144, 2224, 2222, 2217, 726, 737, 2300, 715, 746, 753,
448 0, 152, 2220, 0, 2210, 2214, 759, 785, 2162, 2161,
449 2163, 779, 399, 429, 2159, 2183, 2157, 2182, 751, 414,
450 2168, 2167, 395, 422, 666, 2166, 2137, 0, 575, 715,
451 599, 712, 717, 2300, 2124, 719, 2206, 2204, 2300, 2300,
452 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
454 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
455 2199, 2300, 813, 817, 826, 831, 823, 830, 0, 0,
456 2143, 722, 745, 624, 791, 683, 789, 784, 708, 790,
457 757, 793, 2201, 782, 794, 787, 816, 817, 865, 834,
458 2300, 837, 2131, 2300, 2199, 851, 0, 858, 897, 2198,
459 2124, 2139, 2139, 2194, 2189, 2110, 2191, 915, 2300, 2300,
460 2135, 2146, 847, 2148, 2143, 0, 2156, 2147, 2154, 2138,
461 2155, 2141, 0, 2125, 0, 2135, 2134, 2122, 0, 833,
462 267, 0, 2143, 852, 2132, 2145, 0, 2133, 2147, 2142,
463 0, 2135, 2097, 0, 879, 891, 2300, 909, 934, 2113,
465 2167, 853, 2166, 882, 886, 2165, 895, 896, 899, 901,
466 900, 907, 916, 2164, 2163, 917, 928, 418, 940, 985,
467 991, 995, 999, 1003, 2101, 2300, 1001, 2161, 2160, 1014,
468 2300, 2300, 2091, 2091, 2300, 2153, 2300, 1032, 2300, 2112,
469 2100, 2099, 2128, 2097, 2112, 2095, 2106, 881, 2110, 2103,
470 2118, 2120, 2102, 2111, 0, 2087, 0, 2112, 2112, 2108,
471 2102, 2100, 2107, 2108, 2079, 2093, 2090, 2089, 2073, 0,
472 938, 990, 1039, 0, 2129, 942, 945, 959, 960, 970,
473 967, 921, 1011, 954, 2128, 1064, 1068, 1072, 1079, 1083,
474 1087, 1091, 2130, 2300, 1077, 1110, 2071, 2058, 2300, 1090,
476 1117, 2082, 0, 2095, 2073, 0, 2066, 2093, 2075, 2063,
477 2075, 2061, 2060, 2059, 2071, 2083, 2056, 0, 2070, 2080,
478 2034, 2017, 2005, 2023, 1066, 1124, 2016, 1999, 1996, 1983,
479 1038, 1097, 2047, 2046, 2045, 2044, 1012, 1098, 2043, 1100,
480 1149, 1153, 1157, 1163, 1167, 1176, 1183, 1118, 2011, 1986,
481 2015, 1997, 1972, 1986, 1985, 1972, 0, 1978, 0, 1963,
482 1952, 1946, 1949, 0, 1918, 1941, 0, 1941, 0, 1906,
483 1913, 0, 1169, 1863, 1880, 0, 1829, 1862, 1111, 1156,
484 1116, 1165, 1198, 1202, 1209, 1217, 1224, 1228, 1238, 1172,
485 2300, 1193, 1833, 1828, 1829, 1827, 1769, 1778, 1735, 1733,
487 1744, 1757, 1755, 1729, 1710, 1194, 1720, 1726, 0, 1718,
488 0, 1718, 1671, 1691, 1669, 1207, 1658, 1244, 1248, 1252,
489 1269, 1278, 1284, 1291, 1591, 1617, 1599, 1594, 0, 1580,
490 0, 0, 1588, 1565, 1546, 1532, 0, 1531, 1530, 1528,
491 1538, 1526, 1545, 1509, 0, 1434, 1295, 1416, 1299, 1305,
492 1309, 1314, 1318, 0, 1368, 1367, 1378, 0, 1363, 0,
493 0, 0, 0, 0, 0, 1360, 1386, 1369, 0, 1324,
494 1393, 1241, 1333, 1337, 1346, 1350, 0, 0, 1341, 0,
495 0, 1346, 1309, 1356, 1220, 1361, 1366, 1370, 1374, 1309,
496 1308, 1270, 1217, 2300, 1313, 1335, 1343, 1270, 1238, 0,
498 1233, 1339, 1274, 1215, 1226, 1376, 1348, 0, 1206, 1219,
499 1347, 1203, 1188, 1356, 1181, 1146, 1361, 1015, 1011, 1345,
500 0, 993, 995, 950, 946, 940, 966, 909, 750, 682,
501 597, 586, 543, 434, 429, 1415, 1423, 319, 206, 26,
502 2300, 2300, 1449, 1471, 1493, 1515, 1537, 1556, 1567, 1398,
503 1580, 1593, 1612, 1628, 1636, 1656, 1678, 1700, 1718, 1737,
504 1747, 1764, 1780, 1797, 1816, 1838, 1402, 1852, 1872, 1894,
505 1916, 1936, 1953, 1405, 1969, 1989, 1245, 2005, 2022, 2043,
506 1625, 2052, 2072, 2094
509 static yyconst short int yy_def[785] =
511 743, 743, 744, 744, 745, 745, 742, 7, 746, 746,
512 7, 7, 7, 13, 7, 15, 747, 747, 742, 19,
513 742, 742, 742, 748, 742, 742, 742, 742, 742, 742,
514 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
515 742, 742, 742, 742, 749, 742, 742, 742, 742, 742,
516 742, 742, 742, 750, 742, 751, 752, 753, 742, 742,
517 751, 742, 751, 751, 742, 742, 751, 742, 751, 751,
518 751, 754, 742, 751, 742, 755, 742, 754, 754, 754,
519 754, 754, 754, 754, 754, 754, 754, 754, 742, 751,
520 742, 751, 751, 756, 757, 758, 759, 760, 751, 742,
522 742, 755, 761, 742, 762, 99, 742, 755, 763, 763,
523 763, 763, 763, 742, 751, 751, 751, 755, 761, 754,
524 754, 742, 742, 764, 742, 742, 742, 742, 742, 742,
525 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
526 742, 742, 742, 742, 742, 742, 749, 742, 742, 742,
527 742, 742, 742, 742, 742, 750, 742, 748, 742, 742,
528 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
529 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
530 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
531 742, 742, 750, 742, 751, 752, 742, 765, 742, 766,
533 751, 751, 742, 742, 742, 767, 751, 742, 751, 742,
534 754, 768, 755, 768, 754, 754, 754, 754, 754, 754,
535 754, 754, 754, 754, 754, 754, 754, 754, 754, 754,
536 754, 742, 769, 742, 770, 771, 771, 742, 772, 742,
537 772, 773, 742, 765, 742, 742, 742, 742, 742, 742,
538 774, 768, 775, 776, 742, 765, 742, 742, 742, 742,
539 742, 768, 768, 768, 768, 768, 768, 768, 768, 768,
540 768, 768, 768, 768, 768, 768, 768, 777, 778, 778,
541 778, 778, 778, 742, 742, 754, 779, 742, 742, 742,
542 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
544 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
545 765, 742, 766, 766, 742, 766, 742, 742, 767, 768,
546 768, 754, 754, 754, 754, 754, 754, 754, 754, 754,
547 754, 754, 754, 754, 754, 754, 754, 754, 780, 769,
548 742, 769, 742, 742, 742, 742, 781, 742, 742, 774,
549 768, 768, 742, 775, 776, 742, 742, 742, 742, 742,
550 742, 768, 768, 768, 768, 768, 768, 768, 768, 768,
551 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
552 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
553 768, 768, 768, 782, 778, 778, 742, 742, 742, 768,
555 754, 754, 754, 754, 754, 754, 754, 754, 754, 754,
556 754, 754, 754, 754, 754, 754, 780, 417, 780, 780,
557 780, 780, 780, 780, 742, 742, 742, 781, 742, 742,
558 742, 742, 768, 768, 742, 742, 742, 742, 742, 768,
559 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
560 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
561 768, 768, 768, 768, 768, 768, 768, 768, 768, 782,
562 778, 742, 742, 768, 754, 754, 754, 754, 754, 754,
563 754, 754, 754, 754, 754, 780, 780, 780, 780, 780,
564 780, 780, 742, 742, 742, 742, 768, 768, 742, 742,
566 742, 768, 768, 768, 768, 768, 768, 768, 768, 768,
567 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
568 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
569 754, 754, 754, 754, 754, 754, 754, 754, 754, 754,
570 780, 780, 780, 780, 780, 780, 780, 783, 768, 768,
571 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
572 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
573 768, 768, 768, 768, 768, 768, 768, 754, 754, 754,
574 754, 754, 780, 780, 780, 780, 780, 780, 780, 783,
575 742, 783, 768, 768, 768, 768, 768, 768, 768, 768,
577 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
578 768, 768, 768, 754, 754, 754, 754, 780, 780, 780,
579 780, 780, 780, 780, 768, 768, 768, 768, 768, 768,
580 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
581 768, 768, 768, 768, 768, 754, 780, 784, 780, 780,
582 780, 780, 780, 768, 768, 768, 768, 768, 768, 768,
583 768, 768, 768, 768, 768, 768, 768, 768, 768, 780,
584 784, 784, 780, 780, 780, 780, 768, 768, 768, 768,
585 768, 768, 768, 780, 784, 780, 780, 780, 780, 768,
586 768, 768, 689, 742, 784, 689, 689, 768, 768, 768,
588 689, 689, 689, 768, 768, 689, 689, 768, 768, 742,
589 689, 768, 742, 689, 768, 742, 689, 768, 742, 689,
590 768, 742, 742, 742, 742, 742, 742, 742, 742, 742,
591 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
592 742, 0, 742, 742, 742, 742, 742, 742, 742, 742,
593 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
594 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
595 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
599 static yyconst short int yy_nxt[2392] =
601 23, 23, 23, 23, 23, 23, 23, 23, 742, 97,
602 742, 25, 742, 210, 98, 25, 95, 95, 240, 99,
603 742, 200, 100, 101, 101, 101, 101, 101, 101, 97,
604 93, 742, 165, 742, 98, 201, 246, 180, 742, 99,
605 163, 210, 100, 101, 101, 101, 101, 101, 101, 166,
606 123, 123, 123, 123, 164, 175, 125, 181, 167, 26,
607 168, 210, 210, 26, 28, 102, 103, 169, 176, 28,
608 123, 123, 123, 123, 224, 210, 125, 29, 29, 29,
609 29, 29, 29, 29, 213, 102, 103, 96, 96, 241,
610 30, 31, 32, 33, 34, 35, 36, 37, 170, 171,
612 172, 38, 214, 39, 173, 174, 220, 40, 41, 126,
613 42, 43, 210, 237, 183, 741, 210, 44, 215, 45,
614 184, 185, 46, 47, 210, 186, 187, 48, 216, 126,
615 188, 210, 217, 329, 49, 50, 218, 51, 233, 52,
616 210, 53, 210, 54, 28, 194, 194, 194, 194, 28,
617 161, 161, 161, 161, 161, 161, 161, 29, 29, 29,
618 29, 29, 29, 29, 192, 192, 192, 192, 192, 192,
619 30, 31, 32, 33, 34, 35, 36, 37, 221, 219,
620 167, 38, 168, 39, 222, 223, 238, 40, 41, 169,
621 42, 43, 213, 226, 225, 163, 252, 44, 175, 45,
623 180, 227, 46, 47, 210, 278, 231, 48, 234, 164,
624 214, 176, 341, 342, 49, 50, 351, 51, 352, 52,
625 181, 53, 740, 54, 22, 55, 55, 55, 55, 56,
626 57, 56, 56, 56, 56, 58, 59, 60, 61, 62,
627 63, 64, 56, 65, 66, 66, 66, 66, 66, 66,
628 67, 68, 69, 70, 56, 71, 72, 72, 72, 72,
629 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
630 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
631 72, 72, 73, 74, 75, 56, 76, 77, 72, 72,
632 78, 79, 80, 72, 72, 81, 82, 72, 83, 84,
634 72, 85, 72, 86, 72, 87, 72, 72, 88, 72,
635 72, 89, 90, 91, 92, 104, 458, 97, 194, 194,
636 194, 194, 105, 303, 255, 56, 739, 106, 56, 459,
637 107, 107, 107, 107, 107, 107, 107, 210, 278, 56,
638 210, 278, 56, 210, 278, 304, 203, 210, 204, 204,
639 204, 204, 204, 204, 204, 203, 210, 204, 204, 204,
640 204, 204, 204, 204, 210, 210, 278, 194, 194, 194,
641 194, 210, 210, 108, 103, 109, 109, 110, 109, 109,
642 109, 109, 109, 111, 109, 112, 109, 109, 113, 109,
643 109, 109, 109, 109, 109, 109, 109, 109, 114, 283,
645 280, 115, 22, 116, 217, 165, 205, 22, 210, 281,
646 56, 210, 117, 56, 206, 22, 22, 22, 22, 22,
647 22, 22, 166, 22, 56, 286, 282, 56, 228, 323,
648 385, 367, 200, 736, 229, 245, 246, 246, 246, 246,
649 246, 246, 386, 230, 322, 368, 201, 161, 161, 161,
650 161, 161, 161, 161, 380, 56, 486, 387, 118, 119,
651 381, 487, 72, 120, 72, 369, 370, 72, 121, 371,
652 72, 72, 336, 72, 388, 72, 382, 72, 389, 735,
653 72, 372, 324, 122, 56, 22, 115, 127, 128, 128,
654 128, 128, 127, 129, 127, 127, 127, 127, 129, 127,
656 127, 127, 127, 130, 127, 127, 131, 131, 131, 131,
657 131, 131, 131, 127, 127, 127, 127, 127, 127, 132,
658 133, 134, 135, 136, 137, 138, 139, 127, 127, 127,
659 140, 127, 141, 127, 127, 127, 142, 143, 127, 144,
660 145, 127, 127, 127, 127, 127, 146, 127, 147, 127,
661 127, 148, 149, 127, 127, 127, 150, 127, 127, 127,
662 127, 127, 127, 151, 152, 127, 153, 127, 154, 127,
663 155, 127, 156, 127, 157, 127, 127, 127, 247, 170,
664 171, 172, 210, 278, 210, 173, 174, 247, 248, 734,
665 249, 249, 249, 249, 249, 249, 249, 248, 247, 249,
667 249, 249, 249, 249, 249, 249, 210, 278, 257, 210,
668 258, 258, 258, 258, 258, 258, 258, 183, 294, 295,
669 296, 297, 210, 184, 185, 210, 733, 210, 186, 187,
670 210, 210, 210, 188, 192, 192, 192, 192, 192, 192,
671 161, 161, 161, 161, 161, 161, 161, 732, 250, 192,
672 192, 192, 192, 192, 192, 210, 251, 259, 333, 260,
673 194, 194, 194, 194, 314, 315, 316, 314, 210, 328,
674 261, 317, 317, 317, 317, 317, 317, 317, 318, 318,
675 318, 318, 318, 318, 262, 334, 263, 264, 403, 265,
676 210, 335, 266, 338, 267, 268, 269, 270, 271, 272,
678 327, 337, 273, 274, 275, 203, 276, 204, 204, 204,
679 204, 204, 204, 204, 213, 210, 390, 325, 252, 210,
680 278, 277, 210, 278, 210, 278, 210, 326, 391, 210,
681 330, 731, 214, 247, 348, 348, 348, 348, 348, 348,
682 348, 331, 332, 257, 247, 246, 246, 246, 246, 246,
683 246, 246, 210, 247, 257, 405, 246, 246, 246, 246,
684 246, 246, 246, 248, 210, 249, 249, 249, 249, 249,
685 249, 249, 349, 349, 349, 349, 349, 349, 358, 358,
686 358, 358, 358, 358, 358, 408, 730, 377, 378, 210,
687 401, 210, 247, 396, 210, 395, 210, 210, 210, 331,
689 210, 210, 257, 346, 258, 258, 258, 258, 258, 258,
690 258, 347, 362, 379, 314, 315, 316, 314, 314, 315,
691 316, 314, 363, 210, 210, 402, 364, 398, 398, 398,
692 398, 365, 314, 315, 316, 314, 341, 342, 410, 341,
693 342, 366, 317, 317, 317, 317, 317, 317, 317, 318,
694 318, 318, 318, 318, 318, 404, 407, 406, 413, 399,
695 210, 411, 409, 414, 412, 429, 417, 417, 417, 418,
696 427, 427, 427, 427, 427, 427, 456, 348, 348, 348,
697 348, 348, 348, 348, 415, 441, 210, 278, 461, 210,
698 442, 399, 462, 210, 430, 457, 416, 419, 210, 278,
700 421, 443, 210, 210, 431, 422, 210, 210, 210, 423,
701 398, 398, 398, 398, 210, 424, 349, 349, 349, 349,
702 349, 349, 429, 210, 210, 510, 430, 511, 210, 417,
703 417, 417, 417, 475, 358, 358, 358, 358, 358, 358,
704 358, 742, 742, 742, 742, 210, 278, 471, 472, 210,
705 472, 438, 210, 473, 473, 473, 473, 473, 473, 473,
706 419, 210, 729, 421, 476, 481, 210, 210, 422, 477,
707 728, 478, 423, 488, 210, 479, 727, 210, 424, 482,
708 726, 483, 725, 438, 480, 485, 742, 742, 742, 742,
709 538, 484, 742, 742, 742, 742, 742, 742, 742, 742,
711 742, 742, 742, 742, 742, 742, 742, 742, 431, 473,
712 473, 473, 473, 473, 473, 473, 531, 532, 210, 210,
713 427, 427, 427, 427, 427, 427, 540, 489, 495, 533,
714 495, 491, 724, 496, 496, 496, 496, 496, 496, 496,
715 490, 534, 723, 537, 535, 210, 500, 722, 500, 536,
716 492, 501, 501, 501, 501, 501, 501, 501, 473, 473,
717 473, 473, 473, 473, 473, 742, 742, 742, 742, 742,
718 742, 742, 742, 742, 742, 742, 742, 721, 580, 539,
719 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
720 742, 742, 742, 742, 742, 742, 496, 496, 496, 496,
722 496, 496, 496, 541, 210, 210, 571, 210, 542, 501,
723 501, 501, 501, 501, 501, 501, 544, 429, 210, 578,
724 591, 592, 543, 210, 429, 546, 545, 547, 572, 496,
725 496, 496, 496, 496, 496, 496, 501, 501, 501, 501,
726 501, 501, 501, 573, 573, 573, 573, 573, 573, 573,
727 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
728 742, 742, 581, 210, 742, 742, 742, 742, 742, 742,
729 742, 742, 210, 579, 591, 592, 582, 742, 742, 742,
730 742, 614, 616, 583, 742, 742, 742, 742, 573, 573,
731 573, 573, 573, 573, 573, 591, 592, 719, 584, 742,
733 742, 742, 742, 742, 742, 742, 742, 587, 585, 586,
734 742, 742, 742, 742, 210, 718, 588, 589, 742, 742,
735 742, 742, 694, 695, 615, 742, 742, 742, 742, 742,
736 742, 742, 742, 716, 638, 617, 672, 715, 619, 742,
737 742, 742, 742, 639, 640, 742, 742, 742, 742, 742,
738 742, 742, 648, 742, 742, 742, 742, 672, 620, 713,
739 618, 701, 623, 394, 394, 706, 621, 420, 712, 622,
740 742, 742, 742, 742, 420, 646, 709, 708, 624, 742,
741 742, 742, 742, 420, 649, 742, 742, 742, 742, 705,
742 420, 647, 742, 742, 742, 742, 742, 742, 742, 742,
744 742, 742, 742, 742, 704, 650, 742, 742, 742, 742,
745 742, 742, 742, 742, 651, 742, 742, 742, 742, 742,
746 742, 742, 742, 653, 420, 742, 742, 742, 742, 672,
747 685, 420, 700, 673, 742, 742, 742, 742, 742, 742,
748 742, 742, 699, 698, 670, 692, 652, 742, 742, 742,
749 742, 742, 742, 742, 742, 674, 684, 742, 742, 742,
750 742, 676, 742, 742, 742, 742, 675, 742, 742, 742,
751 742, 742, 742, 742, 742, 742, 742, 742, 742, 703,
752 710, 702, 707, 711, 686, 420, 691, 714, 687, 420,
753 689, 688, 420, 420, 693, 420, 420, 420, 420, 720,
755 420, 717, 420, 690, 420, 420, 420, 696, 193, 672,
756 193, 420, 319, 420, 319, 350, 193, 350, 420, 683,
757 319, 682, 681, 350, 697, 680, 420, 738, 679, 678,
758 677, 697, 672, 420, 737, 737, 737, 737, 737, 737,
759 737, 210, 737, 737, 737, 737, 737, 737, 737, 22,
760 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
761 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
762 22, 24, 24, 24, 24, 24, 24, 24, 24, 24,
763 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
764 24, 24, 24, 27, 27, 27, 27, 27, 27, 27,
766 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
767 27, 27, 27, 27, 27, 94, 94, 94, 94, 94,
768 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
769 94, 94, 94, 94, 94, 94, 94, 124, 124, 124,
770 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
771 124, 124, 124, 124, 124, 124, 124, 124, 124, 158,
772 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
773 158, 669, 158, 158, 158, 158, 158, 158, 191, 191,
774 191, 191, 191, 191, 195, 668, 195, 195, 667, 666,
775 665, 195, 664, 663, 662, 195, 196, 196, 196, 196,
777 196, 196, 196, 196, 196, 196, 196, 196, 661, 196,
778 196, 196, 196, 196, 196, 198, 198, 198, 198, 198,
779 198, 198, 198, 198, 198, 198, 198, 660, 198, 198,
780 198, 198, 198, 198, 211, 428, 211, 428, 211, 659,
781 211, 211, 658, 428, 211, 657, 211, 211, 212, 212,
782 656, 655, 212, 654, 212, 212, 235, 235, 235, 235,
783 235, 235, 235, 235, 235, 210, 235, 235, 235, 235,
784 235, 235, 235, 235, 235, 235, 210, 235, 236, 236,
785 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
786 236, 236, 236, 236, 236, 236, 236, 236, 210, 236,
788 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
789 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
790 239, 242, 242, 242, 242, 242, 242, 242, 242, 242,
791 242, 242, 242, 645, 242, 242, 242, 242, 242, 242,
792 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
793 244, 244, 644, 244, 244, 244, 244, 244, 244, 253,
794 253, 643, 642, 641, 253, 253, 253, 256, 256, 256,
795 256, 256, 637, 256, 256, 256, 256, 256, 256, 636,
796 256, 256, 256, 256, 256, 256, 279, 279, 279, 635,
797 279, 634, 279, 279, 633, 632, 279, 631, 279, 279,
799 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
800 287, 287, 630, 287, 287, 287, 287, 287, 287, 311,
801 311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
802 311, 629, 311, 311, 311, 311, 311, 311, 313, 313,
803 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
804 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
805 320, 628, 320, 627, 320, 320, 626, 625, 320, 210,
806 320, 320, 340, 340, 340, 340, 340, 340, 340, 340,
807 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
808 340, 340, 340, 340, 235, 235, 235, 235, 235, 235,
810 235, 235, 235, 613, 235, 235, 235, 235, 235, 235,
811 235, 235, 235, 235, 612, 235, 236, 236, 236, 236,
812 236, 236, 236, 236, 236, 611, 236, 236, 236, 236,
813 236, 236, 236, 236, 236, 236, 239, 239, 239, 239,
814 239, 239, 239, 239, 239, 610, 239, 239, 239, 239,
815 239, 239, 239, 239, 239, 239, 242, 242, 242, 242,
816 242, 242, 242, 242, 242, 242, 242, 242, 609, 242,
817 242, 242, 242, 242, 242, 354, 608, 354, 607, 354,
818 606, 354, 354, 605, 604, 354, 603, 354, 354, 355,
819 355, 355, 355, 355, 355, 355, 355, 602, 355, 355,
821 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
822 355, 279, 279, 279, 601, 279, 600, 279, 279, 599,
823 598, 279, 597, 279, 279, 287, 287, 287, 287, 287,
824 287, 287, 287, 287, 287, 287, 287, 596, 287, 287,
825 287, 287, 287, 287, 420, 420, 420, 595, 594, 593,
826 210, 210, 210, 210, 210, 420, 420, 577, 576, 420,
827 470, 575, 470, 574, 470, 470, 570, 569, 470, 568,
828 470, 470, 590, 590, 590, 590, 590, 590, 590, 590,
829 590, 590, 590, 590, 590, 590, 590, 590, 590, 590,
830 590, 590, 590, 590, 671, 671, 567, 671, 671, 671,
832 671, 671, 671, 671, 671, 671, 671, 671, 671, 671,
833 671, 671, 671, 671, 671, 671, 566, 565, 564, 563,
834 562, 561, 560, 559, 558, 557, 556, 555, 554, 553,
835 552, 551, 550, 549, 548, 210, 210, 530, 529, 528,
836 527, 526, 525, 524, 523, 522, 521, 520, 519, 518,
837 517, 516, 515, 514, 513, 512, 509, 508, 507, 506,
838 505, 504, 503, 502, 499, 498, 497, 494, 432, 493,
839 210, 210, 210, 210, 210, 474, 469, 468, 467, 466,
840 465, 464, 463, 460, 455, 454, 453, 452, 451, 450,
841 449, 448, 447, 446, 445, 444, 440, 439, 426, 437,
843 436, 353, 435, 434, 433, 432, 426, 425, 210, 400,
844 742, 289, 288, 397, 393, 392, 384, 383, 376, 375,
845 374, 373, 361, 360, 359, 357, 356, 353, 345, 344,
846 243, 241, 237, 343, 339, 210, 210, 210, 321, 213,
847 210, 312, 197, 310, 309, 308, 307, 306, 305, 302,
848 301, 300, 299, 298, 293, 292, 291, 160, 159, 284,
849 190, 189, 182, 179, 178, 177, 162, 200, 290, 289,
850 288, 284, 742, 213, 201, 285, 284, 254, 199, 243,
851 232, 210, 209, 208, 207, 202, 199, 197, 190, 189,
852 182, 179, 178, 177, 162, 160, 159, 742, 93, 21,
854 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
855 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
856 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
857 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
858 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
859 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
860 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
861 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
862 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
867 static yyconst short int yy_chk[2392] =
869 3, 3, 3, 3, 4, 4, 4, 4, 0, 11,
870 0, 3, 0, 83, 11, 4, 9, 10, 96, 11,
871 0, 63, 11, 11, 11, 11, 11, 11, 11, 12,
872 12, 0, 32, 106, 12, 63, 106, 39, 0, 12,
873 31, 81, 12, 12, 12, 12, 12, 12, 12, 32,
874 17, 17, 17, 17, 31, 35, 17, 39, 33, 3,
875 33, 78, 222, 4, 5, 11, 11, 33, 35, 5,
876 18, 18, 18, 18, 83, 79, 18, 5, 5, 5,
877 5, 5, 5, 5, 76, 12, 12, 9, 10, 96,
878 5, 5, 5, 5, 5, 5, 5, 5, 34, 34,
880 34, 5, 76, 5, 34, 34, 81, 5, 5, 17,
881 5, 5, 80, 95, 41, 740, 82, 5, 78, 5,
882 41, 41, 5, 5, 84, 41, 41, 5, 78, 18,
883 41, 85, 79, 222, 5, 5, 79, 5, 93, 5,
884 86, 5, 88, 5, 6, 55, 55, 55, 55, 6,
885 29, 29, 29, 29, 29, 29, 29, 6, 6, 6,
886 6, 6, 6, 6, 50, 50, 50, 50, 50, 50,
887 6, 6, 6, 6, 6, 6, 6, 6, 82, 80,
888 135, 6, 135, 6, 82, 82, 95, 6, 6, 135,
889 6, 6, 102, 85, 84, 133, 102, 6, 137, 6,
891 141, 86, 6, 6, 109, 109, 88, 6, 93, 133,
892 102, 137, 233, 233, 6, 6, 252, 6, 252, 6,
893 141, 6, 739, 6, 7, 7, 7, 7, 7, 7,
894 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
895 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
896 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
897 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
898 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
899 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
900 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
902 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
903 7, 7, 7, 7, 7, 13, 381, 13, 104, 104,
904 104, 104, 13, 174, 104, 13, 738, 13, 13, 381,
905 13, 13, 13, 13, 13, 13, 13, 113, 113, 13,
906 111, 111, 13, 110, 110, 174, 65, 120, 65, 65,
907 65, 65, 65, 65, 65, 66, 121, 66, 66, 66,
908 66, 66, 66, 66, 87, 112, 112, 128, 128, 128,
909 128, 215, 216, 13, 13, 13, 13, 13, 13, 13,
910 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
911 13, 13, 13, 13, 13, 13, 13, 13, 13, 113,
913 110, 13, 15, 15, 120, 134, 65, 15, 217, 111,
914 15, 228, 15, 15, 65, 15, 15, 15, 15, 15,
915 15, 15, 134, 15, 15, 121, 112, 15, 87, 216,
916 273, 263, 99, 735, 87, 99, 99, 99, 99, 99,
917 99, 99, 273, 87, 215, 263, 99, 131, 131, 131,
918 131, 131, 131, 131, 270, 15, 418, 273, 15, 15,
919 270, 418, 15, 15, 15, 264, 264, 15, 15, 264,
920 15, 15, 228, 15, 274, 15, 270, 15, 274, 734,
921 15, 264, 217, 15, 15, 15, 15, 19, 19, 19,
922 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
924 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
925 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
926 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
927 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
928 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
929 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
930 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
931 19, 19, 19, 19, 19, 19, 19, 19, 100, 136,
932 136, 136, 279, 279, 224, 136, 136, 101, 100, 733,
933 100, 100, 100, 100, 100, 100, 100, 101, 107, 101,
935 101, 101, 101, 101, 101, 101, 281, 281, 107, 220,
936 107, 107, 107, 107, 107, 107, 107, 143, 167, 167,
937 167, 167, 227, 143, 143, 225, 732, 219, 143, 143,
938 230, 324, 231, 143, 152, 152, 152, 152, 152, 152,
939 161, 161, 161, 161, 161, 161, 161, 731, 100, 192,
940 192, 192, 192, 192, 192, 218, 100, 108, 224, 108,
941 194, 194, 194, 194, 200, 200, 200, 200, 223, 220,
942 108, 203, 203, 203, 203, 203, 203, 203, 205, 205,
943 205, 205, 205, 205, 108, 225, 108, 108, 324, 108,
944 326, 227, 108, 231, 108, 108, 108, 108, 108, 108,
946 219, 230, 108, 108, 108, 204, 108, 204, 204, 204,
947 204, 204, 204, 204, 108, 329, 275, 218, 108, 282,
948 282, 108, 280, 280, 283, 283, 286, 218, 275, 322,
949 223, 730, 108, 245, 248, 248, 248, 248, 248, 248,
950 248, 223, 223, 245, 246, 245, 245, 245, 245, 245,
951 245, 245, 323, 249, 246, 326, 246, 246, 246, 246,
952 246, 246, 246, 249, 331, 249, 249, 249, 249, 249,
953 249, 249, 250, 250, 250, 250, 250, 250, 257, 257,
954 257, 257, 257, 257, 257, 329, 729, 269, 269, 334,
955 322, 328, 258, 282, 336, 280, 327, 330, 325, 286,
957 332, 335, 258, 245, 258, 258, 258, 258, 258, 258,
958 258, 245, 262, 269, 313, 313, 313, 313, 314, 314,
959 314, 314, 262, 337, 338, 323, 262, 315, 315, 315,
960 315, 262, 316, 316, 316, 316, 340, 340, 331, 342,
961 342, 262, 317, 317, 317, 317, 317, 317, 317, 318,
962 318, 318, 318, 318, 318, 325, 328, 327, 335, 317,
963 402, 332, 330, 336, 334, 348, 339, 339, 339, 339,
964 346, 346, 346, 346, 346, 346, 380, 348, 348, 348,
965 348, 348, 348, 348, 337, 363, 395, 395, 384, 404,
966 363, 317, 384, 405, 348, 380, 338, 339, 396, 396,
968 339, 363, 407, 408, 349, 339, 409, 411, 410, 339,
969 398, 398, 398, 398, 412, 339, 349, 349, 349, 349,
970 349, 349, 358, 413, 416, 448, 348, 448, 482, 417,
971 417, 417, 417, 402, 358, 358, 358, 358, 358, 358,
972 358, 419, 419, 419, 419, 471, 471, 395, 399, 476,
973 399, 358, 477, 399, 399, 399, 399, 399, 399, 399,
974 417, 484, 728, 417, 404, 410, 478, 479, 417, 405,
975 727, 407, 417, 419, 481, 408, 726, 480, 417, 411,
976 725, 412, 724, 358, 409, 416, 420, 420, 420, 420,
977 482, 413, 421, 421, 421, 421, 422, 422, 422, 422,
979 423, 423, 423, 423, 424, 424, 424, 424, 427, 472,
980 472, 472, 472, 472, 472, 472, 476, 477, 483, 537,
981 427, 427, 427, 427, 427, 427, 484, 421, 430, 478,
982 430, 423, 723, 430, 430, 430, 430, 430, 430, 430,
983 422, 479, 722, 481, 480, 531, 438, 719, 438, 480,
984 424, 438, 438, 438, 438, 438, 438, 438, 473, 473,
985 473, 473, 473, 473, 473, 486, 486, 486, 486, 487,
986 487, 487, 487, 488, 488, 488, 488, 718, 537, 483,
987 489, 489, 489, 489, 490, 490, 490, 490, 491, 491,
988 491, 491, 492, 492, 492, 492, 495, 495, 495, 495,
990 495, 495, 495, 486, 532, 538, 525, 540, 487, 500,
991 500, 500, 500, 500, 500, 500, 489, 496, 579, 531,
992 548, 548, 488, 581, 501, 491, 490, 492, 525, 496,
993 496, 496, 496, 496, 496, 496, 501, 501, 501, 501,
994 501, 501, 501, 526, 526, 526, 526, 526, 526, 526,
995 541, 541, 541, 541, 542, 542, 542, 542, 543, 543,
996 543, 543, 538, 580, 544, 544, 544, 544, 545, 545,
997 545, 545, 582, 532, 590, 590, 540, 546, 546, 546,
998 546, 579, 581, 541, 547, 547, 547, 547, 573, 573,
999 573, 573, 573, 573, 573, 592, 592, 716, 542, 583,
1001 583, 583, 583, 584, 584, 584, 584, 545, 543, 544,
1002 585, 585, 585, 585, 616, 715, 546, 547, 586, 586,
1003 586, 586, 685, 685, 580, 587, 587, 587, 587, 588,
1004 588, 588, 588, 713, 606, 582, 685, 712, 584, 589,
1005 589, 589, 589, 606, 606, 618, 618, 618, 618, 619,
1006 619, 619, 619, 620, 620, 620, 620, 672, 585, 710,
1007 583, 693, 588, 777, 777, 701, 586, 693, 709, 587,
1008 621, 621, 621, 621, 693, 616, 705, 704, 589, 622,
1009 622, 622, 622, 701, 620, 623, 623, 623, 623, 699,
1010 701, 618, 624, 624, 624, 624, 647, 647, 647, 647,
1012 649, 649, 649, 649, 698, 621, 650, 650, 650, 650,
1013 651, 651, 651, 651, 622, 652, 652, 652, 652, 653,
1014 653, 653, 653, 624, 703, 670, 670, 670, 670, 695,
1015 672, 703, 692, 649, 673, 673, 673, 673, 674, 674,
1016 674, 674, 691, 690, 647, 683, 623, 675, 675, 675,
1017 675, 676, 676, 676, 676, 650, 670, 684, 684, 684,
1018 684, 653, 686, 686, 686, 686, 652, 687, 687, 687,
1019 687, 688, 688, 688, 688, 689, 689, 689, 689, 697,
1020 706, 696, 702, 707, 673, 696, 682, 711, 674, 702,
1021 676, 675, 696, 697, 684, 720, 702, 711, 707, 717,
1023 697, 714, 720, 679, 711, 707, 714, 688, 750, 671,
1024 750, 717, 767, 714, 767, 774, 750, 774, 717, 668,
1025 767, 667, 666, 774, 689, 659, 706, 737, 657, 656,
1026 655, 689, 648, 706, 736, 736, 736, 736, 736, 736,
1027 736, 646, 737, 737, 737, 737, 737, 737, 737, 743,
1028 743, 743, 743, 743, 743, 743, 743, 743, 743, 743,
1029 743, 743, 743, 743, 743, 743, 743, 743, 743, 743,
1030 743, 744, 744, 744, 744, 744, 744, 744, 744, 744,
1031 744, 744, 744, 744, 744, 744, 744, 744, 744, 744,
1032 744, 744, 744, 745, 745, 745, 745, 745, 745, 745,
1034 745, 745, 745, 745, 745, 745, 745, 745, 745, 745,
1035 745, 745, 745, 745, 745, 746, 746, 746, 746, 746,
1036 746, 746, 746, 746, 746, 746, 746, 746, 746, 746,
1037 746, 746, 746, 746, 746, 746, 746, 747, 747, 747,
1038 747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
1039 747, 747, 747, 747, 747, 747, 747, 747, 747, 748,
1040 748, 748, 748, 748, 748, 748, 748, 748, 748, 748,
1041 748, 644, 748, 748, 748, 748, 748, 748, 749, 749,
1042 749, 749, 749, 749, 751, 643, 751, 751, 642, 641,
1043 640, 751, 639, 638, 636, 751, 752, 752, 752, 752,
1045 752, 752, 752, 752, 752, 752, 752, 752, 635, 752,
1046 752, 752, 752, 752, 752, 753, 753, 753, 753, 753,
1047 753, 753, 753, 753, 753, 753, 753, 634, 753, 753,
1048 753, 753, 753, 753, 754, 781, 754, 781, 754, 633,
1049 754, 754, 630, 781, 754, 628, 754, 754, 755, 755,
1050 627, 626, 755, 625, 755, 755, 756, 756, 756, 756,
1051 756, 756, 756, 756, 756, 617, 756, 756, 756, 756,
1052 756, 756, 756, 756, 756, 756, 615, 756, 757, 757,
1053 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
1054 757, 757, 757, 757, 757, 757, 757, 757, 614, 757,
1056 758, 758, 758, 758, 758, 758, 758, 758, 758, 758,
1057 758, 758, 758, 758, 758, 758, 758, 758, 758, 758,
1058 758, 759, 759, 759, 759, 759, 759, 759, 759, 759,
1059 759, 759, 759, 613, 759, 759, 759, 759, 759, 759,
1060 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
1061 760, 760, 612, 760, 760, 760, 760, 760, 760, 761,
1062 761, 610, 608, 607, 761, 761, 761, 762, 762, 762,
1063 762, 762, 605, 762, 762, 762, 762, 762, 762, 604,
1064 762, 762, 762, 762, 762, 762, 763, 763, 763, 603,
1065 763, 602, 763, 763, 601, 600, 763, 599, 763, 763,
1067 764, 764, 764, 764, 764, 764, 764, 764, 764, 764,
1068 764, 764, 598, 764, 764, 764, 764, 764, 764, 765,
1069 765, 765, 765, 765, 765, 765, 765, 765, 765, 765,
1070 765, 597, 765, 765, 765, 765, 765, 765, 766, 766,
1071 766, 766, 766, 766, 766, 766, 766, 766, 766, 766,
1072 766, 766, 766, 766, 766, 766, 766, 766, 766, 766,
1073 768, 596, 768, 595, 768, 768, 594, 593, 768, 578,
1074 768, 768, 769, 769, 769, 769, 769, 769, 769, 769,
1075 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
1076 769, 769, 769, 769, 770, 770, 770, 770, 770, 770,
1078 770, 770, 770, 577, 770, 770, 770, 770, 770, 770,
1079 770, 770, 770, 770, 575, 770, 771, 771, 771, 771,
1080 771, 771, 771, 771, 771, 574, 771, 771, 771, 771,
1081 771, 771, 771, 771, 771, 771, 772, 772, 772, 772,
1082 772, 772, 772, 772, 772, 571, 772, 772, 772, 772,
1083 772, 772, 772, 772, 772, 772, 773, 773, 773, 773,
1084 773, 773, 773, 773, 773, 773, 773, 773, 570, 773,
1085 773, 773, 773, 773, 773, 775, 568, 775, 566, 775,
1086 565, 775, 775, 563, 562, 775, 561, 775, 775, 776,
1087 776, 776, 776, 776, 776, 776, 776, 560, 776, 776,
1089 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
1090 776, 778, 778, 778, 558, 778, 556, 778, 778, 555,
1091 554, 778, 553, 778, 778, 779, 779, 779, 779, 779,
1092 779, 779, 779, 779, 779, 779, 779, 552, 779, 779,
1093 779, 779, 779, 779, 780, 780, 780, 551, 550, 549,
1094 539, 536, 535, 534, 533, 780, 780, 530, 529, 780,
1095 782, 528, 782, 527, 782, 782, 524, 523, 782, 522,
1096 782, 782, 783, 783, 783, 783, 783, 783, 783, 783,
1097 783, 783, 783, 783, 783, 783, 783, 783, 783, 783,
1098 783, 783, 783, 783, 784, 784, 521, 784, 784, 784,
1100 784, 784, 784, 784, 784, 784, 784, 784, 784, 784,
1101 784, 784, 784, 784, 784, 784, 520, 519, 517, 516,
1102 515, 514, 513, 512, 511, 510, 509, 508, 507, 505,
1103 504, 502, 498, 497, 493, 485, 475, 469, 468, 467,
1104 466, 465, 464, 463, 462, 461, 460, 459, 458, 456,
1105 454, 453, 452, 451, 450, 449, 447, 446, 445, 444,
1106 443, 442, 441, 440, 436, 434, 433, 429, 428, 425,
1107 415, 414, 406, 403, 401, 400, 393, 392, 390, 389,
1108 388, 386, 385, 383, 378, 377, 376, 374, 372, 371,
1109 370, 369, 368, 367, 365, 364, 362, 361, 357, 356,
1111 355, 354, 353, 352, 351, 350, 345, 343, 333, 321,
1112 311, 288, 287, 285, 277, 276, 272, 271, 268, 267,
1113 266, 265, 261, 260, 259, 256, 255, 253, 244, 243,
1114 242, 241, 237, 234, 232, 229, 226, 221, 214, 213,
1115 211, 198, 196, 188, 187, 186, 184, 181, 180, 173,
1116 172, 171, 169, 168, 165, 163, 162, 159, 158, 157,
1117 145, 144, 142, 140, 139, 138, 132, 130, 126, 125,
1118 124, 122, 119, 118, 117, 116, 114, 103, 98, 97,
1119 89, 72, 70, 69, 67, 64, 58, 57, 43, 42,
1120 40, 38, 37, 36, 30, 25, 24, 21, 8, 742,
1122 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1123 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1124 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1125 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1126 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1127 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1128 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1129 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1130 742, 742, 742, 742, 742, 742, 742, 742, 742, 742,
1135 static yy_state_type yy_last_accepting_state;
1136 static char *yy_last_accepting_cpos;
1138 /* The intent behind this definition is that it'll catch
1139 * any uses of REJECT which flex missed.
1141 #define REJECT reject_used_but_not_detected
1142 #define yymore() yymore_used_but_not_detected
1143 #define YY_MORE_ADJ 0
1145 #line 1 "yaccParser/hslexer.flex"
1147 #line 2 "yaccParser/hslexer.flex"
1148 /**********************************************************************
1151 * LEX grammar for Haskell. *
1152 * ------------------------ *
1154 * (c) Copyright K. Hammond, University of Glasgow, *
1155 * 10th. February 1989 *
1157 * Modification History *
1158 * -------------------- *
1160 * 22/08/91 kh Initial Haskell 1.1 version. *
1161 * 18/10/91 kh Added 'ccall'. *
1162 * 19/11/91 kh Tidied generally. *
1163 * 04/12/91 kh Added Int#. *
1164 * 31/01/92 kh Haskell 1.2 version. *
1165 * 24/04/92 ps Added 'scc'. *
1166 * 03/06/92 kh Changed Infix/Prelude Handling. *
1167 * 23/08/93 jsm Changed to support flex *
1174 **********************************************************************/
1176 #include "../../includes/config.h"
1180 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
1182 /* An ANSI string.h and pre-ANSI memory.h might conflict. */
1183 #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
1185 #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
1186 #define index strchr
1187 #define rindex strrchr
1188 #define bcopy(s, d, n) memcpy ((d), (s), (n))
1189 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
1190 #define bzero(s, n) memset ((s), 0, (n))
1191 #else /* not STDC_HEADERS and not HAVE_STRING_H */
1192 #include <strings.h>
1193 /* memory.h and strings.h conflict on some systems. */
1194 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
1196 #include "hspincl.h"
1197 #include "hsparser.tab.h"
1198 #include "constants.h"
1201 /* Our substitute for <ctype.h> */
1210 #define _isconstr(s) (CharTable[*s]&(_C))
1211 BOOLEAN isconstr PROTO((char *)); /* fwd decl */
1213 static unsigned char CharTable[NCHARS] = {
1214 /* nul */ 0, 0, 0, 0, 0, 0, 0, 0,
1215 /* bs */ 0, _S, _S, _S, _S, 0, 0, 0,
1216 /* dle */ 0, 0, 0, 0, 0, 0, 0, 0,
1217 /* can */ 0, 0, 0, 0, 0, 0, 0, 0,
1218 /* sp */ _S, 0, 0, 0, 0, 0, 0, 0,
1219 /* '(' */ 0, 0, 0, 0, 0, 0, 0, 0,
1220 /* '0' */ _D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,
1221 /* '8' */ _D|_H, _D|_H, _C, 0, 0, 0, 0, 0,
1222 /* '@' */ 0, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _C,
1223 /* 'H' */ _C, _C, _C, _C, _C, _C, _C, _C,
1224 /* 'P' */ _C, _C, _C, _C, _C, _C, _C, _C,
1225 /* 'X' */ _C, _C, _C, 0, 0, 0, 0, 0,
1226 /* '`' */ 0, _H, _H, _H, _H, _H, _H, 0,
1227 /* 'h' */ 0, 0, 0, 0, 0, 0, 0, 0,
1228 /* 'p' */ 0, 0, 0, 0, 0, 0, 0, 0,
1229 /* 'x' */ 0, 0, 0, 0, 0, 0, 0, 0,
1231 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1232 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1233 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1234 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1235 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1236 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1237 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1238 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1239 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1240 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1241 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1242 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1243 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1244 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1245 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1246 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1249 /**********************************************************************
1255 **********************************************************************/
1257 char *input_filename = NULL; /* Always points to a dynamically allocated string */
1260 * For my own sanity, things that are not part of the flex skeleton
1261 * have been renamed as hsXXXXX rather than yyXXXXX. --JSM
1264 static int hslineno = 0; /* Line number at end of token */
1265 int hsplineno = 0; /* Line number at end of previous token */
1267 static int hscolno = 0; /* Column number at end of token */
1268 int hspcolno = 0; /* Column number at end of previous token */
1269 static int hsmlcolno = 0; /* Column number for multiple-rule lexemes */
1271 int startlineno = 0; /* The line number where something starts */
1272 int endlineno = 0; /* The line number where something ends */
1274 static BOOLEAN noGap = TRUE; /* For checking string gaps */
1275 static BOOLEAN forgetindent = FALSE; /* Don't bother applying indentation rules */
1277 static int nested_comments; /* For counting comment nesting depth */
1279 /* Hacky definition of yywrap: see flex doc.
1281 If we don't do this, then we'll have to get the default
1282 yywrap from the flex library, which is often something
1283 we are not good at locating. This avoids that difficulty.
1284 (Besides which, this is the way old flexes (pre 2.4.x) did it.)
1289 /* Essential forward declarations */
1291 static void hsnewid PROTO((char *, int));
1292 static void layout_input PROTO((char *, int));
1293 static void cleartext (NO_ARGS);
1294 static void addtext PROTO((char *, unsigned));
1295 static void addchar PROTO((char));
1296 static char *fetchtext PROTO((unsigned *));
1297 static void new_filename PROTO((char *));
1298 static int Return PROTO((int));
1299 static void hsentercontext PROTO((int));
1301 /* Special file handling for IMPORTS */
1302 /* Note: imports only ever go *one deep* (hence no need for a stack) WDP 94/09 */
1304 static YY_BUFFER_STATE hsbuf_save = NULL; /* Saved input buffer */
1305 static char *filename_save; /* File Name */
1306 static int hslineno_save = 0, /* Line Number */
1307 hsplineno_save = 0, /* Line Number of Prev. token */
1308 hscolno_save = 0, /* Indentation */
1309 hspcolno_save = 0; /* Left Indentation */
1310 static short icontexts_save = 0; /* Indent Context Level */
1312 static BOOLEAN etags_save; /* saved: whether doing etags stuff or not */
1313 extern BOOLEAN etags; /* that which is saved */
1315 extern BOOLEAN nonstandardFlag; /* Glasgow extensions allowed */
1317 static BOOLEAN in_interface = FALSE; /* TRUE if we are reading a .hi file */
1319 extern BOOLEAN ignorePragmas; /* True when we should ignore pragmas */
1320 extern int minAcceptablePragmaVersion; /* see documentation in main.c */
1321 extern int maxAcceptablePragmaVersion;
1322 extern int thisIfacePragmaVersion;
1324 static int hssttok = -1; /* Stacked Token: -1 -- no token; -ve -- ";"
1325 * inserted before token +ve -- "}" inserted before
1328 short icontexts = 0; /* Which context we're in */
1333 Table of indentations: right bit indicates whether to use
1334 indentation rules (1 = use rules; 0 = ignore)
1337 push one of these "contexts" at every "case" or "where"; the right bit says
1338 whether user supplied braces, etc., or not. pop appropriately (hsendindent).
1340 ALSO, a push/pop when enter/exit a new file (e.g., on importing). A -1 is
1341 pushed (the "column" for "module", "interface" and EOF). The -1 from the initial
1342 push is shown just below.
1347 static short indenttab[MAX_CONTEXTS] = {-1};
1349 #define INDENTPT (indenttab[icontexts]>>1)
1350 #define INDENTON (indenttab[icontexts]&1)
1352 #define RETURN(tok) return(Return(tok))
1355 #define YY_DECL int yylex1()
1357 /* We should not peek at yy_act, but flex calls us even for the internal action
1358 triggered on 'end-of-buffer' (This is not true of flex 2.4.4 and up, but
1359 to support older versions of flex, we'll continue to peek for now.
1361 #define YY_USER_ACTION \
1362 if (yy_act != YY_END_OF_BUFFER) layout_input(yytext, yyleng);
1366 #define YY_BREAK if (etags) fprintf(stderr,"%d %d / %d %d / %d\n",hsplineno,hspcolno,hslineno,hscolno,startlineno); break;
1369 /* Each time we enter a new start state, we push it onto the state stack.
1370 Note that the rules do not allow us to underflow or overflow the stack.
1371 (At least, they shouldn't.) The maximum expected depth is 4:
1372 0: Code -> 1: String -> 2: StringEsc -> 3: Comment
1374 static int StateStack[5];
1375 static int StateDepth = -1;
1378 #define PUSH_STATE(n) do {\
1379 fprintf(stderr,"Pushing %d (%d)\n", n, StateDepth + 1);\
1380 StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1381 #define POP_STATE do {--StateDepth;\
1382 fprintf(stderr,"Popping %d (%d)\n", StateStack[StateDepth], StateDepth);\
1383 BEGIN(StateStack[StateDepth]);} while(0)
1385 #define PUSH_STATE(n) do {StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1386 #define POP_STATE do {--StateDepth; BEGIN(StateStack[StateDepth]);} while(0)
1389 /* The start states are:
1390 Code -- normal Haskell code (principal lexer)
1391 GlaExt -- Haskell code with Glasgow extensions
1392 Comment -- Nested comment processing
1393 String -- Inside a string literal with backslashes
1394 StringEsc -- Immediately following a backslash in a string literal
1395 Char -- Inside a character literal with backslashes
1396 CharEsc -- Immediately following a backslash in a character literal
1398 Note that the INITIAL state is unused. Also note that these states
1399 are _exclusive_. All rules should be prefixed with an appropriate
1400 list of start states.
1408 #define UserPragma 7
1413 /* Macros after this point can all be overridden by user definitions in
1417 #ifndef YY_SKIP_YYWRAP
1419 extern "C" int yywrap YY_PROTO(( void ));
1421 extern int yywrap YY_PROTO(( void ));
1426 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1430 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1435 static int yyinput YY_PROTO(( void ));
1437 static int input YY_PROTO(( void ));
1442 static int yy_start_stack_ptr = 0;
1443 static int yy_start_stack_depth = 0;
1444 static int *yy_start_stack = 0;
1445 #ifndef YY_NO_PUSH_STATE
1446 static void yy_push_state YY_PROTO(( int new_state ));
1448 #ifndef YY_NO_POP_STATE
1449 static void yy_pop_state YY_PROTO(( void ));
1451 #ifndef YY_NO_TOP_STATE
1452 static int yy_top_state YY_PROTO(( void ));
1456 #define YY_NO_PUSH_STATE 1
1457 #define YY_NO_POP_STATE 1
1458 #define YY_NO_TOP_STATE 1
1461 #ifdef YY_MALLOC_DECL
1469 /* Just try to get by without declaring the routines. This will fail
1470 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1471 * or sizeof(void*) != sizeof(int).
1476 /* Amount of stuff to slurp up with each read. */
1477 #ifndef YY_READ_BUF_SIZE
1478 #define YY_READ_BUF_SIZE 8192
1481 /* Copy whatever the last rule matched to the standard output. */
1484 /* This used to be an fputs(), but since the string might contain NUL's,
1485 * we now use fwrite().
1487 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1490 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1491 * is returned in "result".
1494 #define YY_INPUT(buf,result,max_size) \
1495 if ( yy_current_buffer->yy_is_interactive ) \
1498 for ( n = 0; n < max_size && \
1499 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1500 buf[n] = (char) c; \
1502 buf[n++] = (char) c; \
1503 if ( c == EOF && ferror( yyin ) ) \
1504 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1507 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1508 && ferror( yyin ) ) \
1509 YY_FATAL_ERROR( "input in flex scanner failed" );
1512 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1513 * we don't want an extra ';' after the "return" because that will cause
1514 * some compilers to complain about unreachable statements.
1517 #define yyterminate() return YY_NULL
1520 /* Number of entries by which start-condition stack grows. */
1521 #ifndef YY_START_STACK_INCR
1522 #define YY_START_STACK_INCR 25
1525 /* Report a fatal error. */
1526 #ifndef YY_FATAL_ERROR
1527 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1530 /* Default declaration of generated scanner - a define so the user can
1531 * easily add parameters.
1534 #define YY_DECL int yylex YY_PROTO(( void ))
1537 /* Code executed at the beginning of each rule, after yytext and yyleng
1540 #ifndef YY_USER_ACTION
1541 #define YY_USER_ACTION
1544 /* Code executed at the end of each rule. */
1546 #define YY_BREAK break;
1549 #define YY_RULE_SETUP \
1551 yy_current_buffer->yy_at_bol = \
1552 (yytext[yyleng - 1] == '\n'); \
1557 register yy_state_type yy_current_state;
1558 register char *yy_cp, *yy_bp;
1559 register int yy_act;
1561 #line 277 "yaccParser/hslexer.flex"
1566 * Special GHC pragma rules. Do we need a start state for interface files,
1567 * so these won't be matched in source files? --JSM
1581 yy_start = 1; /* first start state */
1589 if ( ! yy_current_buffer )
1591 yy_create_buffer( yyin, YY_BUF_SIZE );
1593 yy_load_buffer_state();
1596 while ( 1 ) /* loops until end-of-file is reached */
1600 /* Support of yytext. */
1601 *yy_cp = yy_hold_char;
1603 /* yy_bp points to the position in yy_ch_buf of the start of
1608 yy_current_state = yy_start;
1609 yy_current_state += YY_AT_BOL();
1613 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1614 if ( yy_accept[yy_current_state] )
1616 yy_last_accepting_state = yy_current_state;
1617 yy_last_accepting_cpos = yy_cp;
1619 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1621 yy_current_state = (int) yy_def[yy_current_state];
1622 if ( yy_current_state >= 743 )
1623 yy_c = yy_meta[(unsigned int) yy_c];
1625 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1628 while ( yy_base[yy_current_state] != 2300 );
1631 yy_act = yy_accept[yy_current_state];
1633 { /* have to back up */
1634 yy_cp = yy_last_accepting_cpos;
1635 yy_current_state = yy_last_accepting_state;
1636 yy_act = yy_accept[yy_current_state];
1639 YY_DO_BEFORE_ACTION;
1642 do_action: /* This label is used only to access EOF actions. */
1646 { /* beginning of action switch */
1647 case 0: /* must back up */
1648 /* undo the effects of YY_DO_BEFORE_ACTION */
1649 *yy_cp = yy_hold_char;
1650 yy_cp = yy_last_accepting_cpos;
1651 yy_current_state = yy_last_accepting_state;
1652 goto yy_find_action;
1656 #line 286 "yaccParser/hslexer.flex"
1658 char tempf[FILENAME_SIZE];
1659 sscanf(yytext+1, "%d \"%[^\"]", &hslineno, tempf);
1660 new_filename(tempf);
1661 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1666 #line 293 "yaccParser/hslexer.flex"
1668 char tempf[FILENAME_SIZE];
1669 sscanf(yytext+5, "%d \"%[^\"]", &hslineno, tempf);
1670 new_filename(tempf);
1671 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1676 #line 300 "yaccParser/hslexer.flex"
1678 /* partain: pragma-style line directive */
1679 char tempf[FILENAME_SIZE];
1680 sscanf(yytext+9, "%d \"%[^\"]", &hslineno, tempf);
1681 new_filename(tempf);
1682 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1687 #line 307 "yaccParser/hslexer.flex"
1689 sscanf(yytext+33,"%d ",&thisIfacePragmaVersion);
1694 #line 310 "yaccParser/hslexer.flex"
1696 if ( ignorePragmas ||
1697 thisIfacePragmaVersion < minAcceptablePragmaVersion ||
1698 thisIfacePragmaVersion > maxAcceptablePragmaVersion) {
1699 nested_comments = 1;
1700 PUSH_STATE(Comment);
1702 PUSH_STATE(GhcPragma);
1709 #line 321 "yaccParser/hslexer.flex"
1710 { RETURN(NO_PRAGMA); }
1714 #line 322 "yaccParser/hslexer.flex"
1715 { RETURN(NOINFO_PRAGMA); }
1719 #line 323 "yaccParser/hslexer.flex"
1720 { RETURN(ABSTRACT_PRAGMA); }
1724 #line 324 "yaccParser/hslexer.flex"
1725 { RETURN(DEFOREST_PRAGMA); }
1729 #line 325 "yaccParser/hslexer.flex"
1730 { RETURN(SPECIALISE_PRAGMA); }
1734 #line 326 "yaccParser/hslexer.flex"
1735 { RETURN(MODNAME_PRAGMA); }
1739 #line 327 "yaccParser/hslexer.flex"
1740 { RETURN(ARITY_PRAGMA); }
1744 #line 328 "yaccParser/hslexer.flex"
1745 { RETURN(UPDATE_PRAGMA); }
1749 #line 329 "yaccParser/hslexer.flex"
1750 { RETURN(STRICTNESS_PRAGMA); }
1754 #line 330 "yaccParser/hslexer.flex"
1755 { RETURN(KIND_PRAGMA); }
1759 #line 331 "yaccParser/hslexer.flex"
1760 { RETURN(MAGIC_UNFOLDING_PRAGMA); }
1764 #line 332 "yaccParser/hslexer.flex"
1765 { RETURN(UNFOLDING_PRAGMA); }
1769 #line 334 "yaccParser/hslexer.flex"
1774 #line 335 "yaccParser/hslexer.flex"
1779 #line 336 "yaccParser/hslexer.flex"
1784 #line 337 "yaccParser/hslexer.flex"
1785 { RETURN(COTYAPP); }
1789 #line 338 "yaccParser/hslexer.flex"
1790 { RETURN(CO_ALG_ALTS); }
1794 #line 339 "yaccParser/hslexer.flex"
1795 { RETURN(CO_PRIM_ALTS); }
1799 #line 340 "yaccParser/hslexer.flex"
1800 { RETURN(CO_NO_DEFAULT); }
1804 #line 341 "yaccParser/hslexer.flex"
1805 { RETURN(CO_LETREC); }
1809 #line 343 "yaccParser/hslexer.flex"
1810 { RETURN(CO_PRELUDE_DICTS_CC); }
1814 #line 344 "yaccParser/hslexer.flex"
1815 { RETURN(CO_ALL_DICTS_CC); }
1819 #line 345 "yaccParser/hslexer.flex"
1820 { RETURN(CO_USER_CC); }
1824 #line 346 "yaccParser/hslexer.flex"
1825 { RETURN(CO_AUTO_CC); }
1829 #line 347 "yaccParser/hslexer.flex"
1830 { RETURN(CO_DICT_CC); }
1834 #line 349 "yaccParser/hslexer.flex"
1835 { RETURN(CO_DUPD_CC); }
1839 #line 350 "yaccParser/hslexer.flex"
1840 { RETURN(CO_CAF_CC); }
1844 #line 352 "yaccParser/hslexer.flex"
1845 { RETURN(CO_SDSEL_ID); }
1849 #line 353 "yaccParser/hslexer.flex"
1850 { RETURN(CO_METH_ID); }
1854 #line 354 "yaccParser/hslexer.flex"
1855 { RETURN(CO_DEFM_ID); }
1859 #line 355 "yaccParser/hslexer.flex"
1860 { RETURN(CO_DFUN_ID); }
1864 #line 356 "yaccParser/hslexer.flex"
1865 { RETURN(CO_CONSTM_ID); }
1869 #line 357 "yaccParser/hslexer.flex"
1870 { RETURN(CO_SPEC_ID); }
1874 #line 358 "yaccParser/hslexer.flex"
1875 { RETURN(CO_WRKR_ID); }
1879 #line 359 "yaccParser/hslexer.flex"
1880 { RETURN(CO_ORIG_NM); /* fully-qualified original name*/ }
1884 #line 361 "yaccParser/hslexer.flex"
1885 { RETURN(UNFOLD_ALWAYS); }
1889 #line 362 "yaccParser/hslexer.flex"
1890 { RETURN(UNFOLD_IF_ARGS); }
1894 #line 364 "yaccParser/hslexer.flex"
1895 { RETURN(NOREP_INTEGER); }
1899 #line 365 "yaccParser/hslexer.flex"
1900 { RETURN(NOREP_RATIONAL); }
1904 #line 366 "yaccParser/hslexer.flex"
1905 { RETURN(NOREP_STRING); }
1909 #line 368 "yaccParser/hslexer.flex"
1910 { POP_STATE; RETURN(END_PRAGMA); }
1914 #line 370 "yaccParser/hslexer.flex"
1916 PUSH_STATE(UserPragma);
1917 RETURN(SPECIALISE_UPRAGMA);
1922 #line 374 "yaccParser/hslexer.flex"
1924 PUSH_STATE(UserPragma);
1925 RETURN(INLINE_UPRAGMA);
1930 #line 378 "yaccParser/hslexer.flex"
1932 PUSH_STATE(UserPragma);
1933 RETURN(MAGIC_UNFOLDING_UPRAGMA);
1938 #line 382 "yaccParser/hslexer.flex"
1940 PUSH_STATE(UserPragma);
1941 RETURN(DEFOREST_UPRAGMA);
1946 #line 386 "yaccParser/hslexer.flex"
1948 PUSH_STATE(UserPragma);
1949 RETURN(ABSTRACT_UPRAGMA);
1954 #line 390 "yaccParser/hslexer.flex"
1956 fprintf(stderr, "Warning: \"%s\", line %d: Unrecognised pragma '",
1957 input_filename, hsplineno);
1958 format_string(stderr, (unsigned char *) yytext, yyleng);
1959 fputs("'\n", stderr);
1960 nested_comments = 1;
1961 PUSH_STATE(Comment);
1966 #line 398 "yaccParser/hslexer.flex"
1967 { POP_STATE; RETURN(END_UPRAGMA); }
1971 * Haskell keywords. `scc' is actually a Glasgow extension, but it is
1972 * intentionally accepted as a keyword even for normal <Code>.
1977 #line 407 "yaccParser/hslexer.flex"
1982 #line 408 "yaccParser/hslexer.flex"
1987 #line 409 "yaccParser/hslexer.flex"
1992 #line 410 "yaccParser/hslexer.flex"
1993 { RETURN(DEFAULT); }
1997 #line 411 "yaccParser/hslexer.flex"
1998 { RETURN(DERIVING); }
2002 #line 412 "yaccParser/hslexer.flex"
2007 #line 413 "yaccParser/hslexer.flex"
2012 #line 414 "yaccParser/hslexer.flex"
2017 #line 415 "yaccParser/hslexer.flex"
2022 #line 416 "yaccParser/hslexer.flex"
2027 #line 417 "yaccParser/hslexer.flex"
2032 #line 418 "yaccParser/hslexer.flex"
2037 #line 419 "yaccParser/hslexer.flex"
2038 { RETURN(INSTANCE); }
2042 #line 420 "yaccParser/hslexer.flex"
2043 { RETURN(INTERFACE); }
2047 #line 421 "yaccParser/hslexer.flex"
2052 #line 422 "yaccParser/hslexer.flex"
2057 #line 423 "yaccParser/hslexer.flex"
2058 { RETURN(RENAMING); }
2062 #line 424 "yaccParser/hslexer.flex"
2067 #line 425 "yaccParser/hslexer.flex"
2072 #line 426 "yaccParser/hslexer.flex"
2077 #line 427 "yaccParser/hslexer.flex"
2082 #line 428 "yaccParser/hslexer.flex"
2087 #line 429 "yaccParser/hslexer.flex"
2092 #line 430 "yaccParser/hslexer.flex"
2097 #line 431 "yaccParser/hslexer.flex"
2098 { RETURN(CCALL_GC); }
2102 #line 432 "yaccParser/hslexer.flex"
2107 #line 433 "yaccParser/hslexer.flex"
2108 { RETURN(CASM_GC); }
2112 #line 434 "yaccParser/hslexer.flex"
2117 #line 435 "yaccParser/hslexer.flex"
2122 * Haskell operators. Nothing special about these.
2127 #line 443 "yaccParser/hslexer.flex"
2132 #line 444 "yaccParser/hslexer.flex"
2137 #line 445 "yaccParser/hslexer.flex"
2142 #line 446 "yaccParser/hslexer.flex"
2147 #line 447 "yaccParser/hslexer.flex"
2152 #line 448 "yaccParser/hslexer.flex"
2157 #line 449 "yaccParser/hslexer.flex"
2162 #line 450 "yaccParser/hslexer.flex"
2167 #line 451 "yaccParser/hslexer.flex"
2172 #line 452 "yaccParser/hslexer.flex"
2177 #line 453 "yaccParser/hslexer.flex"
2182 #line 454 "yaccParser/hslexer.flex"
2187 #line 455 "yaccParser/hslexer.flex"
2192 #line 456 "yaccParser/hslexer.flex"
2197 #line 457 "yaccParser/hslexer.flex"
2202 #line 458 "yaccParser/hslexer.flex"
2207 #line 459 "yaccParser/hslexer.flex"
2212 #line 460 "yaccParser/hslexer.flex"
2217 #line 461 "yaccParser/hslexer.flex"
2218 { RETURN(TYLAMBDA); }
2222 #line 462 "yaccParser/hslexer.flex"
2223 { RETURN(WILDCARD); }
2227 #line 463 "yaccParser/hslexer.flex"
2232 #line 464 "yaccParser/hslexer.flex"
2237 #line 465 "yaccParser/hslexer.flex"
2242 * Integers and (for Glasgow extensions) primitive integers. Note that
2243 * we pass all of the text on to the parser, because flex/C can't handle
2244 * arbitrary precision numbers.
2249 #line 475 "yaccParser/hslexer.flex"
2251 yylval.uid = xstrndup(yytext, yyleng - 1);
2257 #line 479 "yaccParser/hslexer.flex"
2259 yylval.uid = xstrndup(yytext, yyleng);
2265 #line 483 "yaccParser/hslexer.flex"
2267 yylval.uid = xstrndup(yytext, yyleng - 1);
2273 #line 487 "yaccParser/hslexer.flex"
2275 yylval.uid = xstrndup(yytext, yyleng);
2281 #line 491 "yaccParser/hslexer.flex"
2283 yylval.uid = xstrndup(yytext, yyleng - 1);
2289 #line 495 "yaccParser/hslexer.flex"
2291 yylval.uid = xstrndup(yytext, yyleng);
2297 * Floats and (for Glasgow extensions) primitive floats/doubles.
2302 #line 506 "yaccParser/hslexer.flex"
2304 yylval.uid = xstrndup(yytext, yyleng - 2);
2310 #line 510 "yaccParser/hslexer.flex"
2312 yylval.uid = xstrndup(yytext, yyleng - 1);
2318 #line 514 "yaccParser/hslexer.flex"
2320 yylval.uid = xstrndup(yytext, yyleng);
2326 * Funky ``foo'' style C literals for Glasgow extensions
2331 #line 525 "yaccParser/hslexer.flex"
2333 hsnewid(yytext + 2, yyleng - 4);
2339 * Identifiers, both variables and operators. The trailing hash is allowed
2340 * for Glasgow extensions.
2345 #line 537 "yaccParser/hslexer.flex"
2346 { hsnewid(yytext, yyleng); RETURN(CONID); }
2350 #line 538 "yaccParser/hslexer.flex"
2351 { hsnewid(yytext, yyleng); RETURN(CONID); }
2355 #line 539 "yaccParser/hslexer.flex"
2356 { hsnewid(yytext, yyleng); RETURN(TYVAR_TEMPLATE_ID); }
2359 /* These SHOULDNAE work in "Code" (sigh) */
2363 #line 544 "yaccParser/hslexer.flex"
2365 if (! (nonstandardFlag || in_interface)) {
2366 char errbuf[ERR_BUF_SIZE];
2367 sprintf(errbuf, "Non-standard identifier (trailing `#'): %s\n", yytext);
2370 hsnewid(yytext, yyleng);
2371 RETURN(_isconstr(yytext) ? CONID : VARID);
2376 #line 553 "yaccParser/hslexer.flex"
2378 if (! (nonstandardFlag || in_interface)) {
2379 char errbuf[ERR_BUF_SIZE];
2380 sprintf(errbuf, "Non-standard identifier (leading underscore): %s\n", yytext);
2383 hsnewid(yytext, yyleng);
2384 RETURN(isconstr(yytext) ? CONID : VARID);
2385 /* NB: ^^^^^^^^ : not the macro! */
2390 #line 563 "yaccParser/hslexer.flex"
2392 hsnewid(yytext, yyleng);
2393 RETURN(_isconstr(yytext) ? CONID : VARID);
2398 #line 567 "yaccParser/hslexer.flex"
2400 hsnewid(yytext, yyleng);
2401 RETURN(_isconstr(yytext) ? CONSYM : VARSYM);
2405 /* Why is `{Id}#` matched this way, and `{Id}` lexed as three tokens? --JSM */
2407 /* Because we can make the former well-behaved (we defined them).
2409 Sadly, the latter is defined by Haskell, which allows such
2410 la-la land constructs as `{-a 900-line comment-} foo`. (WDP 94/12)
2415 #line 582 "yaccParser/hslexer.flex"
2417 hsnewid(yytext + 1, yyleng - 2);
2418 RETURN(_isconstr(yytext+1) ? CONSYM : VARSYM);
2423 * Character literals. The first form is the quick form, for character
2424 * literals that don't contain backslashes. Literals with backslashes are
2425 * lexed through multiple rules. First, we match the open ' and as many
2426 * normal characters as possible. This puts us into the <Char> state, where
2427 * a backslash is legal. Then, we match the backslash and move into the
2428 * <CharEsc> state. When we drop out of <CharEsc>, we collect more normal
2429 * characters and the close '. We may end up with too many characters, but
2430 * this allows us to easily share the lex rules with strings. Excess characters
2431 * are ignored with a warning.
2436 #line 601 "yaccParser/hslexer.flex"
2438 yylval.uhstring = installHstring(1, yytext+1);
2444 #line 605 "yaccParser/hslexer.flex"
2446 yylval.uhstring = installHstring(1, yytext+1);
2452 #line 609 "yaccParser/hslexer.flex"
2453 {char errbuf[ERR_BUF_SIZE];
2454 sprintf(errbuf, "'' is not a valid character (or string) literal\n");
2460 #line 613 "yaccParser/hslexer.flex"
2462 hsmlcolno = hspcolno;
2464 addtext(yytext+1, yyleng-1);
2470 #line 619 "yaccParser/hslexer.flex"
2475 addtext(yytext, yyleng - 2);
2476 text = fetchtext(&length);
2478 if (! (nonstandardFlag || in_interface)) {
2479 char errbuf[ERR_BUF_SIZE];
2480 sprintf(errbuf, "`Char-hash' literals are non-standard: %s\n", text);
2485 fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '",
2486 input_filename, hsplineno, hspcolno + 1);
2487 format_string(stderr, (unsigned char *) text, length);
2488 fputs("' too long\n", stderr);
2491 yylval.uhstring = installHstring(1, text);
2492 hspcolno = hsmlcolno;
2499 #line 644 "yaccParser/hslexer.flex"
2504 addtext(yytext, yyleng - 1);
2505 text = fetchtext(&length);
2508 fprintf(stderr, "\"%s\", line %d, column %d: Character literal '",
2509 input_filename, hsplineno, hspcolno + 1);
2510 format_string(stderr, (unsigned char *) text, length);
2511 fputs("' too long\n", stderr);
2514 yylval.uhstring = installHstring(1, text);
2515 hspcolno = hsmlcolno;
2522 #line 663 "yaccParser/hslexer.flex"
2523 { addtext(yytext, yyleng); }
2527 * String literals. The first form is the quick form, for string literals
2528 * that don't contain backslashes. Literals with backslashes are lexed
2529 * through multiple rules. First, we match the open " and as many normal
2530 * characters as possible. This puts us into the <String> state, where
2531 * a backslash is legal. Then, we match the backslash and move into the
2532 * <StringEsc> state. When we drop out of <StringEsc>, we collect more normal
2533 * characters, moving back and forth between <String> and <StringEsc> as more
2534 * backslashes are encountered. (We may even digress into <Comment> mode if we
2535 * find a comment in a gap between backslashes.) Finally, we read the last chunk
2536 * of normal characters and the close ".
2541 #line 681 "yaccParser/hslexer.flex"
2543 yylval.uhstring = installHstring(yyleng-3, yytext+1);
2544 /* the -3 accounts for the " on front, "# on the end */
2550 #line 686 "yaccParser/hslexer.flex"
2552 yylval.uhstring = installHstring(yyleng-2, yytext+1);
2558 #line 690 "yaccParser/hslexer.flex"
2560 hsmlcolno = hspcolno;
2562 addtext(yytext+1, yyleng-1);
2568 #line 696 "yaccParser/hslexer.flex"
2573 addtext(yytext, yyleng-2);
2574 text = fetchtext(&length);
2576 if (! (nonstandardFlag || in_interface)) {
2577 char errbuf[ERR_BUF_SIZE];
2578 sprintf(errbuf, "`String-hash' literals are non-standard: %s\n", text);
2582 yylval.uhstring = installHstring(length, text);
2583 hspcolno = hsmlcolno;
2590 #line 714 "yaccParser/hslexer.flex"
2595 addtext(yytext, yyleng-1);
2596 text = fetchtext(&length);
2598 yylval.uhstring = installHstring(length, text);
2599 hspcolno = hsmlcolno;
2606 #line 726 "yaccParser/hslexer.flex"
2607 { addtext(yytext, yyleng); }
2611 * Character and string escapes are roughly the same, but strings have the
2612 * extra `\&' sequence which is not allowed for characters. Also, comments
2613 * are allowed in the <StringEsc> state. (See the comment section much
2616 * NB: Backslashes and tabs are stored in strings as themselves.
2617 * But if we print them (in printtree.c), they must go out as
2618 * "\\\\" and "\\t" respectively. (This is because of the bogus
2619 * intermediate format that the parser produces. It uses '\t' fpr end of
2620 * string, so it needs to be able to escape tabs, which means that it
2621 * also needs to be able to escape the escape character ('\\'). Sigh.
2626 #line 744 "yaccParser/hslexer.flex"
2627 { PUSH_STATE(CharEsc); }
2631 #line 745 "yaccParser/hslexer.flex"
2636 #line 746 "yaccParser/hslexer.flex"
2637 { PUSH_STATE(StringEsc); noGap = TRUE; }
2641 #line 748 "yaccParser/hslexer.flex"
2642 { addchar(*yytext); POP_STATE; }
2646 #line 749 "yaccParser/hslexer.flex"
2647 { if (noGap) { addchar(*yytext); } POP_STATE; }
2651 #line 751 "yaccParser/hslexer.flex"
2652 { addchar(*yytext); POP_STATE; }
2656 #line 752 "yaccParser/hslexer.flex"
2657 { addchar('\000'); POP_STATE; }
2661 #line 753 "yaccParser/hslexer.flex"
2662 { addchar('\001'); POP_STATE; }
2666 #line 754 "yaccParser/hslexer.flex"
2667 { addchar('\002'); POP_STATE; }
2671 #line 755 "yaccParser/hslexer.flex"
2672 { addchar('\003'); POP_STATE; }
2676 #line 756 "yaccParser/hslexer.flex"
2677 { addchar('\004'); POP_STATE; }
2681 #line 757 "yaccParser/hslexer.flex"
2682 { addchar('\005'); POP_STATE; }
2686 #line 758 "yaccParser/hslexer.flex"
2687 { addchar('\006'); POP_STATE; }
2690 #line 760 "yaccParser/hslexer.flex"
2693 #line 760 "yaccParser/hslexer.flex"
2694 { addchar('\007'); POP_STATE; }
2697 #line 762 "yaccParser/hslexer.flex"
2700 #line 762 "yaccParser/hslexer.flex"
2701 { addchar('\010'); POP_STATE; }
2704 #line 764 "yaccParser/hslexer.flex"
2707 #line 764 "yaccParser/hslexer.flex"
2708 { addchar('\011'); POP_STATE; }
2711 #line 766 "yaccParser/hslexer.flex"
2714 #line 766 "yaccParser/hslexer.flex"
2715 { addchar('\012'); POP_STATE; }
2718 #line 768 "yaccParser/hslexer.flex"
2721 #line 768 "yaccParser/hslexer.flex"
2722 { addchar('\013'); POP_STATE; }
2725 #line 770 "yaccParser/hslexer.flex"
2728 #line 770 "yaccParser/hslexer.flex"
2729 { addchar('\014'); POP_STATE; }
2732 #line 772 "yaccParser/hslexer.flex"
2735 #line 772 "yaccParser/hslexer.flex"
2736 { addchar('\015'); POP_STATE; }
2740 #line 773 "yaccParser/hslexer.flex"
2741 { addchar('\016'); POP_STATE; }
2745 #line 774 "yaccParser/hslexer.flex"
2746 { addchar('\017'); POP_STATE; }
2750 #line 775 "yaccParser/hslexer.flex"
2751 { addchar('\020'); POP_STATE; }
2755 #line 776 "yaccParser/hslexer.flex"
2756 { addchar('\021'); POP_STATE; }
2760 #line 777 "yaccParser/hslexer.flex"
2761 { addchar('\022'); POP_STATE; }
2765 #line 778 "yaccParser/hslexer.flex"
2766 { addchar('\023'); POP_STATE; }
2770 #line 779 "yaccParser/hslexer.flex"
2771 { addchar('\024'); POP_STATE; }
2775 #line 780 "yaccParser/hslexer.flex"
2776 { addchar('\025'); POP_STATE; }
2780 #line 781 "yaccParser/hslexer.flex"
2781 { addchar('\026'); POP_STATE; }
2785 #line 782 "yaccParser/hslexer.flex"
2786 { addchar('\027'); POP_STATE; }
2790 #line 783 "yaccParser/hslexer.flex"
2791 { addchar('\030'); POP_STATE; }
2795 #line 784 "yaccParser/hslexer.flex"
2796 { addchar('\031'); POP_STATE; }
2800 #line 785 "yaccParser/hslexer.flex"
2801 { addchar('\032'); POP_STATE; }
2805 #line 786 "yaccParser/hslexer.flex"
2806 { addchar('\033'); POP_STATE; }
2810 #line 787 "yaccParser/hslexer.flex"
2811 { addchar('\034'); POP_STATE; }
2815 #line 788 "yaccParser/hslexer.flex"
2816 { addchar('\035'); POP_STATE; }
2820 #line 789 "yaccParser/hslexer.flex"
2821 { addchar('\036'); POP_STATE; }
2825 #line 790 "yaccParser/hslexer.flex"
2826 { addchar('\037'); POP_STATE; }
2830 #line 791 "yaccParser/hslexer.flex"
2831 { addchar('\040'); POP_STATE; }
2835 #line 792 "yaccParser/hslexer.flex"
2836 { addchar('\177'); POP_STATE; }
2840 #line 793 "yaccParser/hslexer.flex"
2841 { char c = yytext[1] - '@'; addchar(c); POP_STATE; }
2845 #line 794 "yaccParser/hslexer.flex"
2847 int i = strtol(yytext, NULL, 10);
2851 char errbuf[ERR_BUF_SIZE];
2852 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2861 #line 806 "yaccParser/hslexer.flex"
2863 int i = strtol(yytext + 1, NULL, 8);
2867 char errbuf[ERR_BUF_SIZE];
2868 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2877 #line 818 "yaccParser/hslexer.flex"
2879 int i = strtol(yytext + 1, NULL, 16);
2883 char errbuf[ERR_BUF_SIZE];
2884 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2893 * Simple comments and whitespace. Normally, we would just ignore these, but
2894 * in case we're processing a string escape, we need to note that we've seen
2897 * Note that we cater for a comment line that *doesn't* end in a newline.
2898 * This is incorrect, strictly speaking, but seems like the right thing
2899 * to do. Reported by Rajiv Mirani. (WDP 95/08)
2903 #line 844 "yaccParser/hslexer.flex"
2906 #line 844 "yaccParser/hslexer.flex"
2911 * Nested comments. The major complication here is in trying to match the
2912 * longest lexemes possible, for better performance. (See the flex document.)
2913 * That's why the rules look so bizarre.
2918 #line 854 "yaccParser/hslexer.flex"
2920 noGap = FALSE; nested_comments = 1; PUSH_STATE(Comment);
2924 #line 859 "yaccParser/hslexer.flex"
2926 #line 860 "yaccParser/hslexer.flex"
2929 #line 860 "yaccParser/hslexer.flex"
2934 #line 861 "yaccParser/hslexer.flex"
2935 { nested_comments++; }
2939 #line 862 "yaccParser/hslexer.flex"
2940 { if (--nested_comments == 0) POP_STATE; }
2944 #line 863 "yaccParser/hslexer.flex"
2949 * Illegal characters. This used to be a single rule, but we might as well
2950 * pass on as much information as we have, so now we indicate our state in
2951 * the error message.
2956 #line 873 "yaccParser/hslexer.flex"
2958 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2959 input_filename, hsplineno, hspcolno + 1);
2960 format_string(stderr, (unsigned char *) yytext, 1);
2961 fputs("'\n", stderr);
2967 #line 880 "yaccParser/hslexer.flex"
2969 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2970 input_filename, hsplineno, hspcolno + 1);
2971 format_string(stderr, (unsigned char *) yytext, 1);
2972 fputs("' in a character literal\n", stderr);
2978 #line 887 "yaccParser/hslexer.flex"
2980 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\",
2981 input_filename, hsplineno, hspcolno + 1);
2982 format_string(stderr, (unsigned char *) yytext, 1);
2983 fputs("'\n", stderr);
2989 #line 894 "yaccParser/hslexer.flex"
2990 { if (nonstandardFlag) {
2991 addtext(yytext, yyleng);
2993 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2994 input_filename, hsplineno, hspcolno + 1);
2995 format_string(stderr, (unsigned char *) yytext, 1);
2996 fputs("' in a string literal\n", stderr);
3003 #line 904 "yaccParser/hslexer.flex"
3006 fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\",
3007 input_filename, hsplineno, hspcolno + 1);
3008 format_string(stderr, (unsigned char *) yytext, 1);
3009 fputs("'\n", stderr);
3012 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3013 input_filename, hsplineno, hspcolno + 1);
3014 format_string(stderr, (unsigned char *) yytext, 1);
3015 fputs("' in a string gap\n", stderr);
3022 * End of file. In any sub-state, this is an error. However, for the primary
3023 * <Code> and <GlaExt> states, this is perfectly normal. We just return an EOF
3024 * and let the yylex() wrapper deal with whatever has to be done next (e.g.
3025 * adding virtual close curlies, or closing an interface and returning to the
3026 * primary source file.
3028 * Note that flex does not call YY_USER_ACTION for <<EOF>> rules. Hence the
3029 * line/column advancement has to be done by hand.
3032 case YY_STATE_EOF(Char):
3033 case YY_STATE_EOF(CharEsc):
3034 #line 933 "yaccParser/hslexer.flex"
3036 hsplineno = hslineno; hspcolno = hscolno;
3037 hsperror("unterminated character literal");
3040 case YY_STATE_EOF(Comment):
3041 #line 937 "yaccParser/hslexer.flex"
3043 hsplineno = hslineno; hspcolno = hscolno;
3044 hsperror("unterminated comment");
3047 case YY_STATE_EOF(String):
3048 case YY_STATE_EOF(StringEsc):
3049 #line 941 "yaccParser/hslexer.flex"
3051 hsplineno = hslineno; hspcolno = hscolno;
3052 hsperror("unterminated string literal");
3055 case YY_STATE_EOF(GhcPragma):
3056 #line 945 "yaccParser/hslexer.flex"
3058 hsplineno = hslineno; hspcolno = hscolno;
3059 hsperror("unterminated interface pragma");
3062 case YY_STATE_EOF(UserPragma):
3063 #line 949 "yaccParser/hslexer.flex"
3065 hsplineno = hslineno; hspcolno = hscolno;
3066 hsperror("unterminated user-specified pragma");
3069 case YY_STATE_EOF(Code):
3070 case YY_STATE_EOF(GlaExt):
3071 #line 953 "yaccParser/hslexer.flex"
3072 { hsplineno = hslineno; hspcolno = hscolno; return(EOF); }
3076 #line 955 "yaccParser/hslexer.flex"
3077 YY_FATAL_ERROR( "flex scanner jammed" );
3079 case YY_STATE_EOF(INITIAL):
3082 case YY_END_OF_BUFFER:
3084 /* Amount of text matched not including the EOB char. */
3085 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
3087 /* Undo the effects of YY_DO_BEFORE_ACTION. */
3088 *yy_cp = yy_hold_char;
3090 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
3092 /* We're scanning a new file or input source. It's
3093 * possible that this happened because the user
3094 * just pointed yyin at a new source and called
3095 * yylex(). If so, then we have to assure
3096 * consistency between yy_current_buffer and our
3097 * globals. Here is the right place to do so, because
3098 * this is the first action (other than possibly a
3099 * back-up) that will match for the new input source.
3101 yy_n_chars = yy_current_buffer->yy_n_chars;
3102 yy_current_buffer->yy_input_file = yyin;
3103 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
3106 /* Note that here we test for yy_c_buf_p "<=" to the position
3107 * of the first EOB in the buffer, since yy_c_buf_p will
3108 * already have been incremented past the NUL character
3109 * (since all states make transitions on EOB to the
3110 * end-of-buffer state). Contrast this with the test
3113 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3114 { /* This was really a NUL. */
3115 yy_state_type yy_next_state;
3117 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
3119 yy_current_state = yy_get_previous_state();
3121 /* Okay, we're now positioned to make the NUL
3122 * transition. We couldn't have
3123 * yy_get_previous_state() go ahead and do it
3124 * for us because it doesn't know how to deal
3125 * with the possibility of jamming (and we don't
3126 * want to build jamming into it because then it
3127 * will run more slowly).
3130 yy_next_state = yy_try_NUL_trans( yy_current_state );
3132 yy_bp = yytext_ptr + YY_MORE_ADJ;
3134 if ( yy_next_state )
3136 /* Consume the NUL. */
3137 yy_cp = ++yy_c_buf_p;
3138 yy_current_state = yy_next_state;
3145 goto yy_find_action;
3149 else switch ( yy_get_next_buffer() )
3151 case EOB_ACT_END_OF_FILE:
3153 yy_did_buffer_switch_on_eof = 0;
3157 /* Note: because we've taken care in
3158 * yy_get_next_buffer() to have set up
3159 * yytext, we can now set up
3160 * yy_c_buf_p so that if some total
3161 * hoser (like flex itself) wants to
3162 * call the scanner after we return the
3163 * YY_NULL, it'll still work - another
3164 * YY_NULL will get returned.
3166 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3168 yy_act = YY_STATE_EOF(YY_START);
3174 if ( ! yy_did_buffer_switch_on_eof )
3180 case EOB_ACT_CONTINUE_SCAN:
3182 yytext_ptr + yy_amount_of_matched_text;
3184 yy_current_state = yy_get_previous_state();
3187 yy_bp = yytext_ptr + YY_MORE_ADJ;
3190 case EOB_ACT_LAST_MATCH:
3192 &yy_current_buffer->yy_ch_buf[yy_n_chars];
3194 yy_current_state = yy_get_previous_state();
3197 yy_bp = yytext_ptr + YY_MORE_ADJ;
3198 goto yy_find_action;
3205 "fatal flex scanner internal error--no action found" );
3206 } /* end of action switch */
3207 } /* end of scanning one token */
3208 } /* end of yylex */
3211 /* yy_get_next_buffer - try to read in a new buffer
3213 * Returns a code representing an action:
3214 * EOB_ACT_LAST_MATCH -
3215 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3216 * EOB_ACT_END_OF_FILE - end of file
3219 static int yy_get_next_buffer()
3221 register char *dest = yy_current_buffer->yy_ch_buf;
3222 register char *source = yytext_ptr;
3223 register int number_to_move, i;
3226 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
3228 "fatal flex scanner internal error--end of buffer missed" );
3230 if ( yy_current_buffer->yy_fill_buffer == 0 )
3231 { /* Don't try to fill the buffer, so this is an EOF. */
3232 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
3234 /* We matched a singled characater, the EOB, so
3235 * treat this as a final EOF.
3237 return EOB_ACT_END_OF_FILE;
3242 /* We matched some text prior to the EOB, first
3245 return EOB_ACT_LAST_MATCH;
3249 /* Try to read more data. */
3251 /* First move last chars to start of buffer. */
3252 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
3254 for ( i = 0; i < number_to_move; ++i )
3255 *(dest++) = *(source++);
3257 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3258 /* don't do the read, it's not guaranteed to return an EOF,
3266 yy_current_buffer->yy_buf_size - number_to_move - 1;
3268 while ( num_to_read <= 0 )
3269 { /* Not enough room in the buffer - grow it. */
3270 #ifdef YY_USES_REJECT
3272 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3275 /* just a shorter name for the current buffer */
3276 YY_BUFFER_STATE b = yy_current_buffer;
3278 int yy_c_buf_p_offset =
3279 (int) (yy_c_buf_p - b->yy_ch_buf);
3281 if ( b->yy_is_our_buffer )
3283 int new_size = b->yy_buf_size * 2;
3285 if ( new_size <= 0 )
3286 b->yy_buf_size += b->yy_buf_size / 8;
3288 b->yy_buf_size *= 2;
3290 b->yy_ch_buf = (char *)
3291 /* Include room in for 2 EOB chars. */
3292 yy_flex_realloc( (void *) b->yy_ch_buf,
3293 b->yy_buf_size + 2 );
3296 /* Can't grow it, we don't own it. */
3299 if ( ! b->yy_ch_buf )
3301 "fatal error - scanner input buffer overflow" );
3303 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3305 num_to_read = yy_current_buffer->yy_buf_size -
3310 if ( num_to_read > YY_READ_BUF_SIZE )
3311 num_to_read = YY_READ_BUF_SIZE;
3313 /* Read in more data. */
3314 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
3315 yy_n_chars, num_to_read );
3318 if ( yy_n_chars == 0 )
3320 if ( number_to_move == YY_MORE_ADJ )
3322 ret_val = EOB_ACT_END_OF_FILE;
3328 ret_val = EOB_ACT_LAST_MATCH;
3329 yy_current_buffer->yy_buffer_status =
3330 YY_BUFFER_EOF_PENDING;
3335 ret_val = EOB_ACT_CONTINUE_SCAN;
3337 yy_n_chars += number_to_move;
3338 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
3339 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
3341 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
3347 /* yy_get_previous_state - get the state just before the EOB char was reached */
3349 static yy_state_type yy_get_previous_state()
3351 register yy_state_type yy_current_state;
3352 register char *yy_cp;
3354 yy_current_state = yy_start;
3355 yy_current_state += YY_AT_BOL();
3357 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
3359 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3360 if ( yy_accept[yy_current_state] )
3362 yy_last_accepting_state = yy_current_state;
3363 yy_last_accepting_cpos = yy_cp;
3365 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3367 yy_current_state = (int) yy_def[yy_current_state];
3368 if ( yy_current_state >= 743 )
3369 yy_c = yy_meta[(unsigned int) yy_c];
3371 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3374 return yy_current_state;
3378 /* yy_try_NUL_trans - try to make a transition on the NUL character
3381 * next_state = yy_try_NUL_trans( current_state );
3384 #ifdef YY_USE_PROTOS
3385 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
3387 static yy_state_type yy_try_NUL_trans( yy_current_state )
3388 yy_state_type yy_current_state;
3391 register int yy_is_jam;
3392 register char *yy_cp = yy_c_buf_p;
3394 register YY_CHAR yy_c = 1;
3395 if ( yy_accept[yy_current_state] )
3397 yy_last_accepting_state = yy_current_state;
3398 yy_last_accepting_cpos = yy_cp;
3400 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3402 yy_current_state = (int) yy_def[yy_current_state];
3403 if ( yy_current_state >= 743 )
3404 yy_c = yy_meta[(unsigned int) yy_c];
3406 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3407 yy_is_jam = (yy_current_state == 742);
3409 return yy_is_jam ? 0 : yy_current_state;
3414 #ifdef YY_USE_PROTOS
3415 static void yyunput( int c, register char *yy_bp )
3417 static void yyunput( c, yy_bp )
3419 register char *yy_bp;
3422 register char *yy_cp = yy_c_buf_p;
3424 /* undo effects of setting up yytext */
3425 *yy_cp = yy_hold_char;
3427 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3428 { /* need to shift things up to make room */
3429 /* +2 for EOB chars. */
3430 register int number_to_move = yy_n_chars + 2;
3431 register char *dest = &yy_current_buffer->yy_ch_buf[
3432 yy_current_buffer->yy_buf_size + 2];
3433 register char *source =
3434 &yy_current_buffer->yy_ch_buf[number_to_move];
3436 while ( source > yy_current_buffer->yy_ch_buf )
3437 *--dest = *--source;
3439 yy_cp += (int) (dest - source);
3440 yy_bp += (int) (dest - source);
3441 yy_n_chars = yy_current_buffer->yy_buf_size;
3443 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3444 YY_FATAL_ERROR( "flex scanner push-back overflow" );
3447 *--yy_cp = (char) c;
3451 yy_hold_char = *yy_cp;
3454 #endif /* ifndef YY_NO_UNPUT */
3458 static int yyinput()
3465 *yy_c_buf_p = yy_hold_char;
3467 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
3469 /* yy_c_buf_p now points to the character we want to return.
3470 * If this occurs *before* the EOB characters, then it's a
3471 * valid NUL; if not, then we've hit the end of the buffer.
3473 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3474 /* This was really a NUL. */
3478 { /* need more input */
3479 yytext_ptr = yy_c_buf_p;
3482 switch ( yy_get_next_buffer() )
3484 case EOB_ACT_END_OF_FILE:
3489 yytext_ptr + YY_MORE_ADJ;
3493 if ( ! yy_did_buffer_switch_on_eof )
3502 case EOB_ACT_CONTINUE_SCAN:
3503 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3506 case EOB_ACT_LAST_MATCH:
3509 "unexpected last match in yyinput()" );
3512 "unexpected last match in input()" );
3518 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
3519 *yy_c_buf_p = '\0'; /* preserve yytext */
3520 yy_hold_char = *++yy_c_buf_p;
3522 yy_current_buffer->yy_at_bol = (c == '\n');
3528 #ifdef YY_USE_PROTOS
3529 void yyrestart( FILE *input_file )
3531 void yyrestart( input_file )
3535 if ( ! yy_current_buffer )
3536 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
3538 yy_init_buffer( yy_current_buffer, input_file );
3539 yy_load_buffer_state();
3543 #ifdef YY_USE_PROTOS
3544 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
3546 void yy_switch_to_buffer( new_buffer )
3547 YY_BUFFER_STATE new_buffer;
3550 if ( yy_current_buffer == new_buffer )
3553 if ( yy_current_buffer )
3555 /* Flush out information for old buffer. */
3556 *yy_c_buf_p = yy_hold_char;
3557 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
3558 yy_current_buffer->yy_n_chars = yy_n_chars;
3561 yy_current_buffer = new_buffer;
3562 yy_load_buffer_state();
3564 /* We don't actually know whether we did this switch during
3565 * EOF (yywrap()) processing, but the only time this flag
3566 * is looked at is after yywrap() is called, so it's safe
3567 * to go ahead and always set it.
3569 yy_did_buffer_switch_on_eof = 1;
3573 #ifdef YY_USE_PROTOS
3574 void yy_load_buffer_state( void )
3576 void yy_load_buffer_state()
3579 yy_n_chars = yy_current_buffer->yy_n_chars;
3580 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
3581 yyin = yy_current_buffer->yy_input_file;
3582 yy_hold_char = *yy_c_buf_p;
3586 #ifdef YY_USE_PROTOS
3587 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
3589 YY_BUFFER_STATE yy_create_buffer( file, size )
3596 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3598 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3600 b->yy_buf_size = size;
3602 /* yy_ch_buf has to be 2 characters longer than the size given because
3603 * we need to put in 2 end-of-buffer characters.
3605 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
3606 if ( ! b->yy_ch_buf )
3607 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3609 b->yy_is_our_buffer = 1;
3611 yy_init_buffer( b, file );
3617 #ifdef YY_USE_PROTOS
3618 void yy_delete_buffer( YY_BUFFER_STATE b )
3620 void yy_delete_buffer( b )
3627 if ( b == yy_current_buffer )
3628 yy_current_buffer = (YY_BUFFER_STATE) 0;
3630 if ( b->yy_is_our_buffer )
3631 yy_flex_free( (void *) b->yy_ch_buf );
3633 yy_flex_free( (void *) b );
3637 #ifndef YY_ALWAYS_INTERACTIVE
3638 #ifndef YY_NEVER_INTERACTIVE
3639 extern int isatty YY_PROTO(( int ));
3643 #ifdef YY_USE_PROTOS
3644 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3646 void yy_init_buffer( b, file )
3653 yy_flush_buffer( b );
3655 b->yy_input_file = file;
3656 b->yy_fill_buffer = 1;
3658 #if YY_ALWAYS_INTERACTIVE
3659 b->yy_is_interactive = 1;
3661 #if YY_NEVER_INTERACTIVE
3662 b->yy_is_interactive = 0;
3664 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3670 #ifdef YY_USE_PROTOS
3671 void yy_flush_buffer( YY_BUFFER_STATE b )
3673 void yy_flush_buffer( b )
3680 /* We always need two end-of-buffer characters. The first causes
3681 * a transition to the end-of-buffer state. The second causes
3682 * a jam in that state.
3684 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3685 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3687 b->yy_buf_pos = &b->yy_ch_buf[0];
3690 b->yy_buffer_status = YY_BUFFER_NEW;
3692 if ( b == yy_current_buffer )
3693 yy_load_buffer_state();
3697 #ifndef YY_NO_SCAN_BUFFER
3698 #ifdef YY_USE_PROTOS
3699 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
3701 YY_BUFFER_STATE yy_scan_buffer( base, size )
3709 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3710 base[size-1] != YY_END_OF_BUFFER_CHAR )
3711 /* They forgot to leave room for the EOB's. */
3714 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3716 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3718 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3719 b->yy_buf_pos = b->yy_ch_buf = base;
3720 b->yy_is_our_buffer = 0;
3721 b->yy_input_file = 0;
3722 b->yy_n_chars = b->yy_buf_size;
3723 b->yy_is_interactive = 0;
3725 b->yy_fill_buffer = 0;
3726 b->yy_buffer_status = YY_BUFFER_NEW;
3728 yy_switch_to_buffer( b );
3735 #ifndef YY_NO_SCAN_STRING
3736 #ifdef YY_USE_PROTOS
3737 YY_BUFFER_STATE yy_scan_string( yyconst char *str )
3739 YY_BUFFER_STATE yy_scan_string( str )
3744 for ( len = 0; str[len]; ++len )
3747 return yy_scan_bytes( str, len );
3752 #ifndef YY_NO_SCAN_BYTES
3753 #ifdef YY_USE_PROTOS
3754 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
3756 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
3757 yyconst char *bytes;
3766 /* Get memory for full buffer, including space for trailing EOB's. */
3768 buf = (char *) yy_flex_alloc( n );
3770 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3772 for ( i = 0; i < len; ++i )
3775 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
3777 b = yy_scan_buffer( buf, n );
3779 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3781 /* It's okay to grow etc. this buffer, and we should throw it
3782 * away when we're done.
3784 b->yy_is_our_buffer = 1;
3791 #ifndef YY_NO_PUSH_STATE
3792 #ifdef YY_USE_PROTOS
3793 static void yy_push_state( int new_state )
3795 static void yy_push_state( new_state )
3799 if ( yy_start_stack_ptr >= yy_start_stack_depth )
3803 yy_start_stack_depth += YY_START_STACK_INCR;
3804 new_size = yy_start_stack_depth * sizeof( int );
3806 if ( ! yy_start_stack )
3807 yy_start_stack = (int *) yy_flex_alloc( new_size );
3810 yy_start_stack = (int *) yy_flex_realloc(
3811 (void *) yy_start_stack, new_size );
3813 if ( ! yy_start_stack )
3815 "out of memory expanding start-condition stack" );
3818 yy_start_stack[yy_start_stack_ptr++] = YY_START;
3825 #ifndef YY_NO_POP_STATE
3826 static void yy_pop_state()
3828 if ( --yy_start_stack_ptr < 0 )
3829 YY_FATAL_ERROR( "start-condition stack underflow" );
3831 BEGIN(yy_start_stack[yy_start_stack_ptr]);
3836 #ifndef YY_NO_TOP_STATE
3837 static int yy_top_state()
3839 return yy_start_stack[yy_start_stack_ptr - 1];
3843 #ifndef YY_EXIT_FAILURE
3844 #define YY_EXIT_FAILURE 2
3847 #ifdef YY_USE_PROTOS
3848 static void yy_fatal_error( yyconst char msg[] )
3850 static void yy_fatal_error( msg )
3854 (void) fprintf( stderr, "%s\n", msg );
3855 exit( YY_EXIT_FAILURE );
3860 /* Redefine yyless() so it works in section 3 code. */
3866 /* Undo effects of setting up yytext. */ \
3867 yytext[yyleng] = yy_hold_char; \
3868 yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
3869 yy_hold_char = *yy_c_buf_p; \
3870 *yy_c_buf_p = '\0'; \
3876 /* Internal utility routines. */
3879 #ifdef YY_USE_PROTOS
3880 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3882 static void yy_flex_strncpy( s1, s2, n )
3889 for ( i = 0; i < n; ++i )
3895 #ifdef YY_USE_PROTOS
3896 static void *yy_flex_alloc( yy_size_t size )
3898 static void *yy_flex_alloc( size )
3902 return (void *) malloc( size );
3905 #ifdef YY_USE_PROTOS
3906 static void *yy_flex_realloc( void *ptr, yy_size_t size )
3908 static void *yy_flex_realloc( ptr, size )
3913 /* The cast to (char *) in the following accommodates both
3914 * implementations that use char* generic pointers, and those
3915 * that use void* generic pointers. It works with the latter
3916 * because both ANSI C and C++ allow castless assignment from
3917 * any pointer type to void*, and deal with argument conversions
3918 * as though doing an assignment.
3920 return (void *) realloc( (char *) ptr, size );
3923 #ifdef YY_USE_PROTOS
3924 static void yy_flex_free( void *ptr )
3926 static void yy_flex_free( ptr )
3940 #line 955 "yaccParser/hslexer.flex"
3943 /**********************************************************************
3946 * YACC/LEX Initialisation etc. *
3949 **********************************************************************/
3952 We initialise input_filename to "<stdin>".
3953 This allows unnamed sources to be piped into the parser.
3956 extern BOOLEAN acceptPrim;
3961 input_filename = xstrdup("<stdin>");
3963 /* We must initialize the input buffer _now_, because we call
3964 setyyin _before_ calling yylex for the first time! */
3965 yy_switch_to_buffer(yy_create_buffer(stdin, YY_BUF_SIZE));
3974 new_filename(char *f) /* This looks pretty dodgy to me (WDP) */
3976 if (input_filename != NULL)
3977 free(input_filename);
3978 input_filename = xstrdup(f);
3981 /**********************************************************************
3984 * Layout Processing *
3987 **********************************************************************/
3990 The following section deals with Haskell Layout conventions
3991 forcing insertion of ; or } as appropriate
3995 hsshouldindent(void)
3997 return (!forgetindent && INDENTON);
4001 /* Enter new context and set new indentation level */
4006 fprintf(stderr, "hssetindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4010 * partain: first chk that new indent won't be less than current one; this code
4011 * doesn't make sense to me; hscolno tells the position of the _end_ of the
4012 * current token; what that has to do with indenting, I don't know.
4016 if (hscolno - 1 <= INDENTPT) {
4018 return; /* Empty input OK for Haskell 1.1 */
4020 char errbuf[ERR_BUF_SIZE];
4022 sprintf(errbuf, "Layout error -- indentation should be > %d cols", INDENTPT);
4026 hsentercontext((hspcolno << 1) | 1);
4030 /* Enter a new context without changing the indentation level */
4035 fprintf(stderr, "hsincindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4037 hsentercontext(indenttab[icontexts] & ~1);
4041 /* Turn off indentation processing, usually because an explicit "{" has been seen */
4045 forgetindent = TRUE;
4049 /* Enter a new layout context. */
4051 hsentercontext(int indent)
4053 /* Enter new context and set indentation as specified */
4054 if (++icontexts >= MAX_CONTEXTS) {
4055 char errbuf[ERR_BUF_SIZE];
4057 sprintf(errbuf, "`wheres' and `cases' nested too deeply (>%d)", MAX_CONTEXTS - 1);
4060 forgetindent = FALSE;
4061 indenttab[icontexts] = indent;
4063 fprintf(stderr, "hsentercontext:indent=%d,hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", indent, hscolno, hspcolno, icontexts, INDENTPT);
4068 /* Exit a layout context */
4074 fprintf(stderr, "hsendindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4079 * Return checks the indentation level and returns ;, } or the specified token.
4089 if (hsshouldindent()) {
4090 if (hspcolno < INDENTPT) {
4092 fprintf(stderr, "inserted '}' before %d (%d:%d:%d:%d)\n", tok, hspcolno, hscolno, yyleng, INDENTPT);
4096 } else if (hspcolno == INDENTPT) {
4098 fprintf(stderr, "inserted ';' before %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4106 fprintf(stderr, "returning %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4113 * Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
4119 static BOOLEAN eof = FALSE;
4122 if (hssttok != -1) {
4130 endlineno = hslineno;
4131 if ((tok = yylex1()) != EOF)
4137 if (icontexts > icontexts_save) {
4140 indenttab[icontexts] = 0;
4143 hsperror("missing '}' at end of file");
4144 } else if (hsbuf_save != NULL) {
4146 yy_delete_buffer(YY_CURRENT_BUFFER);
4147 yy_switch_to_buffer(hsbuf_save);
4149 new_filename(filename_save);
4150 free(filename_save);
4151 hslineno = hslineno_save;
4152 hsplineno = hsplineno_save;
4153 hscolno = hscolno_save;
4154 hspcolno = hspcolno_save;
4156 in_interface = FALSE;
4157 icontexts = icontexts_save - 1;
4160 fprintf(stderr, "finished reading interface (%d:%d:%d)\n", hscolno, hspcolno, INDENTPT);
4167 abort(); /* should never get here! */
4171 /**********************************************************************
4174 * Input Processing for Interfaces *
4177 **********************************************************************/
4179 /* setyyin(file) open file as new lex input buffer */
4185 hsbuf_save = YY_CURRENT_BUFFER;
4186 if ((yyin = fopen(file, "r")) == NULL) {
4187 char errbuf[ERR_BUF_SIZE];
4189 sprintf(errbuf, "can't read \"%-.50s\"", file);
4192 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
4194 hslineno_save = hslineno;
4195 hsplineno_save = hsplineno;
4196 hslineno = hsplineno = 1;
4198 filename_save = input_filename;
4199 input_filename = NULL;
4201 hscolno_save = hscolno;
4202 hspcolno_save = hspcolno;
4203 hscolno = hspcolno = 0;
4204 in_interface = TRUE;
4205 etags_save = etags; /* do not do "etags" stuff in interfaces */
4206 etags = 0; /* We remember whether we are doing it in
4207 the module, so we can restore it later [WDP 94/09] */
4208 hsentercontext(-1); /* partain: changed this from 0 */
4209 icontexts_save = icontexts;
4211 fprintf(stderr, "reading %s (%d:%d:%d)\n", input_filename, hscolno_save, hspcolno_save, INDENTPT);
4216 layout_input(char *text, int len)
4219 fprintf(stderr, "Scanning \"%s\"\n", text);
4222 hsplineno = hslineno;
4234 hscolno += 8 - (hscolno % 8); /* Tabs stops are 8 columns apart */
4246 setstartlineno(void)
4248 startlineno = hsplineno;
4252 fprintf(stderr,"%u\tsetstartlineno (col %u)\n",startlineno,hscolno);
4256 /**********************************************************************
4262 **********************************************************************/
4264 #define CACHE_SIZE YY_BUF_SIZE
4270 } textcache = { 0, 0, NULL };
4275 /* fprintf(stderr, "cleartext\n"); */
4277 if (textcache.allocated == 0) {
4278 textcache.allocated = CACHE_SIZE;
4279 textcache.text = xmalloc(CACHE_SIZE);
4284 addtext(char *text, unsigned length)
4286 /* fprintf(stderr, "addtext: %d %s\n", length, text); */
4291 if (textcache.next + length + 1 >= textcache.allocated) {
4292 textcache.allocated += length + CACHE_SIZE;
4293 textcache.text = xrealloc(textcache.text, textcache.allocated);
4295 bcopy(text, textcache.text + textcache.next, length);
4296 textcache.next += length;
4302 /* fprintf(stderr, "addchar: %c\n", c); */
4304 if (textcache.next + 2 >= textcache.allocated) {
4305 textcache.allocated += CACHE_SIZE;
4306 textcache.text = xrealloc(textcache.text, textcache.allocated);
4308 textcache.text[textcache.next++] = c;
4312 fetchtext(unsigned *length)
4314 /* fprintf(stderr, "fetchtext: %d\n", textcache.next); */
4316 *length = textcache.next;
4317 textcache.text[textcache.next] = '\0';
4318 return textcache.text;
4321 /**********************************************************************
4324 * Identifier Processing *
4327 **********************************************************************/
4330 hsnewid Enters an id of length n into the symbol table.
4334 hsnewid(char *name, int length)
4336 char save = name[length];
4338 name[length] = '\0';
4339 yylval.uid = installid(name);
4340 name[length] = save;
4344 isconstr(char *s) /* walks past leading underscores before using the macro */
4348 for ( ; temp != NULL && *temp == '_' ; temp++ );
4350 return _isconstr(temp);