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.2 1996/01/12 11:36:07 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 201
285 #define YY_END_OF_BUFFER 202
286 static yyconst short int yy_accept[836] =
288 0, 0, 0, 0, 0, 0, 0, 0, 190, 190,
289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
290 202, 196, 197, 129, 128, 136, 198, 141, 184, 198,
291 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
292 198, 198, 198, 139, 198, 150, 152, 160, 156, 198,
293 162, 154, 158, 198, 188, 121, 132, 126, 91, 92,
294 97, 84, 104, 121, 110, 110, 121, 83, 121, 86,
295 98, 120, 93, 99, 94, 101, 102, 120, 120, 120,
296 120, 120, 120, 120, 120, 120, 120, 120, 95, 85,
297 96, 103, 121, 190, 195, 195, 132, 126, 104, 110,
299 110, 120, 101, 102, 120, 120, 120, 120, 120, 120,
300 120, 120, 120, 120, 120, 188, 126, 121, 110, 196,
301 120, 120, 120, 120, 120, 95, 121, 121, 121, 196,
302 196, 120, 120, 196, 199, 135, 134, 138, 200, 188,
303 141, 200, 184, 200, 200, 200, 200, 200, 200, 200,
304 200, 200, 200, 200, 200, 200, 200, 140, 200, 150,
305 152, 160, 156, 200, 162, 154, 158, 200, 200, 129,
306 128, 127, 184, 0, 0, 151, 0, 161, 0, 0,
307 0, 174, 0, 0, 0, 0, 159, 177, 178, 153,
308 155, 0, 0, 179, 164, 163, 181, 0, 0, 0,
310 180, 157, 183, 185, 186, 188, 121, 132, 131, 126,
311 125, 187, 88, 82, 0, 110, 0, 0, 90, 87,
312 89, 120, 119, 0, 119, 120, 120, 120, 120, 120,
313 120, 60, 120, 74, 120, 120, 68, 120, 120, 71,
314 120, 120, 189, 0, 0, 190, 191, 0, 194, 192,
315 193, 0, 132, 131, 126, 0, 0, 109, 0, 110,
316 0, 0, 118, 120, 119, 0, 0, 120, 120, 120,
317 120, 120, 120, 60, 120, 74, 120, 120, 68, 120,
318 120, 71, 120, 120, 0, 126, 0, 110, 0, 0,
319 0, 119, 119, 119, 119, 119, 119, 119, 119, 119,
321 119, 119, 119, 119, 119, 119, 119, 0, 120, 120,
322 74, 120, 68, 189, 0, 120, 135, 134, 133, 137,
323 148, 149, 173, 166, 167, 168, 169, 182, 165, 147,
324 146, 176, 172, 145, 170, 142, 143, 144, 175, 171,
325 126, 124, 187, 187, 187, 187, 113, 106, 108, 119,
326 119, 120, 120, 120, 120, 120, 120, 120, 120, 120,
327 120, 120, 75, 120, 120, 120, 120, 120, 0, 0,
328 1, 1, 0, 130, 124, 0, 0, 113, 106, 108,
329 119, 119, 0, 0, 0, 120, 120, 120, 120, 120,
330 120, 120, 120, 120, 120, 120, 75, 120, 120, 120,
332 120, 120, 0, 0, 0, 18, 19, 0, 119, 119,
333 119, 119, 12, 119, 119, 119, 119, 119, 119, 17,
334 119, 15, 119, 119, 119, 11, 119, 119, 6, 119,
335 119, 119, 119, 14, 119, 119, 119, 13, 119, 119,
336 117, 120, 75, 52, 187, 0, 119, 53, 120, 55,
337 120, 120, 58, 120, 120, 120, 120, 120, 120, 120,
338 70, 72, 120, 0, 0, 0, 0, 0, 0, 0,
339 0, 123, 0, 0, 112, 0, 105, 107, 119, 119,
340 122, 0, 53, 120, 55, 120, 120, 58, 120, 120,
341 120, 120, 120, 120, 120, 70, 72, 120, 46, 0,
343 100, 119, 119, 119, 119, 119, 119, 119, 119, 119,
344 119, 119, 119, 119, 119, 119, 16, 119, 7, 119,
345 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
346 119, 117, 53, 0, 113, 80, 54, 120, 120, 120,
347 120, 62, 120, 120, 120, 120, 73, 0, 0, 0,
348 0, 0, 0, 0, 0, 111, 0, 113, 119, 119,
349 114, 54, 120, 120, 120, 120, 62, 120, 120, 120,
350 120, 73, 0, 0, 119, 22, 119, 119, 20, 119,
351 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
352 115, 119, 119, 119, 119, 119, 119, 119, 119, 119,
354 119, 119, 119, 120, 120, 59, 61, 63, 64, 120,
355 120, 67, 120, 0, 0, 0, 0, 0, 0, 0,
356 0, 78, 119, 120, 120, 59, 61, 63, 64, 120,
357 120, 67, 120, 119, 119, 119, 119, 119, 119, 35,
358 119, 36, 119, 119, 119, 119, 34, 119, 119, 40,
359 119, 23, 119, 119, 38, 116, 119, 119, 39, 119,
360 56, 120, 120, 120, 120, 0, 0, 0, 0, 0,
361 0, 0, 0, 2, 2, 119, 76, 56, 120, 120,
362 120, 120, 119, 119, 119, 119, 119, 119, 119, 119,
363 119, 119, 119, 119, 119, 119, 33, 119, 21, 119,
365 119, 57, 65, 120, 69, 0, 0, 0, 0, 0,
366 0, 0, 119, 119, 57, 65, 120, 69, 119, 119,
367 41, 119, 32, 37, 119, 119, 119, 119, 25, 119,
368 119, 119, 119, 119, 119, 119, 81, 66, 0, 0,
369 0, 0, 48, 0, 0, 79, 119, 66, 119, 119,
370 29, 119, 30, 31, 42, 43, 44, 45, 119, 119,
371 119, 28, 0, 0, 0, 0, 0, 0, 0, 77,
372 8, 119, 9, 24, 119, 119, 0, 0, 51, 50,
373 0, 0, 119, 119, 119, 0, 3, 3, 0, 0,
374 119, 119, 10, 0, 0, 47, 119, 119, 0, 0,
376 27, 119, 5, 0, 119, 0, 0, 119, 0, 0,
377 119, 0, 49, 26, 0, 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, 1, 2, 1, 3, 4, 3, 5, 6, 4,
417 4, 7, 3, 3, 4, 3, 8, 4, 4, 9,
418 9, 9, 9, 9, 9, 9, 4, 3, 4, 4,
419 4, 10, 11, 11, 11, 11, 11, 11, 12, 12,
420 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
421 12, 12, 12, 12, 12, 12, 12, 12, 13, 14,
422 13, 10, 15, 16, 17, 17, 17, 17, 17, 17,
423 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
424 18, 18, 18, 18, 18, 18, 18, 19, 4, 20,
429 static yyconst short int yy_base[879] =
431 0, 0, 0, 4, 58, 138, 224, 2188, 0, 1,
432 315, 2187, 402, 0, 487, 0, 25, 39, 578, 0,
433 2194, 2197, 2197, 2181, 2184, 2197, 2197, 2197, 13, 2156,
434 7, 12, 12, 21, 10, 2139, 2137, 2150, 18, 2136,
435 69, 2135, 2133, 2197, 0, 2197, 2197, 2197, 2197, 0,
436 2197, 2197, 2197, 0, 50, 0, 2177, 2171, 2197, 2197,
437 0, 2197, 46, 2164, 131, 415, 2154, 2197, 2163, 2148,
438 0, 0, 2197, 0, 2197, 6, 2197, 11, 36, 2103,
439 2104, 30, 2107, 2097, 2104, 2104, 47, 2100, 2154, 0,
440 2197, 0, 52, 0, 13, 2, 2163, 2157, 425, 662,
442 506, 2160, 66, 2103, 66, 452, 105, 2, 129, 124,
443 107, 131, 138, 663, 42, 407, 0, 148, 515, 745,
444 5, 158, 421, 449, 455, 2149, 0, 2148, 2133, 2100,
445 2098, 122, 135, 2144, 2197, 2153, 2151, 2147, 2197, 192,
446 2197, 2140, 652, 2121, 132, 169, 417, 497, 370, 2104,
447 2102, 2115, 137, 2101, 648, 2100, 2098, 2197, 0, 2197,
448 2197, 2197, 2197, 686, 2197, 2197, 2197, 0, 2132, 2136,
449 2139, 2197, 692, 2103, 2101, 2197, 2098, 2197, 669, 2099,
450 2105, 2197, 2092, 2088, 2104, 410, 2197, 2197, 2197, 2197,
451 2197, 2095, 2093, 2197, 2197, 2096, 2197, 2079, 2100, 2087,
453 2197, 2197, 2197, 699, 0, 723, 0, 2125, 2197, 2119,
454 2197, 727, 0, 0, 734, 745, 722, 0, 0, 2197,
455 0, 0, 0, 2067, 2062, 2047, 2062, 2044, 141, 2044,
456 2056, 0, 2044, 464, 2040, 2053, 0, 2043, 2050, 0,
457 2039, 2048, 2108, 210, 2042, 0, 0, 2097, 2197, 0,
458 2197, 2025, 2105, 2103, 2098, 796, 815, 2197, 822, 841,
459 752, 0, 2197, 2101, 114, 2100, 0, 410, 435, 424,
460 488, 489, 454, 2099, 495, 725, 484, 493, 2098, 726,
461 451, 2097, 673, 730, 2087, 2091, 830, 863, 2039, 2038,
462 2040, 846, 524, 772, 2036, 2060, 2034, 2059, 699, 738,
464 2045, 2044, 843, 641, 501, 2043, 2014, 0, 694, 819,
465 821, 823, 849, 2197, 2001, 753, 2083, 2081, 2197, 2197,
466 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197,
467 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197,
468 2076, 2197, 873, 893, 899, 908, 894, 901, 0, 0,
469 2020, 2017, 2004, 2019, 2018, 2009, 2012, 2007, 2001, 2005,
470 1995, 2007, 0, 1992, 2009, 1996, 2003, 1991, 925, 865,
471 2197, 869, 1993, 2197, 2061, 912, 0, 930, 957, 2060,
472 1986, 2001, 2001, 2056, 2051, 899, 779, 884, 931, 797,
473 900, 932, 671, 933, 934, 935, 2054, 936, 937, 816,
475 938, 731, 1971, 2052, 963, 2197, 2197, 1996, 2007, 918,
476 2009, 2004, 0, 2017, 2008, 2015, 1999, 2016, 2002, 0,
477 1986, 0, 1996, 1995, 1983, 0, 928, 897, 0, 2004,
478 953, 1993, 2006, 0, 1994, 2008, 2003, 0, 1996, 1958,
479 0, 966, 984, 2197, 1006, 1000, 1974, 0, 1955, 0,
480 1952, 1950, 0, 1956, 1952, 1945, 1965, 1949, 1953, 1951,
481 0, 0, 1957, 1025, 1036, 1991, 1987, 1977, 1989, 1973,
482 1951, 2197, 1023, 2011, 2010, 1068, 2197, 2197, 1941, 1941,
483 2197, 2003, 2006, 956, 2005, 951, 987, 2004, 990, 993,
484 696, 989, 1004, 1025, 1006, 2003, 2002, 995, 2197, 1081,
486 2197, 1957, 1945, 1944, 1973, 1942, 1957, 1940, 1951, 408,
487 1955, 1948, 1963, 1965, 1947, 1956, 0, 1932, 0, 1957,
488 1957, 1953, 1947, 1945, 1952, 1953, 1924, 1938, 1935, 1934,
489 1918, 0, 1041, 1088, 1095, 0, 0, 1907, 1908, 1909,
490 1897, 938, 1901, 1907, 1907, 1902, 0, 1934, 1932, 1921,
491 1933, 1926, 1930, 1931, 1962, 2197, 1102, 1121, 1903, 1890,
492 2197, 1956, 1055, 1060, 1028, 1049, 1057, 1071, 140, 1066,
493 1078, 1955, 1132, 1141, 1912, 0, 1925, 1903, 0, 1896,
494 1923, 1905, 1893, 1905, 1891, 1890, 1889, 1901, 1913, 1886,
495 0, 1900, 1910, 1883, 1892, 1881, 1899, 1015, 1148, 1894,
497 1878, 1877, 1864, 1856, 1860, 0, 0, 0, 0, 1869,
498 1870, 0, 1857, 1898, 1886, 1879, 1883, 1888, 1887, 1892,
499 1048, 1887, 1862, 1052, 1128, 1916, 1915, 1914, 1913, 1130,
500 1131, 1912, 1132, 1886, 1877, 1866, 1881, 1880, 1869, 0,
501 1876, 0, 1877, 1876, 1871, 1874, 0, 1845, 1869, 0,
502 1870, 0, 1842, 1871, 0, 1155, 1840, 1867, 0, 1826,
503 0, 1829, 1830, 1831, 1826, 1833, 1858, 1844, 1825, 1805,
504 1814, 1807, 1156, 2197, 1179, 1810, 1804, 1827, 1142, 1176,
505 1177, 1178, 1786, 1784, 1755, 1780, 1750, 1733, 1736, 1750,
506 1749, 1730, 1716, 1148, 1733, 1732, 0, 1703, 0, 1694,
508 1657, 0, 0, 1640, 0, 1631, 1672, 1643, 1636, 1634,
509 1604, 1632, 1601, 1626, 1651, 1623, 1179, 1605, 1547, 1545,
510 0, 1533, 0, 0, 1541, 1528, 1518, 1511, 0, 1503,
511 1502, 1501, 1507, 1494, 1515, 1490, 0, 0, 1501, 1532,
512 1506, 1472, 2197, 1438, 1427, 0, 1397, 1442, 1385, 1396,
513 0, 1379, 0, 0, 0, 0, 0, 0, 1377, 1403,
514 1385, 0, 1401, 1409, 1171, 1356, 1343, 1348, 1352, 0,
515 0, 1328, 0, 0, 1349, 1352, 1334, 1187, 2197, 2197,
516 1222, 1004, 1224, 1223, 1194, 1211, 2197, 1238, 1207, 1216,
517 1217, 1199, 0, 1217, 1203, 2197, 1183, 1192, 1237, 1205,
519 0, 1177, 1198, 1197, 1200, 1188, 1187, 1197, 1160, 1172,
520 1147, 1171, 2197, 0, 1157, 1059, 1062, 1024, 1016, 1037,
521 894, 765, 744, 733, 658, 650, 527, 548, 1194, 1201,
522 408, 396, 96, 2197, 2197, 1261, 1281, 1301, 1321, 1341,
523 1359, 1370, 1183, 1382, 1394, 1412, 1426, 1434, 1452, 1472,
524 1492, 1509, 1527, 1543, 1551, 1567, 1583, 1599, 1617, 1637,
525 1184, 1651, 1663, 1681, 1701, 1721, 1739, 1755, 1219, 1771,
526 1789, 1185, 1805, 1821, 1220, 1835, 1853, 1873
529 static yyconst short int yy_def[879] =
531 836, 836, 837, 837, 838, 838, 835, 7, 839, 839,
532 835, 11, 11, 13, 11, 15, 840, 840, 835, 19,
533 835, 835, 835, 841, 835, 835, 835, 835, 835, 835,
534 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
535 835, 835, 835, 835, 842, 835, 835, 835, 835, 835,
536 835, 835, 835, 843, 835, 844, 845, 846, 835, 835,
537 844, 835, 844, 844, 835, 835, 844, 835, 844, 844,
538 844, 847, 835, 844, 835, 848, 835, 847, 847, 847,
539 847, 847, 847, 847, 847, 847, 847, 847, 835, 844,
540 835, 844, 844, 849, 850, 851, 852, 853, 844, 835,
542 835, 854, 848, 855, 854, 854, 854, 854, 854, 854,
543 854, 854, 854, 854, 854, 835, 856, 99, 835, 848,
544 857, 857, 857, 857, 857, 835, 844, 844, 844, 848,
545 855, 854, 854, 835, 835, 858, 835, 835, 835, 835,
546 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
547 835, 835, 835, 835, 835, 835, 835, 835, 842, 835,
548 835, 835, 835, 835, 835, 835, 835, 843, 835, 841,
549 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
550 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
551 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
553 835, 835, 835, 835, 843, 835, 844, 845, 835, 859,
554 835, 860, 844, 844, 835, 835, 835, 861, 844, 835,
555 844, 862, 863, 848, 863, 862, 862, 862, 862, 862,
556 862, 862, 862, 862, 862, 862, 862, 862, 862, 862,
557 862, 862, 835, 864, 835, 865, 866, 866, 835, 867,
558 835, 867, 868, 835, 859, 835, 835, 835, 835, 835,
559 835, 869, 835, 854, 863, 870, 871, 854, 854, 854,
560 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,
561 854, 854, 854, 854, 835, 859, 835, 835, 835, 835,
562 835, 863, 863, 863, 863, 863, 863, 863, 863, 863,
564 863, 863, 863, 863, 863, 863, 863, 872, 873, 873,
565 873, 873, 873, 835, 835, 854, 874, 835, 835, 835,
566 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
567 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
568 859, 835, 860, 860, 835, 860, 835, 835, 861, 863,
569 863, 862, 862, 862, 862, 862, 862, 862, 862, 862,
570 862, 862, 862, 862, 862, 862, 862, 862, 835, 864,
571 835, 864, 835, 835, 835, 835, 875, 835, 835, 869,
572 863, 863, 835, 870, 871, 854, 854, 854, 854, 854,
573 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,
575 854, 854, 835, 835, 835, 835, 835, 835, 863, 863,
576 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
577 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
578 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
579 876, 873, 873, 835, 835, 835, 863, 862, 862, 862,
580 862, 862, 862, 862, 862, 862, 862, 862, 862, 862,
581 862, 862, 862, 835, 835, 835, 835, 835, 835, 835,
582 835, 835, 835, 875, 835, 835, 835, 835, 863, 863,
583 835, 835, 854, 854, 854, 854, 854, 854, 854, 854,
584 854, 854, 854, 854, 854, 854, 854, 854, 835, 835,
586 835, 863, 863, 863, 863, 863, 863, 863, 863, 863,
587 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
588 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
589 863, 876, 873, 835, 835, 863, 862, 862, 862, 862,
590 862, 862, 862, 862, 862, 862, 862, 835, 835, 835,
591 835, 835, 835, 835, 835, 835, 835, 835, 863, 863,
592 835, 854, 854, 854, 854, 854, 854, 854, 854, 854,
593 854, 854, 835, 835, 863, 863, 863, 863, 863, 863,
594 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
595 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
597 863, 863, 863, 862, 862, 862, 862, 862, 862, 862,
598 862, 862, 862, 835, 835, 835, 835, 835, 835, 835,
599 877, 863, 863, 854, 854, 854, 854, 854, 854, 854,
600 854, 854, 854, 863, 863, 863, 863, 863, 863, 863,
601 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
602 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
603 862, 862, 862, 862, 862, 835, 835, 835, 835, 835,
604 835, 835, 877, 835, 877, 863, 863, 854, 854, 854,
605 854, 854, 863, 863, 863, 863, 863, 863, 863, 863,
606 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
608 863, 862, 862, 862, 862, 835, 835, 835, 835, 835,
609 835, 835, 863, 863, 854, 854, 854, 854, 863, 863,
610 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
611 863, 863, 863, 863, 863, 863, 863, 862, 835, 878,
612 835, 835, 835, 835, 835, 863, 863, 854, 863, 863,
613 863, 863, 863, 863, 863, 863, 863, 863, 863, 863,
614 863, 863, 835, 878, 878, 835, 835, 835, 835, 863,
615 863, 863, 863, 863, 863, 863, 835, 878, 835, 835,
616 835, 835, 863, 863, 863, 835, 835, 878, 835, 835,
617 863, 863, 863, 835, 835, 835, 863, 863, 835, 835,
619 863, 863, 835, 835, 863, 835, 835, 863, 835, 835,
620 863, 835, 835, 863, 835, 835, 835, 835, 835, 835,
621 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
622 835, 835, 835, 835, 0, 835, 835, 835, 835, 835,
623 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
624 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
625 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
626 835, 835, 835, 835, 835, 835, 835, 835
629 static yyconst short int yy_nxt[2289] =
631 23, 23, 23, 23, 23, 23, 23, 23, 835, 263,
632 835, 25, 263, 308, 835, 25, 95, 95, 251, 204,
633 204, 204, 204, 204, 204, 135, 135, 135, 135, 248,
634 835, 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, 835, 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, 835, 263, 308, 257, 175, 192,
649 30, 31, 32, 33, 34, 35, 36, 37, 381, 272,
650 382, 38, 176, 39, 278, 834, 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, 631,
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, 833, 117, 285, 832, 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, 583, 180, 584, 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, 829, 102, 132, 102, 414, 389, 102, 133,
692 398, 102, 102, 438, 102, 397, 102, 390, 102, 391,
693 415, 102, 828, 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, 827, 436, 826, 198,
708 199, 263, 308, 263, 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, 490, 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, 567, 295, 825, 428, 296, 263, 297, 298, 299,
717 300, 301, 302, 824, 394, 303, 304, 305, 402, 306,
719 429, 823, 399, 258, 263, 395, 396, 224, 416, 417,
720 498, 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, 484,
725 260, 260, 260, 260, 260, 260, 260, 371, 372, 487,
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, 496, 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, 473, 473, 473, 473, 473, 473, 475, 263, 263,
734 263, 263, 263, 263, 263, 263, 520, 822, 485, 378,
735 378, 378, 378, 378, 378, 378, 503, 466, 263, 521,
736 467, 504, 446, 263, 477, 468, 476, 483, 488, 469,
737 475, 518, 505, 263, 308, 470, 379, 379, 379, 379,
738 379, 379, 405, 405, 405, 405, 405, 405, 405, 523,
739 519, 263, 308, 524, 263, 486, 263, 263, 476, 500,
741 263, 495, 263, 493, 489, 491, 497, 445, 445, 445,
742 445, 263, 608, 263, 534, 492, 534, 609, 494, 535,
743 535, 535, 535, 535, 535, 535, 464, 464, 464, 464,
744 477, 500, 263, 563, 533, 263, 562, 464, 464, 464,
745 464, 821, 473, 473, 473, 473, 473, 473, 263, 308,
746 674, 675, 820, 568, 790, 654, 263, 466, 819, 263,
747 467, 790, 263, 572, 263, 468, 565, 263, 466, 469,
748 564, 467, 566, 263, 548, 470, 468, 655, 263, 549,
749 469, 571, 557, 569, 557, 263, 470, 558, 558, 558,
750 558, 558, 558, 558, 818, 573, 817, 573, 626, 570,
752 574, 574, 574, 574, 574, 574, 574, 535, 535, 535,
753 535, 535, 535, 535, 535, 535, 535, 535, 535, 535,
754 535, 558, 558, 558, 558, 558, 558, 558, 475, 624,
755 627, 628, 625, 678, 632, 263, 629, 263, 263, 263,
756 558, 558, 558, 558, 558, 558, 558, 630, 475, 263,
757 633, 574, 574, 574, 574, 574, 574, 574, 674, 675,
758 574, 574, 574, 574, 574, 574, 574, 656, 656, 656,
759 656, 656, 656, 656, 656, 656, 656, 656, 656, 656,
760 656, 674, 675, 263, 263, 263, 263, 765, 730, 787,
761 788, 205, 349, 205, 349, 681, 680, 731, 732, 205,
763 349, 441, 441, 765, 679, 831, 816, 815, 682, 814,
764 813, 812, 715, 830, 830, 830, 830, 830, 830, 830,
765 830, 830, 830, 830, 830, 830, 830, 380, 474, 380,
766 474, 811, 810, 809, 808, 380, 474, 807, 806, 805,
767 804, 803, 802, 717, 716, 801, 800, 748, 718, 799,
768 798, 797, 796, 795, 765, 794, 793, 792, 791, 789,
769 778, 22, 22, 22, 22, 22, 22, 22, 22, 22,
770 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
771 22, 24, 24, 24, 24, 24, 24, 24, 24, 24,
772 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
774 24, 27, 27, 27, 27, 27, 27, 27, 27, 27,
775 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
776 27, 94, 94, 94, 94, 94, 94, 94, 94, 94,
777 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
778 94, 136, 136, 136, 136, 136, 136, 136, 136, 136,
779 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
780 136, 170, 170, 170, 170, 170, 170, 170, 170, 170,
781 170, 170, 786, 170, 170, 170, 170, 170, 170, 203,
782 203, 203, 203, 203, 203, 207, 207, 207, 785, 784,
783 783, 207, 782, 781, 780, 207, 208, 208, 208, 208,
785 208, 208, 208, 208, 208, 208, 208, 779, 208, 208,
786 208, 208, 208, 208, 210, 210, 210, 210, 210, 210,
787 210, 210, 210, 210, 210, 765, 210, 210, 210, 210,
788 210, 210, 222, 777, 222, 776, 222, 222, 775, 774,
789 222, 773, 222, 222, 223, 223, 772, 771, 223, 263,
790 223, 223, 246, 246, 246, 246, 246, 246, 246, 770,
791 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
792 769, 246, 247, 247, 247, 247, 247, 247, 247, 247,
793 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
794 768, 247, 250, 250, 250, 250, 250, 250, 250, 250,
796 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
797 250, 253, 253, 253, 253, 253, 253, 253, 253, 253,
798 253, 253, 767, 253, 253, 253, 253, 253, 253, 255,
799 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
800 766, 255, 255, 255, 255, 255, 255, 264, 765, 264,
801 763, 264, 762, 264, 264, 761, 760, 264, 759, 264,
802 264, 266, 266, 758, 757, 756, 266, 266, 266, 286,
803 286, 286, 286, 755, 286, 286, 286, 286, 286, 286,
804 754, 286, 286, 286, 286, 286, 286, 309, 309, 309,
805 753, 309, 752, 309, 309, 751, 750, 309, 749, 309,
807 309, 317, 317, 317, 317, 317, 317, 317, 317, 317,
808 317, 317, 263, 317, 317, 317, 317, 317, 317, 341,
809 341, 341, 341, 341, 341, 341, 341, 341, 341, 341,
810 263, 341, 341, 341, 341, 341, 341, 343, 343, 343,
811 343, 343, 343, 343, 343, 343, 343, 343, 343, 343,
812 343, 343, 343, 343, 343, 343, 343, 222, 263, 222,
813 747, 222, 222, 746, 745, 222, 744, 222, 222, 350,
814 743, 350, 742, 350, 350, 741, 740, 350, 739, 350,
815 350, 370, 370, 370, 370, 370, 370, 370, 370, 370,
816 370, 370, 370, 370, 370, 370, 370, 370, 370, 370,
818 370, 246, 246, 246, 246, 246, 246, 246, 738, 246,
819 246, 246, 246, 246, 246, 246, 246, 246, 246, 737,
820 246, 247, 247, 247, 247, 247, 247, 247, 736, 247,
821 247, 247, 247, 247, 247, 247, 247, 247, 247, 250,
822 250, 250, 250, 250, 250, 250, 735, 250, 250, 250,
823 250, 250, 250, 250, 250, 250, 250, 253, 253, 253,
824 253, 253, 253, 253, 253, 253, 253, 253, 734, 253,
825 253, 253, 253, 253, 253, 384, 733, 384, 729, 384,
826 728, 384, 384, 727, 726, 384, 725, 384, 384, 385,
827 385, 385, 385, 385, 385, 724, 385, 385, 385, 385,
829 385, 385, 385, 385, 385, 385, 385, 385, 385, 309,
830 309, 309, 723, 309, 722, 309, 309, 721, 720, 309,
831 719, 309, 309, 317, 317, 317, 317, 317, 317, 317,
832 317, 317, 317, 317, 263, 317, 317, 317, 317, 317,
833 317, 532, 714, 532, 713, 532, 532, 712, 711, 532,
834 710, 532, 532, 673, 673, 673, 673, 673, 673, 673,
835 673, 673, 673, 673, 673, 673, 673, 673, 673, 673,
836 673, 673, 673, 764, 709, 764, 764, 764, 764, 764,
837 764, 764, 764, 764, 764, 764, 764, 764, 764, 764,
838 764, 764, 764, 708, 707, 706, 705, 704, 703, 702,
840 701, 700, 699, 698, 697, 696, 695, 694, 693, 692,
841 691, 690, 689, 688, 687, 686, 685, 684, 683, 263,
842 263, 263, 263, 263, 677, 676, 672, 671, 670, 669,
843 668, 667, 666, 665, 664, 663, 662, 661, 660, 659,
844 658, 657, 653, 652, 651, 650, 649, 648, 647, 646,
845 645, 644, 643, 642, 641, 640, 639, 638, 637, 636,
846 635, 634, 263, 263, 623, 622, 621, 620, 619, 618,
847 617, 616, 615, 614, 613, 612, 611, 610, 607, 606,
848 605, 604, 603, 602, 601, 600, 599, 598, 597, 596,
849 595, 594, 593, 592, 591, 590, 589, 588, 587, 586,
851 585, 582, 581, 580, 579, 578, 577, 576, 575, 263,
852 263, 263, 263, 263, 561, 560, 559, 556, 478, 555,
853 554, 553, 552, 551, 550, 547, 546, 545, 544, 543,
854 542, 541, 540, 539, 538, 537, 536, 531, 530, 529,
855 528, 527, 526, 525, 522, 517, 516, 515, 514, 513,
856 512, 511, 510, 509, 508, 507, 506, 502, 501, 472,
857 499, 263, 482, 383, 481, 480, 479, 478, 472, 471,
858 463, 462, 461, 460, 459, 458, 457, 456, 455, 454,
859 453, 452, 451, 450, 449, 448, 447, 835, 319, 318,
860 444, 440, 439, 431, 430, 423, 422, 421, 420, 408,
862 407, 406, 404, 403, 263, 263, 263, 383, 263, 375,
863 374, 254, 252, 248, 373, 369, 368, 367, 366, 365,
864 364, 363, 359, 358, 357, 354, 353, 352, 351, 224,
865 342, 209, 340, 339, 338, 337, 336, 335, 332, 331,
866 330, 329, 328, 323, 322, 321, 172, 171, 314, 202,
867 201, 194, 191, 190, 189, 174, 212, 320, 319, 318,
868 314, 835, 224, 213, 315, 314, 267, 263, 211, 254,
869 243, 242, 238, 237, 236, 235, 231, 230, 221, 220,
870 219, 214, 211, 209, 202, 201, 194, 191, 190, 189,
871 174, 172, 171, 835, 93, 93, 21, 835, 835, 835,
873 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
874 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
875 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
876 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
877 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
878 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
879 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
880 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
881 835, 835, 835, 835, 835, 835, 835, 835
884 static yyconst short int yy_chk[2289] =
886 3, 3, 3, 3, 4, 4, 4, 4, 0, 108,
887 0, 3, 121, 121, 0, 4, 9, 10, 96, 50,
888 50, 50, 50, 50, 50, 17, 17, 17, 17, 95,
889 0, 17, 29, 29, 29, 29, 29, 29, 29, 18,
890 18, 18, 18, 31, 32, 18, 33, 35, 33, 115,
891 39, 55, 55, 55, 55, 33, 93, 31, 0, 3,
892 35, 32, 63, 4, 5, 34, 34, 34, 76, 5,
893 39, 34, 34, 105, 108, 78, 63, 5, 5, 5,
894 5, 5, 5, 5, 17, 78, 76, 9, 10, 96,
895 5, 5, 5, 5, 5, 5, 5, 5, 18, 82,
897 79, 5, 95, 5, 79, 82, 82, 5, 5, 41,
898 5, 5, 107, 115, 111, 41, 41, 5, 87, 5,
899 41, 41, 5, 5, 87, 41, 93, 5, 103, 132,
900 105, 110, 103, 87, 5, 5, 109, 5, 112, 5,
901 105, 5, 133, 5, 6, 113, 103, 569, 65, 6,
902 65, 65, 65, 65, 65, 65, 65, 6, 6, 6,
903 6, 6, 6, 6, 118, 122, 122, 118, 145, 153,
904 6, 6, 6, 6, 6, 6, 6, 6, 265, 107,
905 265, 6, 145, 6, 111, 833, 132, 6, 6, 153,
906 6, 6, 110, 140, 140, 140, 140, 6, 109, 6,
908 112, 146, 6, 6, 109, 109, 113, 6, 65, 569,
909 229, 133, 244, 244, 6, 6, 65, 6, 146, 6,
910 229, 6, 122, 6, 7, 7, 7, 7, 7, 7,
911 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
912 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
913 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
914 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
915 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
916 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
917 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
919 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
920 7, 7, 7, 7, 7, 11, 11, 11, 11, 11,
921 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
922 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
923 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
924 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
925 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
926 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
927 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
928 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
930 11, 11, 11, 11, 11, 11, 13, 149, 116, 116,
931 116, 116, 832, 13, 116, 831, 13, 268, 13, 13,
932 149, 13, 13, 13, 13, 13, 13, 13, 123, 123,
933 13, 270, 66, 13, 66, 66, 66, 66, 66, 66,
934 66, 99, 269, 186, 99, 99, 99, 99, 99, 99,
935 99, 147, 510, 147, 510, 99, 124, 124, 281, 106,
936 147, 273, 125, 125, 13, 186, 13, 13, 13, 13,
937 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
938 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
939 268, 277, 13, 15, 15, 271, 272, 123, 15, 269,
941 278, 15, 275, 15, 15, 270, 15, 15, 15, 15,
942 15, 15, 15, 101, 15, 15, 106, 124, 15, 281,
943 106, 273, 119, 101, 125, 101, 101, 101, 101, 101,
944 101, 101, 119, 234, 119, 119, 119, 119, 119, 119,
945 119, 148, 148, 148, 234, 234, 15, 148, 148, 15,
946 15, 305, 828, 15, 15, 15, 293, 271, 15, 15,
947 278, 15, 15, 305, 15, 277, 15, 271, 15, 272,
948 293, 15, 827, 275, 15, 15, 15, 15, 19, 19,
949 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
950 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
952 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
953 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
954 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
955 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
956 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
957 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
958 19, 19, 19, 19, 19, 19, 19, 19, 19, 100,
959 114, 143, 143, 143, 143, 143, 143, 143, 393, 100,
960 283, 100, 100, 100, 100, 100, 100, 100, 155, 179,
961 179, 179, 179, 304, 155, 155, 826, 304, 825, 155,
963 155, 309, 309, 491, 155, 164, 164, 164, 164, 164,
964 164, 173, 173, 173, 173, 173, 173, 173, 204, 204,
965 204, 204, 204, 204, 206, 206, 206, 206, 212, 212,
966 212, 212, 276, 280, 114, 299, 299, 284, 402, 100,
967 114, 217, 217, 217, 217, 217, 217, 100, 393, 114,
968 120, 283, 120, 215, 215, 215, 215, 215, 215, 215,
969 316, 299, 216, 120, 216, 216, 216, 216, 216, 216,
970 216, 261, 261, 261, 261, 261, 261, 120, 300, 120,
971 120, 491, 120, 824, 300, 120, 387, 120, 120, 120,
972 120, 120, 120, 823, 276, 120, 120, 120, 284, 120,
974 300, 822, 280, 256, 390, 276, 276, 120, 294, 294,
975 402, 120, 294, 256, 120, 256, 256, 256, 256, 256,
976 256, 256, 257, 400, 294, 120, 310, 310, 311, 311,
977 312, 312, 257, 316, 257, 257, 257, 257, 257, 257,
978 257, 259, 259, 259, 259, 259, 259, 259, 260, 287,
979 287, 287, 287, 287, 287, 287, 313, 313, 260, 387,
980 260, 260, 260, 260, 260, 260, 260, 370, 370, 390,
981 288, 372, 372, 256, 343, 343, 343, 343, 303, 292,
982 288, 256, 288, 288, 288, 288, 288, 288, 288, 292,
983 303, 388, 400, 292, 344, 344, 344, 344, 292, 310,
985 345, 345, 345, 345, 312, 303, 386, 391, 292, 346,
986 346, 346, 346, 347, 347, 347, 347, 347, 347, 347,
987 348, 348, 348, 348, 348, 348, 369, 369, 369, 369,
988 347, 376, 376, 376, 376, 376, 376, 378, 389, 392,
989 394, 395, 396, 398, 399, 401, 428, 821, 388, 378,
990 378, 378, 378, 378, 378, 378, 410, 369, 486, 428,
991 369, 410, 347, 484, 379, 369, 378, 386, 391, 369,
992 405, 427, 410, 442, 442, 369, 379, 379, 379, 379,
993 379, 379, 405, 405, 405, 405, 405, 405, 405, 431,
994 427, 443, 443, 431, 487, 389, 492, 489, 378, 405,
996 490, 399, 498, 396, 392, 394, 401, 445, 445, 445,
997 445, 493, 542, 495, 446, 395, 446, 542, 398, 446,
998 446, 446, 446, 446, 446, 446, 464, 464, 464, 464,
999 473, 405, 494, 486, 442, 565, 484, 465, 465, 465,
1000 465, 820, 473, 473, 473, 473, 473, 473, 533, 533,
1001 621, 621, 819, 492, 782, 598, 566, 464, 818, 624,
1002 464, 782, 563, 498, 567, 464, 489, 564, 465, 464,
1003 487, 465, 490, 570, 465, 464, 465, 598, 568, 465,
1004 465, 495, 476, 493, 476, 571, 465, 476, 476, 476,
1005 476, 476, 476, 476, 817, 500, 816, 500, 565, 494,
1007 500, 500, 500, 500, 500, 500, 500, 534, 534, 534,
1008 534, 534, 534, 534, 535, 535, 535, 535, 535, 535,
1009 535, 557, 557, 557, 557, 557, 557, 557, 558, 563,
1010 566, 567, 564, 624, 570, 625, 567, 630, 631, 633,
1011 558, 558, 558, 558, 558, 558, 558, 568, 574, 679,
1012 571, 573, 573, 573, 573, 573, 573, 573, 673, 673,
1013 574, 574, 574, 574, 574, 574, 574, 599, 599, 599,
1014 599, 599, 599, 599, 656, 656, 656, 656, 656, 656,
1015 656, 675, 675, 680, 681, 682, 717, 765, 694, 778,
1016 778, 843, 861, 843, 861, 631, 630, 694, 694, 843,
1018 861, 872, 872, 778, 625, 830, 815, 812, 633, 811,
1019 810, 809, 679, 829, 829, 829, 829, 829, 829, 829,
1020 830, 830, 830, 830, 830, 830, 830, 869, 875, 869,
1021 875, 808, 807, 806, 805, 869, 875, 804, 803, 802,
1022 800, 799, 798, 681, 680, 797, 795, 717, 682, 794,
1023 792, 791, 790, 789, 788, 786, 785, 784, 783, 781,
1024 765, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1025 836, 836, 836, 836, 836, 836, 836, 836, 836, 836,
1026 836, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1027 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1029 837, 838, 838, 838, 838, 838, 838, 838, 838, 838,
1030 838, 838, 838, 838, 838, 838, 838, 838, 838, 838,
1031 838, 839, 839, 839, 839, 839, 839, 839, 839, 839,
1032 839, 839, 839, 839, 839, 839, 839, 839, 839, 839,
1033 839, 840, 840, 840, 840, 840, 840, 840, 840, 840,
1034 840, 840, 840, 840, 840, 840, 840, 840, 840, 840,
1035 840, 841, 841, 841, 841, 841, 841, 841, 841, 841,
1036 841, 841, 777, 841, 841, 841, 841, 841, 841, 842,
1037 842, 842, 842, 842, 842, 844, 844, 844, 776, 775,
1038 772, 844, 769, 768, 767, 844, 845, 845, 845, 845,
1040 845, 845, 845, 845, 845, 845, 845, 766, 845, 845,
1041 845, 845, 845, 845, 846, 846, 846, 846, 846, 846,
1042 846, 846, 846, 846, 846, 764, 846, 846, 846, 846,
1043 846, 846, 847, 763, 847, 761, 847, 847, 760, 759,
1044 847, 752, 847, 847, 848, 848, 750, 749, 848, 748,
1045 848, 848, 849, 849, 849, 849, 849, 849, 849, 747,
1046 849, 849, 849, 849, 849, 849, 849, 849, 849, 849,
1047 745, 849, 850, 850, 850, 850, 850, 850, 850, 850,
1048 850, 850, 850, 850, 850, 850, 850, 850, 850, 850,
1049 744, 850, 851, 851, 851, 851, 851, 851, 851, 851,
1051 851, 851, 851, 851, 851, 851, 851, 851, 851, 851,
1052 851, 852, 852, 852, 852, 852, 852, 852, 852, 852,
1053 852, 852, 742, 852, 852, 852, 852, 852, 852, 853,
1054 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
1055 741, 853, 853, 853, 853, 853, 853, 854, 740, 854,
1056 739, 854, 736, 854, 854, 735, 734, 854, 733, 854,
1057 854, 855, 855, 732, 731, 730, 855, 855, 855, 856,
1058 856, 856, 856, 728, 856, 856, 856, 856, 856, 856,
1059 727, 856, 856, 856, 856, 856, 856, 857, 857, 857,
1060 726, 857, 725, 857, 857, 722, 720, 857, 719, 857,
1062 857, 858, 858, 858, 858, 858, 858, 858, 858, 858,
1063 858, 858, 718, 858, 858, 858, 858, 858, 858, 859,
1064 859, 859, 859, 859, 859, 859, 859, 859, 859, 859,
1065 716, 859, 859, 859, 859, 859, 859, 860, 860, 860,
1066 860, 860, 860, 860, 860, 860, 860, 860, 860, 860,
1067 860, 860, 860, 860, 860, 860, 860, 862, 715, 862,
1068 714, 862, 862, 713, 712, 862, 711, 862, 862, 863,
1069 710, 863, 709, 863, 863, 708, 707, 863, 706, 863,
1070 863, 864, 864, 864, 864, 864, 864, 864, 864, 864,
1071 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
1073 864, 865, 865, 865, 865, 865, 865, 865, 704, 865,
1074 865, 865, 865, 865, 865, 865, 865, 865, 865, 701,
1075 865, 866, 866, 866, 866, 866, 866, 866, 700, 866,
1076 866, 866, 866, 866, 866, 866, 866, 866, 866, 867,
1077 867, 867, 867, 867, 867, 867, 698, 867, 867, 867,
1078 867, 867, 867, 867, 867, 867, 867, 868, 868, 868,
1079 868, 868, 868, 868, 868, 868, 868, 868, 696, 868,
1080 868, 868, 868, 868, 868, 870, 695, 870, 693, 870,
1081 692, 870, 870, 691, 690, 870, 689, 870, 870, 871,
1082 871, 871, 871, 871, 871, 688, 871, 871, 871, 871,
1084 871, 871, 871, 871, 871, 871, 871, 871, 871, 873,
1085 873, 873, 687, 873, 686, 873, 873, 685, 684, 873,
1086 683, 873, 873, 874, 874, 874, 874, 874, 874, 874,
1087 874, 874, 874, 874, 678, 874, 874, 874, 874, 874,
1088 874, 876, 677, 876, 676, 876, 876, 672, 671, 876,
1089 670, 876, 876, 877, 877, 877, 877, 877, 877, 877,
1090 877, 877, 877, 877, 877, 877, 877, 877, 877, 877,
1091 877, 877, 877, 878, 669, 878, 878, 878, 878, 878,
1092 878, 878, 878, 878, 878, 878, 878, 878, 878, 878,
1093 878, 878, 878, 668, 667, 666, 665, 664, 663, 662,
1095 660, 658, 657, 654, 653, 651, 649, 648, 646, 645,
1096 644, 643, 641, 639, 638, 637, 636, 635, 634, 632,
1097 629, 628, 627, 626, 623, 622, 620, 619, 618, 617,
1098 616, 615, 614, 613, 611, 610, 605, 604, 603, 602,
1099 601, 600, 597, 596, 595, 594, 593, 592, 590, 589,
1100 588, 587, 586, 585, 584, 583, 582, 581, 580, 578,
1101 577, 575, 572, 562, 560, 559, 555, 554, 553, 552,
1102 551, 550, 549, 548, 546, 545, 544, 543, 541, 540,
1103 539, 538, 531, 530, 529, 528, 527, 526, 525, 524,
1104 523, 522, 521, 520, 518, 516, 515, 514, 513, 512,
1106 511, 509, 508, 507, 506, 505, 504, 503, 502, 497,
1107 496, 488, 485, 483, 482, 480, 479, 475, 474, 471,
1108 470, 469, 468, 467, 466, 463, 460, 459, 458, 457,
1109 456, 455, 454, 452, 451, 449, 447, 440, 439, 437,
1110 436, 435, 433, 432, 430, 425, 424, 423, 421, 419,
1111 418, 417, 416, 415, 414, 412, 411, 409, 408, 404,
1112 403, 397, 385, 384, 383, 382, 381, 380, 375, 373,
1113 368, 367, 366, 365, 364, 362, 361, 360, 359, 358,
1114 357, 356, 355, 354, 353, 352, 351, 341, 318, 317,
1115 315, 307, 306, 302, 301, 298, 297, 296, 295, 291,
1117 290, 289, 286, 285, 282, 279, 274, 266, 264, 255,
1118 254, 253, 252, 248, 245, 243, 242, 241, 239, 238,
1119 236, 235, 233, 231, 230, 228, 227, 226, 225, 224,
1120 210, 208, 200, 199, 198, 196, 193, 192, 185, 184,
1121 183, 181, 180, 177, 175, 174, 171, 170, 169, 157,
1122 156, 154, 152, 151, 150, 144, 142, 138, 137, 136,
1123 134, 131, 130, 129, 128, 126, 104, 102, 98, 97,
1124 89, 88, 86, 85, 84, 83, 81, 80, 70, 69,
1125 67, 64, 58, 57, 43, 42, 40, 38, 37, 36,
1126 30, 25, 24, 21, 12, 8, 835, 835, 835, 835,
1128 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1129 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1130 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1131 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1132 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1133 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1134 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1135 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
1136 835, 835, 835, 835, 835, 835, 835, 835
1139 static yy_state_type yy_last_accepting_state;
1140 static char *yy_last_accepting_cpos;
1142 /* The intent behind this definition is that it'll catch
1143 * any uses of REJECT which flex missed.
1145 #define REJECT reject_used_but_not_detected
1146 #define yymore() yymore_used_but_not_detected
1147 #define YY_MORE_ADJ 0
1149 #line 1 "yaccParser/hslexer.flex"
1151 #line 2 "yaccParser/hslexer.flex"
1152 /**********************************************************************
1155 * LEX grammar for Haskell. *
1156 * ------------------------ *
1158 * (c) Copyright K. Hammond, University of Glasgow, *
1159 * 10th. February 1989 *
1161 * Modification History *
1162 * -------------------- *
1164 * 22/08/91 kh Initial Haskell 1.1 version. *
1165 * 18/10/91 kh Added 'ccall'. *
1166 * 19/11/91 kh Tidied generally. *
1167 * 04/12/91 kh Added Int#. *
1168 * 31/01/92 kh Haskell 1.2 version. *
1169 * 24/04/92 ps Added 'scc'. *
1170 * 03/06/92 kh Changed Infix/Prelude Handling. *
1171 * 23/08/93 jsm Changed to support flex *
1178 **********************************************************************/
1180 #include "../../includes/config.h"
1184 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
1186 /* An ANSI string.h and pre-ANSI memory.h might conflict. */
1187 #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
1189 #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
1190 #define index strchr
1191 #define rindex strrchr
1192 #define bcopy(s, d, n) memcpy ((d), (s), (n))
1193 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
1194 #define bzero(s, n) memset ((s), 0, (n))
1195 #else /* not STDC_HEADERS and not HAVE_STRING_H */
1196 #include <strings.h>
1197 /* memory.h and strings.h conflict on some systems. */
1198 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
1200 #include "hspincl.h"
1201 #include "hsparser.tab.h"
1202 #include "constants.h"
1205 /* Our substitute for <ctype.h> */
1214 #define _isconstr(s) (CharTable[*s]&(_C))
1215 BOOLEAN isconstr PROTO((char *)); /* fwd decl */
1217 static unsigned char CharTable[NCHARS] = {
1218 /* nul */ 0, 0, 0, 0, 0, 0, 0, 0,
1219 /* bs */ 0, _S, _S, _S, _S, 0, 0, 0,
1220 /* dle */ 0, 0, 0, 0, 0, 0, 0, 0,
1221 /* can */ 0, 0, 0, 0, 0, 0, 0, 0,
1222 /* sp */ _S, 0, 0, 0, 0, 0, 0, 0,
1223 /* '(' */ 0, 0, 0, 0, 0, 0, 0, 0,
1224 /* '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,
1225 /* '8' */ _D|_H, _D|_H, _C, 0, 0, 0, 0, 0,
1226 /* '@' */ 0, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _C,
1227 /* 'H' */ _C, _C, _C, _C, _C, _C, _C, _C,
1228 /* 'P' */ _C, _C, _C, _C, _C, _C, _C, _C,
1229 /* 'X' */ _C, _C, _C, 0, 0, 0, 0, 0,
1230 /* '`' */ 0, _H, _H, _H, _H, _H, _H, 0,
1231 /* 'h' */ 0, 0, 0, 0, 0, 0, 0, 0,
1232 /* 'p' */ 0, 0, 0, 0, 0, 0, 0, 0,
1233 /* 'x' */ 0, 0, 0, 0, 0, 0, 0, 0,
1235 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1236 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1237 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1238 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1239 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1240 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1241 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1242 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1243 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1244 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1245 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1246 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1247 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1248 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1249 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1250 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1253 /**********************************************************************
1259 **********************************************************************/
1261 char *input_filename = NULL; /* Always points to a dynamically allocated string */
1264 * For my own sanity, things that are not part of the flex skeleton
1265 * have been renamed as hsXXXXX rather than yyXXXXX. --JSM
1268 static int hslineno = 0; /* Line number at end of token */
1269 int hsplineno = 0; /* Line number at end of previous token */
1271 static int hscolno = 0; /* Column number at end of token */
1272 int hspcolno = 0; /* Column number at end of previous token */
1273 static int hsmlcolno = 0; /* Column number for multiple-rule lexemes */
1275 int startlineno = 0; /* The line number where something starts */
1276 int endlineno = 0; /* The line number where something ends */
1278 static BOOLEAN noGap = TRUE; /* For checking string gaps */
1279 static BOOLEAN forgetindent = FALSE; /* Don't bother applying indentation rules */
1281 static int nested_comments; /* For counting comment nesting depth */
1283 /* Hacky definition of yywrap: see flex doc.
1285 If we don't do this, then we'll have to get the default
1286 yywrap from the flex library, which is often something
1287 we are not good at locating. This avoids that difficulty.
1288 (Besides which, this is the way old flexes (pre 2.4.x) did it.)
1293 /* Essential forward declarations */
1295 static void hsnewid PROTO((char *, int));
1296 static void layout_input PROTO((char *, int));
1297 static void cleartext (NO_ARGS);
1298 static void addtext PROTO((char *, unsigned));
1299 static void addchar PROTO((char));
1300 static char *fetchtext PROTO((unsigned *));
1301 static void new_filename PROTO((char *));
1302 static int Return PROTO((int));
1303 static void hsentercontext PROTO((int));
1305 /* Special file handling for IMPORTS */
1306 /* Note: imports only ever go *one deep* (hence no need for a stack) WDP 94/09 */
1308 static YY_BUFFER_STATE hsbuf_save = NULL; /* Saved input buffer */
1309 static char *filename_save; /* File Name */
1310 static int hslineno_save = 0, /* Line Number */
1311 hsplineno_save = 0, /* Line Number of Prev. token */
1312 hscolno_save = 0, /* Indentation */
1313 hspcolno_save = 0; /* Left Indentation */
1314 static short icontexts_save = 0; /* Indent Context Level */
1316 static BOOLEAN etags_save; /* saved: whether doing etags stuff or not */
1317 extern BOOLEAN etags; /* that which is saved */
1319 extern BOOLEAN nonstandardFlag; /* Glasgow extensions allowed */
1321 static BOOLEAN in_interface = FALSE; /* TRUE if we are reading a .hi file */
1323 extern BOOLEAN ignorePragmas; /* True when we should ignore pragmas */
1324 extern int minAcceptablePragmaVersion; /* see documentation in main.c */
1325 extern int maxAcceptablePragmaVersion;
1326 extern int thisIfacePragmaVersion;
1328 static int hssttok = -1; /* Stacked Token: -1 -- no token; -ve -- ";"
1329 * inserted before token +ve -- "}" inserted before
1332 short icontexts = 0; /* Which context we're in */
1337 Table of indentations: right bit indicates whether to use
1338 indentation rules (1 = use rules; 0 = ignore)
1341 push one of these "contexts" at every "case" or "where"; the right bit says
1342 whether user supplied braces, etc., or not. pop appropriately (hsendindent).
1344 ALSO, a push/pop when enter/exit a new file (e.g., on importing). A -1 is
1345 pushed (the "column" for "module", "interface" and EOF). The -1 from the initial
1346 push is shown just below.
1351 static short indenttab[MAX_CONTEXTS] = {-1};
1353 #define INDENTPT (indenttab[icontexts]>>1)
1354 #define INDENTON (indenttab[icontexts]&1)
1356 #define RETURN(tok) return(Return(tok))
1359 #define YY_DECL int yylex1()
1361 /* We should not peek at yy_act, but flex calls us even for the internal action
1362 triggered on 'end-of-buffer' (This is not true of flex 2.4.4 and up, but
1363 to support older versions of flex, we'll continue to peek for now.
1365 #define YY_USER_ACTION \
1366 if (yy_act != YY_END_OF_BUFFER) layout_input(yytext, yyleng);
1370 #define YY_BREAK if (etags) fprintf(stderr,"%d %d / %d %d / %d\n",hsplineno,hspcolno,hslineno,hscolno,startlineno); break;
1373 /* Each time we enter a new start state, we push it onto the state stack.
1374 Note that the rules do not allow us to underflow or overflow the stack.
1375 (At least, they shouldn't.) The maximum expected depth is 4:
1376 0: Code -> 1: String -> 2: StringEsc -> 3: Comment
1378 static int StateStack[5];
1379 static int StateDepth = -1;
1382 #define PUSH_STATE(n) do {\
1383 fprintf(stderr,"Pushing %d (%d)\n", n, StateDepth + 1);\
1384 StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1385 #define POP_STATE do {--StateDepth;\
1386 fprintf(stderr,"Popping %d (%d)\n", StateStack[StateDepth], StateDepth);\
1387 BEGIN(StateStack[StateDepth]);} while(0)
1389 #define PUSH_STATE(n) do {StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1390 #define POP_STATE do {--StateDepth; BEGIN(StateStack[StateDepth]);} while(0)
1393 /* The start states are:
1394 Code -- normal Haskell code (principal lexer)
1395 GlaExt -- Haskell code with Glasgow extensions
1396 Comment -- Nested comment processing
1397 String -- Inside a string literal with backslashes
1398 StringEsc -- Immediately following a backslash in a string literal
1399 Char -- Inside a character literal with backslashes
1400 CharEsc -- Immediately following a backslash in a character literal
1402 Note that the INITIAL state is unused. Also note that these states
1403 are _exclusive_. All rules should be prefixed with an appropriate
1404 list of start states.
1412 #define UserPragma 7
1417 /* Macros after this point can all be overridden by user definitions in
1421 #ifndef YY_SKIP_YYWRAP
1423 extern "C" int yywrap YY_PROTO(( void ));
1425 extern int yywrap YY_PROTO(( void ));
1430 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1434 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1439 static int yyinput YY_PROTO(( void ));
1441 static int input YY_PROTO(( void ));
1446 static int yy_start_stack_ptr = 0;
1447 static int yy_start_stack_depth = 0;
1448 static int *yy_start_stack = 0;
1449 #ifndef YY_NO_PUSH_STATE
1450 static void yy_push_state YY_PROTO(( int new_state ));
1452 #ifndef YY_NO_POP_STATE
1453 static void yy_pop_state YY_PROTO(( void ));
1455 #ifndef YY_NO_TOP_STATE
1456 static int yy_top_state YY_PROTO(( void ));
1460 #define YY_NO_PUSH_STATE 1
1461 #define YY_NO_POP_STATE 1
1462 #define YY_NO_TOP_STATE 1
1465 #ifdef YY_MALLOC_DECL
1473 /* Just try to get by without declaring the routines. This will fail
1474 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1475 * or sizeof(void*) != sizeof(int).
1480 /* Amount of stuff to slurp up with each read. */
1481 #ifndef YY_READ_BUF_SIZE
1482 #define YY_READ_BUF_SIZE 8192
1485 /* Copy whatever the last rule matched to the standard output. */
1488 /* This used to be an fputs(), but since the string might contain NUL's,
1489 * we now use fwrite().
1491 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1494 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1495 * is returned in "result".
1498 #define YY_INPUT(buf,result,max_size) \
1499 if ( yy_current_buffer->yy_is_interactive ) \
1502 for ( n = 0; n < max_size && \
1503 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1504 buf[n] = (char) c; \
1506 buf[n++] = (char) c; \
1507 if ( c == EOF && ferror( yyin ) ) \
1508 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1511 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1512 && ferror( yyin ) ) \
1513 YY_FATAL_ERROR( "input in flex scanner failed" );
1516 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1517 * we don't want an extra ';' after the "return" because that will cause
1518 * some compilers to complain about unreachable statements.
1521 #define yyterminate() return YY_NULL
1524 /* Number of entries by which start-condition stack grows. */
1525 #ifndef YY_START_STACK_INCR
1526 #define YY_START_STACK_INCR 25
1529 /* Report a fatal error. */
1530 #ifndef YY_FATAL_ERROR
1531 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1534 /* Default declaration of generated scanner - a define so the user can
1535 * easily add parameters.
1538 #define YY_DECL int yylex YY_PROTO(( void ))
1541 /* Code executed at the beginning of each rule, after yytext and yyleng
1544 #ifndef YY_USER_ACTION
1545 #define YY_USER_ACTION
1548 /* Code executed at the end of each rule. */
1550 #define YY_BREAK break;
1553 #define YY_RULE_SETUP \
1555 yy_current_buffer->yy_at_bol = \
1556 (yytext[yyleng - 1] == '\n'); \
1561 register yy_state_type yy_current_state;
1562 register char *yy_cp, *yy_bp;
1563 register int yy_act;
1565 #line 277 "yaccParser/hslexer.flex"
1570 * Special GHC pragma rules. Do we need a start state for interface files,
1571 * so these won't be matched in source files? --JSM
1585 yy_start = 1; /* first start state */
1593 if ( ! yy_current_buffer )
1595 yy_create_buffer( yyin, YY_BUF_SIZE );
1597 yy_load_buffer_state();
1600 while ( 1 ) /* loops until end-of-file is reached */
1604 /* Support of yytext. */
1605 *yy_cp = yy_hold_char;
1607 /* yy_bp points to the position in yy_ch_buf of the start of
1612 yy_current_state = yy_start;
1613 yy_current_state += YY_AT_BOL();
1617 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1618 if ( yy_accept[yy_current_state] )
1620 yy_last_accepting_state = yy_current_state;
1621 yy_last_accepting_cpos = yy_cp;
1623 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1625 yy_current_state = (int) yy_def[yy_current_state];
1626 if ( yy_current_state >= 836 )
1627 yy_c = yy_meta[(unsigned int) yy_c];
1629 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1632 while ( yy_base[yy_current_state] != 2197 );
1635 yy_act = yy_accept[yy_current_state];
1637 { /* have to back up */
1638 yy_cp = yy_last_accepting_cpos;
1639 yy_current_state = yy_last_accepting_state;
1640 yy_act = yy_accept[yy_current_state];
1643 YY_DO_BEFORE_ACTION;
1646 do_action: /* This label is used only to access EOF actions. */
1650 { /* beginning of action switch */
1651 case 0: /* must back up */
1652 /* undo the effects of YY_DO_BEFORE_ACTION */
1653 *yy_cp = yy_hold_char;
1654 yy_cp = yy_last_accepting_cpos;
1655 yy_current_state = yy_last_accepting_state;
1656 goto yy_find_action;
1660 #line 286 "yaccParser/hslexer.flex"
1662 char tempf[FILENAME_SIZE];
1663 sscanf(yytext+1, "%d \"%[^\"]", &hslineno, tempf);
1664 new_filename(tempf);
1665 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1670 #line 293 "yaccParser/hslexer.flex"
1672 char tempf[FILENAME_SIZE];
1673 sscanf(yytext+5, "%d \"%[^\"]", &hslineno, tempf);
1674 new_filename(tempf);
1675 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1680 #line 300 "yaccParser/hslexer.flex"
1682 /* partain: pragma-style line directive */
1683 char tempf[FILENAME_SIZE];
1684 sscanf(yytext+9, "%d \"%[^\"]", &hslineno, tempf);
1685 new_filename(tempf);
1686 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1691 #line 307 "yaccParser/hslexer.flex"
1693 sscanf(yytext+33,"%d ",&thisIfacePragmaVersion);
1698 #line 310 "yaccParser/hslexer.flex"
1700 if ( ignorePragmas ||
1701 thisIfacePragmaVersion < minAcceptablePragmaVersion ||
1702 thisIfacePragmaVersion > maxAcceptablePragmaVersion) {
1703 nested_comments = 1;
1704 PUSH_STATE(Comment);
1706 PUSH_STATE(GhcPragma);
1713 #line 321 "yaccParser/hslexer.flex"
1714 { RETURN(NO_PRAGMA); }
1718 #line 322 "yaccParser/hslexer.flex"
1719 { RETURN(NOINFO_PRAGMA); }
1723 #line 323 "yaccParser/hslexer.flex"
1724 { RETURN(ABSTRACT_PRAGMA); }
1728 #line 324 "yaccParser/hslexer.flex"
1729 { RETURN(DEFOREST_PRAGMA); }
1733 #line 325 "yaccParser/hslexer.flex"
1734 { RETURN(SPECIALISE_PRAGMA); }
1738 #line 326 "yaccParser/hslexer.flex"
1739 { RETURN(MODNAME_PRAGMA); }
1743 #line 327 "yaccParser/hslexer.flex"
1744 { RETURN(ARITY_PRAGMA); }
1748 #line 328 "yaccParser/hslexer.flex"
1749 { RETURN(UPDATE_PRAGMA); }
1753 #line 329 "yaccParser/hslexer.flex"
1754 { RETURN(STRICTNESS_PRAGMA); }
1758 #line 330 "yaccParser/hslexer.flex"
1759 { RETURN(KIND_PRAGMA); }
1763 #line 331 "yaccParser/hslexer.flex"
1764 { RETURN(MAGIC_UNFOLDING_PRAGMA); }
1768 #line 332 "yaccParser/hslexer.flex"
1769 { RETURN(UNFOLDING_PRAGMA); }
1773 #line 334 "yaccParser/hslexer.flex"
1778 #line 335 "yaccParser/hslexer.flex"
1783 #line 336 "yaccParser/hslexer.flex"
1788 #line 337 "yaccParser/hslexer.flex"
1789 { RETURN(COTYAPP); }
1793 #line 338 "yaccParser/hslexer.flex"
1794 { RETURN(CO_ALG_ALTS); }
1798 #line 339 "yaccParser/hslexer.flex"
1799 { RETURN(CO_PRIM_ALTS); }
1803 #line 340 "yaccParser/hslexer.flex"
1804 { RETURN(CO_NO_DEFAULT); }
1808 #line 341 "yaccParser/hslexer.flex"
1809 { RETURN(CO_LETREC); }
1813 #line 343 "yaccParser/hslexer.flex"
1814 { RETURN(CO_PRELUDE_DICTS_CC); }
1818 #line 344 "yaccParser/hslexer.flex"
1819 { RETURN(CO_ALL_DICTS_CC); }
1823 #line 345 "yaccParser/hslexer.flex"
1824 { RETURN(CO_USER_CC); }
1828 #line 346 "yaccParser/hslexer.flex"
1829 { RETURN(CO_AUTO_CC); }
1833 #line 347 "yaccParser/hslexer.flex"
1834 { RETURN(CO_DICT_CC); }
1838 #line 349 "yaccParser/hslexer.flex"
1839 { RETURN(CO_DUPD_CC); }
1843 #line 350 "yaccParser/hslexer.flex"
1844 { RETURN(CO_CAF_CC); }
1848 #line 352 "yaccParser/hslexer.flex"
1849 { RETURN(CO_SDSEL_ID); }
1853 #line 353 "yaccParser/hslexer.flex"
1854 { RETURN(CO_METH_ID); }
1858 #line 354 "yaccParser/hslexer.flex"
1859 { RETURN(CO_DEFM_ID); }
1863 #line 355 "yaccParser/hslexer.flex"
1864 { RETURN(CO_DFUN_ID); }
1868 #line 356 "yaccParser/hslexer.flex"
1869 { RETURN(CO_CONSTM_ID); }
1873 #line 357 "yaccParser/hslexer.flex"
1874 { RETURN(CO_SPEC_ID); }
1878 #line 358 "yaccParser/hslexer.flex"
1879 { RETURN(CO_WRKR_ID); }
1883 #line 359 "yaccParser/hslexer.flex"
1884 { RETURN(CO_ORIG_NM); /* fully-qualified original name*/ }
1888 #line 361 "yaccParser/hslexer.flex"
1889 { RETURN(UNFOLD_ALWAYS); }
1893 #line 362 "yaccParser/hslexer.flex"
1894 { RETURN(UNFOLD_IF_ARGS); }
1898 #line 364 "yaccParser/hslexer.flex"
1899 { RETURN(NOREP_INTEGER); }
1903 #line 365 "yaccParser/hslexer.flex"
1904 { RETURN(NOREP_RATIONAL); }
1908 #line 366 "yaccParser/hslexer.flex"
1909 { RETURN(NOREP_STRING); }
1913 #line 368 "yaccParser/hslexer.flex"
1914 { POP_STATE; RETURN(END_PRAGMA); }
1918 #line 370 "yaccParser/hslexer.flex"
1920 PUSH_STATE(UserPragma);
1921 RETURN(SPECIALISE_UPRAGMA);
1926 #line 374 "yaccParser/hslexer.flex"
1928 PUSH_STATE(UserPragma);
1929 RETURN(INLINE_UPRAGMA);
1934 #line 378 "yaccParser/hslexer.flex"
1936 PUSH_STATE(UserPragma);
1937 RETURN(MAGIC_UNFOLDING_UPRAGMA);
1942 #line 382 "yaccParser/hslexer.flex"
1944 PUSH_STATE(UserPragma);
1945 RETURN(DEFOREST_UPRAGMA);
1950 #line 386 "yaccParser/hslexer.flex"
1952 PUSH_STATE(UserPragma);
1953 RETURN(ABSTRACT_UPRAGMA);
1958 #line 390 "yaccParser/hslexer.flex"
1959 { POP_STATE; RETURN(END_UPRAGMA); }
1963 * Haskell keywords. `scc' is actually a Glasgow extension, but it is
1964 * intentionally accepted as a keyword even for normal <Code>.
1969 #line 399 "yaccParser/hslexer.flex"
1974 #line 400 "yaccParser/hslexer.flex"
1979 #line 401 "yaccParser/hslexer.flex"
1984 #line 402 "yaccParser/hslexer.flex"
1985 { RETURN(DEFAULT); }
1989 #line 403 "yaccParser/hslexer.flex"
1990 { RETURN(DERIVING); }
1994 #line 404 "yaccParser/hslexer.flex"
1999 #line 405 "yaccParser/hslexer.flex"
2004 #line 406 "yaccParser/hslexer.flex"
2009 #line 407 "yaccParser/hslexer.flex"
2014 #line 408 "yaccParser/hslexer.flex"
2019 #line 409 "yaccParser/hslexer.flex"
2024 #line 410 "yaccParser/hslexer.flex"
2029 #line 411 "yaccParser/hslexer.flex"
2030 { RETURN(INSTANCE); }
2034 #line 412 "yaccParser/hslexer.flex"
2035 { RETURN(INTERFACE); }
2039 #line 413 "yaccParser/hslexer.flex"
2044 #line 414 "yaccParser/hslexer.flex"
2049 #line 415 "yaccParser/hslexer.flex"
2050 { RETURN(RENAMING); }
2054 #line 416 "yaccParser/hslexer.flex"
2059 #line 417 "yaccParser/hslexer.flex"
2064 #line 418 "yaccParser/hslexer.flex"
2069 #line 419 "yaccParser/hslexer.flex"
2074 #line 420 "yaccParser/hslexer.flex"
2079 #line 421 "yaccParser/hslexer.flex"
2084 #line 422 "yaccParser/hslexer.flex"
2089 #line 423 "yaccParser/hslexer.flex"
2090 { RETURN(CCALL_GC); }
2094 #line 424 "yaccParser/hslexer.flex"
2099 #line 425 "yaccParser/hslexer.flex"
2100 { RETURN(CASM_GC); }
2104 #line 426 "yaccParser/hslexer.flex"
2109 #line 427 "yaccParser/hslexer.flex"
2114 * Haskell operators. Nothing special about these.
2119 #line 435 "yaccParser/hslexer.flex"
2124 #line 436 "yaccParser/hslexer.flex"
2129 #line 437 "yaccParser/hslexer.flex"
2134 #line 438 "yaccParser/hslexer.flex"
2139 #line 439 "yaccParser/hslexer.flex"
2144 #line 440 "yaccParser/hslexer.flex"
2149 #line 441 "yaccParser/hslexer.flex"
2154 #line 442 "yaccParser/hslexer.flex"
2159 #line 443 "yaccParser/hslexer.flex"
2164 #line 444 "yaccParser/hslexer.flex"
2169 #line 445 "yaccParser/hslexer.flex"
2174 #line 446 "yaccParser/hslexer.flex"
2179 #line 447 "yaccParser/hslexer.flex"
2184 #line 448 "yaccParser/hslexer.flex"
2189 #line 449 "yaccParser/hslexer.flex"
2194 #line 450 "yaccParser/hslexer.flex"
2199 #line 451 "yaccParser/hslexer.flex"
2204 #line 452 "yaccParser/hslexer.flex"
2209 #line 453 "yaccParser/hslexer.flex"
2210 { RETURN(TYLAMBDA); }
2214 #line 454 "yaccParser/hslexer.flex"
2215 { RETURN(WILDCARD); }
2219 #line 455 "yaccParser/hslexer.flex"
2224 #line 456 "yaccParser/hslexer.flex"
2229 #line 457 "yaccParser/hslexer.flex"
2234 * Integers and (for Glasgow extensions) primitive integers. Note that
2235 * we pass all of the text on to the parser, because flex/C can't handle
2236 * arbitrary precision numbers.
2241 #line 467 "yaccParser/hslexer.flex"
2243 yylval.uid = xstrndup(yytext, yyleng - 1);
2249 #line 471 "yaccParser/hslexer.flex"
2251 yylval.uid = xstrndup(yytext, yyleng);
2257 #line 475 "yaccParser/hslexer.flex"
2259 yylval.uid = xstrndup(yytext, yyleng - 1);
2265 #line 479 "yaccParser/hslexer.flex"
2267 yylval.uid = xstrndup(yytext, yyleng);
2273 #line 483 "yaccParser/hslexer.flex"
2275 yylval.uid = xstrndup(yytext, yyleng - 1);
2281 #line 487 "yaccParser/hslexer.flex"
2283 yylval.uid = xstrndup(yytext, yyleng);
2289 * Floats and (for Glasgow extensions) primitive floats/doubles.
2294 #line 498 "yaccParser/hslexer.flex"
2296 yylval.uid = xstrndup(yytext, yyleng - 2);
2302 #line 502 "yaccParser/hslexer.flex"
2304 yylval.uid = xstrndup(yytext, yyleng - 1);
2310 #line 506 "yaccParser/hslexer.flex"
2312 yylval.uid = xstrndup(yytext, yyleng);
2318 * Funky ``foo'' style C literals for Glasgow extensions
2323 #line 517 "yaccParser/hslexer.flex"
2325 hsnewid(yytext + 2, yyleng - 4);
2331 * Identifiers, both variables and operators. The trailing hash is allowed
2332 * for Glasgow extensions.
2337 #line 529 "yaccParser/hslexer.flex"
2338 { hsnewid(yytext, yyleng); RETURN(CONID); }
2342 #line 530 "yaccParser/hslexer.flex"
2343 { hsnewid(yytext, yyleng); RETURN(CONID); }
2347 #line 531 "yaccParser/hslexer.flex"
2348 { hsnewid(yytext, yyleng); RETURN(TYVAR_TEMPLATE_ID); }
2352 #line 533 "yaccParser/hslexer.flex"
2354 hsnewid(yytext, yyleng);
2355 RETURN(_isconstr(yytext) ? CONID : VARID);
2359 /* This SHOULDNAE work in "Code" (sigh) */
2363 #line 540 "yaccParser/hslexer.flex"
2365 if (! (nonstandardFlag || in_interface)) {
2366 char errbuf[ERR_BUF_SIZE];
2367 sprintf(errbuf, "Non-standard identifier (leading underscore): %s\n", yytext);
2370 hsnewid(yytext, yyleng);
2371 RETURN(isconstr(yytext) ? CONID : VARID);
2372 /* NB: ^^^^^^^^ : not the macro! */
2377 #line 550 "yaccParser/hslexer.flex"
2379 hsnewid(yytext, yyleng);
2380 RETURN(_isconstr(yytext) ? CONID : VARID);
2385 #line 554 "yaccParser/hslexer.flex"
2387 hsnewid(yytext, yyleng);
2388 RETURN(_isconstr(yytext) ? CONSYM : VARSYM);
2392 /* Why is `{Id}#` matched this way, and `{Id}` lexed as three tokens? --JSM */
2394 /* Because we can make the former well-behaved (we defined them).
2396 Sadly, the latter is defined by Haskell, which allows such
2397 la-la land constructs as `{-a 900-line comment-} foo`. (WDP 94/12)
2402 #line 569 "yaccParser/hslexer.flex"
2404 hsnewid(yytext + 1, yyleng - 2);
2405 RETURN(_isconstr(yytext+1) ? CONSYM : VARSYM);
2410 * Character literals. The first form is the quick form, for character
2411 * literals that don't contain backslashes. Literals with backslashes are
2412 * lexed through multiple rules. First, we match the open ' and as many
2413 * normal characters as possible. This puts us into the <Char> state, where
2414 * a backslash is legal. Then, we match the backslash and move into the
2415 * <CharEsc> state. When we drop out of <CharEsc>, we collect more normal
2416 * characters and the close '. We may end up with too many characters, but
2417 * this allows us to easily share the lex rules with strings. Excess characters
2418 * are ignored with a warning.
2423 #line 588 "yaccParser/hslexer.flex"
2425 yylval.uhstring = installHstring(1, yytext+1);
2431 #line 592 "yaccParser/hslexer.flex"
2433 yylval.uhstring = installHstring(1, yytext+1);
2439 #line 596 "yaccParser/hslexer.flex"
2440 {char errbuf[ERR_BUF_SIZE];
2441 sprintf(errbuf, "'' is not a valid character (or string) literal\n");
2447 #line 600 "yaccParser/hslexer.flex"
2449 hsmlcolno = hspcolno;
2451 addtext(yytext+1, yyleng-1);
2457 #line 606 "yaccParser/hslexer.flex"
2462 addtext(yytext, yyleng - 2);
2463 text = fetchtext(&length);
2465 if (! (nonstandardFlag || in_interface)) {
2466 char errbuf[ERR_BUF_SIZE];
2467 sprintf(errbuf, "`Char-hash' literals are non-standard: %s\n", text);
2472 fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '",
2473 input_filename, hsplineno, hspcolno + 1);
2474 format_string(stderr, (unsigned char *) text, length);
2475 fputs("' too long\n", stderr);
2478 yylval.uhstring = installHstring(1, text);
2479 hspcolno = hsmlcolno;
2486 #line 631 "yaccParser/hslexer.flex"
2491 addtext(yytext, yyleng - 1);
2492 text = fetchtext(&length);
2495 fprintf(stderr, "\"%s\", line %d, column %d: Character literal '",
2496 input_filename, hsplineno, hspcolno + 1);
2497 format_string(stderr, (unsigned char *) text, length);
2498 fputs("' too long\n", stderr);
2501 yylval.uhstring = installHstring(1, text);
2502 hspcolno = hsmlcolno;
2509 #line 650 "yaccParser/hslexer.flex"
2510 { addtext(yytext, yyleng); }
2514 * String literals. The first form is the quick form, for string literals
2515 * that don't contain backslashes. Literals with backslashes are lexed
2516 * through multiple rules. First, we match the open " and as many normal
2517 * characters as possible. This puts us into the <String> state, where
2518 * a backslash is legal. Then, we match the backslash and move into the
2519 * <StringEsc> state. When we drop out of <StringEsc>, we collect more normal
2520 * characters, moving back and forth between <String> and <StringEsc> as more
2521 * backslashes are encountered. (We may even digress into <Comment> mode if we
2522 * find a comment in a gap between backslashes.) Finally, we read the last chunk
2523 * of normal characters and the close ".
2528 #line 668 "yaccParser/hslexer.flex"
2530 yylval.uhstring = installHstring(yyleng-3, yytext+1);
2531 /* the -3 accounts for the " on front, "# on the end */
2537 #line 673 "yaccParser/hslexer.flex"
2539 yylval.uhstring = installHstring(yyleng-2, yytext+1);
2545 #line 677 "yaccParser/hslexer.flex"
2547 hsmlcolno = hspcolno;
2549 addtext(yytext+1, yyleng-1);
2555 #line 683 "yaccParser/hslexer.flex"
2560 addtext(yytext, yyleng-2);
2561 text = fetchtext(&length);
2563 if (! (nonstandardFlag || in_interface)) {
2564 char errbuf[ERR_BUF_SIZE];
2565 sprintf(errbuf, "`String-hash' literals are non-standard: %s\n", text);
2569 yylval.uhstring = installHstring(length, text);
2570 hspcolno = hsmlcolno;
2577 #line 701 "yaccParser/hslexer.flex"
2582 addtext(yytext, yyleng-1);
2583 text = fetchtext(&length);
2585 yylval.uhstring = installHstring(length, text);
2586 hspcolno = hsmlcolno;
2593 #line 713 "yaccParser/hslexer.flex"
2594 { addtext(yytext, yyleng); }
2598 * Character and string escapes are roughly the same, but strings have the
2599 * extra `\&' sequence which is not allowed for characters. Also, comments
2600 * are allowed in the <StringEsc> state. (See the comment section much
2603 * NB: Backslashes and tabs are stored in strings as themselves.
2604 * But if we print them (in printtree.c), they must go out as
2605 * "\\\\" and "\\t" respectively. (This is because of the bogus
2606 * intermediate format that the parser produces. It uses '\t' fpr end of
2607 * string, so it needs to be able to escape tabs, which means that it
2608 * also needs to be able to escape the escape character ('\\'). Sigh.
2613 #line 731 "yaccParser/hslexer.flex"
2614 { PUSH_STATE(CharEsc); }
2618 #line 732 "yaccParser/hslexer.flex"
2623 #line 733 "yaccParser/hslexer.flex"
2624 { PUSH_STATE(StringEsc); noGap = TRUE; }
2628 #line 735 "yaccParser/hslexer.flex"
2629 { addchar(*yytext); POP_STATE; }
2633 #line 736 "yaccParser/hslexer.flex"
2634 { if (noGap) { addchar(*yytext); } POP_STATE; }
2638 #line 738 "yaccParser/hslexer.flex"
2639 { addchar(*yytext); POP_STATE; }
2643 #line 739 "yaccParser/hslexer.flex"
2644 { addchar('\000'); POP_STATE; }
2648 #line 740 "yaccParser/hslexer.flex"
2649 { addchar('\001'); POP_STATE; }
2653 #line 741 "yaccParser/hslexer.flex"
2654 { addchar('\002'); POP_STATE; }
2658 #line 742 "yaccParser/hslexer.flex"
2659 { addchar('\003'); POP_STATE; }
2663 #line 743 "yaccParser/hslexer.flex"
2664 { addchar('\004'); POP_STATE; }
2668 #line 744 "yaccParser/hslexer.flex"
2669 { addchar('\005'); POP_STATE; }
2673 #line 745 "yaccParser/hslexer.flex"
2674 { addchar('\006'); POP_STATE; }
2677 #line 747 "yaccParser/hslexer.flex"
2680 #line 747 "yaccParser/hslexer.flex"
2681 { addchar('\007'); POP_STATE; }
2684 #line 749 "yaccParser/hslexer.flex"
2687 #line 749 "yaccParser/hslexer.flex"
2688 { addchar('\010'); POP_STATE; }
2691 #line 751 "yaccParser/hslexer.flex"
2694 #line 751 "yaccParser/hslexer.flex"
2695 { addchar('\011'); POP_STATE; }
2698 #line 753 "yaccParser/hslexer.flex"
2701 #line 753 "yaccParser/hslexer.flex"
2702 { addchar('\012'); POP_STATE; }
2705 #line 755 "yaccParser/hslexer.flex"
2708 #line 755 "yaccParser/hslexer.flex"
2709 { addchar('\013'); POP_STATE; }
2712 #line 757 "yaccParser/hslexer.flex"
2715 #line 757 "yaccParser/hslexer.flex"
2716 { addchar('\014'); POP_STATE; }
2719 #line 759 "yaccParser/hslexer.flex"
2722 #line 759 "yaccParser/hslexer.flex"
2723 { addchar('\015'); POP_STATE; }
2727 #line 760 "yaccParser/hslexer.flex"
2728 { addchar('\016'); POP_STATE; }
2732 #line 761 "yaccParser/hslexer.flex"
2733 { addchar('\017'); POP_STATE; }
2737 #line 762 "yaccParser/hslexer.flex"
2738 { addchar('\020'); POP_STATE; }
2742 #line 763 "yaccParser/hslexer.flex"
2743 { addchar('\021'); POP_STATE; }
2747 #line 764 "yaccParser/hslexer.flex"
2748 { addchar('\022'); POP_STATE; }
2752 #line 765 "yaccParser/hslexer.flex"
2753 { addchar('\023'); POP_STATE; }
2757 #line 766 "yaccParser/hslexer.flex"
2758 { addchar('\024'); POP_STATE; }
2762 #line 767 "yaccParser/hslexer.flex"
2763 { addchar('\025'); POP_STATE; }
2767 #line 768 "yaccParser/hslexer.flex"
2768 { addchar('\026'); POP_STATE; }
2772 #line 769 "yaccParser/hslexer.flex"
2773 { addchar('\027'); POP_STATE; }
2777 #line 770 "yaccParser/hslexer.flex"
2778 { addchar('\030'); POP_STATE; }
2782 #line 771 "yaccParser/hslexer.flex"
2783 { addchar('\031'); POP_STATE; }
2787 #line 772 "yaccParser/hslexer.flex"
2788 { addchar('\032'); POP_STATE; }
2792 #line 773 "yaccParser/hslexer.flex"
2793 { addchar('\033'); POP_STATE; }
2797 #line 774 "yaccParser/hslexer.flex"
2798 { addchar('\034'); POP_STATE; }
2802 #line 775 "yaccParser/hslexer.flex"
2803 { addchar('\035'); POP_STATE; }
2807 #line 776 "yaccParser/hslexer.flex"
2808 { addchar('\036'); POP_STATE; }
2812 #line 777 "yaccParser/hslexer.flex"
2813 { addchar('\037'); POP_STATE; }
2817 #line 778 "yaccParser/hslexer.flex"
2818 { addchar('\040'); POP_STATE; }
2822 #line 779 "yaccParser/hslexer.flex"
2823 { addchar('\177'); POP_STATE; }
2827 #line 780 "yaccParser/hslexer.flex"
2828 { char c = yytext[1] - '@'; addchar(c); POP_STATE; }
2832 #line 781 "yaccParser/hslexer.flex"
2834 int i = strtol(yytext, NULL, 10);
2838 char errbuf[ERR_BUF_SIZE];
2839 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2848 #line 793 "yaccParser/hslexer.flex"
2850 int i = strtol(yytext + 1, NULL, 8);
2854 char errbuf[ERR_BUF_SIZE];
2855 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2864 #line 805 "yaccParser/hslexer.flex"
2866 int i = strtol(yytext + 1, NULL, 16);
2870 char errbuf[ERR_BUF_SIZE];
2871 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2880 * Simple comments and whitespace. Normally, we would just ignore these, but
2881 * in case we're processing a string escape, we need to note that we've seen
2884 * Note that we cater for a comment line that *doesn't* end in a newline.
2885 * This is incorrect, strictly speaking, but seems like the right thing
2886 * to do. Reported by Rajiv Mirani. (WDP 95/08)
2890 #line 831 "yaccParser/hslexer.flex"
2893 #line 831 "yaccParser/hslexer.flex"
2898 * Nested comments. The major complication here is in trying to match the
2899 * longest lexemes possible, for better performance. (See the flex document.)
2900 * That's why the rules look so bizarre.
2905 #line 841 "yaccParser/hslexer.flex"
2907 noGap = FALSE; nested_comments = 1; PUSH_STATE(Comment);
2911 #line 846 "yaccParser/hslexer.flex"
2913 #line 847 "yaccParser/hslexer.flex"
2916 #line 847 "yaccParser/hslexer.flex"
2921 #line 848 "yaccParser/hslexer.flex"
2922 { nested_comments++; }
2926 #line 849 "yaccParser/hslexer.flex"
2927 { if (--nested_comments == 0) POP_STATE; }
2931 #line 850 "yaccParser/hslexer.flex"
2936 * Illegal characters. This used to be a single rule, but we might as well
2937 * pass on as much information as we have, so now we indicate our state in
2938 * the error message.
2943 #line 860 "yaccParser/hslexer.flex"
2945 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2946 input_filename, hsplineno, hspcolno + 1);
2947 format_string(stderr, (unsigned char *) yytext, 1);
2948 fputs("'\n", stderr);
2954 #line 867 "yaccParser/hslexer.flex"
2956 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2957 input_filename, hsplineno, hspcolno + 1);
2958 format_string(stderr, (unsigned char *) yytext, 1);
2959 fputs("' in a character literal\n", stderr);
2965 #line 874 "yaccParser/hslexer.flex"
2967 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\",
2968 input_filename, hsplineno, hspcolno + 1);
2969 format_string(stderr, (unsigned char *) yytext, 1);
2970 fputs("'\n", stderr);
2976 #line 881 "yaccParser/hslexer.flex"
2977 { if (nonstandardFlag) {
2978 addtext(yytext, yyleng);
2980 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2981 input_filename, hsplineno, hspcolno + 1);
2982 format_string(stderr, (unsigned char *) yytext, 1);
2983 fputs("' in a string literal\n", stderr);
2990 #line 891 "yaccParser/hslexer.flex"
2993 fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\",
2994 input_filename, hsplineno, hspcolno + 1);
2995 format_string(stderr, (unsigned char *) yytext, 1);
2996 fputs("'\n", stderr);
2999 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3000 input_filename, hsplineno, hspcolno + 1);
3001 format_string(stderr, (unsigned char *) yytext, 1);
3002 fputs("' in a string gap\n", stderr);
3009 * End of file. In any sub-state, this is an error. However, for the primary
3010 * <Code> and <GlaExt> states, this is perfectly normal. We just return an EOF
3011 * and let the yylex() wrapper deal with whatever has to be done next (e.g.
3012 * adding virtual close curlies, or closing an interface and returning to the
3013 * primary source file.
3015 * Note that flex does not call YY_USER_ACTION for <<EOF>> rules. Hence the
3016 * line/column advancement has to be done by hand.
3019 case YY_STATE_EOF(Char):
3020 case YY_STATE_EOF(CharEsc):
3021 #line 920 "yaccParser/hslexer.flex"
3023 hsplineno = hslineno; hspcolno = hscolno;
3024 hsperror("unterminated character literal");
3027 case YY_STATE_EOF(Comment):
3028 #line 924 "yaccParser/hslexer.flex"
3030 hsplineno = hslineno; hspcolno = hscolno;
3031 hsperror("unterminated comment");
3034 case YY_STATE_EOF(String):
3035 case YY_STATE_EOF(StringEsc):
3036 #line 928 "yaccParser/hslexer.flex"
3038 hsplineno = hslineno; hspcolno = hscolno;
3039 hsperror("unterminated string literal");
3042 case YY_STATE_EOF(GhcPragma):
3043 #line 932 "yaccParser/hslexer.flex"
3045 hsplineno = hslineno; hspcolno = hscolno;
3046 hsperror("unterminated interface pragma");
3049 case YY_STATE_EOF(UserPragma):
3050 #line 936 "yaccParser/hslexer.flex"
3052 hsplineno = hslineno; hspcolno = hscolno;
3053 hsperror("unterminated user-specified pragma");
3056 case YY_STATE_EOF(Code):
3057 case YY_STATE_EOF(GlaExt):
3058 #line 940 "yaccParser/hslexer.flex"
3059 { hsplineno = hslineno; hspcolno = hscolno; return(EOF); }
3063 #line 942 "yaccParser/hslexer.flex"
3064 YY_FATAL_ERROR( "flex scanner jammed" );
3066 case YY_STATE_EOF(INITIAL):
3069 case YY_END_OF_BUFFER:
3071 /* Amount of text matched not including the EOB char. */
3072 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
3074 /* Undo the effects of YY_DO_BEFORE_ACTION. */
3075 *yy_cp = yy_hold_char;
3077 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
3079 /* We're scanning a new file or input source. It's
3080 * possible that this happened because the user
3081 * just pointed yyin at a new source and called
3082 * yylex(). If so, then we have to assure
3083 * consistency between yy_current_buffer and our
3084 * globals. Here is the right place to do so, because
3085 * this is the first action (other than possibly a
3086 * back-up) that will match for the new input source.
3088 yy_n_chars = yy_current_buffer->yy_n_chars;
3089 yy_current_buffer->yy_input_file = yyin;
3090 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
3093 /* Note that here we test for yy_c_buf_p "<=" to the position
3094 * of the first EOB in the buffer, since yy_c_buf_p will
3095 * already have been incremented past the NUL character
3096 * (since all states make transitions on EOB to the
3097 * end-of-buffer state). Contrast this with the test
3100 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3101 { /* This was really a NUL. */
3102 yy_state_type yy_next_state;
3104 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
3106 yy_current_state = yy_get_previous_state();
3108 /* Okay, we're now positioned to make the NUL
3109 * transition. We couldn't have
3110 * yy_get_previous_state() go ahead and do it
3111 * for us because it doesn't know how to deal
3112 * with the possibility of jamming (and we don't
3113 * want to build jamming into it because then it
3114 * will run more slowly).
3117 yy_next_state = yy_try_NUL_trans( yy_current_state );
3119 yy_bp = yytext_ptr + YY_MORE_ADJ;
3121 if ( yy_next_state )
3123 /* Consume the NUL. */
3124 yy_cp = ++yy_c_buf_p;
3125 yy_current_state = yy_next_state;
3132 goto yy_find_action;
3136 else switch ( yy_get_next_buffer() )
3138 case EOB_ACT_END_OF_FILE:
3140 yy_did_buffer_switch_on_eof = 0;
3144 /* Note: because we've taken care in
3145 * yy_get_next_buffer() to have set up
3146 * yytext, we can now set up
3147 * yy_c_buf_p so that if some total
3148 * hoser (like flex itself) wants to
3149 * call the scanner after we return the
3150 * YY_NULL, it'll still work - another
3151 * YY_NULL will get returned.
3153 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3155 yy_act = YY_STATE_EOF(YY_START);
3161 if ( ! yy_did_buffer_switch_on_eof )
3167 case EOB_ACT_CONTINUE_SCAN:
3169 yytext_ptr + yy_amount_of_matched_text;
3171 yy_current_state = yy_get_previous_state();
3174 yy_bp = yytext_ptr + YY_MORE_ADJ;
3177 case EOB_ACT_LAST_MATCH:
3179 &yy_current_buffer->yy_ch_buf[yy_n_chars];
3181 yy_current_state = yy_get_previous_state();
3184 yy_bp = yytext_ptr + YY_MORE_ADJ;
3185 goto yy_find_action;
3192 "fatal flex scanner internal error--no action found" );
3193 } /* end of action switch */
3194 } /* end of scanning one token */
3195 } /* end of yylex */
3198 /* yy_get_next_buffer - try to read in a new buffer
3200 * Returns a code representing an action:
3201 * EOB_ACT_LAST_MATCH -
3202 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3203 * EOB_ACT_END_OF_FILE - end of file
3206 static int yy_get_next_buffer()
3208 register char *dest = yy_current_buffer->yy_ch_buf;
3209 register char *source = yytext_ptr;
3210 register int number_to_move, i;
3213 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
3215 "fatal flex scanner internal error--end of buffer missed" );
3217 if ( yy_current_buffer->yy_fill_buffer == 0 )
3218 { /* Don't try to fill the buffer, so this is an EOF. */
3219 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
3221 /* We matched a singled characater, the EOB, so
3222 * treat this as a final EOF.
3224 return EOB_ACT_END_OF_FILE;
3229 /* We matched some text prior to the EOB, first
3232 return EOB_ACT_LAST_MATCH;
3236 /* Try to read more data. */
3238 /* First move last chars to start of buffer. */
3239 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
3241 for ( i = 0; i < number_to_move; ++i )
3242 *(dest++) = *(source++);
3244 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3245 /* don't do the read, it's not guaranteed to return an EOF,
3253 yy_current_buffer->yy_buf_size - number_to_move - 1;
3255 while ( num_to_read <= 0 )
3256 { /* Not enough room in the buffer - grow it. */
3257 #ifdef YY_USES_REJECT
3259 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3262 /* just a shorter name for the current buffer */
3263 YY_BUFFER_STATE b = yy_current_buffer;
3265 int yy_c_buf_p_offset =
3266 (int) (yy_c_buf_p - b->yy_ch_buf);
3268 if ( b->yy_is_our_buffer )
3270 int new_size = b->yy_buf_size * 2;
3272 if ( new_size <= 0 )
3273 b->yy_buf_size += b->yy_buf_size / 8;
3275 b->yy_buf_size *= 2;
3277 b->yy_ch_buf = (char *)
3278 /* Include room in for 2 EOB chars. */
3279 yy_flex_realloc( (void *) b->yy_ch_buf,
3280 b->yy_buf_size + 2 );
3283 /* Can't grow it, we don't own it. */
3286 if ( ! b->yy_ch_buf )
3288 "fatal error - scanner input buffer overflow" );
3290 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3292 num_to_read = yy_current_buffer->yy_buf_size -
3297 if ( num_to_read > YY_READ_BUF_SIZE )
3298 num_to_read = YY_READ_BUF_SIZE;
3300 /* Read in more data. */
3301 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
3302 yy_n_chars, num_to_read );
3305 if ( yy_n_chars == 0 )
3307 if ( number_to_move == YY_MORE_ADJ )
3309 ret_val = EOB_ACT_END_OF_FILE;
3315 ret_val = EOB_ACT_LAST_MATCH;
3316 yy_current_buffer->yy_buffer_status =
3317 YY_BUFFER_EOF_PENDING;
3322 ret_val = EOB_ACT_CONTINUE_SCAN;
3324 yy_n_chars += number_to_move;
3325 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
3326 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
3328 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
3334 /* yy_get_previous_state - get the state just before the EOB char was reached */
3336 static yy_state_type yy_get_previous_state()
3338 register yy_state_type yy_current_state;
3339 register char *yy_cp;
3341 yy_current_state = yy_start;
3342 yy_current_state += YY_AT_BOL();
3344 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
3346 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3347 if ( yy_accept[yy_current_state] )
3349 yy_last_accepting_state = yy_current_state;
3350 yy_last_accepting_cpos = yy_cp;
3352 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3354 yy_current_state = (int) yy_def[yy_current_state];
3355 if ( yy_current_state >= 836 )
3356 yy_c = yy_meta[(unsigned int) yy_c];
3358 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3361 return yy_current_state;
3365 /* yy_try_NUL_trans - try to make a transition on the NUL character
3368 * next_state = yy_try_NUL_trans( current_state );
3371 #ifdef YY_USE_PROTOS
3372 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
3374 static yy_state_type yy_try_NUL_trans( yy_current_state )
3375 yy_state_type yy_current_state;
3378 register int yy_is_jam;
3379 register char *yy_cp = yy_c_buf_p;
3381 register YY_CHAR yy_c = 1;
3382 if ( yy_accept[yy_current_state] )
3384 yy_last_accepting_state = yy_current_state;
3385 yy_last_accepting_cpos = yy_cp;
3387 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3389 yy_current_state = (int) yy_def[yy_current_state];
3390 if ( yy_current_state >= 836 )
3391 yy_c = yy_meta[(unsigned int) yy_c];
3393 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3394 yy_is_jam = (yy_current_state == 835);
3396 return yy_is_jam ? 0 : yy_current_state;
3401 #ifdef YY_USE_PROTOS
3402 static void yyunput( int c, register char *yy_bp )
3404 static void yyunput( c, yy_bp )
3406 register char *yy_bp;
3409 register char *yy_cp = yy_c_buf_p;
3411 /* undo effects of setting up yytext */
3412 *yy_cp = yy_hold_char;
3414 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3415 { /* need to shift things up to make room */
3416 /* +2 for EOB chars. */
3417 register int number_to_move = yy_n_chars + 2;
3418 register char *dest = &yy_current_buffer->yy_ch_buf[
3419 yy_current_buffer->yy_buf_size + 2];
3420 register char *source =
3421 &yy_current_buffer->yy_ch_buf[number_to_move];
3423 while ( source > yy_current_buffer->yy_ch_buf )
3424 *--dest = *--source;
3426 yy_cp += (int) (dest - source);
3427 yy_bp += (int) (dest - source);
3428 yy_n_chars = yy_current_buffer->yy_buf_size;
3430 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3431 YY_FATAL_ERROR( "flex scanner push-back overflow" );
3434 *--yy_cp = (char) c;
3438 yy_hold_char = *yy_cp;
3441 #endif /* ifndef YY_NO_UNPUT */
3445 static int yyinput()
3452 *yy_c_buf_p = yy_hold_char;
3454 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
3456 /* yy_c_buf_p now points to the character we want to return.
3457 * If this occurs *before* the EOB characters, then it's a
3458 * valid NUL; if not, then we've hit the end of the buffer.
3460 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3461 /* This was really a NUL. */
3465 { /* need more input */
3466 yytext_ptr = yy_c_buf_p;
3469 switch ( yy_get_next_buffer() )
3471 case EOB_ACT_END_OF_FILE:
3476 yytext_ptr + YY_MORE_ADJ;
3480 if ( ! yy_did_buffer_switch_on_eof )
3489 case EOB_ACT_CONTINUE_SCAN:
3490 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3493 case EOB_ACT_LAST_MATCH:
3496 "unexpected last match in yyinput()" );
3499 "unexpected last match in input()" );
3505 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
3506 *yy_c_buf_p = '\0'; /* preserve yytext */
3507 yy_hold_char = *++yy_c_buf_p;
3509 yy_current_buffer->yy_at_bol = (c == '\n');
3515 #ifdef YY_USE_PROTOS
3516 void yyrestart( FILE *input_file )
3518 void yyrestart( input_file )
3522 if ( ! yy_current_buffer )
3523 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
3525 yy_init_buffer( yy_current_buffer, input_file );
3526 yy_load_buffer_state();
3530 #ifdef YY_USE_PROTOS
3531 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
3533 void yy_switch_to_buffer( new_buffer )
3534 YY_BUFFER_STATE new_buffer;
3537 if ( yy_current_buffer == new_buffer )
3540 if ( yy_current_buffer )
3542 /* Flush out information for old buffer. */
3543 *yy_c_buf_p = yy_hold_char;
3544 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
3545 yy_current_buffer->yy_n_chars = yy_n_chars;
3548 yy_current_buffer = new_buffer;
3549 yy_load_buffer_state();
3551 /* We don't actually know whether we did this switch during
3552 * EOF (yywrap()) processing, but the only time this flag
3553 * is looked at is after yywrap() is called, so it's safe
3554 * to go ahead and always set it.
3556 yy_did_buffer_switch_on_eof = 1;
3560 #ifdef YY_USE_PROTOS
3561 void yy_load_buffer_state( void )
3563 void yy_load_buffer_state()
3566 yy_n_chars = yy_current_buffer->yy_n_chars;
3567 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
3568 yyin = yy_current_buffer->yy_input_file;
3569 yy_hold_char = *yy_c_buf_p;
3573 #ifdef YY_USE_PROTOS
3574 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
3576 YY_BUFFER_STATE yy_create_buffer( file, size )
3583 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3585 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3587 b->yy_buf_size = size;
3589 /* yy_ch_buf has to be 2 characters longer than the size given because
3590 * we need to put in 2 end-of-buffer characters.
3592 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
3593 if ( ! b->yy_ch_buf )
3594 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3596 b->yy_is_our_buffer = 1;
3598 yy_init_buffer( b, file );
3604 #ifdef YY_USE_PROTOS
3605 void yy_delete_buffer( YY_BUFFER_STATE b )
3607 void yy_delete_buffer( b )
3614 if ( b == yy_current_buffer )
3615 yy_current_buffer = (YY_BUFFER_STATE) 0;
3617 if ( b->yy_is_our_buffer )
3618 yy_flex_free( (void *) b->yy_ch_buf );
3620 yy_flex_free( (void *) b );
3624 #ifndef YY_ALWAYS_INTERACTIVE
3625 #ifndef YY_NEVER_INTERACTIVE
3626 extern int isatty YY_PROTO(( int ));
3630 #ifdef YY_USE_PROTOS
3631 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3633 void yy_init_buffer( b, file )
3640 yy_flush_buffer( b );
3642 b->yy_input_file = file;
3643 b->yy_fill_buffer = 1;
3645 #if YY_ALWAYS_INTERACTIVE
3646 b->yy_is_interactive = 1;
3648 #if YY_NEVER_INTERACTIVE
3649 b->yy_is_interactive = 0;
3651 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3657 #ifdef YY_USE_PROTOS
3658 void yy_flush_buffer( YY_BUFFER_STATE b )
3660 void yy_flush_buffer( b )
3667 /* We always need two end-of-buffer characters. The first causes
3668 * a transition to the end-of-buffer state. The second causes
3669 * a jam in that state.
3671 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3672 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3674 b->yy_buf_pos = &b->yy_ch_buf[0];
3677 b->yy_buffer_status = YY_BUFFER_NEW;
3679 if ( b == yy_current_buffer )
3680 yy_load_buffer_state();
3684 #ifndef YY_NO_SCAN_BUFFER
3685 #ifdef YY_USE_PROTOS
3686 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
3688 YY_BUFFER_STATE yy_scan_buffer( base, size )
3696 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3697 base[size-1] != YY_END_OF_BUFFER_CHAR )
3698 /* They forgot to leave room for the EOB's. */
3701 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3703 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3705 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3706 b->yy_buf_pos = b->yy_ch_buf = base;
3707 b->yy_is_our_buffer = 0;
3708 b->yy_input_file = 0;
3709 b->yy_n_chars = b->yy_buf_size;
3710 b->yy_is_interactive = 0;
3712 b->yy_fill_buffer = 0;
3713 b->yy_buffer_status = YY_BUFFER_NEW;
3715 yy_switch_to_buffer( b );
3722 #ifndef YY_NO_SCAN_STRING
3723 #ifdef YY_USE_PROTOS
3724 YY_BUFFER_STATE yy_scan_string( yyconst char *str )
3726 YY_BUFFER_STATE yy_scan_string( str )
3731 for ( len = 0; str[len]; ++len )
3734 return yy_scan_bytes( str, len );
3739 #ifndef YY_NO_SCAN_BYTES
3740 #ifdef YY_USE_PROTOS
3741 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
3743 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
3744 yyconst char *bytes;
3753 /* Get memory for full buffer, including space for trailing EOB's. */
3755 buf = (char *) yy_flex_alloc( n );
3757 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3759 for ( i = 0; i < len; ++i )
3762 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
3764 b = yy_scan_buffer( buf, n );
3766 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3768 /* It's okay to grow etc. this buffer, and we should throw it
3769 * away when we're done.
3771 b->yy_is_our_buffer = 1;
3778 #ifndef YY_NO_PUSH_STATE
3779 #ifdef YY_USE_PROTOS
3780 static void yy_push_state( int new_state )
3782 static void yy_push_state( new_state )
3786 if ( yy_start_stack_ptr >= yy_start_stack_depth )
3790 yy_start_stack_depth += YY_START_STACK_INCR;
3791 new_size = yy_start_stack_depth * sizeof( int );
3793 if ( ! yy_start_stack )
3794 yy_start_stack = (int *) yy_flex_alloc( new_size );
3797 yy_start_stack = (int *) yy_flex_realloc(
3798 (void *) yy_start_stack, new_size );
3800 if ( ! yy_start_stack )
3802 "out of memory expanding start-condition stack" );
3805 yy_start_stack[yy_start_stack_ptr++] = YY_START;
3812 #ifndef YY_NO_POP_STATE
3813 static void yy_pop_state()
3815 if ( --yy_start_stack_ptr < 0 )
3816 YY_FATAL_ERROR( "start-condition stack underflow" );
3818 BEGIN(yy_start_stack[yy_start_stack_ptr]);
3823 #ifndef YY_NO_TOP_STATE
3824 static int yy_top_state()
3826 return yy_start_stack[yy_start_stack_ptr - 1];
3830 #ifndef YY_EXIT_FAILURE
3831 #define YY_EXIT_FAILURE 2
3834 #ifdef YY_USE_PROTOS
3835 static void yy_fatal_error( yyconst char msg[] )
3837 static void yy_fatal_error( msg )
3841 (void) fprintf( stderr, "%s\n", msg );
3842 exit( YY_EXIT_FAILURE );
3847 /* Redefine yyless() so it works in section 3 code. */
3853 /* Undo effects of setting up yytext. */ \
3854 yytext[yyleng] = yy_hold_char; \
3855 yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
3856 yy_hold_char = *yy_c_buf_p; \
3857 *yy_c_buf_p = '\0'; \
3863 /* Internal utility routines. */
3866 #ifdef YY_USE_PROTOS
3867 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3869 static void yy_flex_strncpy( s1, s2, n )
3876 for ( i = 0; i < n; ++i )
3882 #ifdef YY_USE_PROTOS
3883 static void *yy_flex_alloc( yy_size_t size )
3885 static void *yy_flex_alloc( size )
3889 return (void *) malloc( size );
3892 #ifdef YY_USE_PROTOS
3893 static void *yy_flex_realloc( void *ptr, yy_size_t size )
3895 static void *yy_flex_realloc( ptr, size )
3900 /* The cast to (char *) in the following accommodates both
3901 * implementations that use char* generic pointers, and those
3902 * that use void* generic pointers. It works with the latter
3903 * because both ANSI C and C++ allow castless assignment from
3904 * any pointer type to void*, and deal with argument conversions
3905 * as though doing an assignment.
3907 return (void *) realloc( (char *) ptr, size );
3910 #ifdef YY_USE_PROTOS
3911 static void yy_flex_free( void *ptr )
3913 static void yy_flex_free( ptr )
3927 #line 942 "yaccParser/hslexer.flex"
3930 /**********************************************************************
3933 * YACC/LEX Initialisation etc. *
3936 **********************************************************************/
3939 We initialise input_filename to "<stdin>".
3940 This allows unnamed sources to be piped into the parser.
3943 extern BOOLEAN acceptPrim;
3948 input_filename = xstrdup("<stdin>");
3950 /* We must initialize the input buffer _now_, because we call
3951 setyyin _before_ calling yylex for the first time! */
3952 yy_switch_to_buffer(yy_create_buffer(stdin, YY_BUF_SIZE));
3961 new_filename(char *f) /* This looks pretty dodgy to me (WDP) */
3963 if (input_filename != NULL)
3964 free(input_filename);
3965 input_filename = xstrdup(f);
3968 /**********************************************************************
3971 * Layout Processing *
3974 **********************************************************************/
3977 The following section deals with Haskell Layout conventions
3978 forcing insertion of ; or } as appropriate
3982 hsshouldindent(void)
3984 return (!forgetindent && INDENTON);
3988 /* Enter new context and set new indentation level */
3993 fprintf(stderr, "hssetindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
3997 * partain: first chk that new indent won't be less than current one; this code
3998 * doesn't make sense to me; hscolno tells the position of the _end_ of the
3999 * current token; what that has to do with indenting, I don't know.
4003 if (hscolno - 1 <= INDENTPT) {
4005 return; /* Empty input OK for Haskell 1.1 */
4007 char errbuf[ERR_BUF_SIZE];
4009 sprintf(errbuf, "Layout error -- indentation should be > %d cols", INDENTPT);
4013 hsentercontext((hspcolno << 1) | 1);
4017 /* Enter a new context without changing the indentation level */
4022 fprintf(stderr, "hsincindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4024 hsentercontext(indenttab[icontexts] & ~1);
4028 /* Turn off indentation processing, usually because an explicit "{" has been seen */
4032 forgetindent = TRUE;
4036 /* Enter a new layout context. */
4038 hsentercontext(int indent)
4040 /* Enter new context and set indentation as specified */
4041 if (++icontexts >= MAX_CONTEXTS) {
4042 char errbuf[ERR_BUF_SIZE];
4044 sprintf(errbuf, "`wheres' and `cases' nested too deeply (>%d)", MAX_CONTEXTS - 1);
4047 forgetindent = FALSE;
4048 indenttab[icontexts] = indent;
4050 fprintf(stderr, "hsentercontext:indent=%d,hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", indent, hscolno, hspcolno, icontexts, INDENTPT);
4055 /* Exit a layout context */
4061 fprintf(stderr, "hsendindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4066 * Return checks the indentation level and returns ;, } or the specified token.
4076 if (hsshouldindent()) {
4077 if (hspcolno < INDENTPT) {
4079 fprintf(stderr, "inserted '}' before %d (%d:%d:%d:%d)\n", tok, hspcolno, hscolno, yyleng, INDENTPT);
4083 } else if (hspcolno == INDENTPT) {
4085 fprintf(stderr, "inserted ';' before %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4093 fprintf(stderr, "returning %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4100 * Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
4106 static BOOLEAN eof = FALSE;
4109 if (hssttok != -1) {
4117 endlineno = hslineno;
4118 if ((tok = yylex1()) != EOF)
4124 if (icontexts > icontexts_save) {
4127 indenttab[icontexts] = 0;
4130 hsperror("missing '}' at end of file");
4131 } else if (hsbuf_save != NULL) {
4133 yy_delete_buffer(YY_CURRENT_BUFFER);
4134 yy_switch_to_buffer(hsbuf_save);
4136 new_filename(filename_save);
4137 free(filename_save);
4138 hslineno = hslineno_save;
4139 hsplineno = hsplineno_save;
4140 hscolno = hscolno_save;
4141 hspcolno = hspcolno_save;
4143 in_interface = FALSE;
4144 icontexts = icontexts_save - 1;
4147 fprintf(stderr, "finished reading interface (%d:%d:%d)\n", hscolno, hspcolno, INDENTPT);
4154 abort(); /* should never get here! */
4158 /**********************************************************************
4161 * Input Processing for Interfaces *
4164 **********************************************************************/
4166 /* setyyin(file) open file as new lex input buffer */
4172 hsbuf_save = YY_CURRENT_BUFFER;
4173 if ((yyin = fopen(file, "r")) == NULL) {
4174 char errbuf[ERR_BUF_SIZE];
4176 sprintf(errbuf, "can't read \"%-.50s\"", file);
4179 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
4181 hslineno_save = hslineno;
4182 hsplineno_save = hsplineno;
4183 hslineno = hsplineno = 1;
4185 filename_save = input_filename;
4186 input_filename = NULL;
4188 hscolno_save = hscolno;
4189 hspcolno_save = hspcolno;
4190 hscolno = hspcolno = 0;
4191 in_interface = TRUE;
4192 etags_save = etags; /* do not do "etags" stuff in interfaces */
4193 etags = 0; /* We remember whether we are doing it in
4194 the module, so we can restore it later [WDP 94/09] */
4195 hsentercontext(-1); /* partain: changed this from 0 */
4196 icontexts_save = icontexts;
4198 fprintf(stderr, "reading %s (%d:%d:%d)\n", input_filename, hscolno_save, hspcolno_save, INDENTPT);
4203 layout_input(char *text, int len)
4206 fprintf(stderr, "Scanning \"%s\"\n", text);
4209 hsplineno = hslineno;
4221 hscolno += 8 - (hscolno % 8); /* Tabs stops are 8 columns apart */
4233 setstartlineno(void)
4235 startlineno = hsplineno;
4239 fprintf(stderr,"%u\tsetstartlineno (col %u)\n",startlineno,hscolno);
4243 /**********************************************************************
4249 **********************************************************************/
4251 #define CACHE_SIZE YY_BUF_SIZE
4257 } textcache = { 0, 0, NULL };
4262 /* fprintf(stderr, "cleartext\n"); */
4264 if (textcache.allocated == 0) {
4265 textcache.allocated = CACHE_SIZE;
4266 textcache.text = xmalloc(CACHE_SIZE);
4271 addtext(char *text, unsigned length)
4273 /* fprintf(stderr, "addtext: %d %s\n", length, text); */
4278 if (textcache.next + length + 1 >= textcache.allocated) {
4279 textcache.allocated += length + CACHE_SIZE;
4280 textcache.text = xrealloc(textcache.text, textcache.allocated);
4282 bcopy(text, textcache.text + textcache.next, length);
4283 textcache.next += length;
4289 /* fprintf(stderr, "addchar: %c\n", c); */
4291 if (textcache.next + 2 >= textcache.allocated) {
4292 textcache.allocated += CACHE_SIZE;
4293 textcache.text = xrealloc(textcache.text, textcache.allocated);
4295 textcache.text[textcache.next++] = c;
4299 fetchtext(unsigned *length)
4301 /* fprintf(stderr, "fetchtext: %d\n", textcache.next); */
4303 *length = textcache.next;
4304 textcache.text[textcache.next] = '\0';
4305 return textcache.text;
4308 /**********************************************************************
4311 * Identifier Processing *
4314 **********************************************************************/
4317 hsnewid Enters an id of length n into the symbol table.
4321 hsnewid(char *name, int length)
4323 char save = name[length];
4325 name[length] = '\0';
4326 yylval.uid = installid(name);
4327 name[length] = save;
4331 isconstr(char *s) /* walks past leading underscores before using the macro */
4335 for ( ; temp != NULL && *temp == '_' ; temp++ );
4337 return _isconstr(temp);