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.3 1996/01/18 16:36:38 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[837] =
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, 121, 102, 103, 121, 121, 121, 121, 121, 121,
300 121, 121, 121, 121, 121, 189, 127, 122, 111, 197,
301 121, 121, 121, 121, 121, 96, 122, 122, 122, 197,
302 197, 121, 121, 197, 200, 136, 135, 139, 201, 189,
303 142, 201, 185, 201, 201, 201, 201, 201, 201, 201,
304 201, 201, 201, 201, 201, 201, 201, 141, 201, 151,
305 153, 161, 157, 201, 163, 155, 159, 201, 201, 130,
306 129, 128, 185, 0, 0, 152, 0, 162, 0, 0,
307 0, 175, 0, 0, 0, 0, 160, 178, 179, 154,
308 156, 0, 0, 180, 165, 164, 182, 0, 0, 0,
310 181, 158, 184, 186, 187, 189, 122, 133, 132, 127,
311 126, 188, 89, 83, 0, 111, 0, 0, 91, 88,
312 90, 121, 120, 0, 120, 121, 121, 121, 121, 121,
313 121, 61, 121, 75, 121, 121, 69, 121, 121, 72,
314 121, 121, 190, 0, 0, 191, 192, 0, 195, 193,
315 194, 0, 133, 132, 127, 0, 0, 110, 0, 111,
316 0, 0, 119, 121, 120, 0, 0, 121, 121, 121,
317 121, 121, 121, 61, 121, 75, 121, 121, 69, 121,
318 121, 72, 121, 121, 0, 127, 0, 111, 0, 0,
319 0, 120, 120, 120, 120, 120, 120, 120, 120, 120,
321 120, 120, 120, 120, 120, 120, 120, 0, 121, 121,
322 75, 121, 69, 190, 0, 121, 136, 135, 134, 138,
323 149, 150, 174, 167, 168, 169, 170, 183, 166, 148,
324 147, 177, 173, 146, 171, 143, 144, 145, 176, 172,
325 127, 125, 188, 188, 188, 188, 114, 107, 109, 120,
326 120, 121, 121, 121, 121, 121, 121, 121, 121, 121,
327 121, 121, 76, 121, 121, 121, 121, 121, 0, 0,
328 1, 1, 0, 131, 125, 0, 0, 114, 107, 109,
329 120, 120, 0, 0, 0, 121, 121, 121, 121, 121,
330 121, 121, 121, 121, 121, 121, 76, 121, 121, 121,
332 121, 121, 0, 0, 0, 18, 19, 0, 120, 120,
333 120, 120, 12, 120, 120, 120, 120, 120, 120, 17,
334 120, 15, 120, 120, 120, 11, 120, 120, 6, 120,
335 120, 120, 120, 14, 120, 120, 120, 13, 120, 120,
336 118, 121, 76, 53, 188, 0, 120, 54, 121, 56,
337 121, 121, 59, 121, 121, 121, 121, 121, 121, 121,
338 71, 73, 121, 0, 0, 52, 52, 52, 52, 52,
339 52, 0, 124, 0, 0, 113, 0, 106, 108, 120,
340 120, 123, 0, 54, 121, 56, 121, 121, 59, 121,
341 121, 121, 121, 121, 121, 121, 71, 73, 121, 46,
343 0, 101, 120, 120, 120, 120, 120, 120, 120, 120,
344 120, 120, 120, 120, 120, 120, 120, 16, 120, 7,
345 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
346 120, 120, 118, 54, 0, 114, 81, 55, 121, 121,
347 121, 121, 63, 121, 121, 121, 121, 74, 52, 52,
348 52, 52, 52, 52, 52, 0, 112, 0, 114, 120,
349 120, 115, 55, 121, 121, 121, 121, 63, 121, 121,
350 121, 121, 74, 0, 0, 120, 22, 120, 120, 20,
351 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
352 120, 116, 120, 120, 120, 120, 120, 120, 120, 120,
354 120, 120, 120, 120, 121, 121, 60, 62, 64, 65,
355 121, 121, 68, 121, 52, 52, 52, 52, 52, 52,
356 52, 0, 79, 120, 121, 121, 60, 62, 64, 65,
357 121, 121, 68, 121, 120, 120, 120, 120, 120, 120,
358 35, 120, 36, 120, 120, 120, 120, 34, 120, 120,
359 40, 120, 23, 120, 120, 38, 117, 120, 120, 39,
360 120, 57, 121, 121, 121, 121, 52, 52, 52, 52,
361 52, 52, 52, 0, 2, 2, 120, 77, 57, 121,
362 121, 121, 121, 120, 120, 120, 120, 120, 120, 120,
363 120, 120, 120, 120, 120, 120, 120, 33, 120, 21,
365 120, 120, 58, 66, 121, 70, 52, 52, 52, 52,
366 52, 52, 52, 120, 120, 58, 66, 121, 70, 120,
367 120, 41, 120, 32, 37, 120, 120, 120, 120, 25,
368 120, 120, 120, 120, 120, 120, 120, 82, 67, 52,
369 0, 52, 52, 48, 52, 52, 80, 120, 67, 120,
370 120, 29, 120, 30, 31, 42, 43, 44, 45, 120,
371 120, 120, 28, 52, 0, 0, 52, 52, 52, 52,
372 78, 8, 120, 9, 24, 120, 120, 52, 0, 51,
373 50, 52, 52, 120, 120, 120, 52, 3, 3, 52,
374 52, 120, 120, 10, 52, 52, 47, 120, 120, 52,
376 52, 27, 120, 5, 52, 120, 0, 52, 120, 0,
377 52, 120, 0, 49, 26, 0, 0, 0, 0, 0,
378 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
382 static yyconst int yy_ec[256] =
384 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
385 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 5, 6, 7, 8, 9, 10, 11, 12, 13,
388 14, 10, 15, 16, 17, 18, 19, 20, 21, 22,
389 23, 24, 25, 25, 25, 26, 26, 27, 28, 29,
390 30, 31, 10, 32, 33, 34, 35, 36, 37, 38,
391 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
392 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
393 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
395 69, 70, 71, 72, 73, 74, 74, 75, 76, 77,
396 78, 79, 74, 80, 81, 82, 83, 84, 85, 86,
397 87, 74, 88, 89, 90, 91, 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,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 static yyconst int yy_meta[92] =
416 1, 2, 3, 2, 4, 5, 6, 7, 8, 5,
417 5, 9, 6, 6, 5, 6, 10, 5, 5, 11,
418 11, 11, 11, 11, 11, 11, 5, 6, 5, 5,
419 5, 12, 13, 13, 13, 13, 13, 13, 14, 14,
420 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
421 14, 14, 14, 14, 14, 14, 14, 14, 15, 16,
422 15, 12, 17, 18, 19, 19, 19, 19, 19, 19,
423 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
424 20, 20, 20, 20, 20, 20, 20, 21, 5, 22,
429 static yyconst short int yy_base[881] =
431 0, 0, 0, 4, 58, 138, 224, 2450, 0, 1,
432 315, 2449, 402, 0, 487, 0, 25, 39, 578, 0,
433 2456, 2459, 2459, 2443, 2446, 2459, 2459, 2459, 13, 2418,
434 7, 12, 12, 21, 10, 2401, 2399, 2412, 18, 2398,
435 69, 2397, 2395, 2459, 0, 2459, 2459, 2459, 2459, 0,
436 2459, 2459, 2459, 0, 50, 0, 2439, 2433, 2459, 2459,
437 0, 2459, 46, 2426, 131, 415, 2416, 2459, 2425, 2410,
438 0, 0, 2459, 0, 2459, 6, 2459, 11, 36, 2365,
439 2366, 30, 2369, 2359, 2366, 2366, 47, 2362, 2416, 0,
440 2459, 0, 52, 0, 13, 2, 2425, 2419, 425, 662,
442 506, 2422, 66, 2365, 66, 452, 105, 2, 129, 124,
443 107, 131, 138, 663, 42, 407, 0, 148, 515, 745,
444 5, 158, 421, 449, 455, 2411, 0, 2410, 2395, 2362,
445 2360, 122, 135, 2406, 2459, 2415, 2413, 2409, 2459, 192,
446 2459, 2402, 652, 2383, 132, 169, 417, 497, 370, 2366,
447 2364, 2377, 137, 2363, 648, 2362, 2360, 2459, 0, 2459,
448 2459, 2459, 2459, 686, 2459, 2459, 2459, 0, 2394, 2398,
449 2401, 2459, 692, 2365, 2363, 2459, 2360, 2459, 669, 2361,
450 2367, 2459, 2354, 2350, 2366, 410, 2459, 2459, 2459, 2459,
451 2459, 2357, 2355, 2459, 2459, 2358, 2459, 2341, 2362, 2349,
453 2459, 2459, 2459, 699, 0, 723, 0, 2387, 2459, 2381,
454 2459, 727, 0, 0, 734, 745, 722, 0, 0, 2459,
455 0, 0, 0, 2329, 2324, 2309, 2324, 2306, 141, 2306,
456 2318, 0, 2306, 464, 2302, 2315, 0, 2305, 2312, 0,
457 2301, 2310, 2370, 210, 2304, 0, 0, 2359, 2459, 0,
458 2459, 2287, 2367, 2365, 2360, 796, 815, 2459, 822, 841,
459 752, 0, 2459, 2363, 114, 2362, 0, 410, 435, 424,
460 488, 489, 454, 2361, 495, 725, 484, 493, 2360, 726,
461 451, 2359, 673, 730, 2349, 2353, 830, 863, 2301, 2300,
462 2302, 846, 524, 772, 2298, 2322, 2296, 2321, 699, 738,
464 2307, 2306, 843, 641, 501, 2305, 2276, 0, 694, 819,
465 821, 823, 849, 2459, 2263, 753, 2345, 2343, 2459, 2459,
466 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
467 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
468 2338, 2459, 873, 893, 899, 908, 894, 901, 0, 0,
469 2282, 2279, 2266, 2281, 2280, 2271, 2274, 2269, 2263, 2267,
470 2257, 2269, 0, 2254, 2271, 2258, 2265, 2253, 925, 865,
471 2459, 869, 2255, 2459, 2323, 912, 0, 930, 957, 2322,
472 2248, 2263, 2263, 2318, 2313, 899, 779, 884, 931, 797,
473 900, 932, 671, 933, 934, 935, 2316, 936, 937, 816,
475 938, 731, 2233, 2314, 963, 2459, 2459, 2258, 2269, 918,
476 2271, 2266, 0, 2279, 2270, 2277, 2261, 2278, 2264, 0,
477 2248, 0, 2258, 2257, 2245, 0, 928, 897, 0, 2266,
478 953, 2255, 2268, 0, 2256, 2270, 2265, 0, 2258, 2220,
479 0, 966, 984, 2459, 1006, 1000, 2236, 0, 2217, 0,
480 2214, 2212, 0, 2218, 2214, 2207, 2227, 2211, 2215, 2213,
481 0, 0, 2219, 1025, 660, 1034, 1038, 1042, 1046, 1050,
482 1060, 2218, 2459, 1064, 2278, 2277, 1076, 2459, 2459, 2208,
483 2208, 2459, 2270, 2273, 990, 2272, 951, 989, 2271, 956,
484 987, 995, 1004, 1010, 1005, 1006, 2270, 2269, 1048, 2459,
486 1089, 2459, 2224, 2212, 2211, 2240, 2209, 2224, 2207, 2218,
487 408, 2222, 2215, 2230, 2232, 2214, 2223, 0, 2199, 0,
488 2224, 2224, 2220, 2214, 2212, 2219, 2220, 2191, 2205, 2202,
489 2201, 2185, 0, 1051, 1098, 1105, 0, 0, 2174, 2175,
490 2176, 2164, 1057, 2168, 2174, 2174, 2169, 0, 1131, 1136,
491 1140, 1144, 1148, 1154, 1158, 2236, 2459, 1144, 1164, 2177,
492 2164, 2459, 2230, 1099, 1108, 1023, 993, 1146, 1147, 140,
493 1165, 1167, 2229, 1176, 1186, 2186, 0, 2199, 2177, 0,
494 2170, 2197, 2179, 2167, 2179, 2165, 2164, 2163, 2175, 2168,
495 2115, 0, 2128, 2138, 2109, 2117, 2104, 2122, 1142, 1193,
497 2115, 2099, 2098, 2085, 2077, 2081, 0, 0, 0, 0,
498 2090, 2091, 0, 2069, 1225, 1233, 1239, 1243, 1247, 1251,
499 1259, 1074, 2092, 2066, 1097, 1195, 2120, 2117, 2115, 2098,
500 1172, 1168, 2087, 1196, 2060, 2051, 2038, 2052, 2050, 2032,
501 0, 2017, 0, 1999, 1988, 1973, 1943, 0, 1913, 1937,
502 0, 1936, 0, 1907, 1933, 0, 1245, 1901, 1928, 0,
503 1885, 0, 1887, 1859, 1842, 1823, 1272, 1278, 1282, 1293,
504 1298, 1302, 1306, 1219, 2459, 1228, 1857, 1852, 1880, 1249,
505 1250, 1251, 1270, 1851, 1841, 1806, 1825, 1796, 1795, 1802,
506 1816, 1815, 1796, 1782, 1271, 1799, 1798, 0, 1772, 0,
508 1746, 1696, 0, 0, 1679, 0, 1321, 1325, 1346, 1350,
509 1354, 1358, 1362, 1673, 1699, 1725, 1718, 1305, 1717, 1660,
510 1641, 0, 1616, 0, 0, 1626, 1614, 1612, 1611, 0,
511 1610, 1607, 1593, 1474, 1462, 1483, 1458, 0, 0, 1368,
512 1502, 1373, 1378, 1394, 1398, 1402, 0, 1455, 1495, 1439,
513 1450, 0, 1437, 0, 0, 0, 0, 0, 0, 1436,
514 1459, 1441, 0, 1407, 1464, 1203, 1411, 1420, 1428, 1432,
515 0, 0, 1416, 0, 0, 1436, 1434, 1439, 1435, 1445,
516 1451, 1455, 1462, 1393, 1392, 1357, 1288, 2459, 1400, 1287,
517 1424, 1359, 1338, 0, 1335, 1418, 1334, 1326, 1337, 1440,
519 1432, 0, 1321, 1301, 1429, 1305, 1290, 1438, 1296, 1262,
520 1446, 1236, 1252, 1368, 0, 1175, 1140, 1070, 1060, 1037,
521 1052, 894, 765, 744, 733, 741, 650, 527, 548, 1485,
522 1507, 408, 396, 96, 2459, 2459, 1533, 1555, 1577, 1599,
523 1621, 1640, 1651, 1475, 1664, 1677, 1696, 1710, 1718, 1738,
524 1760, 1782, 1800, 1819, 1835, 1843, 1860, 1876, 1893, 1912,
525 1934, 1503, 1948, 1960, 1980, 2002, 2024, 2044, 2061, 1504,
526 2077, 2097, 1297, 2113, 2130, 2151, 1709, 2160, 2180, 2202
529 static yyconst short int yy_def[881] =
531 837, 837, 838, 838, 839, 839, 836, 7, 840, 840,
532 836, 11, 11, 13, 11, 15, 841, 841, 836, 19,
533 836, 836, 836, 842, 836, 836, 836, 836, 836, 836,
534 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
535 836, 836, 836, 836, 843, 836, 836, 836, 836, 836,
536 836, 836, 836, 844, 836, 845, 846, 847, 836, 836,
537 845, 836, 845, 845, 836, 836, 845, 836, 845, 845,
538 845, 848, 836, 845, 836, 849, 836, 848, 848, 848,
539 848, 848, 848, 848, 848, 848, 848, 848, 836, 845,
540 836, 845, 845, 850, 851, 852, 853, 854, 845, 836,
542 836, 855, 849, 856, 855, 855, 855, 855, 855, 855,
543 855, 855, 855, 855, 855, 836, 857, 99, 836, 849,
544 858, 858, 858, 858, 858, 836, 845, 845, 845, 849,
545 856, 855, 855, 836, 836, 859, 836, 836, 836, 836,
546 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
547 836, 836, 836, 836, 836, 836, 836, 836, 843, 836,
548 836, 836, 836, 836, 836, 836, 836, 844, 836, 842,
549 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
550 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
551 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
553 836, 836, 836, 836, 844, 836, 845, 846, 836, 860,
554 836, 861, 845, 845, 836, 836, 836, 862, 845, 836,
555 845, 863, 864, 849, 864, 863, 863, 863, 863, 863,
556 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
557 863, 863, 836, 865, 836, 866, 867, 867, 836, 868,
558 836, 868, 869, 836, 860, 836, 836, 836, 836, 836,
559 836, 870, 836, 855, 864, 871, 872, 855, 855, 855,
560 855, 855, 855, 855, 855, 855, 855, 855, 855, 855,
561 855, 855, 855, 855, 836, 860, 836, 836, 836, 836,
562 836, 864, 864, 864, 864, 864, 864, 864, 864, 864,
564 864, 864, 864, 864, 864, 864, 864, 873, 874, 874,
565 874, 874, 874, 836, 836, 855, 875, 836, 836, 836,
566 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
567 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
568 860, 836, 861, 861, 836, 861, 836, 836, 862, 864,
569 864, 863, 863, 863, 863, 863, 863, 863, 863, 863,
570 863, 863, 863, 863, 863, 863, 863, 863, 876, 865,
571 836, 865, 836, 836, 836, 836, 877, 836, 836, 870,
572 864, 864, 836, 871, 872, 855, 855, 855, 855, 855,
573 855, 855, 855, 855, 855, 855, 855, 855, 855, 855,
575 855, 855, 836, 836, 836, 836, 836, 836, 864, 864,
576 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
577 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
578 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
579 878, 874, 874, 836, 836, 836, 864, 863, 863, 863,
580 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
581 863, 863, 863, 876, 464, 876, 876, 876, 876, 876,
582 876, 836, 836, 836, 877, 836, 836, 836, 836, 864,
583 864, 836, 836, 855, 855, 855, 855, 855, 855, 855,
584 855, 855, 855, 855, 855, 855, 855, 855, 855, 836,
586 836, 836, 864, 864, 864, 864, 864, 864, 864, 864,
587 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
588 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
589 864, 864, 878, 874, 836, 836, 864, 863, 863, 863,
590 863, 863, 863, 863, 863, 863, 863, 863, 876, 876,
591 876, 876, 876, 876, 876, 836, 836, 836, 836, 864,
592 864, 836, 855, 855, 855, 855, 855, 855, 855, 855,
593 855, 855, 855, 836, 836, 864, 864, 864, 864, 864,
594 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
595 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
597 864, 864, 864, 864, 863, 863, 863, 863, 863, 863,
598 863, 863, 863, 863, 876, 876, 876, 876, 876, 876,
599 876, 879, 864, 864, 855, 855, 855, 855, 855, 855,
600 855, 855, 855, 855, 864, 864, 864, 864, 864, 864,
601 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
602 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
603 864, 863, 863, 863, 863, 863, 876, 876, 876, 876,
604 876, 876, 876, 879, 836, 879, 864, 864, 855, 855,
605 855, 855, 855, 864, 864, 864, 864, 864, 864, 864,
606 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
608 864, 864, 863, 863, 863, 863, 876, 876, 876, 876,
609 876, 876, 876, 864, 864, 855, 855, 855, 855, 864,
610 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
611 864, 864, 864, 864, 864, 864, 864, 864, 863, 876,
612 880, 876, 876, 876, 876, 876, 864, 864, 855, 864,
613 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
614 864, 864, 864, 876, 880, 880, 876, 876, 876, 876,
615 864, 864, 864, 864, 864, 864, 864, 876, 880, 876,
616 876, 876, 876, 864, 864, 864, 783, 836, 880, 783,
617 783, 864, 864, 864, 783, 783, 783, 864, 864, 783,
619 783, 864, 864, 836, 783, 864, 836, 783, 864, 836,
620 783, 864, 836, 783, 864, 836, 836, 836, 836, 836,
621 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
622 836, 836, 836, 836, 836, 0, 836, 836, 836, 836,
623 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
624 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
625 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
626 836, 836, 836, 836, 836, 836, 836, 836, 836, 836
629 static yyconst short int yy_nxt[2551] =
631 23, 23, 23, 23, 23, 23, 23, 23, 836, 263,
632 836, 25, 263, 308, 836, 25, 95, 95, 251, 204,
633 204, 204, 204, 204, 204, 135, 135, 135, 135, 248,
634 836, 137, 173, 173, 173, 173, 173, 173, 173, 135,
635 135, 135, 135, 175, 177, 137, 179, 187, 180, 263,
636 192, 206, 206, 206, 206, 181, 244, 176, 836, 26,
637 188, 178, 212, 26, 28, 182, 183, 184, 224, 28,
638 193, 185, 186, 263, 273, 226, 213, 29, 29, 29,
639 29, 29, 29, 29, 138, 227, 225, 96, 96, 252,
640 30, 31, 32, 33, 34, 35, 36, 37, 138, 232,
642 228, 38, 249, 39, 229, 233, 234, 40, 41, 195,
643 42, 43, 263, 284, 263, 196, 197, 44, 239, 45,
644 198, 199, 46, 47, 240, 200, 245, 48, 224, 263,
645 268, 263, 265, 241, 49, 50, 263, 51, 263, 52,
646 269, 53, 263, 54, 28, 263, 225, 263, 215, 28,
647 216, 216, 216, 216, 216, 216, 216, 29, 29, 29,
648 29, 29, 29, 29, 836, 263, 308, 257, 175, 192,
649 30, 31, 32, 33, 34, 35, 36, 37, 381, 272,
650 382, 38, 176, 39, 278, 835, 270, 40, 41, 193,
651 42, 43, 277, 206, 206, 206, 206, 44, 274, 45,
653 279, 177, 46, 47, 275, 276, 280, 48, 217, 632,
654 355, 316, 371, 372, 49, 50, 218, 51, 178, 52,
655 356, 53, 310, 54, 22, 55, 55, 55, 55, 56,
656 57, 56, 56, 56, 56, 58, 59, 60, 61, 62,
657 63, 64, 56, 65, 66, 66, 66, 66, 66, 66,
658 67, 68, 69, 70, 56, 71, 72, 72, 72, 72,
659 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
660 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
661 72, 72, 73, 74, 75, 56, 76, 77, 72, 72,
662 78, 79, 80, 72, 72, 81, 82, 72, 83, 84,
664 72, 85, 72, 86, 72, 87, 72, 72, 88, 72,
665 72, 89, 90, 91, 92, 22, 55, 55, 55, 55,
666 56, 97, 56, 56, 56, 56, 98, 59, 60, 61,
667 62, 99, 64, 56, 100, 101, 101, 101, 101, 101,
668 101, 67, 68, 69, 70, 56, 71, 102, 102, 102,
669 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
670 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
671 102, 102, 102, 73, 74, 75, 56, 103, 104, 102,
672 102, 105, 106, 107, 102, 102, 108, 109, 102, 110,
673 111, 102, 112, 102, 113, 102, 114, 102, 102, 115,
675 102, 102, 89, 90, 91, 92, 116, 187, 206, 206,
676 206, 206, 834, 117, 285, 833, 56, 263, 118, 56,
677 188, 119, 119, 119, 119, 119, 119, 119, 263, 308,
678 56, 263, 215, 56, 216, 216, 216, 216, 216, 216,
679 216, 212, 263, 333, 256, 257, 257, 257, 257, 257,
680 257, 179, 584, 180, 585, 213, 263, 308, 263, 263,
681 181, 263, 263, 308, 120, 334, 121, 121, 122, 121,
682 121, 121, 121, 121, 123, 121, 124, 121, 121, 125,
683 121, 121, 121, 121, 121, 121, 121, 121, 121, 126,
684 386, 263, 127, 22, 128, 263, 263, 311, 22, 387,
686 263, 56, 263, 129, 56, 388, 22, 22, 22, 22,
687 22, 22, 22, 258, 22, 56, 270, 312, 56, 400,
688 271, 392, 258, 259, 313, 260, 260, 260, 260, 260,
689 260, 260, 287, 360, 288, 288, 288, 288, 288, 288,
690 288, 182, 183, 184, 361, 362, 56, 185, 186, 130,
691 131, 437, 830, 102, 132, 102, 414, 389, 102, 133,
692 398, 102, 102, 438, 102, 397, 102, 390, 102, 391,
693 415, 102, 829, 393, 134, 56, 22, 127, 139, 140,
694 140, 140, 140, 139, 141, 139, 139, 139, 139, 141,
695 139, 139, 139, 139, 142, 139, 139, 143, 143, 143,
697 143, 143, 143, 143, 139, 139, 139, 139, 139, 139,
698 144, 145, 146, 147, 148, 149, 150, 151, 139, 139,
699 139, 152, 139, 153, 139, 139, 139, 154, 155, 139,
700 156, 157, 139, 139, 139, 139, 139, 158, 139, 159,
701 139, 139, 160, 161, 139, 139, 139, 162, 139, 139,
702 139, 139, 139, 139, 163, 164, 139, 165, 139, 166,
703 139, 167, 139, 168, 139, 169, 139, 139, 139, 258,
704 263, 173, 173, 173, 173, 173, 173, 173, 263, 259,
705 263, 260, 260, 260, 260, 260, 260, 260, 195, 324,
706 325, 326, 327, 435, 196, 197, 828, 436, 549, 198,
708 199, 263, 308, 550, 200, 204, 204, 204, 204, 204,
709 204, 173, 173, 173, 173, 173, 173, 173, 204, 204,
710 204, 204, 204, 204, 206, 206, 206, 206, 344, 345,
711 346, 344, 263, 263, 281, 424, 425, 263, 263, 261,
712 282, 348, 348, 348, 348, 348, 348, 262, 491, 283,
713 289, 401, 290, 347, 347, 347, 347, 347, 347, 347,
714 263, 426, 215, 291, 216, 216, 216, 216, 216, 216,
715 216, 379, 379, 379, 379, 379, 379, 292, 427, 293,
716 294, 827, 295, 826, 428, 296, 263, 297, 298, 299,
717 300, 301, 302, 825, 394, 303, 304, 305, 402, 306,
719 429, 824, 399, 258, 263, 395, 396, 224, 416, 417,
720 499, 265, 418, 287, 307, 257, 257, 257, 257, 257,
721 257, 257, 258, 263, 419, 225, 263, 308, 263, 308,
722 263, 308, 287, 395, 257, 257, 257, 257, 257, 257,
723 257, 378, 378, 378, 378, 378, 378, 378, 258, 405,
724 405, 405, 405, 405, 405, 405, 263, 308, 259, 485,
725 260, 260, 260, 260, 260, 260, 260, 371, 372, 488,
726 258, 371, 372, 376, 344, 345, 346, 344, 432, 409,
727 287, 377, 288, 288, 288, 288, 288, 288, 288, 410,
728 433, 263, 497, 411, 344, 345, 346, 344, 412, 442,
730 445, 445, 445, 445, 443, 434, 263, 263, 413, 344,
731 345, 346, 344, 347, 347, 347, 347, 347, 347, 347,
732 348, 348, 348, 348, 348, 348, 464, 464, 464, 465,
733 446, 474, 474, 474, 474, 474, 474, 476, 263, 263,
734 263, 263, 263, 263, 263, 263, 521, 823, 486, 378,
735 378, 378, 378, 378, 378, 378, 504, 466, 263, 522,
736 468, 505, 446, 263, 478, 469, 477, 484, 489, 470,
737 476, 519, 506, 263, 308, 471, 379, 379, 379, 379,
738 379, 379, 405, 405, 405, 405, 405, 405, 405, 524,
739 520, 263, 308, 525, 263, 487, 263, 263, 477, 501,
741 263, 496, 263, 494, 490, 492, 498, 445, 445, 445,
742 445, 263, 263, 263, 535, 493, 535, 263, 495, 536,
743 536, 536, 536, 536, 536, 536, 464, 464, 464, 464,
744 263, 501, 566, 564, 534, 836, 836, 836, 836, 836,
745 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
746 836, 836, 836, 836, 836, 263, 822, 466, 263, 308,
747 468, 836, 836, 836, 836, 469, 567, 551, 569, 470,
748 563, 478, 565, 821, 628, 471, 675, 676, 552, 571,
749 568, 572, 554, 474, 474, 474, 474, 474, 474, 570,
750 558, 553, 558, 627, 820, 559, 559, 559, 559, 559,
752 559, 559, 819, 574, 263, 574, 263, 555, 575, 575,
753 575, 575, 575, 575, 575, 263, 573, 536, 536, 536,
754 536, 536, 536, 536, 536, 536, 536, 536, 536, 536,
755 536, 609, 836, 836, 836, 836, 610, 836, 836, 836,
756 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
757 836, 836, 836, 263, 263, 836, 836, 836, 836, 836,
758 836, 836, 836, 559, 559, 559, 559, 559, 559, 559,
759 615, 476, 263, 625, 263, 263, 616, 818, 679, 263,
760 626, 618, 655, 559, 559, 559, 559, 559, 559, 559,
761 617, 619, 620, 476, 621, 575, 575, 575, 575, 575,
763 575, 575, 263, 263, 656, 575, 575, 575, 575, 575,
764 575, 575, 657, 657, 657, 657, 657, 657, 657, 766,
765 629, 675, 676, 631, 817, 630, 836, 836, 836, 836,
766 675, 676, 682, 633, 836, 836, 836, 836, 681, 634,
767 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
768 836, 836, 836, 836, 836, 836, 263, 263, 263, 667,
769 836, 836, 836, 836, 657, 657, 657, 657, 657, 657,
770 657, 680, 683, 836, 836, 836, 836, 263, 668, 836,
771 836, 836, 836, 836, 836, 836, 836, 671, 816, 670,
772 669, 672, 779, 673, 836, 836, 836, 836, 815, 836,
774 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
775 836, 731, 263, 813, 708, 441, 441, 718, 717, 716,
776 732, 733, 836, 836, 836, 836, 836, 836, 836, 741,
777 812, 709, 795, 796, 707, 810, 712, 467, 467, 809,
778 719, 807, 710, 711, 467, 467, 713, 836, 836, 836,
779 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
780 836, 836, 836, 836, 836, 836, 836, 800, 740, 836,
781 836, 836, 836, 749, 836, 836, 836, 836, 742, 836,
782 836, 836, 836, 806, 467, 467, 743, 803, 802, 799,
783 744, 467, 467, 798, 746, 836, 836, 836, 836, 836,
785 836, 836, 836, 836, 836, 836, 836, 767, 836, 836,
786 836, 836, 836, 836, 836, 836, 766, 764, 467, 794,
787 745, 836, 836, 836, 836, 467, 793, 792, 768, 836,
788 836, 836, 836, 836, 836, 836, 836, 788, 789, 778,
789 836, 836, 836, 836, 804, 770, 836, 836, 836, 836,
790 769, 766, 836, 836, 836, 836, 836, 836, 836, 836,
791 797, 801, 780, 836, 836, 836, 836, 805, 467, 808,
792 786, 781, 783, 782, 467, 467, 785, 787, 784, 467,
793 766, 467, 467, 811, 814, 205, 467, 205, 467, 467,
794 467, 777, 790, 205, 776, 467, 467, 467, 775, 774,
796 773, 772, 263, 467, 831, 831, 831, 831, 831, 831,
797 831, 832, 791, 349, 380, 349, 380, 771, 766, 791,
798 763, 349, 380, 762, 761, 760, 831, 831, 831, 831,
799 831, 831, 831, 22, 22, 22, 22, 22, 22, 22,
800 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
801 22, 22, 22, 22, 22, 24, 24, 24, 24, 24,
802 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
803 24, 24, 24, 24, 24, 24, 24, 27, 27, 27,
804 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
805 27, 27, 27, 27, 27, 27, 27, 27, 27, 94,
807 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
808 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
809 94, 136, 136, 136, 136, 136, 136, 136, 136, 136,
810 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
811 136, 136, 136, 170, 170, 170, 170, 170, 170, 170,
812 170, 170, 170, 170, 170, 759, 170, 170, 170, 170,
813 170, 170, 203, 203, 203, 203, 203, 203, 207, 758,
814 207, 207, 757, 756, 755, 207, 754, 753, 752, 207,
815 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
816 208, 208, 751, 208, 208, 208, 208, 208, 208, 210,
818 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
819 210, 750, 210, 210, 210, 210, 210, 210, 222, 475,
820 222, 475, 222, 222, 263, 263, 222, 475, 222, 222,
821 223, 223, 263, 748, 223, 747, 223, 223, 246, 246,
822 246, 246, 246, 246, 246, 246, 246, 739, 246, 246,
823 246, 246, 246, 246, 246, 246, 246, 246, 738, 246,
824 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
825 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
826 737, 247, 250, 250, 250, 250, 250, 250, 250, 250,
827 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
829 250, 250, 250, 253, 253, 253, 253, 253, 253, 253,
830 253, 253, 253, 253, 253, 736, 253, 253, 253, 253,
831 253, 253, 255, 255, 255, 255, 255, 255, 255, 255,
832 255, 255, 255, 255, 735, 255, 255, 255, 255, 255,
833 255, 264, 734, 264, 730, 264, 729, 264, 264, 728,
834 727, 264, 726, 264, 264, 266, 266, 725, 724, 723,
835 266, 266, 266, 286, 286, 286, 286, 286, 722, 286,
836 286, 286, 286, 286, 286, 721, 286, 286, 286, 286,
837 286, 286, 309, 309, 309, 720, 309, 263, 309, 309,
838 715, 714, 309, 706, 309, 309, 317, 317, 317, 317,
840 317, 317, 317, 317, 317, 317, 317, 317, 705, 317,
841 317, 317, 317, 317, 317, 341, 341, 341, 341, 341,
842 341, 341, 341, 341, 341, 341, 341, 704, 341, 341,
843 341, 341, 341, 341, 343, 343, 343, 343, 343, 343,
844 343, 343, 343, 343, 343, 343, 343, 343, 343, 343,
845 343, 343, 343, 343, 343, 343, 222, 703, 222, 702,
846 222, 222, 701, 700, 222, 699, 222, 222, 350, 698,
847 350, 697, 350, 350, 696, 695, 350, 694, 350, 350,
848 370, 370, 370, 370, 370, 370, 370, 370, 370, 370,
849 370, 370, 370, 370, 370, 370, 370, 370, 370, 370,
851 370, 370, 246, 246, 246, 246, 246, 246, 246, 246,
852 246, 693, 246, 246, 246, 246, 246, 246, 246, 246,
853 246, 246, 692, 246, 247, 247, 247, 247, 247, 247,
854 247, 247, 247, 691, 247, 247, 247, 247, 247, 247,
855 247, 247, 247, 247, 250, 250, 250, 250, 250, 250,
856 250, 250, 250, 690, 250, 250, 250, 250, 250, 250,
857 250, 250, 250, 250, 253, 253, 253, 253, 253, 253,
858 253, 253, 253, 253, 253, 253, 689, 253, 253, 253,
859 253, 253, 253, 384, 688, 384, 687, 384, 686, 384,
860 384, 685, 684, 384, 263, 384, 384, 385, 385, 385,
862 385, 385, 385, 385, 385, 263, 385, 385, 385, 385,
863 385, 385, 385, 385, 385, 385, 385, 385, 385, 309,
864 309, 309, 263, 309, 263, 309, 309, 263, 678, 309,
865 677, 309, 309, 317, 317, 317, 317, 317, 317, 317,
866 317, 317, 317, 317, 317, 666, 317, 317, 317, 317,
867 317, 317, 467, 467, 467, 665, 664, 663, 662, 661,
868 660, 659, 658, 467, 467, 654, 653, 467, 533, 652,
869 533, 651, 533, 533, 650, 649, 533, 648, 533, 533,
870 674, 674, 674, 674, 674, 674, 674, 674, 674, 674,
871 674, 674, 674, 674, 674, 674, 674, 674, 674, 674,
873 674, 674, 765, 765, 647, 765, 765, 765, 765, 765,
874 765, 765, 765, 765, 765, 765, 765, 765, 765, 765,
875 765, 765, 765, 765, 646, 645, 644, 643, 642, 641,
876 640, 639, 638, 637, 636, 635, 263, 263, 624, 623,
877 622, 614, 613, 612, 611, 608, 607, 606, 605, 604,
878 603, 602, 601, 600, 599, 598, 597, 596, 595, 594,
879 593, 592, 591, 590, 589, 588, 587, 586, 583, 582,
880 581, 580, 579, 578, 577, 576, 263, 263, 263, 263,
881 263, 562, 561, 560, 557, 479, 556, 548, 547, 546,
882 545, 544, 543, 542, 541, 540, 539, 538, 537, 532,
884 531, 530, 529, 528, 527, 526, 523, 518, 517, 516,
885 515, 514, 513, 512, 511, 510, 509, 508, 507, 503,
886 502, 473, 500, 263, 483, 383, 482, 481, 480, 479,
887 473, 472, 463, 462, 461, 460, 459, 458, 457, 456,
888 455, 454, 453, 452, 451, 450, 449, 448, 447, 836,
889 319, 318, 444, 440, 439, 431, 430, 423, 422, 421,
890 420, 408, 407, 406, 404, 403, 263, 263, 263, 383,
891 263, 375, 374, 254, 252, 248, 373, 369, 368, 367,
892 366, 365, 364, 363, 359, 358, 357, 354, 353, 352,
893 351, 224, 342, 209, 340, 339, 338, 337, 336, 335,
895 332, 331, 330, 329, 328, 323, 322, 321, 172, 171,
896 314, 202, 201, 194, 191, 190, 189, 174, 212, 320,
897 319, 318, 314, 836, 224, 213, 315, 314, 267, 263,
898 211, 254, 243, 242, 238, 237, 236, 235, 231, 230,
899 221, 220, 219, 214, 211, 209, 202, 201, 194, 191,
900 190, 189, 174, 172, 171, 836, 93, 93, 21, 836,
901 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
902 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
903 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
904 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
906 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
907 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
908 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
909 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
910 836, 836, 836, 836, 836, 836, 836, 836, 836, 836
913 static yyconst short int yy_chk[2551] =
915 3, 3, 3, 3, 4, 4, 4, 4, 0, 108,
916 0, 3, 121, 121, 0, 4, 9, 10, 96, 50,
917 50, 50, 50, 50, 50, 17, 17, 17, 17, 95,
918 0, 17, 29, 29, 29, 29, 29, 29, 29, 18,
919 18, 18, 18, 31, 32, 18, 33, 35, 33, 115,
920 39, 55, 55, 55, 55, 33, 93, 31, 0, 3,
921 35, 32, 63, 4, 5, 34, 34, 34, 76, 5,
922 39, 34, 34, 105, 108, 78, 63, 5, 5, 5,
923 5, 5, 5, 5, 17, 78, 76, 9, 10, 96,
924 5, 5, 5, 5, 5, 5, 5, 5, 18, 82,
926 79, 5, 95, 5, 79, 82, 82, 5, 5, 41,
927 5, 5, 107, 115, 111, 41, 41, 5, 87, 5,
928 41, 41, 5, 5, 87, 41, 93, 5, 103, 132,
929 105, 110, 103, 87, 5, 5, 109, 5, 112, 5,
930 105, 5, 133, 5, 6, 113, 103, 570, 65, 6,
931 65, 65, 65, 65, 65, 65, 65, 6, 6, 6,
932 6, 6, 6, 6, 118, 122, 122, 118, 145, 153,
933 6, 6, 6, 6, 6, 6, 6, 6, 265, 107,
934 265, 6, 145, 6, 111, 834, 132, 6, 6, 153,
935 6, 6, 110, 140, 140, 140, 140, 6, 109, 6,
937 112, 146, 6, 6, 109, 109, 113, 6, 65, 570,
938 229, 133, 244, 244, 6, 6, 65, 6, 146, 6,
939 229, 6, 122, 6, 7, 7, 7, 7, 7, 7,
940 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
941 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
942 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
943 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
944 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
945 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
946 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
948 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
949 7, 7, 7, 7, 7, 11, 11, 11, 11, 11,
950 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
951 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
952 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
953 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
954 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
955 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
956 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
957 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
959 11, 11, 11, 11, 11, 11, 13, 149, 116, 116,
960 116, 116, 833, 13, 116, 832, 13, 268, 13, 13,
961 149, 13, 13, 13, 13, 13, 13, 13, 123, 123,
962 13, 270, 66, 13, 66, 66, 66, 66, 66, 66,
963 66, 99, 269, 186, 99, 99, 99, 99, 99, 99,
964 99, 147, 511, 147, 511, 99, 124, 124, 281, 106,
965 147, 273, 125, 125, 13, 186, 13, 13, 13, 13,
966 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
967 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
968 268, 277, 13, 15, 15, 271, 272, 123, 15, 269,
970 278, 15, 275, 15, 15, 270, 15, 15, 15, 15,
971 15, 15, 15, 101, 15, 15, 106, 124, 15, 281,
972 106, 273, 119, 101, 125, 101, 101, 101, 101, 101,
973 101, 101, 119, 234, 119, 119, 119, 119, 119, 119,
974 119, 148, 148, 148, 234, 234, 15, 148, 148, 15,
975 15, 305, 829, 15, 15, 15, 293, 271, 15, 15,
976 278, 15, 15, 305, 15, 277, 15, 271, 15, 272,
977 293, 15, 828, 275, 15, 15, 15, 15, 19, 19,
978 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
979 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
981 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
982 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
983 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
984 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
985 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
986 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
987 19, 19, 19, 19, 19, 19, 19, 19, 19, 100,
988 114, 143, 143, 143, 143, 143, 143, 143, 393, 100,
989 283, 100, 100, 100, 100, 100, 100, 100, 155, 179,
990 179, 179, 179, 304, 155, 155, 827, 304, 465, 155,
992 155, 309, 309, 465, 155, 164, 164, 164, 164, 164,
993 164, 173, 173, 173, 173, 173, 173, 173, 204, 204,
994 204, 204, 204, 204, 206, 206, 206, 206, 212, 212,
995 212, 212, 276, 280, 114, 299, 299, 284, 402, 100,
996 114, 217, 217, 217, 217, 217, 217, 100, 393, 114,
997 120, 283, 120, 215, 215, 215, 215, 215, 215, 215,
998 316, 299, 216, 120, 216, 216, 216, 216, 216, 216,
999 216, 261, 261, 261, 261, 261, 261, 120, 300, 120,
1000 120, 826, 120, 825, 300, 120, 387, 120, 120, 120,
1001 120, 120, 120, 824, 276, 120, 120, 120, 284, 120,
1003 300, 823, 280, 256, 390, 276, 276, 120, 294, 294,
1004 402, 120, 294, 256, 120, 256, 256, 256, 256, 256,
1005 256, 256, 257, 400, 294, 120, 310, 310, 311, 311,
1006 312, 312, 257, 316, 257, 257, 257, 257, 257, 257,
1007 257, 259, 259, 259, 259, 259, 259, 259, 260, 287,
1008 287, 287, 287, 287, 287, 287, 313, 313, 260, 387,
1009 260, 260, 260, 260, 260, 260, 260, 370, 370, 390,
1010 288, 372, 372, 256, 343, 343, 343, 343, 303, 292,
1011 288, 256, 288, 288, 288, 288, 288, 288, 288, 292,
1012 303, 388, 400, 292, 344, 344, 344, 344, 292, 310,
1014 345, 345, 345, 345, 312, 303, 386, 391, 292, 346,
1015 346, 346, 346, 347, 347, 347, 347, 347, 347, 347,
1016 348, 348, 348, 348, 348, 348, 369, 369, 369, 369,
1017 347, 376, 376, 376, 376, 376, 376, 378, 389, 392,
1018 394, 395, 396, 398, 399, 401, 428, 822, 388, 378,
1019 378, 378, 378, 378, 378, 378, 410, 369, 487, 428,
1020 369, 410, 347, 490, 379, 369, 378, 386, 391, 369,
1021 405, 427, 410, 442, 442, 369, 379, 379, 379, 379,
1022 379, 379, 405, 405, 405, 405, 405, 405, 405, 431,
1023 427, 443, 443, 431, 491, 389, 488, 485, 378, 405,
1025 567, 399, 492, 396, 392, 394, 401, 445, 445, 445,
1026 445, 493, 495, 496, 446, 395, 446, 494, 398, 446,
1027 446, 446, 446, 446, 446, 446, 464, 464, 464, 464,
1028 566, 405, 490, 487, 442, 466, 466, 466, 466, 467,
1029 467, 467, 467, 468, 468, 468, 468, 469, 469, 469,
1030 469, 470, 470, 470, 470, 499, 821, 464, 534, 534,
1031 464, 471, 471, 471, 471, 464, 491, 466, 493, 464,
1032 485, 474, 488, 820, 567, 464, 622, 622, 468, 495,
1033 492, 496, 470, 474, 474, 474, 474, 474, 474, 494,
1034 477, 469, 477, 566, 819, 477, 477, 477, 477, 477,
1036 477, 477, 818, 501, 625, 501, 564, 471, 501, 501,
1037 501, 501, 501, 501, 501, 565, 499, 535, 535, 535,
1038 535, 535, 535, 535, 536, 536, 536, 536, 536, 536,
1039 536, 543, 549, 549, 549, 549, 543, 550, 550, 550,
1040 550, 551, 551, 551, 551, 552, 552, 552, 552, 553,
1041 553, 553, 553, 568, 569, 554, 554, 554, 554, 555,
1042 555, 555, 555, 558, 558, 558, 558, 558, 558, 558,
1043 549, 559, 571, 564, 572, 632, 550, 817, 625, 631,
1044 565, 552, 599, 559, 559, 559, 559, 559, 559, 559,
1045 551, 553, 554, 575, 555, 574, 574, 574, 574, 574,
1047 574, 574, 626, 634, 599, 575, 575, 575, 575, 575,
1048 575, 575, 600, 600, 600, 600, 600, 600, 600, 766,
1049 568, 674, 674, 569, 816, 568, 615, 615, 615, 615,
1050 676, 676, 632, 571, 616, 616, 616, 616, 631, 572,
1051 617, 617, 617, 617, 618, 618, 618, 618, 619, 619,
1052 619, 619, 620, 620, 620, 620, 680, 681, 682, 615,
1053 621, 621, 621, 621, 657, 657, 657, 657, 657, 657,
1054 657, 626, 634, 667, 667, 667, 667, 683, 616, 668,
1055 668, 668, 668, 669, 669, 669, 669, 619, 813, 618,
1056 617, 620, 766, 621, 670, 670, 670, 670, 812, 671,
1058 671, 671, 671, 672, 672, 672, 672, 673, 673, 673,
1059 673, 695, 718, 810, 668, 873, 873, 682, 681, 680,
1060 695, 695, 707, 707, 707, 707, 708, 708, 708, 708,
1061 809, 669, 787, 790, 667, 807, 672, 790, 787, 806,
1062 683, 804, 670, 671, 790, 787, 673, 709, 709, 709,
1063 709, 710, 710, 710, 710, 711, 711, 711, 711, 712,
1064 712, 712, 712, 713, 713, 713, 713, 795, 707, 740,
1065 740, 740, 740, 718, 742, 742, 742, 742, 709, 743,
1066 743, 743, 743, 803, 797, 795, 710, 799, 798, 793,
1067 711, 797, 795, 792, 713, 744, 744, 744, 744, 745,
1069 745, 745, 745, 746, 746, 746, 746, 742, 764, 764,
1070 764, 764, 767, 767, 767, 767, 789, 740, 814, 786,
1071 712, 768, 768, 768, 768, 814, 785, 784, 743, 769,
1072 769, 769, 769, 770, 770, 770, 770, 779, 779, 764,
1073 778, 778, 778, 778, 800, 746, 780, 780, 780, 780,
1074 745, 779, 781, 781, 781, 781, 782, 782, 782, 782,
1075 791, 796, 767, 783, 783, 783, 783, 801, 796, 805,
1076 777, 768, 770, 769, 791, 796, 776, 778, 773, 805,
1077 765, 791, 801, 808, 811, 844, 805, 844, 808, 801,
1078 800, 762, 782, 844, 761, 808, 811, 800, 760, 753,
1080 751, 750, 749, 811, 830, 830, 830, 830, 830, 830,
1081 830, 831, 783, 862, 870, 862, 870, 748, 741, 783,
1082 737, 862, 870, 736, 735, 734, 831, 831, 831, 831,
1083 831, 831, 831, 837, 837, 837, 837, 837, 837, 837,
1084 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1085 837, 837, 837, 837, 837, 838, 838, 838, 838, 838,
1086 838, 838, 838, 838, 838, 838, 838, 838, 838, 838,
1087 838, 838, 838, 838, 838, 838, 838, 839, 839, 839,
1088 839, 839, 839, 839, 839, 839, 839, 839, 839, 839,
1089 839, 839, 839, 839, 839, 839, 839, 839, 839, 840,
1091 840, 840, 840, 840, 840, 840, 840, 840, 840, 840,
1092 840, 840, 840, 840, 840, 840, 840, 840, 840, 840,
1093 840, 841, 841, 841, 841, 841, 841, 841, 841, 841,
1094 841, 841, 841, 841, 841, 841, 841, 841, 841, 841,
1095 841, 841, 841, 842, 842, 842, 842, 842, 842, 842,
1096 842, 842, 842, 842, 842, 733, 842, 842, 842, 842,
1097 842, 842, 843, 843, 843, 843, 843, 843, 845, 732,
1098 845, 845, 731, 729, 728, 845, 727, 726, 723, 845,
1099 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,
1100 846, 846, 721, 846, 846, 846, 846, 846, 846, 847,
1102 847, 847, 847, 847, 847, 847, 847, 847, 847, 847,
1103 847, 720, 847, 847, 847, 847, 847, 847, 848, 877,
1104 848, 877, 848, 848, 719, 717, 848, 877, 848, 848,
1105 849, 849, 716, 715, 849, 714, 849, 849, 850, 850,
1106 850, 850, 850, 850, 850, 850, 850, 705, 850, 850,
1107 850, 850, 850, 850, 850, 850, 850, 850, 702, 850,
1108 851, 851, 851, 851, 851, 851, 851, 851, 851, 851,
1109 851, 851, 851, 851, 851, 851, 851, 851, 851, 851,
1110 701, 851, 852, 852, 852, 852, 852, 852, 852, 852,
1111 852, 852, 852, 852, 852, 852, 852, 852, 852, 852,
1113 852, 852, 852, 853, 853, 853, 853, 853, 853, 853,
1114 853, 853, 853, 853, 853, 699, 853, 853, 853, 853,
1115 853, 853, 854, 854, 854, 854, 854, 854, 854, 854,
1116 854, 854, 854, 854, 697, 854, 854, 854, 854, 854,
1117 854, 855, 696, 855, 694, 855, 693, 855, 855, 692,
1118 691, 855, 690, 855, 855, 856, 856, 689, 688, 687,
1119 856, 856, 856, 857, 857, 857, 857, 857, 686, 857,
1120 857, 857, 857, 857, 857, 685, 857, 857, 857, 857,
1121 857, 857, 858, 858, 858, 684, 858, 679, 858, 858,
1122 678, 677, 858, 666, 858, 858, 859, 859, 859, 859,
1124 859, 859, 859, 859, 859, 859, 859, 859, 665, 859,
1125 859, 859, 859, 859, 859, 860, 860, 860, 860, 860,
1126 860, 860, 860, 860, 860, 860, 860, 664, 860, 860,
1127 860, 860, 860, 860, 861, 861, 861, 861, 861, 861,
1128 861, 861, 861, 861, 861, 861, 861, 861, 861, 861,
1129 861, 861, 861, 861, 861, 861, 863, 663, 863, 661,
1130 863, 863, 659, 658, 863, 655, 863, 863, 864, 654,
1131 864, 652, 864, 864, 650, 649, 864, 647, 864, 864,
1132 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
1133 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
1135 865, 865, 866, 866, 866, 866, 866, 866, 866, 866,
1136 866, 646, 866, 866, 866, 866, 866, 866, 866, 866,
1137 866, 866, 645, 866, 867, 867, 867, 867, 867, 867,
1138 867, 867, 867, 644, 867, 867, 867, 867, 867, 867,
1139 867, 867, 867, 867, 868, 868, 868, 868, 868, 868,
1140 868, 868, 868, 642, 868, 868, 868, 868, 868, 868,
1141 868, 868, 868, 868, 869, 869, 869, 869, 869, 869,
1142 869, 869, 869, 869, 869, 869, 640, 869, 869, 869,
1143 869, 869, 869, 871, 639, 871, 638, 871, 637, 871,
1144 871, 636, 635, 871, 633, 871, 871, 872, 872, 872,
1146 872, 872, 872, 872, 872, 630, 872, 872, 872, 872,
1147 872, 872, 872, 872, 872, 872, 872, 872, 872, 874,
1148 874, 874, 629, 874, 628, 874, 874, 627, 624, 874,
1149 623, 874, 874, 875, 875, 875, 875, 875, 875, 875,
1150 875, 875, 875, 875, 875, 614, 875, 875, 875, 875,
1151 875, 875, 876, 876, 876, 612, 611, 606, 605, 604,
1152 603, 602, 601, 876, 876, 598, 597, 876, 878, 596,
1153 878, 595, 878, 878, 594, 593, 878, 591, 878, 878,
1154 879, 879, 879, 879, 879, 879, 879, 879, 879, 879,
1155 879, 879, 879, 879, 879, 879, 879, 879, 879, 879,
1157 879, 879, 880, 880, 590, 880, 880, 880, 880, 880,
1158 880, 880, 880, 880, 880, 880, 880, 880, 880, 880,
1159 880, 880, 880, 880, 589, 588, 587, 586, 585, 584,
1160 583, 582, 581, 579, 578, 576, 573, 563, 561, 560,
1161 556, 547, 546, 545, 544, 542, 541, 540, 539, 532,
1162 531, 530, 529, 528, 527, 526, 525, 524, 523, 522,
1163 521, 519, 517, 516, 515, 514, 513, 512, 510, 509,
1164 508, 507, 506, 505, 504, 503, 498, 497, 489, 486,
1165 484, 483, 481, 480, 476, 475, 472, 463, 460, 459,
1166 458, 457, 456, 455, 454, 452, 451, 449, 447, 440,
1168 439, 437, 436, 435, 433, 432, 430, 425, 424, 423,
1169 421, 419, 418, 417, 416, 415, 414, 412, 411, 409,
1170 408, 404, 403, 397, 385, 384, 383, 382, 381, 380,
1171 375, 373, 368, 367, 366, 365, 364, 362, 361, 360,
1172 359, 358, 357, 356, 355, 354, 353, 352, 351, 341,
1173 318, 317, 315, 307, 306, 302, 301, 298, 297, 296,
1174 295, 291, 290, 289, 286, 285, 282, 279, 274, 266,
1175 264, 255, 254, 253, 252, 248, 245, 243, 242, 241,
1176 239, 238, 236, 235, 233, 231, 230, 228, 227, 226,
1177 225, 224, 210, 208, 200, 199, 198, 196, 193, 192,
1179 185, 184, 183, 181, 180, 177, 175, 174, 171, 170,
1180 169, 157, 156, 154, 152, 151, 150, 144, 142, 138,
1181 137, 136, 134, 131, 130, 129, 128, 126, 104, 102,
1182 98, 97, 89, 88, 86, 85, 84, 83, 81, 80,
1183 70, 69, 67, 64, 58, 57, 43, 42, 40, 38,
1184 37, 36, 30, 25, 24, 21, 12, 8, 836, 836,
1185 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1186 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1187 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1188 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1190 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1191 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1192 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1193 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1194 836, 836, 836, 836, 836, 836, 836, 836, 836, 836
1197 static yy_state_type yy_last_accepting_state;
1198 static char *yy_last_accepting_cpos;
1200 /* The intent behind this definition is that it'll catch
1201 * any uses of REJECT which flex missed.
1203 #define REJECT reject_used_but_not_detected
1204 #define yymore() yymore_used_but_not_detected
1205 #define YY_MORE_ADJ 0
1207 #line 1 "yaccParser/hslexer.flex"
1209 #line 2 "yaccParser/hslexer.flex"
1210 /**********************************************************************
1213 * LEX grammar for Haskell. *
1214 * ------------------------ *
1216 * (c) Copyright K. Hammond, University of Glasgow, *
1217 * 10th. February 1989 *
1219 * Modification History *
1220 * -------------------- *
1222 * 22/08/91 kh Initial Haskell 1.1 version. *
1223 * 18/10/91 kh Added 'ccall'. *
1224 * 19/11/91 kh Tidied generally. *
1225 * 04/12/91 kh Added Int#. *
1226 * 31/01/92 kh Haskell 1.2 version. *
1227 * 24/04/92 ps Added 'scc'. *
1228 * 03/06/92 kh Changed Infix/Prelude Handling. *
1229 * 23/08/93 jsm Changed to support flex *
1236 **********************************************************************/
1238 #include "../../includes/config.h"
1242 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
1244 /* An ANSI string.h and pre-ANSI memory.h might conflict. */
1245 #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
1247 #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
1248 #define index strchr
1249 #define rindex strrchr
1250 #define bcopy(s, d, n) memcpy ((d), (s), (n))
1251 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
1252 #define bzero(s, n) memset ((s), 0, (n))
1253 #else /* not STDC_HEADERS and not HAVE_STRING_H */
1254 #include <strings.h>
1255 /* memory.h and strings.h conflict on some systems. */
1256 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
1258 #include "hspincl.h"
1259 #include "hsparser.tab.h"
1260 #include "constants.h"
1263 /* Our substitute for <ctype.h> */
1272 #define _isconstr(s) (CharTable[*s]&(_C))
1273 BOOLEAN isconstr PROTO((char *)); /* fwd decl */
1275 static unsigned char CharTable[NCHARS] = {
1276 /* nul */ 0, 0, 0, 0, 0, 0, 0, 0,
1277 /* bs */ 0, _S, _S, _S, _S, 0, 0, 0,
1278 /* dle */ 0, 0, 0, 0, 0, 0, 0, 0,
1279 /* can */ 0, 0, 0, 0, 0, 0, 0, 0,
1280 /* sp */ _S, 0, 0, 0, 0, 0, 0, 0,
1281 /* '(' */ 0, 0, 0, 0, 0, 0, 0, 0,
1282 /* '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,
1283 /* '8' */ _D|_H, _D|_H, _C, 0, 0, 0, 0, 0,
1284 /* '@' */ 0, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _C,
1285 /* 'H' */ _C, _C, _C, _C, _C, _C, _C, _C,
1286 /* 'P' */ _C, _C, _C, _C, _C, _C, _C, _C,
1287 /* 'X' */ _C, _C, _C, 0, 0, 0, 0, 0,
1288 /* '`' */ 0, _H, _H, _H, _H, _H, _H, 0,
1289 /* 'h' */ 0, 0, 0, 0, 0, 0, 0, 0,
1290 /* 'p' */ 0, 0, 0, 0, 0, 0, 0, 0,
1291 /* 'x' */ 0, 0, 0, 0, 0, 0, 0, 0,
1293 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1294 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1295 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1296 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1297 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1298 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1299 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1300 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1301 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1302 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1303 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1304 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1305 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1306 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1307 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1308 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1311 /**********************************************************************
1317 **********************************************************************/
1319 char *input_filename = NULL; /* Always points to a dynamically allocated string */
1322 * For my own sanity, things that are not part of the flex skeleton
1323 * have been renamed as hsXXXXX rather than yyXXXXX. --JSM
1326 static int hslineno = 0; /* Line number at end of token */
1327 int hsplineno = 0; /* Line number at end of previous token */
1329 static int hscolno = 0; /* Column number at end of token */
1330 int hspcolno = 0; /* Column number at end of previous token */
1331 static int hsmlcolno = 0; /* Column number for multiple-rule lexemes */
1333 int startlineno = 0; /* The line number where something starts */
1334 int endlineno = 0; /* The line number where something ends */
1336 static BOOLEAN noGap = TRUE; /* For checking string gaps */
1337 static BOOLEAN forgetindent = FALSE; /* Don't bother applying indentation rules */
1339 static int nested_comments; /* For counting comment nesting depth */
1341 /* Hacky definition of yywrap: see flex doc.
1343 If we don't do this, then we'll have to get the default
1344 yywrap from the flex library, which is often something
1345 we are not good at locating. This avoids that difficulty.
1346 (Besides which, this is the way old flexes (pre 2.4.x) did it.)
1351 /* Essential forward declarations */
1353 static void hsnewid PROTO((char *, int));
1354 static void layout_input PROTO((char *, int));
1355 static void cleartext (NO_ARGS);
1356 static void addtext PROTO((char *, unsigned));
1357 static void addchar PROTO((char));
1358 static char *fetchtext PROTO((unsigned *));
1359 static void new_filename PROTO((char *));
1360 static int Return PROTO((int));
1361 static void hsentercontext PROTO((int));
1363 /* Special file handling for IMPORTS */
1364 /* Note: imports only ever go *one deep* (hence no need for a stack) WDP 94/09 */
1366 static YY_BUFFER_STATE hsbuf_save = NULL; /* Saved input buffer */
1367 static char *filename_save; /* File Name */
1368 static int hslineno_save = 0, /* Line Number */
1369 hsplineno_save = 0, /* Line Number of Prev. token */
1370 hscolno_save = 0, /* Indentation */
1371 hspcolno_save = 0; /* Left Indentation */
1372 static short icontexts_save = 0; /* Indent Context Level */
1374 static BOOLEAN etags_save; /* saved: whether doing etags stuff or not */
1375 extern BOOLEAN etags; /* that which is saved */
1377 extern BOOLEAN nonstandardFlag; /* Glasgow extensions allowed */
1379 static BOOLEAN in_interface = FALSE; /* TRUE if we are reading a .hi file */
1381 extern BOOLEAN ignorePragmas; /* True when we should ignore pragmas */
1382 extern int minAcceptablePragmaVersion; /* see documentation in main.c */
1383 extern int maxAcceptablePragmaVersion;
1384 extern int thisIfacePragmaVersion;
1386 static int hssttok = -1; /* Stacked Token: -1 -- no token; -ve -- ";"
1387 * inserted before token +ve -- "}" inserted before
1390 short icontexts = 0; /* Which context we're in */
1395 Table of indentations: right bit indicates whether to use
1396 indentation rules (1 = use rules; 0 = ignore)
1399 push one of these "contexts" at every "case" or "where"; the right bit says
1400 whether user supplied braces, etc., or not. pop appropriately (hsendindent).
1402 ALSO, a push/pop when enter/exit a new file (e.g., on importing). A -1 is
1403 pushed (the "column" for "module", "interface" and EOF). The -1 from the initial
1404 push is shown just below.
1409 static short indenttab[MAX_CONTEXTS] = {-1};
1411 #define INDENTPT (indenttab[icontexts]>>1)
1412 #define INDENTON (indenttab[icontexts]&1)
1414 #define RETURN(tok) return(Return(tok))
1417 #define YY_DECL int yylex1()
1419 /* We should not peek at yy_act, but flex calls us even for the internal action
1420 triggered on 'end-of-buffer' (This is not true of flex 2.4.4 and up, but
1421 to support older versions of flex, we'll continue to peek for now.
1423 #define YY_USER_ACTION \
1424 if (yy_act != YY_END_OF_BUFFER) layout_input(yytext, yyleng);
1428 #define YY_BREAK if (etags) fprintf(stderr,"%d %d / %d %d / %d\n",hsplineno,hspcolno,hslineno,hscolno,startlineno); break;
1431 /* Each time we enter a new start state, we push it onto the state stack.
1432 Note that the rules do not allow us to underflow or overflow the stack.
1433 (At least, they shouldn't.) The maximum expected depth is 4:
1434 0: Code -> 1: String -> 2: StringEsc -> 3: Comment
1436 static int StateStack[5];
1437 static int StateDepth = -1;
1440 #define PUSH_STATE(n) do {\
1441 fprintf(stderr,"Pushing %d (%d)\n", n, StateDepth + 1);\
1442 StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1443 #define POP_STATE do {--StateDepth;\
1444 fprintf(stderr,"Popping %d (%d)\n", StateStack[StateDepth], StateDepth);\
1445 BEGIN(StateStack[StateDepth]);} while(0)
1447 #define PUSH_STATE(n) do {StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1448 #define POP_STATE do {--StateDepth; BEGIN(StateStack[StateDepth]);} while(0)
1451 /* The start states are:
1452 Code -- normal Haskell code (principal lexer)
1453 GlaExt -- Haskell code with Glasgow extensions
1454 Comment -- Nested comment processing
1455 String -- Inside a string literal with backslashes
1456 StringEsc -- Immediately following a backslash in a string literal
1457 Char -- Inside a character literal with backslashes
1458 CharEsc -- Immediately following a backslash in a character literal
1460 Note that the INITIAL state is unused. Also note that these states
1461 are _exclusive_. All rules should be prefixed with an appropriate
1462 list of start states.
1470 #define UserPragma 7
1475 /* Macros after this point can all be overridden by user definitions in
1479 #ifndef YY_SKIP_YYWRAP
1481 extern "C" int yywrap YY_PROTO(( void ));
1483 extern int yywrap YY_PROTO(( void ));
1488 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1492 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1497 static int yyinput YY_PROTO(( void ));
1499 static int input YY_PROTO(( void ));
1504 static int yy_start_stack_ptr = 0;
1505 static int yy_start_stack_depth = 0;
1506 static int *yy_start_stack = 0;
1507 #ifndef YY_NO_PUSH_STATE
1508 static void yy_push_state YY_PROTO(( int new_state ));
1510 #ifndef YY_NO_POP_STATE
1511 static void yy_pop_state YY_PROTO(( void ));
1513 #ifndef YY_NO_TOP_STATE
1514 static int yy_top_state YY_PROTO(( void ));
1518 #define YY_NO_PUSH_STATE 1
1519 #define YY_NO_POP_STATE 1
1520 #define YY_NO_TOP_STATE 1
1523 #ifdef YY_MALLOC_DECL
1531 /* Just try to get by without declaring the routines. This will fail
1532 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1533 * or sizeof(void*) != sizeof(int).
1538 /* Amount of stuff to slurp up with each read. */
1539 #ifndef YY_READ_BUF_SIZE
1540 #define YY_READ_BUF_SIZE 8192
1543 /* Copy whatever the last rule matched to the standard output. */
1546 /* This used to be an fputs(), but since the string might contain NUL's,
1547 * we now use fwrite().
1549 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1552 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1553 * is returned in "result".
1556 #define YY_INPUT(buf,result,max_size) \
1557 if ( yy_current_buffer->yy_is_interactive ) \
1560 for ( n = 0; n < max_size && \
1561 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1562 buf[n] = (char) c; \
1564 buf[n++] = (char) c; \
1565 if ( c == EOF && ferror( yyin ) ) \
1566 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1569 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1570 && ferror( yyin ) ) \
1571 YY_FATAL_ERROR( "input in flex scanner failed" );
1574 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1575 * we don't want an extra ';' after the "return" because that will cause
1576 * some compilers to complain about unreachable statements.
1579 #define yyterminate() return YY_NULL
1582 /* Number of entries by which start-condition stack grows. */
1583 #ifndef YY_START_STACK_INCR
1584 #define YY_START_STACK_INCR 25
1587 /* Report a fatal error. */
1588 #ifndef YY_FATAL_ERROR
1589 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1592 /* Default declaration of generated scanner - a define so the user can
1593 * easily add parameters.
1596 #define YY_DECL int yylex YY_PROTO(( void ))
1599 /* Code executed at the beginning of each rule, after yytext and yyleng
1602 #ifndef YY_USER_ACTION
1603 #define YY_USER_ACTION
1606 /* Code executed at the end of each rule. */
1608 #define YY_BREAK break;
1611 #define YY_RULE_SETUP \
1613 yy_current_buffer->yy_at_bol = \
1614 (yytext[yyleng - 1] == '\n'); \
1619 register yy_state_type yy_current_state;
1620 register char *yy_cp, *yy_bp;
1621 register int yy_act;
1623 #line 277 "yaccParser/hslexer.flex"
1628 * Special GHC pragma rules. Do we need a start state for interface files,
1629 * so these won't be matched in source files? --JSM
1643 yy_start = 1; /* first start state */
1651 if ( ! yy_current_buffer )
1653 yy_create_buffer( yyin, YY_BUF_SIZE );
1655 yy_load_buffer_state();
1658 while ( 1 ) /* loops until end-of-file is reached */
1662 /* Support of yytext. */
1663 *yy_cp = yy_hold_char;
1665 /* yy_bp points to the position in yy_ch_buf of the start of
1670 yy_current_state = yy_start;
1671 yy_current_state += YY_AT_BOL();
1675 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1676 if ( yy_accept[yy_current_state] )
1678 yy_last_accepting_state = yy_current_state;
1679 yy_last_accepting_cpos = yy_cp;
1681 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1683 yy_current_state = (int) yy_def[yy_current_state];
1684 if ( yy_current_state >= 837 )
1685 yy_c = yy_meta[(unsigned int) yy_c];
1687 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1690 while ( yy_base[yy_current_state] != 2459 );
1693 yy_act = yy_accept[yy_current_state];
1695 { /* have to back up */
1696 yy_cp = yy_last_accepting_cpos;
1697 yy_current_state = yy_last_accepting_state;
1698 yy_act = yy_accept[yy_current_state];
1701 YY_DO_BEFORE_ACTION;
1704 do_action: /* This label is used only to access EOF actions. */
1708 { /* beginning of action switch */
1709 case 0: /* must back up */
1710 /* undo the effects of YY_DO_BEFORE_ACTION */
1711 *yy_cp = yy_hold_char;
1712 yy_cp = yy_last_accepting_cpos;
1713 yy_current_state = yy_last_accepting_state;
1714 goto yy_find_action;
1718 #line 286 "yaccParser/hslexer.flex"
1720 char tempf[FILENAME_SIZE];
1721 sscanf(yytext+1, "%d \"%[^\"]", &hslineno, tempf);
1722 new_filename(tempf);
1723 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1728 #line 293 "yaccParser/hslexer.flex"
1730 char tempf[FILENAME_SIZE];
1731 sscanf(yytext+5, "%d \"%[^\"]", &hslineno, tempf);
1732 new_filename(tempf);
1733 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1738 #line 300 "yaccParser/hslexer.flex"
1740 /* partain: pragma-style line directive */
1741 char tempf[FILENAME_SIZE];
1742 sscanf(yytext+9, "%d \"%[^\"]", &hslineno, tempf);
1743 new_filename(tempf);
1744 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1749 #line 307 "yaccParser/hslexer.flex"
1751 sscanf(yytext+33,"%d ",&thisIfacePragmaVersion);
1756 #line 310 "yaccParser/hslexer.flex"
1758 if ( ignorePragmas ||
1759 thisIfacePragmaVersion < minAcceptablePragmaVersion ||
1760 thisIfacePragmaVersion > maxAcceptablePragmaVersion) {
1761 nested_comments = 1;
1762 PUSH_STATE(Comment);
1764 PUSH_STATE(GhcPragma);
1771 #line 321 "yaccParser/hslexer.flex"
1772 { RETURN(NO_PRAGMA); }
1776 #line 322 "yaccParser/hslexer.flex"
1777 { RETURN(NOINFO_PRAGMA); }
1781 #line 323 "yaccParser/hslexer.flex"
1782 { RETURN(ABSTRACT_PRAGMA); }
1786 #line 324 "yaccParser/hslexer.flex"
1787 { RETURN(DEFOREST_PRAGMA); }
1791 #line 325 "yaccParser/hslexer.flex"
1792 { RETURN(SPECIALISE_PRAGMA); }
1796 #line 326 "yaccParser/hslexer.flex"
1797 { RETURN(MODNAME_PRAGMA); }
1801 #line 327 "yaccParser/hslexer.flex"
1802 { RETURN(ARITY_PRAGMA); }
1806 #line 328 "yaccParser/hslexer.flex"
1807 { RETURN(UPDATE_PRAGMA); }
1811 #line 329 "yaccParser/hslexer.flex"
1812 { RETURN(STRICTNESS_PRAGMA); }
1816 #line 330 "yaccParser/hslexer.flex"
1817 { RETURN(KIND_PRAGMA); }
1821 #line 331 "yaccParser/hslexer.flex"
1822 { RETURN(MAGIC_UNFOLDING_PRAGMA); }
1826 #line 332 "yaccParser/hslexer.flex"
1827 { RETURN(UNFOLDING_PRAGMA); }
1831 #line 334 "yaccParser/hslexer.flex"
1836 #line 335 "yaccParser/hslexer.flex"
1841 #line 336 "yaccParser/hslexer.flex"
1846 #line 337 "yaccParser/hslexer.flex"
1847 { RETURN(COTYAPP); }
1851 #line 338 "yaccParser/hslexer.flex"
1852 { RETURN(CO_ALG_ALTS); }
1856 #line 339 "yaccParser/hslexer.flex"
1857 { RETURN(CO_PRIM_ALTS); }
1861 #line 340 "yaccParser/hslexer.flex"
1862 { RETURN(CO_NO_DEFAULT); }
1866 #line 341 "yaccParser/hslexer.flex"
1867 { RETURN(CO_LETREC); }
1871 #line 343 "yaccParser/hslexer.flex"
1872 { RETURN(CO_PRELUDE_DICTS_CC); }
1876 #line 344 "yaccParser/hslexer.flex"
1877 { RETURN(CO_ALL_DICTS_CC); }
1881 #line 345 "yaccParser/hslexer.flex"
1882 { RETURN(CO_USER_CC); }
1886 #line 346 "yaccParser/hslexer.flex"
1887 { RETURN(CO_AUTO_CC); }
1891 #line 347 "yaccParser/hslexer.flex"
1892 { RETURN(CO_DICT_CC); }
1896 #line 349 "yaccParser/hslexer.flex"
1897 { RETURN(CO_DUPD_CC); }
1901 #line 350 "yaccParser/hslexer.flex"
1902 { RETURN(CO_CAF_CC); }
1906 #line 352 "yaccParser/hslexer.flex"
1907 { RETURN(CO_SDSEL_ID); }
1911 #line 353 "yaccParser/hslexer.flex"
1912 { RETURN(CO_METH_ID); }
1916 #line 354 "yaccParser/hslexer.flex"
1917 { RETURN(CO_DEFM_ID); }
1921 #line 355 "yaccParser/hslexer.flex"
1922 { RETURN(CO_DFUN_ID); }
1926 #line 356 "yaccParser/hslexer.flex"
1927 { RETURN(CO_CONSTM_ID); }
1931 #line 357 "yaccParser/hslexer.flex"
1932 { RETURN(CO_SPEC_ID); }
1936 #line 358 "yaccParser/hslexer.flex"
1937 { RETURN(CO_WRKR_ID); }
1941 #line 359 "yaccParser/hslexer.flex"
1942 { RETURN(CO_ORIG_NM); /* fully-qualified original name*/ }
1946 #line 361 "yaccParser/hslexer.flex"
1947 { RETURN(UNFOLD_ALWAYS); }
1951 #line 362 "yaccParser/hslexer.flex"
1952 { RETURN(UNFOLD_IF_ARGS); }
1956 #line 364 "yaccParser/hslexer.flex"
1957 { RETURN(NOREP_INTEGER); }
1961 #line 365 "yaccParser/hslexer.flex"
1962 { RETURN(NOREP_RATIONAL); }
1966 #line 366 "yaccParser/hslexer.flex"
1967 { RETURN(NOREP_STRING); }
1971 #line 368 "yaccParser/hslexer.flex"
1972 { POP_STATE; RETURN(END_PRAGMA); }
1976 #line 370 "yaccParser/hslexer.flex"
1978 PUSH_STATE(UserPragma);
1979 RETURN(SPECIALISE_UPRAGMA);
1984 #line 374 "yaccParser/hslexer.flex"
1986 PUSH_STATE(UserPragma);
1987 RETURN(INLINE_UPRAGMA);
1992 #line 378 "yaccParser/hslexer.flex"
1994 PUSH_STATE(UserPragma);
1995 RETURN(MAGIC_UNFOLDING_UPRAGMA);
2000 #line 382 "yaccParser/hslexer.flex"
2002 PUSH_STATE(UserPragma);
2003 RETURN(DEFOREST_UPRAGMA);
2008 #line 386 "yaccParser/hslexer.flex"
2010 PUSH_STATE(UserPragma);
2011 RETURN(ABSTRACT_UPRAGMA);
2016 #line 390 "yaccParser/hslexer.flex"
2018 fprintf(stderr, "Warning: \"%s\", line %d: Unrecognised pragma '",
2019 input_filename, hsplineno);
2020 format_string(stderr, (unsigned char *) yytext, yyleng);
2021 fputs("'\n", stderr);
2022 nested_comments = 1;
2023 PUSH_STATE(Comment);
2028 #line 398 "yaccParser/hslexer.flex"
2029 { POP_STATE; RETURN(END_UPRAGMA); }
2033 * Haskell keywords. `scc' is actually a Glasgow extension, but it is
2034 * intentionally accepted as a keyword even for normal <Code>.
2039 #line 407 "yaccParser/hslexer.flex"
2044 #line 408 "yaccParser/hslexer.flex"
2049 #line 409 "yaccParser/hslexer.flex"
2054 #line 410 "yaccParser/hslexer.flex"
2055 { RETURN(DEFAULT); }
2059 #line 411 "yaccParser/hslexer.flex"
2060 { RETURN(DERIVING); }
2064 #line 412 "yaccParser/hslexer.flex"
2069 #line 413 "yaccParser/hslexer.flex"
2074 #line 414 "yaccParser/hslexer.flex"
2079 #line 415 "yaccParser/hslexer.flex"
2084 #line 416 "yaccParser/hslexer.flex"
2089 #line 417 "yaccParser/hslexer.flex"
2094 #line 418 "yaccParser/hslexer.flex"
2099 #line 419 "yaccParser/hslexer.flex"
2100 { RETURN(INSTANCE); }
2104 #line 420 "yaccParser/hslexer.flex"
2105 { RETURN(INTERFACE); }
2109 #line 421 "yaccParser/hslexer.flex"
2114 #line 422 "yaccParser/hslexer.flex"
2119 #line 423 "yaccParser/hslexer.flex"
2120 { RETURN(RENAMING); }
2124 #line 424 "yaccParser/hslexer.flex"
2129 #line 425 "yaccParser/hslexer.flex"
2134 #line 426 "yaccParser/hslexer.flex"
2139 #line 427 "yaccParser/hslexer.flex"
2144 #line 428 "yaccParser/hslexer.flex"
2149 #line 429 "yaccParser/hslexer.flex"
2154 #line 430 "yaccParser/hslexer.flex"
2159 #line 431 "yaccParser/hslexer.flex"
2160 { RETURN(CCALL_GC); }
2164 #line 432 "yaccParser/hslexer.flex"
2169 #line 433 "yaccParser/hslexer.flex"
2170 { RETURN(CASM_GC); }
2174 #line 434 "yaccParser/hslexer.flex"
2179 #line 435 "yaccParser/hslexer.flex"
2184 * Haskell operators. Nothing special about these.
2189 #line 443 "yaccParser/hslexer.flex"
2194 #line 444 "yaccParser/hslexer.flex"
2199 #line 445 "yaccParser/hslexer.flex"
2204 #line 446 "yaccParser/hslexer.flex"
2209 #line 447 "yaccParser/hslexer.flex"
2214 #line 448 "yaccParser/hslexer.flex"
2219 #line 449 "yaccParser/hslexer.flex"
2224 #line 450 "yaccParser/hslexer.flex"
2229 #line 451 "yaccParser/hslexer.flex"
2234 #line 452 "yaccParser/hslexer.flex"
2239 #line 453 "yaccParser/hslexer.flex"
2244 #line 454 "yaccParser/hslexer.flex"
2249 #line 455 "yaccParser/hslexer.flex"
2254 #line 456 "yaccParser/hslexer.flex"
2259 #line 457 "yaccParser/hslexer.flex"
2264 #line 458 "yaccParser/hslexer.flex"
2269 #line 459 "yaccParser/hslexer.flex"
2274 #line 460 "yaccParser/hslexer.flex"
2279 #line 461 "yaccParser/hslexer.flex"
2280 { RETURN(TYLAMBDA); }
2284 #line 462 "yaccParser/hslexer.flex"
2285 { RETURN(WILDCARD); }
2289 #line 463 "yaccParser/hslexer.flex"
2294 #line 464 "yaccParser/hslexer.flex"
2299 #line 465 "yaccParser/hslexer.flex"
2304 * Integers and (for Glasgow extensions) primitive integers. Note that
2305 * we pass all of the text on to the parser, because flex/C can't handle
2306 * arbitrary precision numbers.
2311 #line 475 "yaccParser/hslexer.flex"
2313 yylval.uid = xstrndup(yytext, yyleng - 1);
2319 #line 479 "yaccParser/hslexer.flex"
2321 yylval.uid = xstrndup(yytext, yyleng);
2327 #line 483 "yaccParser/hslexer.flex"
2329 yylval.uid = xstrndup(yytext, yyleng - 1);
2335 #line 487 "yaccParser/hslexer.flex"
2337 yylval.uid = xstrndup(yytext, yyleng);
2343 #line 491 "yaccParser/hslexer.flex"
2345 yylval.uid = xstrndup(yytext, yyleng - 1);
2351 #line 495 "yaccParser/hslexer.flex"
2353 yylval.uid = xstrndup(yytext, yyleng);
2359 * Floats and (for Glasgow extensions) primitive floats/doubles.
2364 #line 506 "yaccParser/hslexer.flex"
2366 yylval.uid = xstrndup(yytext, yyleng - 2);
2372 #line 510 "yaccParser/hslexer.flex"
2374 yylval.uid = xstrndup(yytext, yyleng - 1);
2380 #line 514 "yaccParser/hslexer.flex"
2382 yylval.uid = xstrndup(yytext, yyleng);
2388 * Funky ``foo'' style C literals for Glasgow extensions
2393 #line 525 "yaccParser/hslexer.flex"
2395 hsnewid(yytext + 2, yyleng - 4);
2401 * Identifiers, both variables and operators. The trailing hash is allowed
2402 * for Glasgow extensions.
2407 #line 537 "yaccParser/hslexer.flex"
2408 { hsnewid(yytext, yyleng); RETURN(CONID); }
2412 #line 538 "yaccParser/hslexer.flex"
2413 { hsnewid(yytext, yyleng); RETURN(CONID); }
2417 #line 539 "yaccParser/hslexer.flex"
2418 { hsnewid(yytext, yyleng); RETURN(TYVAR_TEMPLATE_ID); }
2422 #line 541 "yaccParser/hslexer.flex"
2424 hsnewid(yytext, yyleng);
2425 RETURN(_isconstr(yytext) ? CONID : VARID);
2429 /* This SHOULDNAE work in "Code" (sigh) */
2433 #line 548 "yaccParser/hslexer.flex"
2435 if (! (nonstandardFlag || in_interface)) {
2436 char errbuf[ERR_BUF_SIZE];
2437 sprintf(errbuf, "Non-standard identifier (leading underscore): %s\n", yytext);
2440 hsnewid(yytext, yyleng);
2441 RETURN(isconstr(yytext) ? CONID : VARID);
2442 /* NB: ^^^^^^^^ : not the macro! */
2447 #line 558 "yaccParser/hslexer.flex"
2449 hsnewid(yytext, yyleng);
2450 RETURN(_isconstr(yytext) ? CONID : VARID);
2455 #line 562 "yaccParser/hslexer.flex"
2457 hsnewid(yytext, yyleng);
2458 RETURN(_isconstr(yytext) ? CONSYM : VARSYM);
2462 /* Why is `{Id}#` matched this way, and `{Id}` lexed as three tokens? --JSM */
2464 /* Because we can make the former well-behaved (we defined them).
2466 Sadly, the latter is defined by Haskell, which allows such
2467 la-la land constructs as `{-a 900-line comment-} foo`. (WDP 94/12)
2472 #line 577 "yaccParser/hslexer.flex"
2474 hsnewid(yytext + 1, yyleng - 2);
2475 RETURN(_isconstr(yytext+1) ? CONSYM : VARSYM);
2480 * Character literals. The first form is the quick form, for character
2481 * literals that don't contain backslashes. Literals with backslashes are
2482 * lexed through multiple rules. First, we match the open ' and as many
2483 * normal characters as possible. This puts us into the <Char> state, where
2484 * a backslash is legal. Then, we match the backslash and move into the
2485 * <CharEsc> state. When we drop out of <CharEsc>, we collect more normal
2486 * characters and the close '. We may end up with too many characters, but
2487 * this allows us to easily share the lex rules with strings. Excess characters
2488 * are ignored with a warning.
2493 #line 596 "yaccParser/hslexer.flex"
2495 yylval.uhstring = installHstring(1, yytext+1);
2501 #line 600 "yaccParser/hslexer.flex"
2503 yylval.uhstring = installHstring(1, yytext+1);
2509 #line 604 "yaccParser/hslexer.flex"
2510 {char errbuf[ERR_BUF_SIZE];
2511 sprintf(errbuf, "'' is not a valid character (or string) literal\n");
2517 #line 608 "yaccParser/hslexer.flex"
2519 hsmlcolno = hspcolno;
2521 addtext(yytext+1, yyleng-1);
2527 #line 614 "yaccParser/hslexer.flex"
2532 addtext(yytext, yyleng - 2);
2533 text = fetchtext(&length);
2535 if (! (nonstandardFlag || in_interface)) {
2536 char errbuf[ERR_BUF_SIZE];
2537 sprintf(errbuf, "`Char-hash' literals are non-standard: %s\n", text);
2542 fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '",
2543 input_filename, hsplineno, hspcolno + 1);
2544 format_string(stderr, (unsigned char *) text, length);
2545 fputs("' too long\n", stderr);
2548 yylval.uhstring = installHstring(1, text);
2549 hspcolno = hsmlcolno;
2556 #line 639 "yaccParser/hslexer.flex"
2561 addtext(yytext, yyleng - 1);
2562 text = fetchtext(&length);
2565 fprintf(stderr, "\"%s\", line %d, column %d: Character literal '",
2566 input_filename, hsplineno, hspcolno + 1);
2567 format_string(stderr, (unsigned char *) text, length);
2568 fputs("' too long\n", stderr);
2571 yylval.uhstring = installHstring(1, text);
2572 hspcolno = hsmlcolno;
2579 #line 658 "yaccParser/hslexer.flex"
2580 { addtext(yytext, yyleng); }
2584 * String literals. The first form is the quick form, for string literals
2585 * that don't contain backslashes. Literals with backslashes are lexed
2586 * through multiple rules. First, we match the open " and as many normal
2587 * characters as possible. This puts us into the <String> state, where
2588 * a backslash is legal. Then, we match the backslash and move into the
2589 * <StringEsc> state. When we drop out of <StringEsc>, we collect more normal
2590 * characters, moving back and forth between <String> and <StringEsc> as more
2591 * backslashes are encountered. (We may even digress into <Comment> mode if we
2592 * find a comment in a gap between backslashes.) Finally, we read the last chunk
2593 * of normal characters and the close ".
2598 #line 676 "yaccParser/hslexer.flex"
2600 yylval.uhstring = installHstring(yyleng-3, yytext+1);
2601 /* the -3 accounts for the " on front, "# on the end */
2607 #line 681 "yaccParser/hslexer.flex"
2609 yylval.uhstring = installHstring(yyleng-2, yytext+1);
2615 #line 685 "yaccParser/hslexer.flex"
2617 hsmlcolno = hspcolno;
2619 addtext(yytext+1, yyleng-1);
2625 #line 691 "yaccParser/hslexer.flex"
2630 addtext(yytext, yyleng-2);
2631 text = fetchtext(&length);
2633 if (! (nonstandardFlag || in_interface)) {
2634 char errbuf[ERR_BUF_SIZE];
2635 sprintf(errbuf, "`String-hash' literals are non-standard: %s\n", text);
2639 yylval.uhstring = installHstring(length, text);
2640 hspcolno = hsmlcolno;
2647 #line 709 "yaccParser/hslexer.flex"
2652 addtext(yytext, yyleng-1);
2653 text = fetchtext(&length);
2655 yylval.uhstring = installHstring(length, text);
2656 hspcolno = hsmlcolno;
2663 #line 721 "yaccParser/hslexer.flex"
2664 { addtext(yytext, yyleng); }
2668 * Character and string escapes are roughly the same, but strings have the
2669 * extra `\&' sequence which is not allowed for characters. Also, comments
2670 * are allowed in the <StringEsc> state. (See the comment section much
2673 * NB: Backslashes and tabs are stored in strings as themselves.
2674 * But if we print them (in printtree.c), they must go out as
2675 * "\\\\" and "\\t" respectively. (This is because of the bogus
2676 * intermediate format that the parser produces. It uses '\t' fpr end of
2677 * string, so it needs to be able to escape tabs, which means that it
2678 * also needs to be able to escape the escape character ('\\'). Sigh.
2683 #line 739 "yaccParser/hslexer.flex"
2684 { PUSH_STATE(CharEsc); }
2688 #line 740 "yaccParser/hslexer.flex"
2693 #line 741 "yaccParser/hslexer.flex"
2694 { PUSH_STATE(StringEsc); noGap = TRUE; }
2698 #line 743 "yaccParser/hslexer.flex"
2699 { addchar(*yytext); POP_STATE; }
2703 #line 744 "yaccParser/hslexer.flex"
2704 { if (noGap) { addchar(*yytext); } POP_STATE; }
2708 #line 746 "yaccParser/hslexer.flex"
2709 { addchar(*yytext); POP_STATE; }
2713 #line 747 "yaccParser/hslexer.flex"
2714 { addchar('\000'); POP_STATE; }
2718 #line 748 "yaccParser/hslexer.flex"
2719 { addchar('\001'); POP_STATE; }
2723 #line 749 "yaccParser/hslexer.flex"
2724 { addchar('\002'); POP_STATE; }
2728 #line 750 "yaccParser/hslexer.flex"
2729 { addchar('\003'); POP_STATE; }
2733 #line 751 "yaccParser/hslexer.flex"
2734 { addchar('\004'); POP_STATE; }
2738 #line 752 "yaccParser/hslexer.flex"
2739 { addchar('\005'); POP_STATE; }
2743 #line 753 "yaccParser/hslexer.flex"
2744 { addchar('\006'); POP_STATE; }
2747 #line 755 "yaccParser/hslexer.flex"
2750 #line 755 "yaccParser/hslexer.flex"
2751 { addchar('\007'); POP_STATE; }
2754 #line 757 "yaccParser/hslexer.flex"
2757 #line 757 "yaccParser/hslexer.flex"
2758 { addchar('\010'); POP_STATE; }
2761 #line 759 "yaccParser/hslexer.flex"
2764 #line 759 "yaccParser/hslexer.flex"
2765 { addchar('\011'); POP_STATE; }
2768 #line 761 "yaccParser/hslexer.flex"
2771 #line 761 "yaccParser/hslexer.flex"
2772 { addchar('\012'); POP_STATE; }
2775 #line 763 "yaccParser/hslexer.flex"
2778 #line 763 "yaccParser/hslexer.flex"
2779 { addchar('\013'); POP_STATE; }
2782 #line 765 "yaccParser/hslexer.flex"
2785 #line 765 "yaccParser/hslexer.flex"
2786 { addchar('\014'); POP_STATE; }
2789 #line 767 "yaccParser/hslexer.flex"
2792 #line 767 "yaccParser/hslexer.flex"
2793 { addchar('\015'); POP_STATE; }
2797 #line 768 "yaccParser/hslexer.flex"
2798 { addchar('\016'); POP_STATE; }
2802 #line 769 "yaccParser/hslexer.flex"
2803 { addchar('\017'); POP_STATE; }
2807 #line 770 "yaccParser/hslexer.flex"
2808 { addchar('\020'); POP_STATE; }
2812 #line 771 "yaccParser/hslexer.flex"
2813 { addchar('\021'); POP_STATE; }
2817 #line 772 "yaccParser/hslexer.flex"
2818 { addchar('\022'); POP_STATE; }
2822 #line 773 "yaccParser/hslexer.flex"
2823 { addchar('\023'); POP_STATE; }
2827 #line 774 "yaccParser/hslexer.flex"
2828 { addchar('\024'); POP_STATE; }
2832 #line 775 "yaccParser/hslexer.flex"
2833 { addchar('\025'); POP_STATE; }
2837 #line 776 "yaccParser/hslexer.flex"
2838 { addchar('\026'); POP_STATE; }
2842 #line 777 "yaccParser/hslexer.flex"
2843 { addchar('\027'); POP_STATE; }
2847 #line 778 "yaccParser/hslexer.flex"
2848 { addchar('\030'); POP_STATE; }
2852 #line 779 "yaccParser/hslexer.flex"
2853 { addchar('\031'); POP_STATE; }
2857 #line 780 "yaccParser/hslexer.flex"
2858 { addchar('\032'); POP_STATE; }
2862 #line 781 "yaccParser/hslexer.flex"
2863 { addchar('\033'); POP_STATE; }
2867 #line 782 "yaccParser/hslexer.flex"
2868 { addchar('\034'); POP_STATE; }
2872 #line 783 "yaccParser/hslexer.flex"
2873 { addchar('\035'); POP_STATE; }
2877 #line 784 "yaccParser/hslexer.flex"
2878 { addchar('\036'); POP_STATE; }
2882 #line 785 "yaccParser/hslexer.flex"
2883 { addchar('\037'); POP_STATE; }
2887 #line 786 "yaccParser/hslexer.flex"
2888 { addchar('\040'); POP_STATE; }
2892 #line 787 "yaccParser/hslexer.flex"
2893 { addchar('\177'); POP_STATE; }
2897 #line 788 "yaccParser/hslexer.flex"
2898 { char c = yytext[1] - '@'; addchar(c); POP_STATE; }
2902 #line 789 "yaccParser/hslexer.flex"
2904 int i = strtol(yytext, NULL, 10);
2908 char errbuf[ERR_BUF_SIZE];
2909 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2918 #line 801 "yaccParser/hslexer.flex"
2920 int i = strtol(yytext + 1, NULL, 8);
2924 char errbuf[ERR_BUF_SIZE];
2925 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2934 #line 813 "yaccParser/hslexer.flex"
2936 int i = strtol(yytext + 1, NULL, 16);
2940 char errbuf[ERR_BUF_SIZE];
2941 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2950 * Simple comments and whitespace. Normally, we would just ignore these, but
2951 * in case we're processing a string escape, we need to note that we've seen
2954 * Note that we cater for a comment line that *doesn't* end in a newline.
2955 * This is incorrect, strictly speaking, but seems like the right thing
2956 * to do. Reported by Rajiv Mirani. (WDP 95/08)
2960 #line 839 "yaccParser/hslexer.flex"
2963 #line 839 "yaccParser/hslexer.flex"
2968 * Nested comments. The major complication here is in trying to match the
2969 * longest lexemes possible, for better performance. (See the flex document.)
2970 * That's why the rules look so bizarre.
2975 #line 849 "yaccParser/hslexer.flex"
2977 noGap = FALSE; nested_comments = 1; PUSH_STATE(Comment);
2981 #line 854 "yaccParser/hslexer.flex"
2983 #line 855 "yaccParser/hslexer.flex"
2986 #line 855 "yaccParser/hslexer.flex"
2991 #line 856 "yaccParser/hslexer.flex"
2992 { nested_comments++; }
2996 #line 857 "yaccParser/hslexer.flex"
2997 { if (--nested_comments == 0) POP_STATE; }
3001 #line 858 "yaccParser/hslexer.flex"
3006 * Illegal characters. This used to be a single rule, but we might as well
3007 * pass on as much information as we have, so now we indicate our state in
3008 * the error message.
3013 #line 868 "yaccParser/hslexer.flex"
3015 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3016 input_filename, hsplineno, hspcolno + 1);
3017 format_string(stderr, (unsigned char *) yytext, 1);
3018 fputs("'\n", stderr);
3024 #line 875 "yaccParser/hslexer.flex"
3026 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3027 input_filename, hsplineno, hspcolno + 1);
3028 format_string(stderr, (unsigned char *) yytext, 1);
3029 fputs("' in a character literal\n", stderr);
3035 #line 882 "yaccParser/hslexer.flex"
3037 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\",
3038 input_filename, hsplineno, hspcolno + 1);
3039 format_string(stderr, (unsigned char *) yytext, 1);
3040 fputs("'\n", stderr);
3046 #line 889 "yaccParser/hslexer.flex"
3047 { if (nonstandardFlag) {
3048 addtext(yytext, yyleng);
3050 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3051 input_filename, hsplineno, hspcolno + 1);
3052 format_string(stderr, (unsigned char *) yytext, 1);
3053 fputs("' in a string literal\n", stderr);
3060 #line 899 "yaccParser/hslexer.flex"
3063 fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\",
3064 input_filename, hsplineno, hspcolno + 1);
3065 format_string(stderr, (unsigned char *) yytext, 1);
3066 fputs("'\n", stderr);
3069 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3070 input_filename, hsplineno, hspcolno + 1);
3071 format_string(stderr, (unsigned char *) yytext, 1);
3072 fputs("' in a string gap\n", stderr);
3079 * End of file. In any sub-state, this is an error. However, for the primary
3080 * <Code> and <GlaExt> states, this is perfectly normal. We just return an EOF
3081 * and let the yylex() wrapper deal with whatever has to be done next (e.g.
3082 * adding virtual close curlies, or closing an interface and returning to the
3083 * primary source file.
3085 * Note that flex does not call YY_USER_ACTION for <<EOF>> rules. Hence the
3086 * line/column advancement has to be done by hand.
3089 case YY_STATE_EOF(Char):
3090 case YY_STATE_EOF(CharEsc):
3091 #line 928 "yaccParser/hslexer.flex"
3093 hsplineno = hslineno; hspcolno = hscolno;
3094 hsperror("unterminated character literal");
3097 case YY_STATE_EOF(Comment):
3098 #line 932 "yaccParser/hslexer.flex"
3100 hsplineno = hslineno; hspcolno = hscolno;
3101 hsperror("unterminated comment");
3104 case YY_STATE_EOF(String):
3105 case YY_STATE_EOF(StringEsc):
3106 #line 936 "yaccParser/hslexer.flex"
3108 hsplineno = hslineno; hspcolno = hscolno;
3109 hsperror("unterminated string literal");
3112 case YY_STATE_EOF(GhcPragma):
3113 #line 940 "yaccParser/hslexer.flex"
3115 hsplineno = hslineno; hspcolno = hscolno;
3116 hsperror("unterminated interface pragma");
3119 case YY_STATE_EOF(UserPragma):
3120 #line 944 "yaccParser/hslexer.flex"
3122 hsplineno = hslineno; hspcolno = hscolno;
3123 hsperror("unterminated user-specified pragma");
3126 case YY_STATE_EOF(Code):
3127 case YY_STATE_EOF(GlaExt):
3128 #line 948 "yaccParser/hslexer.flex"
3129 { hsplineno = hslineno; hspcolno = hscolno; return(EOF); }
3133 #line 950 "yaccParser/hslexer.flex"
3134 YY_FATAL_ERROR( "flex scanner jammed" );
3136 case YY_STATE_EOF(INITIAL):
3139 case YY_END_OF_BUFFER:
3141 /* Amount of text matched not including the EOB char. */
3142 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
3144 /* Undo the effects of YY_DO_BEFORE_ACTION. */
3145 *yy_cp = yy_hold_char;
3147 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
3149 /* We're scanning a new file or input source. It's
3150 * possible that this happened because the user
3151 * just pointed yyin at a new source and called
3152 * yylex(). If so, then we have to assure
3153 * consistency between yy_current_buffer and our
3154 * globals. Here is the right place to do so, because
3155 * this is the first action (other than possibly a
3156 * back-up) that will match for the new input source.
3158 yy_n_chars = yy_current_buffer->yy_n_chars;
3159 yy_current_buffer->yy_input_file = yyin;
3160 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
3163 /* Note that here we test for yy_c_buf_p "<=" to the position
3164 * of the first EOB in the buffer, since yy_c_buf_p will
3165 * already have been incremented past the NUL character
3166 * (since all states make transitions on EOB to the
3167 * end-of-buffer state). Contrast this with the test
3170 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3171 { /* This was really a NUL. */
3172 yy_state_type yy_next_state;
3174 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
3176 yy_current_state = yy_get_previous_state();
3178 /* Okay, we're now positioned to make the NUL
3179 * transition. We couldn't have
3180 * yy_get_previous_state() go ahead and do it
3181 * for us because it doesn't know how to deal
3182 * with the possibility of jamming (and we don't
3183 * want to build jamming into it because then it
3184 * will run more slowly).
3187 yy_next_state = yy_try_NUL_trans( yy_current_state );
3189 yy_bp = yytext_ptr + YY_MORE_ADJ;
3191 if ( yy_next_state )
3193 /* Consume the NUL. */
3194 yy_cp = ++yy_c_buf_p;
3195 yy_current_state = yy_next_state;
3202 goto yy_find_action;
3206 else switch ( yy_get_next_buffer() )
3208 case EOB_ACT_END_OF_FILE:
3210 yy_did_buffer_switch_on_eof = 0;
3214 /* Note: because we've taken care in
3215 * yy_get_next_buffer() to have set up
3216 * yytext, we can now set up
3217 * yy_c_buf_p so that if some total
3218 * hoser (like flex itself) wants to
3219 * call the scanner after we return the
3220 * YY_NULL, it'll still work - another
3221 * YY_NULL will get returned.
3223 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3225 yy_act = YY_STATE_EOF(YY_START);
3231 if ( ! yy_did_buffer_switch_on_eof )
3237 case EOB_ACT_CONTINUE_SCAN:
3239 yytext_ptr + yy_amount_of_matched_text;
3241 yy_current_state = yy_get_previous_state();
3244 yy_bp = yytext_ptr + YY_MORE_ADJ;
3247 case EOB_ACT_LAST_MATCH:
3249 &yy_current_buffer->yy_ch_buf[yy_n_chars];
3251 yy_current_state = yy_get_previous_state();
3254 yy_bp = yytext_ptr + YY_MORE_ADJ;
3255 goto yy_find_action;
3262 "fatal flex scanner internal error--no action found" );
3263 } /* end of action switch */
3264 } /* end of scanning one token */
3265 } /* end of yylex */
3268 /* yy_get_next_buffer - try to read in a new buffer
3270 * Returns a code representing an action:
3271 * EOB_ACT_LAST_MATCH -
3272 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3273 * EOB_ACT_END_OF_FILE - end of file
3276 static int yy_get_next_buffer()
3278 register char *dest = yy_current_buffer->yy_ch_buf;
3279 register char *source = yytext_ptr;
3280 register int number_to_move, i;
3283 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
3285 "fatal flex scanner internal error--end of buffer missed" );
3287 if ( yy_current_buffer->yy_fill_buffer == 0 )
3288 { /* Don't try to fill the buffer, so this is an EOF. */
3289 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
3291 /* We matched a singled characater, the EOB, so
3292 * treat this as a final EOF.
3294 return EOB_ACT_END_OF_FILE;
3299 /* We matched some text prior to the EOB, first
3302 return EOB_ACT_LAST_MATCH;
3306 /* Try to read more data. */
3308 /* First move last chars to start of buffer. */
3309 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
3311 for ( i = 0; i < number_to_move; ++i )
3312 *(dest++) = *(source++);
3314 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3315 /* don't do the read, it's not guaranteed to return an EOF,
3323 yy_current_buffer->yy_buf_size - number_to_move - 1;
3325 while ( num_to_read <= 0 )
3326 { /* Not enough room in the buffer - grow it. */
3327 #ifdef YY_USES_REJECT
3329 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3332 /* just a shorter name for the current buffer */
3333 YY_BUFFER_STATE b = yy_current_buffer;
3335 int yy_c_buf_p_offset =
3336 (int) (yy_c_buf_p - b->yy_ch_buf);
3338 if ( b->yy_is_our_buffer )
3340 int new_size = b->yy_buf_size * 2;
3342 if ( new_size <= 0 )
3343 b->yy_buf_size += b->yy_buf_size / 8;
3345 b->yy_buf_size *= 2;
3347 b->yy_ch_buf = (char *)
3348 /* Include room in for 2 EOB chars. */
3349 yy_flex_realloc( (void *) b->yy_ch_buf,
3350 b->yy_buf_size + 2 );
3353 /* Can't grow it, we don't own it. */
3356 if ( ! b->yy_ch_buf )
3358 "fatal error - scanner input buffer overflow" );
3360 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3362 num_to_read = yy_current_buffer->yy_buf_size -
3367 if ( num_to_read > YY_READ_BUF_SIZE )
3368 num_to_read = YY_READ_BUF_SIZE;
3370 /* Read in more data. */
3371 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
3372 yy_n_chars, num_to_read );
3375 if ( yy_n_chars == 0 )
3377 if ( number_to_move == YY_MORE_ADJ )
3379 ret_val = EOB_ACT_END_OF_FILE;
3385 ret_val = EOB_ACT_LAST_MATCH;
3386 yy_current_buffer->yy_buffer_status =
3387 YY_BUFFER_EOF_PENDING;
3392 ret_val = EOB_ACT_CONTINUE_SCAN;
3394 yy_n_chars += number_to_move;
3395 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
3396 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
3398 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
3404 /* yy_get_previous_state - get the state just before the EOB char was reached */
3406 static yy_state_type yy_get_previous_state()
3408 register yy_state_type yy_current_state;
3409 register char *yy_cp;
3411 yy_current_state = yy_start;
3412 yy_current_state += YY_AT_BOL();
3414 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
3416 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3417 if ( yy_accept[yy_current_state] )
3419 yy_last_accepting_state = yy_current_state;
3420 yy_last_accepting_cpos = yy_cp;
3422 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3424 yy_current_state = (int) yy_def[yy_current_state];
3425 if ( yy_current_state >= 837 )
3426 yy_c = yy_meta[(unsigned int) yy_c];
3428 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3431 return yy_current_state;
3435 /* yy_try_NUL_trans - try to make a transition on the NUL character
3438 * next_state = yy_try_NUL_trans( current_state );
3441 #ifdef YY_USE_PROTOS
3442 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
3444 static yy_state_type yy_try_NUL_trans( yy_current_state )
3445 yy_state_type yy_current_state;
3448 register int yy_is_jam;
3449 register char *yy_cp = yy_c_buf_p;
3451 register YY_CHAR yy_c = 1;
3452 if ( yy_accept[yy_current_state] )
3454 yy_last_accepting_state = yy_current_state;
3455 yy_last_accepting_cpos = yy_cp;
3457 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3459 yy_current_state = (int) yy_def[yy_current_state];
3460 if ( yy_current_state >= 837 )
3461 yy_c = yy_meta[(unsigned int) yy_c];
3463 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3464 yy_is_jam = (yy_current_state == 836);
3466 return yy_is_jam ? 0 : yy_current_state;
3471 #ifdef YY_USE_PROTOS
3472 static void yyunput( int c, register char *yy_bp )
3474 static void yyunput( c, yy_bp )
3476 register char *yy_bp;
3479 register char *yy_cp = yy_c_buf_p;
3481 /* undo effects of setting up yytext */
3482 *yy_cp = yy_hold_char;
3484 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3485 { /* need to shift things up to make room */
3486 /* +2 for EOB chars. */
3487 register int number_to_move = yy_n_chars + 2;
3488 register char *dest = &yy_current_buffer->yy_ch_buf[
3489 yy_current_buffer->yy_buf_size + 2];
3490 register char *source =
3491 &yy_current_buffer->yy_ch_buf[number_to_move];
3493 while ( source > yy_current_buffer->yy_ch_buf )
3494 *--dest = *--source;
3496 yy_cp += (int) (dest - source);
3497 yy_bp += (int) (dest - source);
3498 yy_n_chars = yy_current_buffer->yy_buf_size;
3500 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3501 YY_FATAL_ERROR( "flex scanner push-back overflow" );
3504 *--yy_cp = (char) c;
3508 yy_hold_char = *yy_cp;
3511 #endif /* ifndef YY_NO_UNPUT */
3515 static int yyinput()
3522 *yy_c_buf_p = yy_hold_char;
3524 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
3526 /* yy_c_buf_p now points to the character we want to return.
3527 * If this occurs *before* the EOB characters, then it's a
3528 * valid NUL; if not, then we've hit the end of the buffer.
3530 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3531 /* This was really a NUL. */
3535 { /* need more input */
3536 yytext_ptr = yy_c_buf_p;
3539 switch ( yy_get_next_buffer() )
3541 case EOB_ACT_END_OF_FILE:
3546 yytext_ptr + YY_MORE_ADJ;
3550 if ( ! yy_did_buffer_switch_on_eof )
3559 case EOB_ACT_CONTINUE_SCAN:
3560 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3563 case EOB_ACT_LAST_MATCH:
3566 "unexpected last match in yyinput()" );
3569 "unexpected last match in input()" );
3575 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
3576 *yy_c_buf_p = '\0'; /* preserve yytext */
3577 yy_hold_char = *++yy_c_buf_p;
3579 yy_current_buffer->yy_at_bol = (c == '\n');
3585 #ifdef YY_USE_PROTOS
3586 void yyrestart( FILE *input_file )
3588 void yyrestart( input_file )
3592 if ( ! yy_current_buffer )
3593 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
3595 yy_init_buffer( yy_current_buffer, input_file );
3596 yy_load_buffer_state();
3600 #ifdef YY_USE_PROTOS
3601 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
3603 void yy_switch_to_buffer( new_buffer )
3604 YY_BUFFER_STATE new_buffer;
3607 if ( yy_current_buffer == new_buffer )
3610 if ( yy_current_buffer )
3612 /* Flush out information for old buffer. */
3613 *yy_c_buf_p = yy_hold_char;
3614 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
3615 yy_current_buffer->yy_n_chars = yy_n_chars;
3618 yy_current_buffer = new_buffer;
3619 yy_load_buffer_state();
3621 /* We don't actually know whether we did this switch during
3622 * EOF (yywrap()) processing, but the only time this flag
3623 * is looked at is after yywrap() is called, so it's safe
3624 * to go ahead and always set it.
3626 yy_did_buffer_switch_on_eof = 1;
3630 #ifdef YY_USE_PROTOS
3631 void yy_load_buffer_state( void )
3633 void yy_load_buffer_state()
3636 yy_n_chars = yy_current_buffer->yy_n_chars;
3637 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
3638 yyin = yy_current_buffer->yy_input_file;
3639 yy_hold_char = *yy_c_buf_p;
3643 #ifdef YY_USE_PROTOS
3644 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
3646 YY_BUFFER_STATE yy_create_buffer( file, size )
3653 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3655 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3657 b->yy_buf_size = size;
3659 /* yy_ch_buf has to be 2 characters longer than the size given because
3660 * we need to put in 2 end-of-buffer characters.
3662 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
3663 if ( ! b->yy_ch_buf )
3664 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3666 b->yy_is_our_buffer = 1;
3668 yy_init_buffer( b, file );
3674 #ifdef YY_USE_PROTOS
3675 void yy_delete_buffer( YY_BUFFER_STATE b )
3677 void yy_delete_buffer( b )
3684 if ( b == yy_current_buffer )
3685 yy_current_buffer = (YY_BUFFER_STATE) 0;
3687 if ( b->yy_is_our_buffer )
3688 yy_flex_free( (void *) b->yy_ch_buf );
3690 yy_flex_free( (void *) b );
3694 #ifndef YY_ALWAYS_INTERACTIVE
3695 #ifndef YY_NEVER_INTERACTIVE
3696 extern int isatty YY_PROTO(( int ));
3700 #ifdef YY_USE_PROTOS
3701 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3703 void yy_init_buffer( b, file )
3710 yy_flush_buffer( b );
3712 b->yy_input_file = file;
3713 b->yy_fill_buffer = 1;
3715 #if YY_ALWAYS_INTERACTIVE
3716 b->yy_is_interactive = 1;
3718 #if YY_NEVER_INTERACTIVE
3719 b->yy_is_interactive = 0;
3721 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3727 #ifdef YY_USE_PROTOS
3728 void yy_flush_buffer( YY_BUFFER_STATE b )
3730 void yy_flush_buffer( b )
3737 /* We always need two end-of-buffer characters. The first causes
3738 * a transition to the end-of-buffer state. The second causes
3739 * a jam in that state.
3741 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3742 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3744 b->yy_buf_pos = &b->yy_ch_buf[0];
3747 b->yy_buffer_status = YY_BUFFER_NEW;
3749 if ( b == yy_current_buffer )
3750 yy_load_buffer_state();
3754 #ifndef YY_NO_SCAN_BUFFER
3755 #ifdef YY_USE_PROTOS
3756 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
3758 YY_BUFFER_STATE yy_scan_buffer( base, size )
3766 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3767 base[size-1] != YY_END_OF_BUFFER_CHAR )
3768 /* They forgot to leave room for the EOB's. */
3771 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3773 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3775 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3776 b->yy_buf_pos = b->yy_ch_buf = base;
3777 b->yy_is_our_buffer = 0;
3778 b->yy_input_file = 0;
3779 b->yy_n_chars = b->yy_buf_size;
3780 b->yy_is_interactive = 0;
3782 b->yy_fill_buffer = 0;
3783 b->yy_buffer_status = YY_BUFFER_NEW;
3785 yy_switch_to_buffer( b );
3792 #ifndef YY_NO_SCAN_STRING
3793 #ifdef YY_USE_PROTOS
3794 YY_BUFFER_STATE yy_scan_string( yyconst char *str )
3796 YY_BUFFER_STATE yy_scan_string( str )
3801 for ( len = 0; str[len]; ++len )
3804 return yy_scan_bytes( str, len );
3809 #ifndef YY_NO_SCAN_BYTES
3810 #ifdef YY_USE_PROTOS
3811 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
3813 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
3814 yyconst char *bytes;
3823 /* Get memory for full buffer, including space for trailing EOB's. */
3825 buf = (char *) yy_flex_alloc( n );
3827 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3829 for ( i = 0; i < len; ++i )
3832 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
3834 b = yy_scan_buffer( buf, n );
3836 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3838 /* It's okay to grow etc. this buffer, and we should throw it
3839 * away when we're done.
3841 b->yy_is_our_buffer = 1;
3848 #ifndef YY_NO_PUSH_STATE
3849 #ifdef YY_USE_PROTOS
3850 static void yy_push_state( int new_state )
3852 static void yy_push_state( new_state )
3856 if ( yy_start_stack_ptr >= yy_start_stack_depth )
3860 yy_start_stack_depth += YY_START_STACK_INCR;
3861 new_size = yy_start_stack_depth * sizeof( int );
3863 if ( ! yy_start_stack )
3864 yy_start_stack = (int *) yy_flex_alloc( new_size );
3867 yy_start_stack = (int *) yy_flex_realloc(
3868 (void *) yy_start_stack, new_size );
3870 if ( ! yy_start_stack )
3872 "out of memory expanding start-condition stack" );
3875 yy_start_stack[yy_start_stack_ptr++] = YY_START;
3882 #ifndef YY_NO_POP_STATE
3883 static void yy_pop_state()
3885 if ( --yy_start_stack_ptr < 0 )
3886 YY_FATAL_ERROR( "start-condition stack underflow" );
3888 BEGIN(yy_start_stack[yy_start_stack_ptr]);
3893 #ifndef YY_NO_TOP_STATE
3894 static int yy_top_state()
3896 return yy_start_stack[yy_start_stack_ptr - 1];
3900 #ifndef YY_EXIT_FAILURE
3901 #define YY_EXIT_FAILURE 2
3904 #ifdef YY_USE_PROTOS
3905 static void yy_fatal_error( yyconst char msg[] )
3907 static void yy_fatal_error( msg )
3911 (void) fprintf( stderr, "%s\n", msg );
3912 exit( YY_EXIT_FAILURE );
3917 /* Redefine yyless() so it works in section 3 code. */
3923 /* Undo effects of setting up yytext. */ \
3924 yytext[yyleng] = yy_hold_char; \
3925 yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
3926 yy_hold_char = *yy_c_buf_p; \
3927 *yy_c_buf_p = '\0'; \
3933 /* Internal utility routines. */
3936 #ifdef YY_USE_PROTOS
3937 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3939 static void yy_flex_strncpy( s1, s2, n )
3946 for ( i = 0; i < n; ++i )
3952 #ifdef YY_USE_PROTOS
3953 static void *yy_flex_alloc( yy_size_t size )
3955 static void *yy_flex_alloc( size )
3959 return (void *) malloc( size );
3962 #ifdef YY_USE_PROTOS
3963 static void *yy_flex_realloc( void *ptr, yy_size_t size )
3965 static void *yy_flex_realloc( ptr, size )
3970 /* The cast to (char *) in the following accommodates both
3971 * implementations that use char* generic pointers, and those
3972 * that use void* generic pointers. It works with the latter
3973 * because both ANSI C and C++ allow castless assignment from
3974 * any pointer type to void*, and deal with argument conversions
3975 * as though doing an assignment.
3977 return (void *) realloc( (char *) ptr, size );
3980 #ifdef YY_USE_PROTOS
3981 static void yy_flex_free( void *ptr )
3983 static void yy_flex_free( ptr )
3997 #line 950 "yaccParser/hslexer.flex"
4000 /**********************************************************************
4003 * YACC/LEX Initialisation etc. *
4006 **********************************************************************/
4009 We initialise input_filename to "<stdin>".
4010 This allows unnamed sources to be piped into the parser.
4013 extern BOOLEAN acceptPrim;
4018 input_filename = xstrdup("<stdin>");
4020 /* We must initialize the input buffer _now_, because we call
4021 setyyin _before_ calling yylex for the first time! */
4022 yy_switch_to_buffer(yy_create_buffer(stdin, YY_BUF_SIZE));
4031 new_filename(char *f) /* This looks pretty dodgy to me (WDP) */
4033 if (input_filename != NULL)
4034 free(input_filename);
4035 input_filename = xstrdup(f);
4038 /**********************************************************************
4041 * Layout Processing *
4044 **********************************************************************/
4047 The following section deals with Haskell Layout conventions
4048 forcing insertion of ; or } as appropriate
4052 hsshouldindent(void)
4054 return (!forgetindent && INDENTON);
4058 /* Enter new context and set new indentation level */
4063 fprintf(stderr, "hssetindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4067 * partain: first chk that new indent won't be less than current one; this code
4068 * doesn't make sense to me; hscolno tells the position of the _end_ of the
4069 * current token; what that has to do with indenting, I don't know.
4073 if (hscolno - 1 <= INDENTPT) {
4075 return; /* Empty input OK for Haskell 1.1 */
4077 char errbuf[ERR_BUF_SIZE];
4079 sprintf(errbuf, "Layout error -- indentation should be > %d cols", INDENTPT);
4083 hsentercontext((hspcolno << 1) | 1);
4087 /* Enter a new context without changing the indentation level */
4092 fprintf(stderr, "hsincindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4094 hsentercontext(indenttab[icontexts] & ~1);
4098 /* Turn off indentation processing, usually because an explicit "{" has been seen */
4102 forgetindent = TRUE;
4106 /* Enter a new layout context. */
4108 hsentercontext(int indent)
4110 /* Enter new context and set indentation as specified */
4111 if (++icontexts >= MAX_CONTEXTS) {
4112 char errbuf[ERR_BUF_SIZE];
4114 sprintf(errbuf, "`wheres' and `cases' nested too deeply (>%d)", MAX_CONTEXTS - 1);
4117 forgetindent = FALSE;
4118 indenttab[icontexts] = indent;
4120 fprintf(stderr, "hsentercontext:indent=%d,hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", indent, hscolno, hspcolno, icontexts, INDENTPT);
4125 /* Exit a layout context */
4131 fprintf(stderr, "hsendindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4136 * Return checks the indentation level and returns ;, } or the specified token.
4146 if (hsshouldindent()) {
4147 if (hspcolno < INDENTPT) {
4149 fprintf(stderr, "inserted '}' before %d (%d:%d:%d:%d)\n", tok, hspcolno, hscolno, yyleng, INDENTPT);
4153 } else if (hspcolno == INDENTPT) {
4155 fprintf(stderr, "inserted ';' before %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4163 fprintf(stderr, "returning %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4170 * Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
4176 static BOOLEAN eof = FALSE;
4179 if (hssttok != -1) {
4187 endlineno = hslineno;
4188 if ((tok = yylex1()) != EOF)
4194 if (icontexts > icontexts_save) {
4197 indenttab[icontexts] = 0;
4200 hsperror("missing '}' at end of file");
4201 } else if (hsbuf_save != NULL) {
4203 yy_delete_buffer(YY_CURRENT_BUFFER);
4204 yy_switch_to_buffer(hsbuf_save);
4206 new_filename(filename_save);
4207 free(filename_save);
4208 hslineno = hslineno_save;
4209 hsplineno = hsplineno_save;
4210 hscolno = hscolno_save;
4211 hspcolno = hspcolno_save;
4213 in_interface = FALSE;
4214 icontexts = icontexts_save - 1;
4217 fprintf(stderr, "finished reading interface (%d:%d:%d)\n", hscolno, hspcolno, INDENTPT);
4224 abort(); /* should never get here! */
4228 /**********************************************************************
4231 * Input Processing for Interfaces *
4234 **********************************************************************/
4236 /* setyyin(file) open file as new lex input buffer */
4242 hsbuf_save = YY_CURRENT_BUFFER;
4243 if ((yyin = fopen(file, "r")) == NULL) {
4244 char errbuf[ERR_BUF_SIZE];
4246 sprintf(errbuf, "can't read \"%-.50s\"", file);
4249 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
4251 hslineno_save = hslineno;
4252 hsplineno_save = hsplineno;
4253 hslineno = hsplineno = 1;
4255 filename_save = input_filename;
4256 input_filename = NULL;
4258 hscolno_save = hscolno;
4259 hspcolno_save = hspcolno;
4260 hscolno = hspcolno = 0;
4261 in_interface = TRUE;
4262 etags_save = etags; /* do not do "etags" stuff in interfaces */
4263 etags = 0; /* We remember whether we are doing it in
4264 the module, so we can restore it later [WDP 94/09] */
4265 hsentercontext(-1); /* partain: changed this from 0 */
4266 icontexts_save = icontexts;
4268 fprintf(stderr, "reading %s (%d:%d:%d)\n", input_filename, hscolno_save, hspcolno_save, INDENTPT);
4273 layout_input(char *text, int len)
4276 fprintf(stderr, "Scanning \"%s\"\n", text);
4279 hsplineno = hslineno;
4291 hscolno += 8 - (hscolno % 8); /* Tabs stops are 8 columns apart */
4303 setstartlineno(void)
4305 startlineno = hsplineno;
4309 fprintf(stderr,"%u\tsetstartlineno (col %u)\n",startlineno,hscolno);
4313 /**********************************************************************
4319 **********************************************************************/
4321 #define CACHE_SIZE YY_BUF_SIZE
4327 } textcache = { 0, 0, NULL };
4332 /* fprintf(stderr, "cleartext\n"); */
4334 if (textcache.allocated == 0) {
4335 textcache.allocated = CACHE_SIZE;
4336 textcache.text = xmalloc(CACHE_SIZE);
4341 addtext(char *text, unsigned length)
4343 /* fprintf(stderr, "addtext: %d %s\n", length, text); */
4348 if (textcache.next + length + 1 >= textcache.allocated) {
4349 textcache.allocated += length + CACHE_SIZE;
4350 textcache.text = xrealloc(textcache.text, textcache.allocated);
4352 bcopy(text, textcache.text + textcache.next, length);
4353 textcache.next += length;
4359 /* fprintf(stderr, "addchar: %c\n", c); */
4361 if (textcache.next + 2 >= textcache.allocated) {
4362 textcache.allocated += CACHE_SIZE;
4363 textcache.text = xrealloc(textcache.text, textcache.allocated);
4365 textcache.text[textcache.next++] = c;
4369 fetchtext(unsigned *length)
4371 /* fprintf(stderr, "fetchtext: %d\n", textcache.next); */
4373 *length = textcache.next;
4374 textcache.text[textcache.next] = '\0';
4375 return textcache.text;
4378 /**********************************************************************
4381 * Identifier Processing *
4384 **********************************************************************/
4387 hsnewid Enters an id of length n into the symbol table.
4391 hsnewid(char *name, int length)
4393 char save = name[length];
4395 name[length] = '\0';
4396 yylval.uid = installid(name);
4397 name[length] = save;
4401 isconstr(char *s) /* walks past leading underscores before using the macro */
4405 for ( ; temp != NULL && *temp == '_' ; temp++ );
4407 return _isconstr(temp);