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.1 1996/01/08 20:15:54 partain Exp $
12 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
25 /* Use prototypes in function declarations. */
28 /* The "const" storage-class-modifier is valid. */
31 #else /* ! __cplusplus */
39 #endif /* ! __cplusplus */
55 #define YY_PROTO(proto) proto
57 #define YY_PROTO(proto) ()
60 /* Returned upon end-of-file. */
63 /* Promotes a possibly negative, possibly signed char to an unsigned
64 * integer for use as an array index. If the signed char is negative,
65 * we want to instead treat it as an 8-bit unsigned char, hence the
68 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
70 /* Enter a start condition. This macro really ought to take a parameter,
71 * but we do it the disgusting crufty way forced on us by the ()-less
72 * definition of BEGIN.
74 #define BEGIN yy_start = 1 + 2 *
76 /* Translate the current start state into a value that can be later handed
77 * to BEGIN to return to the state.
79 #define YY_START ((yy_start - 1) / 2)
81 /* Action number for EOF rule of a given start state. */
82 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
84 /* Special action meaning "start processing a new file". Now included
85 * only for backward compatibility with previous versions of flex.
87 #define YY_NEW_FILE yyrestart( yyin )
89 #define YY_END_OF_BUFFER_CHAR 0
91 /* Size of default input buffer. */
92 #define YY_BUF_SIZE 16384
94 typedef struct yy_buffer_state *YY_BUFFER_STATE;
97 extern FILE *yyin, *yyout;
102 extern int yywrap YY_PROTO(( void ));
107 #define EOB_ACT_CONTINUE_SCAN 0
108 #define EOB_ACT_END_OF_FILE 1
109 #define EOB_ACT_LAST_MATCH 2
111 /* The funky do-while in the following #define is used to turn the definition
112 * int a single C statement (which needs a semi-colon terminator). This
113 * avoids problems with code like:
115 * if ( condition_holds )
118 * do_something_else();
120 * Prior to using the do-while the compiler would get upset at the
121 * "else" because it interpreted the "if" statement as being all
122 * done when it reached the ';' after the yyless() call.
125 /* Return all but the first 'n' matched characters back to the input stream. */
130 /* Undo effects of setting up yytext. */ \
131 *yy_cp = yy_hold_char; \
132 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
133 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
137 #define unput(c) yyunput( c, yytext_ptr )
140 struct yy_buffer_state
144 char *yy_ch_buf; /* input buffer */
145 char *yy_buf_pos; /* current position in input buffer */
147 /* Size of input buffer in bytes, not including room for EOB
152 /* Number of characters read into yy_ch_buf, not including EOB
157 /* Whether this is an "interactive" input source; if so, and
158 * if we're using stdio for input, then we want to use getc()
159 * instead of fread(), to make sure we stop fetching input after
162 int yy_is_interactive;
164 /* Whether to try to fill the input buffer when we reach the
169 int yy_buffer_status;
170 #define YY_BUFFER_NEW 0
171 #define YY_BUFFER_NORMAL 1
172 /* When an EOF's been seen but there's still some text to process
173 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
174 * shouldn't try reading from the input source any more. We might
175 * still have a bunch of tokens to match, though, because of
176 * possible backing-up.
178 * When we actually see the EOF, we change the status to "new"
179 * (via yyrestart()), so that the user can continue scanning by
180 * just pointing yyin at a new input file.
182 #define YY_BUFFER_EOF_PENDING 2
185 static YY_BUFFER_STATE yy_current_buffer = 0;
187 /* We provide macros for accessing buffer states in case in the
188 * future we want to put the buffer states in a more general
191 #define YY_CURRENT_BUFFER yy_current_buffer
194 /* yy_hold_char holds the character lost when yytext is formed. */
195 static char yy_hold_char;
197 static int yy_n_chars; /* number of characters read into yy_ch_buf */
202 /* Points to current character in buffer. */
203 static char *yy_c_buf_p = (char *) 0;
204 static int yy_init = 1; /* whether we need to initialize */
205 static int yy_start = 0; /* start state number */
207 /* Flag which is used to allow yywrap()'s to do buffer switches
208 * instead of setting up a fresh yyin. A bit of a hack ...
210 static int yy_did_buffer_switch_on_eof;
212 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
213 void yyrestart YY_PROTO(( FILE *input_file ));
214 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
215 void yy_load_buffer_state YY_PROTO(( void ));
216 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
217 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
218 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
220 static int yy_start_stack_ptr = 0;
221 static int yy_start_stack_depth = 0;
222 static int *yy_start_stack = 0;
223 static void yy_push_state YY_PROTO(( int new_state ));
224 static void yy_pop_state YY_PROTO(( void ));
225 static int yy_top_state YY_PROTO(( void ));
227 static void *yy_flex_alloc YY_PROTO(( unsigned int ));
228 static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
229 static void yy_flex_free YY_PROTO(( void * ));
231 #define yy_new_buffer yy_create_buffer
243 typedef unsigned char YY_CHAR;
244 typedef int yy_state_type;
245 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
247 #define yytext_ptr yytext
250 static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
254 static int yyinput YY_PROTO(( void ));
256 static int input YY_PROTO(( void ));
259 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
260 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
261 static int yy_get_next_buffer YY_PROTO(( void ));
262 static void yy_fatal_error YY_PROTO(( const char msg[] ));
264 /* Done after the current pattern has been matched and before the
265 * corresponding action - sets up yytext.
267 #define YY_DO_BEFORE_ACTION \
268 yytext_ptr = yy_bp; \
269 yyleng = yy_cp - yy_bp; \
270 yy_hold_char = *yy_cp; \
274 #define YY_END_OF_BUFFER 202
275 static const short int yy_accept[838] =
277 0, 0, 0, 0, 0, 0, 0, 0, 190, 190,
278 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
279 202, 196, 197, 129, 128, 136, 198, 141, 184, 198,
280 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
281 198, 198, 198, 139, 198, 150, 152, 160, 156, 198,
282 162, 154, 158, 198, 188, 121, 132, 126, 91, 92,
283 97, 84, 104, 121, 110, 110, 121, 83, 121, 86,
284 98, 120, 93, 99, 94, 101, 102, 120, 120, 120,
285 120, 120, 120, 120, 120, 120, 120, 120, 95, 85,
286 96, 103, 121, 190, 195, 195, 132, 126, 104, 110,
288 110, 120, 101, 102, 120, 120, 120, 120, 120, 120,
289 120, 120, 120, 120, 120, 188, 126, 121, 110, 196,
290 120, 120, 120, 120, 120, 95, 121, 121, 121, 196,
291 196, 120, 120, 196, 199, 135, 134, 138, 200, 188,
292 141, 200, 184, 200, 200, 200, 200, 200, 200, 200,
293 200, 200, 200, 200, 200, 200, 200, 140, 200, 150,
294 152, 160, 156, 200, 162, 154, 158, 200, 200, 129,
295 128, 127, 184, 0, 0, 151, 0, 161, 0, 0,
296 0, 174, 0, 0, 0, 0, 159, 177, 178, 153,
297 155, 0, 0, 179, 164, 163, 181, 0, 0, 0,
299 180, 157, 183, 185, 186, 188, 121, 132, 131, 126,
300 125, 0, 88, 82, 0, 110, 0, 0, 90, 87,
301 89, 120, 119, 0, 119, 120, 120, 120, 120, 120,
302 120, 60, 120, 74, 120, 120, 68, 120, 120, 71,
303 120, 120, 189, 0, 0, 190, 191, 0, 194, 192,
304 193, 0, 132, 131, 126, 0, 0, 109, 0, 110,
305 0, 0, 118, 120, 119, 0, 0, 120, 120, 120,
306 120, 120, 120, 60, 120, 74, 120, 120, 68, 120,
307 120, 71, 120, 120, 0, 126, 0, 110, 0, 0,
308 0, 119, 119, 119, 119, 119, 119, 119, 119, 119,
310 119, 119, 119, 119, 119, 119, 119, 0, 120, 120,
311 74, 120, 68, 189, 0, 120, 135, 134, 133, 137,
312 148, 149, 173, 166, 167, 168, 169, 182, 165, 147,
313 146, 176, 172, 145, 170, 142, 143, 144, 175, 171,
314 126, 124, 0, 187, 187, 113, 106, 108, 119, 119,
315 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
316 120, 75, 120, 120, 120, 120, 120, 0, 0, 1,
317 1, 0, 130, 124, 0, 0, 113, 106, 108, 119,
318 119, 0, 0, 0, 120, 120, 120, 120, 120, 120,
319 120, 120, 120, 120, 120, 75, 120, 120, 120, 120,
321 120, 0, 0, 0, 18, 19, 0, 119, 119, 119,
322 119, 12, 119, 119, 119, 119, 119, 119, 17, 119,
323 15, 119, 119, 119, 11, 119, 119, 6, 119, 119,
324 119, 119, 14, 119, 119, 119, 13, 119, 119, 117,
325 120, 75, 52, 187, 187, 187, 187, 0, 119, 53,
326 120, 55, 120, 120, 58, 120, 120, 120, 120, 120,
327 120, 120, 70, 72, 120, 0, 0, 0, 0, 0,
328 0, 0, 0, 123, 0, 0, 112, 0, 105, 107,
329 119, 119, 122, 0, 53, 120, 55, 120, 120, 58,
330 120, 120, 120, 120, 120, 120, 120, 70, 72, 120,
332 46, 0, 100, 119, 119, 119, 119, 119, 119, 119,
333 119, 119, 119, 119, 119, 119, 119, 119, 16, 119,
334 7, 119, 119, 119, 119, 119, 119, 119, 119, 119,
335 119, 119, 119, 117, 53, 0, 113, 80, 54, 120,
336 120, 120, 120, 62, 120, 120, 120, 120, 73, 0,
337 0, 0, 0, 0, 0, 0, 0, 111, 0, 113,
338 119, 119, 114, 54, 120, 120, 120, 120, 62, 120,
339 120, 120, 120, 73, 0, 0, 119, 22, 119, 119,
340 20, 119, 119, 119, 119, 119, 119, 119, 119, 119,
341 119, 119, 115, 119, 119, 119, 119, 119, 119, 119,
343 119, 119, 119, 119, 119, 120, 120, 59, 61, 63,
344 64, 120, 120, 67, 120, 0, 0, 0, 0, 0,
345 0, 0, 0, 78, 119, 120, 120, 59, 61, 63,
346 64, 120, 120, 67, 120, 119, 119, 119, 119, 119,
347 119, 35, 119, 36, 119, 119, 119, 119, 34, 119,
348 119, 40, 119, 23, 119, 119, 38, 116, 119, 119,
349 39, 119, 56, 120, 120, 120, 120, 0, 0, 0,
350 0, 0, 0, 0, 0, 2, 2, 119, 76, 56,
351 120, 120, 120, 120, 119, 119, 119, 119, 119, 119,
352 119, 119, 119, 119, 119, 119, 119, 119, 33, 119,
354 21, 119, 119, 57, 65, 120, 69, 0, 0, 0,
355 0, 0, 0, 0, 119, 119, 57, 65, 120, 69,
356 119, 119, 41, 119, 32, 37, 119, 119, 119, 119,
357 25, 119, 119, 119, 119, 119, 119, 119, 81, 66,
358 0, 0, 0, 0, 48, 0, 0, 79, 119, 66,
359 119, 119, 29, 119, 30, 31, 42, 43, 44, 45,
360 119, 119, 119, 28, 0, 0, 0, 0, 0, 0,
361 0, 77, 8, 119, 9, 24, 119, 119, 0, 0,
362 51, 50, 0, 0, 119, 119, 119, 0, 3, 3,
363 0, 0, 119, 119, 10, 0, 0, 47, 119, 119,
365 0, 0, 27, 119, 5, 0, 119, 0, 0, 119,
366 0, 0, 119, 0, 49, 26, 0, 0, 0, 0,
367 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
371 static const int yy_ec[256] =
373 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
374 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 5, 6, 7, 8, 9, 10, 11, 12, 13,
377 14, 10, 15, 16, 17, 18, 19, 20, 21, 22,
378 23, 24, 25, 25, 25, 26, 26, 27, 28, 29,
379 30, 31, 10, 32, 33, 34, 35, 36, 37, 38,
380 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
381 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
382 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
384 69, 70, 71, 72, 73, 74, 74, 75, 76, 77,
385 78, 79, 74, 80, 81, 82, 83, 84, 85, 86,
386 87, 74, 88, 89, 90, 91, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 static const int yy_meta[92] =
405 1, 1, 2, 1, 3, 4, 3, 5, 6, 4,
406 4, 7, 3, 3, 4, 3, 8, 4, 4, 9,
407 9, 9, 9, 9, 9, 9, 4, 3, 4, 4,
408 4, 10, 11, 11, 11, 11, 11, 11, 12, 12,
409 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
410 12, 12, 12, 12, 12, 12, 12, 12, 13, 14,
411 13, 10, 15, 16, 17, 17, 17, 17, 17, 17,
412 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
413 18, 18, 18, 18, 18, 18, 18, 19, 4, 20,
418 static const short int yy_base[881] =
420 0, 0, 0, 4, 58, 138, 224, 2192, 0, 1,
421 315, 2191, 402, 0, 487, 0, 25, 39, 578, 0,
422 2198, 2201, 2201, 2185, 2188, 2201, 2201, 2201, 13, 2160,
423 7, 12, 12, 21, 10, 2143, 2141, 2154, 18, 2140,
424 69, 2139, 2137, 2201, 0, 2201, 2201, 2201, 2201, 0,
425 2201, 2201, 2201, 0, 50, 0, 2181, 2175, 2201, 2201,
426 0, 2201, 46, 2168, 131, 415, 2158, 2201, 2167, 2152,
427 0, 0, 2201, 0, 2201, 6, 2201, 11, 36, 2107,
428 2108, 30, 2111, 2101, 2108, 2108, 47, 2104, 2158, 0,
429 2201, 0, 52, 0, 13, 2, 2167, 2161, 425, 662,
431 506, 2164, 66, 2107, 66, 452, 105, 2, 129, 124,
432 107, 131, 138, 663, 42, 407, 0, 148, 515, 745,
433 5, 158, 421, 449, 455, 2153, 0, 2152, 2137, 2104,
434 2102, 122, 135, 2148, 2201, 2157, 2155, 2151, 2201, 192,
435 2201, 2144, 652, 2125, 132, 169, 417, 497, 370, 2108,
436 2106, 2119, 137, 2105, 648, 2104, 2102, 2201, 0, 2201,
437 2201, 2201, 2201, 686, 2201, 2201, 2201, 0, 2136, 2140,
438 2143, 2201, 692, 2107, 2105, 2201, 2102, 2201, 669, 2103,
439 2109, 2201, 2096, 2092, 2108, 410, 2201, 2201, 2201, 2201,
440 2201, 2099, 2097, 2201, 2201, 2100, 2201, 2083, 2104, 2091,
442 2201, 2201, 2201, 699, 0, 723, 0, 2129, 2201, 2123,
443 2201, 207, 0, 0, 734, 745, 709, 0, 0, 2201,
444 0, 0, 0, 2071, 2066, 2051, 2066, 2048, 373, 2048,
445 2060, 0, 2048, 464, 2044, 2057, 0, 2047, 2054, 0,
446 2043, 2052, 2112, 210, 2046, 0, 0, 2101, 2201, 0,
447 2201, 2029, 2109, 2107, 2102, 796, 815, 2201, 822, 841,
448 722, 0, 2201, 2105, 114, 2104, 0, 140, 488, 410,
449 729, 483, 454, 2103, 424, 691, 489, 493, 2102, 728,
450 451, 2101, 673, 741, 2091, 2095, 830, 863, 2043, 2042,
451 2044, 846, 519, 838, 2040, 2064, 2038, 2063, 738, 766,
453 2049, 2048, 856, 517, 711, 2047, 2018, 0, 549, 730,
454 689, 695, 776, 2201, 2005, 492, 2087, 2085, 2201, 2201,
455 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
456 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
457 2080, 2201, 791, 893, 898, 890, 900, 0, 0, 2024,
458 2021, 2008, 2023, 2022, 2013, 2016, 2011, 2005, 2009, 1999,
459 2011, 0, 1996, 2013, 2000, 2007, 1995, 903, 799, 2201,
460 821, 1997, 2201, 2065, 908, 0, 941, 948, 2064, 1990,
461 2005, 2005, 2060, 2055, 824, 779, 861, 869, 862, 849,
462 864, 860, 870, 865, 932, 2058, 909, 933, 934, 937,
464 938, 1975, 2056, 999, 2201, 2201, 2000, 2011, 935, 2013,
465 2008, 0, 2021, 2012, 2019, 2003, 2020, 2006, 0, 1990,
466 0, 2000, 1999, 1987, 0, 913, 925, 0, 2008, 790,
467 1997, 2010, 0, 1998, 2012, 2007, 0, 2000, 1962, 0,
468 943, 972, 2201, 980, 991, 1000, 1011, 1017, 1978, 0,
469 1959, 0, 1956, 1954, 0, 1960, 1956, 1949, 1969, 1953,
470 1957, 1955, 0, 0, 1961, 1024, 1043, 1995, 1991, 1981,
471 1993, 1977, 1955, 2201, 1075, 2015, 2014, 1086, 2201, 2201,
472 1945, 1945, 2201, 2007, 2010, 950, 2009, 947, 774, 2008,
473 978, 969, 981, 952, 979, 983, 1001, 2007, 2006, 992,
475 2201, 1098, 2201, 1961, 1949, 1948, 1977, 1946, 1961, 1944,
476 1955, 783, 1959, 1952, 1967, 1969, 1951, 1960, 0, 1936,
477 0, 1961, 1961, 1957, 1951, 1949, 1956, 1957, 1928, 1942,
478 1939, 1938, 1922, 0, 1042, 1105, 1112, 0, 0, 1911,
479 1912, 1913, 1901, 991, 1905, 1911, 1911, 1906, 0, 1938,
480 1936, 1925, 1937, 1930, 1934, 1935, 1966, 2201, 1119, 1138,
481 1907, 1894, 2201, 1960, 989, 1000, 991, 1066, 1072, 1025,
482 498, 1036, 1044, 1959, 1145, 1164, 1916, 0, 1929, 1907,
483 0, 1900, 1927, 1909, 1897, 1909, 1895, 1894, 1893, 1905,
484 1917, 1890, 0, 1904, 1914, 1887, 1896, 1885, 1903, 1015,
486 1153, 1898, 1882, 1881, 1868, 1860, 1864, 0, 0, 0,
487 0, 1873, 1874, 0, 1861, 1902, 1890, 1883, 1887, 1892,
488 1891, 1896, 1050, 1891, 1866, 1073, 1027, 1920, 1919, 1918,
489 1917, 1082, 1085, 1916, 1077, 1890, 1881, 1870, 1885, 1884,
490 1873, 0, 1880, 0, 1881, 1880, 1875, 1878, 0, 1849,
491 1873, 0, 1874, 0, 1846, 1875, 0, 1171, 1844, 1871,
492 0, 1830, 0, 1833, 1834, 1835, 1830, 1837, 1862, 1848,
493 1847, 1850, 1860, 1853, 1088, 2201, 1153, 1858, 1853, 1883,
494 1143, 1172, 1145, 1173, 1855, 1854, 1807, 1811, 1781, 1780,
495 1789, 1803, 1795, 1765, 1751, 1157, 1769, 1773, 0, 1764,
497 0, 1756, 1719, 0, 0, 1711, 0, 1731, 1771, 1741,
498 1735, 1727, 1679, 1691, 1652, 1669, 1666, 1664, 1174, 1663,
499 1616, 1614, 0, 1599, 0, 0, 1608, 1596, 1593, 1591,
500 0, 1563, 1545, 1531, 1540, 1528, 1547, 1523, 0, 0,
501 1526, 1552, 1526, 1509, 2201, 1506, 1510, 0, 1489, 1543,
502 1485, 1495, 0, 1481, 0, 0, 0, 0, 0, 0,
503 1473, 1482, 1435, 0, 1433, 1438, 1166, 1393, 1391, 1396,
504 1396, 0, 0, 1372, 0, 0, 1393, 1394, 1390, 1196,
505 2201, 2201, 1383, 1012, 1368, 1355, 1326, 1343, 2201, 1369,
506 1338, 1347, 1333, 1203, 0, 1221, 1209, 2201, 1189, 1200,
508 1245, 1213, 0, 1185, 1206, 1205, 1210, 1196, 1192, 1202,
509 1184, 1196, 1143, 1164, 2201, 0, 1066, 1076, 1056, 1051,
510 1035, 948, 896, 797, 756, 728, 661, 647, 633, 450,
511 1195, 1204, 408, 396, 96, 2201, 2201, 1256, 1276, 1296,
512 1316, 1336, 1354, 1365, 1193, 1377, 1389, 1407, 1421, 1429,
513 1447, 1467, 1487, 1504, 1522, 1538, 1546, 1562, 1578, 1594,
514 1612, 1632, 1194, 1646, 1658, 1676, 1696, 1716, 1734, 1750,
515 1222, 1766, 1784, 1205, 1800, 1816, 1223, 1830, 1848, 1868
518 static const short int yy_def[881] =
520 838, 838, 839, 839, 840, 840, 837, 7, 841, 841,
521 837, 11, 11, 13, 11, 15, 842, 842, 837, 19,
522 837, 837, 837, 843, 837, 837, 837, 837, 837, 837,
523 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
524 837, 837, 837, 837, 844, 837, 837, 837, 837, 837,
525 837, 837, 837, 845, 837, 846, 847, 848, 837, 837,
526 846, 837, 846, 846, 837, 837, 846, 837, 846, 846,
527 846, 849, 837, 846, 837, 850, 837, 849, 849, 849,
528 849, 849, 849, 849, 849, 849, 849, 849, 837, 846,
529 837, 846, 846, 851, 852, 853, 854, 855, 846, 837,
531 837, 856, 850, 857, 856, 856, 856, 856, 856, 856,
532 856, 856, 856, 856, 856, 837, 858, 99, 837, 850,
533 859, 859, 859, 859, 859, 837, 846, 846, 846, 850,
534 857, 856, 856, 837, 837, 860, 837, 837, 837, 837,
535 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
536 837, 837, 837, 837, 837, 837, 837, 837, 844, 837,
537 837, 837, 837, 837, 837, 837, 837, 845, 837, 843,
538 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
539 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
540 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
542 837, 837, 837, 837, 845, 837, 846, 847, 837, 861,
543 837, 862, 846, 846, 837, 837, 837, 863, 846, 837,
544 846, 864, 865, 850, 865, 864, 864, 864, 864, 864,
545 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
546 864, 864, 837, 866, 837, 867, 868, 868, 837, 869,
547 837, 869, 870, 837, 861, 837, 837, 837, 837, 837,
548 837, 871, 837, 856, 865, 872, 873, 856, 856, 856,
549 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
550 856, 856, 856, 856, 837, 861, 837, 837, 837, 837,
551 837, 865, 865, 865, 865, 865, 865, 865, 865, 865,
553 865, 865, 865, 865, 865, 865, 865, 874, 875, 875,
554 875, 875, 875, 837, 837, 856, 876, 837, 837, 837,
555 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
556 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
557 861, 837, 862, 837, 862, 837, 837, 863, 865, 865,
558 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
559 864, 864, 864, 864, 864, 864, 864, 837, 866, 837,
560 866, 837, 837, 837, 837, 877, 837, 837, 871, 865,
561 865, 837, 872, 873, 856, 856, 856, 856, 856, 856,
562 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
564 856, 837, 837, 837, 837, 837, 837, 865, 865, 865,
565 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
566 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
567 865, 865, 865, 865, 865, 865, 865, 865, 865, 878,
568 875, 875, 837, 837, 862, 837, 862, 837, 865, 864,
569 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
570 864, 864, 864, 864, 864, 837, 837, 837, 837, 837,
571 837, 837, 837, 837, 837, 877, 837, 837, 837, 837,
572 865, 865, 837, 837, 856, 856, 856, 856, 856, 856,
573 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
575 837, 837, 837, 865, 865, 865, 865, 865, 865, 865,
576 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
577 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
578 865, 865, 865, 878, 875, 837, 837, 865, 864, 864,
579 864, 864, 864, 864, 864, 864, 864, 864, 864, 837,
580 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
581 865, 865, 837, 856, 856, 856, 856, 856, 856, 856,
582 856, 856, 856, 856, 837, 837, 865, 865, 865, 865,
583 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
584 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
586 865, 865, 865, 865, 865, 864, 864, 864, 864, 864,
587 864, 864, 864, 864, 864, 837, 837, 837, 837, 837,
588 837, 837, 879, 865, 865, 856, 856, 856, 856, 856,
589 856, 856, 856, 856, 856, 865, 865, 865, 865, 865,
590 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
591 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
592 865, 865, 864, 864, 864, 864, 864, 837, 837, 837,
593 837, 837, 837, 837, 879, 837, 879, 865, 865, 856,
594 856, 856, 856, 856, 865, 865, 865, 865, 865, 865,
595 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
597 865, 865, 865, 864, 864, 864, 864, 837, 837, 837,
598 837, 837, 837, 837, 865, 865, 856, 856, 856, 856,
599 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
600 865, 865, 865, 865, 865, 865, 865, 865, 865, 864,
601 837, 880, 837, 837, 837, 837, 837, 865, 865, 856,
602 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
603 865, 865, 865, 865, 837, 880, 880, 837, 837, 837,
604 837, 865, 865, 865, 865, 865, 865, 865, 837, 880,
605 837, 837, 837, 837, 865, 865, 865, 837, 837, 880,
606 837, 837, 865, 865, 865, 837, 837, 837, 865, 865,
608 837, 837, 865, 865, 837, 837, 865, 837, 837, 865,
609 837, 837, 865, 837, 837, 865, 837, 837, 837, 837,
610 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
611 837, 837, 837, 837, 837, 837, 0, 837, 837, 837,
612 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
613 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
614 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
615 837, 837, 837, 837, 837, 837, 837, 837, 837, 837
618 static const short int yy_nxt[2293] =
620 23, 23, 23, 23, 23, 23, 23, 23, 837, 263,
621 837, 25, 263, 308, 837, 25, 95, 95, 251, 204,
622 204, 204, 204, 204, 204, 135, 135, 135, 135, 248,
623 837, 137, 173, 173, 173, 173, 173, 173, 173, 135,
624 135, 135, 135, 175, 177, 137, 179, 187, 180, 263,
625 192, 206, 206, 206, 206, 181, 244, 176, 837, 26,
626 188, 178, 212, 26, 28, 182, 183, 184, 224, 28,
627 193, 185, 186, 263, 273, 226, 213, 29, 29, 29,
628 29, 29, 29, 29, 138, 227, 225, 96, 96, 252,
629 30, 31, 32, 33, 34, 35, 36, 37, 138, 232,
631 228, 38, 249, 39, 229, 233, 234, 40, 41, 195,
632 42, 43, 263, 284, 263, 196, 197, 44, 239, 45,
633 198, 199, 46, 47, 240, 200, 245, 48, 224, 263,
634 268, 263, 265, 241, 49, 50, 263, 51, 263, 52,
635 269, 53, 263, 54, 28, 263, 225, 263, 215, 28,
636 216, 216, 216, 216, 216, 216, 216, 29, 29, 29,
637 29, 29, 29, 29, 837, 263, 308, 257, 175, 192,
638 30, 31, 32, 33, 34, 35, 36, 37, 380, 272,
639 381, 38, 176, 39, 278, 836, 270, 40, 41, 193,
640 42, 43, 277, 206, 206, 206, 206, 44, 274, 45,
642 279, 177, 46, 47, 275, 276, 280, 48, 217, 344,
643 345, 316, 370, 371, 49, 50, 218, 51, 178, 52,
644 385, 53, 310, 54, 22, 55, 55, 55, 55, 56,
645 57, 56, 56, 56, 56, 58, 59, 60, 61, 62,
646 63, 64, 56, 65, 66, 66, 66, 66, 66, 66,
647 67, 68, 69, 70, 56, 71, 72, 72, 72, 72,
648 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
649 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
650 72, 72, 73, 74, 75, 56, 76, 77, 72, 72,
651 78, 79, 80, 72, 72, 81, 82, 72, 83, 84,
653 72, 85, 72, 86, 72, 87, 72, 72, 88, 72,
654 72, 89, 90, 91, 92, 22, 55, 55, 55, 55,
655 56, 97, 56, 56, 56, 56, 98, 59, 60, 61,
656 62, 99, 64, 56, 100, 101, 101, 101, 101, 101,
657 101, 67, 68, 69, 70, 56, 71, 102, 102, 102,
658 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
659 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
660 102, 102, 102, 73, 74, 75, 56, 103, 104, 102,
661 102, 105, 106, 107, 102, 102, 108, 109, 102, 110,
662 111, 102, 112, 102, 113, 102, 114, 102, 102, 115,
664 102, 102, 89, 90, 91, 92, 116, 187, 206, 206,
665 206, 206, 835, 117, 285, 834, 56, 263, 118, 56,
666 188, 119, 119, 119, 119, 119, 119, 119, 263, 308,
667 56, 263, 215, 56, 216, 216, 216, 216, 216, 216,
668 216, 212, 354, 333, 256, 257, 257, 257, 257, 257,
669 257, 179, 355, 180, 831, 213, 263, 308, 263, 263,
670 181, 263, 263, 308, 120, 334, 121, 121, 122, 121,
671 121, 121, 121, 121, 123, 121, 124, 121, 121, 125,
672 121, 121, 121, 121, 121, 121, 121, 121, 121, 126,
673 263, 387, 127, 22, 128, 263, 263, 311, 22, 263,
675 263, 56, 392, 129, 56, 263, 22, 22, 22, 22,
676 22, 22, 22, 258, 22, 56, 270, 312, 56, 399,
677 271, 391, 258, 259, 313, 260, 260, 260, 260, 260,
678 260, 260, 287, 359, 288, 288, 288, 288, 288, 288,
679 288, 182, 183, 184, 360, 361, 56, 185, 186, 130,
680 131, 413, 386, 102, 132, 102, 263, 308, 102, 133,
681 397, 102, 102, 390, 102, 414, 102, 633, 102, 434,
682 396, 102, 394, 435, 134, 56, 22, 127, 139, 140,
683 140, 140, 140, 139, 141, 139, 139, 139, 139, 141,
684 139, 139, 139, 139, 142, 139, 139, 143, 143, 143,
686 143, 143, 143, 143, 139, 139, 139, 139, 139, 139,
687 144, 145, 146, 147, 148, 149, 150, 151, 139, 139,
688 139, 152, 139, 153, 139, 139, 139, 154, 155, 139,
689 156, 157, 139, 139, 139, 139, 139, 158, 139, 159,
690 139, 139, 160, 161, 139, 139, 139, 162, 139, 139,
691 139, 139, 139, 139, 163, 164, 139, 165, 139, 166,
692 139, 167, 139, 168, 139, 169, 139, 139, 139, 258,
693 263, 173, 173, 173, 173, 173, 173, 173, 830, 259,
694 263, 260, 260, 260, 260, 260, 260, 260, 195, 324,
695 325, 326, 327, 829, 196, 197, 263, 308, 263, 198,
697 199, 828, 263, 308, 200, 204, 204, 204, 204, 204,
698 204, 173, 173, 173, 173, 173, 173, 173, 204, 204,
699 204, 204, 204, 204, 206, 206, 206, 206, 347, 347,
700 347, 347, 347, 347, 281, 263, 263, 263, 308, 261,
701 282, 378, 378, 378, 378, 378, 378, 262, 263, 283,
702 289, 400, 290, 346, 346, 346, 346, 346, 346, 346,
703 393, 436, 215, 291, 216, 216, 216, 216, 216, 216,
704 216, 394, 395, 437, 423, 424, 442, 292, 827, 293,
705 294, 263, 295, 263, 308, 296, 263, 297, 298, 299,
706 300, 301, 302, 344, 345, 303, 304, 305, 388, 306,
708 425, 370, 371, 258, 398, 826, 426, 224, 389, 401,
709 441, 265, 427, 287, 307, 257, 257, 257, 257, 257,
710 257, 257, 258, 370, 371, 225, 525, 585, 428, 586,
711 526, 263, 287, 825, 257, 257, 257, 257, 257, 257,
712 257, 377, 377, 377, 377, 377, 377, 377, 258, 404,
713 404, 404, 404, 404, 404, 404, 263, 566, 259, 486,
714 260, 260, 260, 260, 260, 260, 260, 263, 263, 263,
715 258, 263, 263, 375, 415, 416, 263, 263, 417, 408,
716 287, 376, 288, 288, 288, 288, 288, 288, 288, 409,
717 418, 431, 485, 410, 444, 444, 444, 444, 411, 445,
719 446, 447, 445, 432, 466, 466, 466, 467, 412, 346,
720 346, 346, 346, 346, 346, 346, 263, 490, 433, 347,
721 347, 347, 347, 347, 347, 487, 448, 475, 475, 475,
722 475, 475, 475, 488, 489, 468, 491, 492, 469, 263,
723 263, 263, 493, 470, 263, 263, 494, 471, 477, 824,
724 263, 308, 823, 472, 263, 479, 520, 263, 448, 263,
725 377, 377, 377, 377, 377, 377, 377, 378, 378, 378,
726 378, 378, 378, 505, 522, 521, 263, 478, 506, 263,
727 308, 444, 444, 444, 444, 263, 263, 523, 263, 507,
728 263, 496, 445, 446, 447, 445, 263, 497, 263, 263,
730 495, 444, 444, 444, 444, 499, 477, 263, 263, 478,
731 498, 535, 445, 446, 447, 445, 570, 500, 404, 404,
732 404, 404, 404, 404, 404, 466, 466, 466, 466, 565,
733 564, 536, 263, 536, 263, 502, 537, 537, 537, 537,
734 537, 537, 537, 263, 466, 466, 466, 466, 568, 263,
735 308, 263, 676, 677, 567, 656, 468, 572, 571, 469,
736 574, 628, 792, 626, 470, 610, 569, 502, 471, 792,
737 611, 822, 627, 263, 472, 468, 573, 657, 469, 263,
738 263, 550, 479, 470, 263, 821, 551, 471, 820, 263,
739 676, 677, 263, 472, 475, 475, 475, 475, 475, 475,
741 559, 632, 559, 681, 634, 560, 560, 560, 560, 560,
742 560, 560, 575, 819, 575, 818, 635, 576, 576, 576,
743 576, 576, 576, 576, 537, 537, 537, 537, 537, 537,
744 537, 537, 537, 537, 537, 537, 537, 537, 560, 560,
745 560, 560, 560, 560, 560, 477, 630, 629, 682, 683,
746 263, 631, 263, 684, 680, 676, 677, 560, 560, 560,
747 560, 560, 560, 560, 576, 576, 576, 576, 576, 576,
748 576, 477, 658, 658, 658, 658, 658, 658, 658, 263,
749 263, 263, 767, 576, 576, 576, 576, 576, 576, 576,
750 658, 658, 658, 658, 658, 658, 658, 732, 789, 790,
752 817, 205, 348, 205, 348, 816, 733, 734, 833, 205,
753 348, 719, 767, 717, 832, 832, 832, 832, 832, 832,
754 832, 440, 440, 832, 832, 832, 832, 832, 832, 832,
755 379, 476, 379, 476, 815, 814, 813, 812, 379, 476,
756 718, 811, 750, 720, 810, 809, 808, 807, 806, 805,
757 804, 803, 802, 801, 800, 780, 22, 22, 22, 22,
758 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
759 22, 22, 22, 22, 22, 22, 24, 24, 24, 24,
760 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
761 24, 24, 24, 24, 24, 24, 27, 27, 27, 27,
763 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
764 27, 27, 27, 27, 27, 27, 94, 94, 94, 94,
765 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
766 94, 94, 94, 94, 94, 94, 136, 136, 136, 136,
767 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
768 136, 136, 136, 136, 136, 136, 170, 170, 170, 170,
769 170, 170, 170, 170, 170, 170, 170, 799, 170, 170,
770 170, 170, 170, 170, 203, 203, 203, 203, 203, 203,
771 207, 207, 207, 798, 797, 767, 207, 796, 795, 794,
772 207, 208, 208, 208, 208, 208, 208, 208, 208, 208,
774 208, 208, 793, 208, 208, 208, 208, 208, 208, 210,
775 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
776 791, 210, 210, 210, 210, 210, 210, 222, 788, 222,
777 787, 222, 222, 786, 785, 222, 784, 222, 222, 223,
778 223, 783, 782, 223, 781, 223, 223, 246, 246, 246,
779 246, 246, 246, 246, 767, 246, 246, 246, 246, 246,
780 246, 246, 246, 246, 246, 779, 246, 247, 247, 247,
781 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
782 247, 247, 247, 247, 247, 778, 247, 250, 250, 250,
783 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
785 250, 250, 250, 250, 250, 250, 253, 253, 253, 253,
786 253, 253, 253, 253, 253, 253, 253, 777, 253, 253,
787 253, 253, 253, 253, 255, 255, 255, 255, 255, 255,
788 255, 255, 255, 255, 255, 776, 255, 255, 255, 255,
789 255, 255, 264, 775, 264, 774, 264, 773, 264, 264,
790 263, 772, 264, 771, 264, 264, 266, 266, 770, 769,
791 768, 266, 266, 266, 286, 286, 286, 286, 767, 286,
792 286, 286, 286, 286, 286, 765, 286, 286, 286, 286,
793 286, 286, 309, 309, 309, 764, 309, 763, 309, 309,
794 762, 761, 309, 760, 309, 309, 317, 317, 317, 317,
796 317, 317, 317, 317, 317, 317, 317, 759, 317, 317,
797 317, 317, 317, 317, 341, 341, 341, 341, 341, 341,
798 341, 341, 341, 341, 341, 758, 341, 341, 341, 341,
799 341, 341, 343, 343, 343, 343, 343, 343, 343, 343,
800 343, 343, 343, 343, 343, 343, 343, 343, 343, 343,
801 343, 343, 222, 757, 222, 756, 222, 222, 755, 754,
802 222, 753, 222, 222, 349, 752, 349, 751, 349, 349,
803 263, 263, 349, 263, 349, 349, 369, 369, 369, 369,
804 369, 369, 369, 369, 369, 369, 369, 369, 369, 369,
805 369, 369, 369, 369, 369, 369, 246, 246, 246, 246,
807 246, 246, 246, 749, 246, 246, 246, 246, 246, 246,
808 246, 246, 246, 246, 748, 246, 247, 247, 247, 247,
809 247, 247, 247, 747, 247, 247, 247, 247, 247, 247,
810 247, 247, 247, 247, 250, 250, 250, 250, 250, 250,
811 250, 746, 250, 250, 250, 250, 250, 250, 250, 250,
812 250, 250, 253, 253, 253, 253, 253, 253, 253, 253,
813 253, 253, 253, 745, 253, 253, 253, 253, 253, 253,
814 383, 744, 383, 743, 383, 742, 383, 383, 741, 740,
815 383, 739, 383, 383, 384, 384, 384, 384, 384, 384,
816 738, 384, 384, 384, 384, 384, 384, 384, 384, 384,
818 384, 384, 384, 384, 309, 309, 309, 737, 309, 736,
819 309, 309, 735, 731, 309, 730, 309, 309, 317, 317,
820 317, 317, 317, 317, 317, 317, 317, 317, 317, 729,
821 317, 317, 317, 317, 317, 317, 534, 728, 534, 727,
822 534, 534, 726, 725, 534, 724, 534, 534, 675, 675,
823 675, 675, 675, 675, 675, 675, 675, 675, 675, 675,
824 675, 675, 675, 675, 675, 675, 675, 675, 766, 723,
825 766, 766, 766, 766, 766, 766, 766, 766, 766, 766,
826 766, 766, 766, 766, 766, 766, 766, 766, 722, 721,
827 263, 716, 715, 714, 713, 712, 711, 710, 709, 708,
829 707, 706, 705, 704, 703, 702, 701, 700, 699, 698,
830 697, 696, 695, 694, 693, 692, 691, 690, 689, 688,
831 687, 686, 685, 263, 263, 263, 263, 263, 679, 678,
832 674, 673, 672, 671, 670, 669, 668, 667, 666, 665,
833 664, 663, 662, 661, 660, 659, 655, 654, 653, 652,
834 651, 650, 649, 648, 647, 646, 645, 644, 643, 642,
835 641, 640, 639, 638, 637, 636, 263, 263, 625, 624,
836 623, 622, 621, 620, 619, 618, 617, 616, 615, 614,
837 613, 612, 609, 608, 607, 606, 605, 604, 603, 602,
838 601, 600, 599, 598, 597, 596, 595, 594, 593, 592,
840 591, 590, 589, 588, 587, 584, 583, 582, 581, 580,
841 579, 578, 577, 263, 263, 263, 263, 263, 563, 562,
842 561, 558, 480, 557, 556, 555, 554, 553, 552, 549,
843 548, 547, 546, 545, 544, 543, 542, 541, 540, 539,
844 538, 533, 532, 531, 530, 529, 528, 527, 524, 519,
845 518, 517, 516, 515, 514, 513, 512, 511, 510, 509,
846 508, 504, 503, 474, 501, 263, 484, 382, 483, 482,
847 481, 480, 474, 473, 465, 464, 463, 462, 461, 460,
848 459, 458, 457, 456, 455, 454, 453, 452, 451, 450,
849 449, 837, 319, 318, 443, 439, 438, 430, 429, 422,
851 421, 420, 419, 407, 406, 405, 403, 402, 263, 263,
852 263, 382, 263, 374, 373, 254, 252, 248, 372, 368,
853 367, 366, 365, 364, 363, 362, 358, 357, 356, 353,
854 352, 351, 350, 224, 342, 209, 340, 339, 338, 337,
855 336, 335, 332, 331, 330, 329, 328, 323, 322, 321,
856 172, 171, 314, 202, 201, 194, 191, 190, 189, 174,
857 212, 320, 319, 318, 314, 837, 224, 213, 315, 314,
858 267, 263, 211, 254, 243, 242, 238, 237, 236, 235,
859 231, 230, 221, 220, 219, 214, 211, 209, 202, 201,
860 194, 191, 190, 189, 174, 172, 171, 837, 93, 93,
862 21, 837, 837, 837, 837, 837, 837, 837, 837, 837,
863 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
864 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
865 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
866 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
867 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
868 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
869 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
870 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
875 static const short int yy_chk[2293] =
877 3, 3, 3, 3, 4, 4, 4, 4, 0, 108,
878 0, 3, 121, 121, 0, 4, 9, 10, 96, 50,
879 50, 50, 50, 50, 50, 17, 17, 17, 17, 95,
880 0, 17, 29, 29, 29, 29, 29, 29, 29, 18,
881 18, 18, 18, 31, 32, 18, 33, 35, 33, 115,
882 39, 55, 55, 55, 55, 33, 93, 31, 0, 3,
883 35, 32, 63, 4, 5, 34, 34, 34, 76, 5,
884 39, 34, 34, 105, 108, 78, 63, 5, 5, 5,
885 5, 5, 5, 5, 17, 78, 76, 9, 10, 96,
886 5, 5, 5, 5, 5, 5, 5, 5, 18, 82,
888 79, 5, 95, 5, 79, 82, 82, 5, 5, 41,
889 5, 5, 107, 115, 111, 41, 41, 5, 87, 5,
890 41, 41, 5, 5, 87, 41, 93, 5, 103, 132,
891 105, 110, 103, 87, 5, 5, 109, 5, 112, 5,
892 105, 5, 133, 5, 6, 113, 103, 268, 65, 6,
893 65, 65, 65, 65, 65, 65, 65, 6, 6, 6,
894 6, 6, 6, 6, 118, 122, 122, 118, 145, 153,
895 6, 6, 6, 6, 6, 6, 6, 6, 265, 107,
896 265, 6, 145, 6, 111, 835, 132, 6, 6, 153,
897 6, 6, 110, 140, 140, 140, 140, 6, 109, 6,
899 112, 146, 6, 6, 109, 109, 113, 6, 65, 212,
900 212, 133, 244, 244, 6, 6, 65, 6, 146, 6,
901 268, 6, 122, 6, 7, 7, 7, 7, 7, 7,
902 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
903 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
904 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
905 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
906 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
907 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
908 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
910 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
911 7, 7, 7, 7, 7, 11, 11, 11, 11, 11,
912 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
913 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
914 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
915 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
916 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
917 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
918 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
919 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
921 11, 11, 11, 11, 11, 11, 13, 149, 116, 116,
922 116, 116, 834, 13, 116, 833, 13, 270, 13, 13,
923 149, 13, 13, 13, 13, 13, 13, 13, 123, 123,
924 13, 275, 66, 13, 66, 66, 66, 66, 66, 66,
925 66, 99, 229, 186, 99, 99, 99, 99, 99, 99,
926 99, 147, 229, 147, 830, 99, 124, 124, 281, 106,
927 147, 273, 125, 125, 13, 186, 13, 13, 13, 13,
928 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
929 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
930 272, 270, 13, 15, 15, 269, 277, 123, 15, 316,
932 278, 15, 275, 15, 15, 571, 15, 15, 15, 15,
933 15, 15, 15, 101, 15, 15, 106, 124, 15, 281,
934 106, 273, 119, 101, 125, 101, 101, 101, 101, 101,
935 101, 101, 119, 234, 119, 119, 119, 119, 119, 119,
936 119, 148, 148, 148, 234, 234, 15, 148, 148, 15,
937 15, 293, 269, 15, 15, 15, 309, 309, 15, 15,
938 278, 15, 15, 272, 15, 293, 15, 571, 15, 304,
939 277, 15, 316, 304, 15, 15, 15, 15, 19, 19,
940 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
941 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
943 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
944 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
945 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
946 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
947 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
948 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
949 19, 19, 19, 19, 19, 19, 19, 19, 19, 100,
950 114, 143, 143, 143, 143, 143, 143, 143, 829, 100,
951 283, 100, 100, 100, 100, 100, 100, 100, 155, 179,
952 179, 179, 179, 828, 155, 155, 311, 311, 276, 155,
954 155, 827, 312, 312, 155, 164, 164, 164, 164, 164,
955 164, 173, 173, 173, 173, 173, 173, 173, 204, 204,
956 204, 204, 204, 204, 206, 206, 206, 206, 217, 217,
957 217, 217, 217, 217, 114, 280, 271, 310, 310, 100,
958 114, 261, 261, 261, 261, 261, 261, 100, 284, 114,
959 120, 283, 120, 215, 215, 215, 215, 215, 215, 215,
960 276, 305, 216, 120, 216, 216, 216, 216, 216, 216,
961 216, 276, 276, 305, 299, 299, 312, 120, 826, 120,
962 120, 489, 120, 313, 313, 120, 386, 120, 120, 120,
963 120, 120, 120, 343, 343, 120, 120, 120, 271, 120,
965 299, 369, 369, 256, 280, 825, 300, 120, 271, 284,
966 310, 120, 300, 256, 120, 256, 256, 256, 256, 256,
967 256, 256, 257, 371, 371, 120, 430, 512, 300, 512,
968 430, 385, 257, 824, 257, 257, 257, 257, 257, 257,
969 257, 259, 259, 259, 259, 259, 259, 259, 260, 287,
970 287, 287, 287, 287, 287, 287, 390, 489, 260, 386,
971 260, 260, 260, 260, 260, 260, 260, 392, 387, 389,
972 288, 391, 394, 256, 294, 294, 388, 393, 294, 292,
973 288, 256, 288, 288, 288, 288, 288, 288, 288, 292,
974 294, 303, 385, 292, 344, 344, 344, 344, 292, 345,
976 345, 345, 345, 303, 368, 368, 368, 368, 292, 346,
977 346, 346, 346, 346, 346, 346, 397, 390, 303, 347,
978 347, 347, 347, 347, 347, 387, 346, 375, 375, 375,
979 375, 375, 375, 388, 389, 368, 391, 392, 368, 395,
980 398, 399, 393, 368, 400, 401, 394, 368, 377, 823,
981 441, 441, 822, 368, 488, 378, 426, 486, 346, 494,
982 377, 377, 377, 377, 377, 377, 377, 378, 378, 378,
983 378, 378, 378, 409, 427, 426, 492, 377, 409, 442,
984 442, 444, 444, 444, 444, 491, 495, 427, 493, 409,
985 496, 397, 445, 445, 445, 445, 565, 398, 567, 500,
987 395, 446, 446, 446, 446, 400, 404, 566, 497, 377,
988 399, 441, 447, 447, 447, 447, 494, 401, 404, 404,
989 404, 404, 404, 404, 404, 466, 466, 466, 466, 488,
990 486, 448, 570, 448, 627, 404, 448, 448, 448, 448,
991 448, 448, 448, 572, 467, 467, 467, 467, 492, 535,
992 535, 573, 623, 623, 491, 600, 466, 496, 495, 466,
993 500, 567, 784, 565, 466, 544, 493, 404, 466, 784,
994 544, 821, 566, 568, 466, 467, 497, 600, 467, 569,
995 626, 467, 475, 467, 635, 820, 467, 467, 819, 632,
996 675, 675, 633, 467, 475, 475, 475, 475, 475, 475,
998 478, 570, 478, 627, 572, 478, 478, 478, 478, 478,
999 478, 478, 502, 818, 502, 817, 573, 502, 502, 502,
1000 502, 502, 502, 502, 536, 536, 536, 536, 536, 536,
1001 536, 537, 537, 537, 537, 537, 537, 537, 559, 559,
1002 559, 559, 559, 559, 559, 560, 569, 568, 632, 633,
1003 681, 569, 683, 635, 626, 677, 677, 560, 560, 560,
1004 560, 560, 560, 560, 575, 575, 575, 575, 575, 575,
1005 575, 576, 601, 601, 601, 601, 601, 601, 601, 682,
1006 684, 719, 767, 576, 576, 576, 576, 576, 576, 576,
1007 658, 658, 658, 658, 658, 658, 658, 696, 780, 780,
1009 814, 845, 863, 845, 863, 813, 696, 696, 832, 845,
1010 863, 683, 780, 681, 831, 831, 831, 831, 831, 831,
1011 831, 874, 874, 832, 832, 832, 832, 832, 832, 832,
1012 871, 877, 871, 877, 812, 811, 810, 809, 871, 877,
1013 682, 808, 719, 684, 807, 806, 805, 804, 802, 801,
1014 800, 799, 797, 796, 794, 767, 838, 838, 838, 838,
1015 838, 838, 838, 838, 838, 838, 838, 838, 838, 838,
1016 838, 838, 838, 838, 838, 838, 839, 839, 839, 839,
1017 839, 839, 839, 839, 839, 839, 839, 839, 839, 839,
1018 839, 839, 839, 839, 839, 839, 840, 840, 840, 840,
1020 840, 840, 840, 840, 840, 840, 840, 840, 840, 840,
1021 840, 840, 840, 840, 840, 840, 841, 841, 841, 841,
1022 841, 841, 841, 841, 841, 841, 841, 841, 841, 841,
1023 841, 841, 841, 841, 841, 841, 842, 842, 842, 842,
1024 842, 842, 842, 842, 842, 842, 842, 842, 842, 842,
1025 842, 842, 842, 842, 842, 842, 843, 843, 843, 843,
1026 843, 843, 843, 843, 843, 843, 843, 793, 843, 843,
1027 843, 843, 843, 843, 844, 844, 844, 844, 844, 844,
1028 846, 846, 846, 792, 791, 790, 846, 788, 787, 786,
1029 846, 847, 847, 847, 847, 847, 847, 847, 847, 847,
1031 847, 847, 785, 847, 847, 847, 847, 847, 847, 848,
1032 848, 848, 848, 848, 848, 848, 848, 848, 848, 848,
1033 783, 848, 848, 848, 848, 848, 848, 849, 779, 849,
1034 778, 849, 849, 777, 774, 849, 771, 849, 849, 850,
1035 850, 770, 769, 850, 768, 850, 850, 851, 851, 851,
1036 851, 851, 851, 851, 766, 851, 851, 851, 851, 851,
1037 851, 851, 851, 851, 851, 765, 851, 852, 852, 852,
1038 852, 852, 852, 852, 852, 852, 852, 852, 852, 852,
1039 852, 852, 852, 852, 852, 763, 852, 853, 853, 853,
1040 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
1042 853, 853, 853, 853, 853, 853, 854, 854, 854, 854,
1043 854, 854, 854, 854, 854, 854, 854, 762, 854, 854,
1044 854, 854, 854, 854, 855, 855, 855, 855, 855, 855,
1045 855, 855, 855, 855, 855, 761, 855, 855, 855, 855,
1046 855, 855, 856, 754, 856, 752, 856, 751, 856, 856,
1047 750, 749, 856, 747, 856, 856, 857, 857, 746, 744,
1048 743, 857, 857, 857, 858, 858, 858, 858, 742, 858,
1049 858, 858, 858, 858, 858, 741, 858, 858, 858, 858,
1050 858, 858, 859, 859, 859, 738, 859, 737, 859, 859,
1051 736, 735, 859, 734, 859, 859, 860, 860, 860, 860,
1053 860, 860, 860, 860, 860, 860, 860, 733, 860, 860,
1054 860, 860, 860, 860, 861, 861, 861, 861, 861, 861,
1055 861, 861, 861, 861, 861, 732, 861, 861, 861, 861,
1056 861, 861, 862, 862, 862, 862, 862, 862, 862, 862,
1057 862, 862, 862, 862, 862, 862, 862, 862, 862, 862,
1058 862, 862, 864, 730, 864, 729, 864, 864, 728, 727,
1059 864, 724, 864, 864, 865, 722, 865, 721, 865, 865,
1060 720, 718, 865, 717, 865, 865, 866, 866, 866, 866,
1061 866, 866, 866, 866, 866, 866, 866, 866, 866, 866,
1062 866, 866, 866, 866, 866, 866, 867, 867, 867, 867,
1064 867, 867, 867, 716, 867, 867, 867, 867, 867, 867,
1065 867, 867, 867, 867, 715, 867, 868, 868, 868, 868,
1066 868, 868, 868, 714, 868, 868, 868, 868, 868, 868,
1067 868, 868, 868, 868, 869, 869, 869, 869, 869, 869,
1068 869, 713, 869, 869, 869, 869, 869, 869, 869, 869,
1069 869, 869, 870, 870, 870, 870, 870, 870, 870, 870,
1070 870, 870, 870, 712, 870, 870, 870, 870, 870, 870,
1071 872, 711, 872, 710, 872, 709, 872, 872, 708, 706,
1072 872, 703, 872, 872, 873, 873, 873, 873, 873, 873,
1073 702, 873, 873, 873, 873, 873, 873, 873, 873, 873,
1075 873, 873, 873, 873, 875, 875, 875, 700, 875, 698,
1076 875, 875, 697, 695, 875, 694, 875, 875, 876, 876,
1077 876, 876, 876, 876, 876, 876, 876, 876, 876, 693,
1078 876, 876, 876, 876, 876, 876, 878, 692, 878, 691,
1079 878, 878, 690, 689, 878, 688, 878, 878, 879, 879,
1080 879, 879, 879, 879, 879, 879, 879, 879, 879, 879,
1081 879, 879, 879, 879, 879, 879, 879, 879, 880, 687,
1082 880, 880, 880, 880, 880, 880, 880, 880, 880, 880,
1083 880, 880, 880, 880, 880, 880, 880, 880, 686, 685,
1084 680, 679, 678, 674, 673, 672, 671, 670, 669, 668,
1086 667, 666, 665, 664, 662, 660, 659, 656, 655, 653,
1087 651, 650, 648, 647, 646, 645, 643, 641, 640, 639,
1088 638, 637, 636, 634, 631, 630, 629, 628, 625, 624,
1089 622, 621, 620, 619, 618, 617, 616, 615, 613, 612,
1090 607, 606, 605, 604, 603, 602, 599, 598, 597, 596,
1091 595, 594, 592, 591, 590, 589, 588, 587, 586, 585,
1092 584, 583, 582, 580, 579, 577, 574, 564, 562, 561,
1093 557, 556, 555, 554, 553, 552, 551, 550, 548, 547,
1094 546, 545, 543, 542, 541, 540, 533, 532, 531, 530,
1095 529, 528, 527, 526, 525, 524, 523, 522, 520, 518,
1097 517, 516, 515, 514, 513, 511, 510, 509, 508, 507,
1098 506, 505, 504, 499, 498, 490, 487, 485, 484, 482,
1099 481, 477, 476, 473, 472, 471, 470, 469, 468, 465,
1100 462, 461, 460, 459, 458, 457, 456, 454, 453, 451,
1101 449, 439, 438, 436, 435, 434, 432, 431, 429, 424,
1102 423, 422, 420, 418, 417, 416, 415, 414, 413, 411,
1103 410, 408, 407, 403, 402, 396, 384, 383, 382, 381,
1104 380, 379, 374, 372, 367, 366, 365, 364, 363, 361,
1105 360, 359, 358, 357, 356, 355, 354, 353, 352, 351,
1106 350, 341, 318, 317, 315, 307, 306, 302, 301, 298,
1108 297, 296, 295, 291, 290, 289, 286, 285, 282, 279,
1109 274, 266, 264, 255, 254, 253, 252, 248, 245, 243,
1110 242, 241, 239, 238, 236, 235, 233, 231, 230, 228,
1111 227, 226, 225, 224, 210, 208, 200, 199, 198, 196,
1112 193, 192, 185, 184, 183, 181, 180, 177, 175, 174,
1113 171, 170, 169, 157, 156, 154, 152, 151, 150, 144,
1114 142, 138, 137, 136, 134, 131, 130, 129, 128, 126,
1115 104, 102, 98, 97, 89, 88, 86, 85, 84, 83,
1116 81, 80, 70, 69, 67, 64, 58, 57, 43, 42,
1117 40, 38, 37, 36, 30, 25, 24, 21, 12, 8,
1119 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1120 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1121 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1122 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1123 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1124 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1125 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1126 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1127 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
1132 static yy_state_type yy_last_accepting_state;
1133 static char *yy_last_accepting_cpos;
1135 /* The intent behind this definition is that it'll catch
1136 * any uses of REJECT which flex missed.
1138 #define REJECT reject_used_but_not_detected
1139 #define yymore() yymore_used_but_not_detected
1140 #define YY_MORE_ADJ 0
1142 # line 1 "yaccParser/hslexer.flex"
1143 # line 2 "yaccParser/hslexer.flex"
1144 /**********************************************************************
1147 * LEX grammar for Haskell. *
1148 * ------------------------ *
1150 * (c) Copyright K. Hammond, University of Glasgow, *
1151 * 10th. February 1989 *
1153 * Modification History *
1154 * -------------------- *
1156 * 22/08/91 kh Initial Haskell 1.1 version. *
1157 * 18/10/91 kh Added 'ccall'. *
1158 * 19/11/91 kh Tidied generally. *
1159 * 04/12/91 kh Added Int#. *
1160 * 31/01/92 kh Haskell 1.2 version. *
1161 * 24/04/92 ps Added 'scc'. *
1162 * 03/06/92 kh Changed Infix/Prelude Handling. *
1163 * 23/08/93 jsm Changed to support flex *
1170 **********************************************************************/
1172 #include "../../includes/config.h"
1176 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
1178 /* An ANSI string.h and pre-ANSI memory.h might conflict. */
1179 #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
1181 #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
1182 #define index strchr
1183 #define rindex strrchr
1184 #define bcopy(s, d, n) memcpy ((d), (s), (n))
1185 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
1186 #define bzero(s, n) memset ((s), 0, (n))
1187 #else /* not STDC_HEADERS and not HAVE_STRING_H */
1188 #include <strings.h>
1189 /* memory.h and strings.h conflict on some systems. */
1190 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
1192 #include "hspincl.h"
1193 #include "hsparser.tab.h"
1194 #include "constants.h"
1197 /* Our substitute for <ctype.h> */
1206 #define _isconstr(s) (CharTable[*s]&(_C))
1207 BOOLEAN isconstr PROTO((char *)); /* fwd decl */
1209 unsigned char CharTable[NCHARS] = {
1210 /* nul */ 0, 0, 0, 0, 0, 0, 0, 0,
1211 /* bs */ 0, _S, _S, _S, _S, 0, 0, 0,
1212 /* dle */ 0, 0, 0, 0, 0, 0, 0, 0,
1213 /* can */ 0, 0, 0, 0, 0, 0, 0, 0,
1214 /* sp */ _S, 0, 0, 0, 0, 0, 0, 0,
1215 /* '(' */ 0, 0, 0, 0, 0, 0, 0, 0,
1216 /* '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,
1217 /* '8' */ _D|_H, _D|_H, _C, 0, 0, 0, 0, 0,
1218 /* '@' */ 0, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _C,
1219 /* 'H' */ _C, _C, _C, _C, _C, _C, _C, _C,
1220 /* 'P' */ _C, _C, _C, _C, _C, _C, _C, _C,
1221 /* 'X' */ _C, _C, _C, 0, 0, 0, 0, 0,
1222 /* '`' */ 0, _H, _H, _H, _H, _H, _H, 0,
1223 /* 'h' */ 0, 0, 0, 0, 0, 0, 0, 0,
1224 /* 'p' */ 0, 0, 0, 0, 0, 0, 0, 0,
1225 /* 'x' */ 0, 0, 0, 0, 0, 0, 0, 0,
1227 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1228 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1229 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1230 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1231 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1232 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1233 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1234 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1235 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1236 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1237 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1238 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1239 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1240 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1241 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1242 /* */ 0, 0, 0, 0, 0, 0, 0, 0,
1245 /**********************************************************************
1251 **********************************************************************/
1253 char *input_filename = NULL; /* Always points to a dynamically allocated string */
1256 * For my own sanity, things that are not part of the flex skeleton
1257 * have been renamed as hsXXXXX rather than yyXXXXX. --JSM
1260 int hslineno = 0; /* Line number at end of token */
1261 int hsplineno = 0; /* Line number at end of previous token */
1263 int hscolno = 0; /* Column number at end of token */
1264 int hspcolno = 0; /* Column number at end of previous token */
1265 int hsmlcolno = 0; /* Column number for multiple-rule lexemes */
1267 int startlineno = 0; /* The line number where something starts */
1268 int endlineno = 0; /* The line number where something ends */
1270 static BOOLEAN noGap = TRUE; /* For checking string gaps */
1271 static BOOLEAN forgetindent = FALSE; /* Don't bother applying indentation rules */
1273 static int nested_comments; /* For counting comment nesting depth */
1275 /* Hacky definition of yywrap: see flex doc.
1277 If we don't do this, then we'll have to get the default
1278 yywrap from the flex library, which is often something
1279 we are not good at locating. This avoids that difficulty.
1280 (Besides which, this is the way old flexes (pre 2.4.x) did it.)
1285 /* Essential forward declarations */
1287 static VOID hsnewid PROTO((char *, int));
1288 static VOID layout_input PROTO((char *, int));
1289 static VOID cleartext (NO_ARGS);
1290 static VOID addtext PROTO((char *, unsigned));
1291 static VOID addchar PROTO((char));
1292 static char *fetchtext PROTO((unsigned *));
1294 /* Special file handling for IMPORTS */
1295 /* Note: imports only ever go *one deep* (hence no need for a stack) WDP 94/09 */
1297 static YY_BUFFER_STATE hsbuf_save = NULL; /* Saved input buffer */
1298 static char *filename_save; /* File Name */
1299 static int hslineno_save = 0, /* Line Number */
1300 hsplineno_save = 0, /* Line Number of Prev. token */
1301 hscolno_save = 0, /* Indentation */
1302 hspcolno_save = 0; /* Left Indentation */
1303 static short icontexts_save = 0; /* Indent Context Level */
1305 static BOOLEAN etags_save; /* saved: whether doing etags stuff or not */
1306 extern BOOLEAN etags; /* that which is saved */
1308 extern BOOLEAN nonstandardFlag; /* Glasgow extensions allowed */
1310 static BOOLEAN in_interface = FALSE; /* TRUE if we are reading a .hi file */
1312 extern BOOLEAN ignorePragmas; /* True when we should ignore pragmas */
1313 extern int minAcceptablePragmaVersion; /* see documentation in main.c */
1314 extern int maxAcceptablePragmaVersion;
1315 extern int thisIfacePragmaVersion;
1317 static int hssttok = -1; /* Stacked Token: -1 -- no token; -ve -- ";"
1318 * inserted before token +ve -- "}" inserted before
1321 short icontexts = 0; /* Which context we're in */
1326 Table of indentations: right bit indicates whether to use
1327 indentation rules (1 = use rules; 0 = ignore)
1330 push one of these "contexts" at every "case" or "where"; the right bit says
1331 whether user supplied braces, etc., or not. pop appropriately (hsendindent).
1333 ALSO, a push/pop when enter/exit a new file (e.g., on importing). A -1 is
1334 pushed (the "column" for "module", "interface" and EOF). The -1 from the initial
1335 push is shown just below.
1340 static short indenttab[MAX_CONTEXTS] = {-1};
1342 #define INDENTPT (indenttab[icontexts]>>1)
1343 #define INDENTON (indenttab[icontexts]&1)
1345 #define RETURN(tok) return(Return(tok))
1348 #define YY_DECL int yylex1()
1350 /* We should not peek at yy_act, but flex calls us even for the internal action
1351 triggered on 'end-of-buffer' (This is not true of flex 2.4.4 and up, but
1352 to support older versions of flex, we'll continue to peek for now.
1354 #define YY_USER_ACTION \
1355 if (yy_act != YY_END_OF_BUFFER) layout_input(yytext, yyleng);
1359 #define YY_BREAK if (etags) fprintf(stderr,"%d %d / %d %d / %d\n",hsplineno,hspcolno,hslineno,hscolno,startlineno); break;
1362 /* Each time we enter a new start state, we push it onto the state stack.
1363 Note that the rules do not allow us to underflow or overflow the stack.
1364 (At least, they shouldn't.) The maximum expected depth is 4:
1365 0: Code -> 1: String -> 2: StringEsc -> 3: Comment
1367 static int StateStack[5];
1368 static int StateDepth = -1;
1371 #define PUSH_STATE(n) do {\
1372 fprintf(stderr,"Pushing %d (%d)\n", n, StateDepth + 1);\
1373 StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1374 #define POP_STATE do {--StateDepth;\
1375 fprintf(stderr,"Popping %d (%d)\n", StateStack[StateDepth], StateDepth);\
1376 BEGIN(StateStack[StateDepth]);} while(0)
1378 #define PUSH_STATE(n) do {StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1379 #define POP_STATE do {--StateDepth; BEGIN(StateStack[StateDepth]);} while(0)
1382 /* The start states are:
1383 Code -- normal Haskell code (principal lexer)
1384 GlaExt -- Haskell code with Glasgow extensions
1385 Comment -- Nested comment processing
1386 String -- Inside a string literal with backslashes
1387 StringEsc -- Immediately following a backslash in a string literal
1388 Char -- Inside a character literal with backslashes
1389 CharEsc -- Immediately following a backslash in a character literal
1391 Note that the INITIAL state is unused. Also note that these states
1392 are _exclusive_. All rules should be prefixed with an appropriate
1393 list of start states.
1396 /* Macros after this point can all be overridden by user definitions in
1400 #ifdef YY_MALLOC_DECL
1408 /* Just try to get by without declaring the routines. This will fail
1409 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1410 * or sizeof(void*) != sizeof(int).
1415 /* Amount of stuff to slurp up with each read. */
1416 #ifndef YY_READ_BUF_SIZE
1417 #define YY_READ_BUF_SIZE 8192
1420 /* Copy whatever the last rule matched to the standard output. */
1423 /* This used to be an fputs(), but since the string might contain NUL's,
1424 * we now use fwrite().
1426 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1429 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1430 * is returned in "result".
1433 #define YY_INPUT(buf,result,max_size) \
1434 if ( yy_current_buffer->yy_is_interactive ) \
1436 int c = getc( yyin ); \
1437 result = c == EOF ? 0 : 1; \
1438 buf[0] = (char) c; \
1440 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1441 && ferror( yyin ) ) \
1442 YY_FATAL_ERROR( "input in flex scanner failed" );
1445 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1446 * we don't want an extra ';' after the "return" because that will cause
1447 * some compilers to complain about unreachable statements.
1450 #define yyterminate() return YY_NULL
1453 /* Number of entries by which start-condition stack grows. */
1454 #ifndef YY_START_STACK_INCR
1455 #define YY_START_STACK_INCR 25
1458 /* Report a fatal error. */
1459 #ifndef YY_FATAL_ERROR
1460 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1463 /* Default declaration of generated scanner - a define so the user can
1464 * easily add parameters.
1467 #define YY_DECL int yylex YY_PROTO(( void ))
1470 /* Code executed at the beginning of each rule, after yytext and yyleng
1473 #ifndef YY_USER_ACTION
1474 #define YY_USER_ACTION
1477 /* Code executed at the end of each rule. */
1479 #define YY_BREAK break;
1484 register yy_state_type yy_current_state;
1485 register char *yy_cp, *yy_bp;
1486 register int yy_act;
1488 # line 274 "yaccParser/hslexer.flex"
1493 * Special GHC pragma rules. Do we need a start state for interface files,
1494 * so these won't be matched in source files? --JSM
1506 yy_start = 1; /* first start state */
1514 if ( yy_current_buffer )
1515 yy_init_buffer( yy_current_buffer, yyin );
1518 yy_create_buffer( yyin, YY_BUF_SIZE );
1520 yy_load_buffer_state();
1525 while ( 1 ) /* loops until end-of-file is reached */
1529 /* Support of yytext. */
1530 *yy_cp = yy_hold_char;
1532 /* yy_bp points to the position in yy_ch_buf of the start of
1537 yy_current_state = yy_start;
1538 if ( yy_bp[-1] == '\n' )
1543 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1544 if ( yy_accept[yy_current_state] )
1546 yy_last_accepting_state = yy_current_state;
1547 yy_last_accepting_cpos = yy_cp;
1549 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1551 yy_current_state = (int) yy_def[yy_current_state];
1552 if ( yy_current_state >= 838 )
1553 yy_c = yy_meta[(unsigned int) yy_c];
1555 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1558 while ( yy_base[yy_current_state] != 2201 );
1561 yy_act = yy_accept[yy_current_state];
1563 YY_DO_BEFORE_ACTION;
1566 do_action: /* This label is used only to access EOF actions. */
1570 { /* beginning of action switch */
1571 case 0: /* must back up */
1572 /* undo the effects of YY_DO_BEFORE_ACTION */
1573 *yy_cp = yy_hold_char;
1574 yy_cp = yy_last_accepting_cpos;
1575 yy_current_state = yy_last_accepting_state;
1576 goto yy_find_action;
1580 # line 283 "yaccParser/hslexer.flex"
1582 char tempf[FILENAME_SIZE];
1583 sscanf(yytext+1, "%d \"%[^\"]", &hslineno, tempf);
1584 new_filename(tempf);
1585 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1590 # line 290 "yaccParser/hslexer.flex"
1592 char tempf[FILENAME_SIZE];
1593 sscanf(yytext+5, "%d \"%[^\"]", &hslineno, tempf);
1594 new_filename(tempf);
1595 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1600 # line 297 "yaccParser/hslexer.flex"
1602 /* partain: pragma-style line directive */
1603 char tempf[FILENAME_SIZE];
1604 sscanf(yytext+9, "%d \"%[^\"]", &hslineno, tempf);
1605 new_filename(tempf);
1606 hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1611 # line 304 "yaccParser/hslexer.flex"
1613 sscanf(yytext+33,"%d ",&thisIfacePragmaVersion);
1618 # line 307 "yaccParser/hslexer.flex"
1620 if ( ignorePragmas ||
1621 thisIfacePragmaVersion < minAcceptablePragmaVersion ||
1622 thisIfacePragmaVersion > maxAcceptablePragmaVersion) {
1623 nested_comments = 1;
1624 PUSH_STATE(Comment);
1626 PUSH_STATE(GhcPragma);
1633 # line 318 "yaccParser/hslexer.flex"
1634 { RETURN(NO_PRAGMA); }
1638 # line 319 "yaccParser/hslexer.flex"
1639 { RETURN(NOINFO_PRAGMA); }
1643 # line 320 "yaccParser/hslexer.flex"
1644 { RETURN(ABSTRACT_PRAGMA); }
1648 # line 321 "yaccParser/hslexer.flex"
1649 { RETURN(DEFOREST_PRAGMA); }
1653 # line 322 "yaccParser/hslexer.flex"
1654 { RETURN(SPECIALISE_PRAGMA); }
1658 # line 323 "yaccParser/hslexer.flex"
1659 { RETURN(MODNAME_PRAGMA); }
1663 # line 324 "yaccParser/hslexer.flex"
1664 { RETURN(ARITY_PRAGMA); }
1668 # line 325 "yaccParser/hslexer.flex"
1669 { RETURN(UPDATE_PRAGMA); }
1673 # line 326 "yaccParser/hslexer.flex"
1674 { RETURN(STRICTNESS_PRAGMA); }
1678 # line 327 "yaccParser/hslexer.flex"
1679 { RETURN(KIND_PRAGMA); }
1683 # line 328 "yaccParser/hslexer.flex"
1684 { RETURN(MAGIC_UNFOLDING_PRAGMA); }
1688 # line 329 "yaccParser/hslexer.flex"
1689 { RETURN(UNFOLDING_PRAGMA); }
1693 # line 331 "yaccParser/hslexer.flex"
1698 # line 332 "yaccParser/hslexer.flex"
1703 # line 333 "yaccParser/hslexer.flex"
1708 # line 334 "yaccParser/hslexer.flex"
1709 { RETURN(COTYAPP); }
1713 # line 335 "yaccParser/hslexer.flex"
1714 { RETURN(CO_ALG_ALTS); }
1718 # line 336 "yaccParser/hslexer.flex"
1719 { RETURN(CO_PRIM_ALTS); }
1723 # line 337 "yaccParser/hslexer.flex"
1724 { RETURN(CO_NO_DEFAULT); }
1728 # line 338 "yaccParser/hslexer.flex"
1729 { RETURN(CO_LETREC); }
1733 # line 340 "yaccParser/hslexer.flex"
1734 { RETURN(CO_PRELUDE_DICTS_CC); }
1738 # line 341 "yaccParser/hslexer.flex"
1739 { RETURN(CO_ALL_DICTS_CC); }
1743 # line 342 "yaccParser/hslexer.flex"
1744 { RETURN(CO_USER_CC); }
1748 # line 343 "yaccParser/hslexer.flex"
1749 { RETURN(CO_AUTO_CC); }
1753 # line 344 "yaccParser/hslexer.flex"
1754 { RETURN(CO_DICT_CC); }
1758 # line 346 "yaccParser/hslexer.flex"
1759 { RETURN(CO_DUPD_CC); }
1763 # line 347 "yaccParser/hslexer.flex"
1764 { RETURN(CO_CAF_CC); }
1768 # line 349 "yaccParser/hslexer.flex"
1769 { RETURN(CO_SDSEL_ID); }
1773 # line 350 "yaccParser/hslexer.flex"
1774 { RETURN(CO_METH_ID); }
1778 # line 351 "yaccParser/hslexer.flex"
1779 { RETURN(CO_DEFM_ID); }
1783 # line 352 "yaccParser/hslexer.flex"
1784 { RETURN(CO_DFUN_ID); }
1788 # line 353 "yaccParser/hslexer.flex"
1789 { RETURN(CO_CONSTM_ID); }
1793 # line 354 "yaccParser/hslexer.flex"
1794 { RETURN(CO_SPEC_ID); }
1798 # line 355 "yaccParser/hslexer.flex"
1799 { RETURN(CO_WRKR_ID); }
1803 # line 356 "yaccParser/hslexer.flex"
1804 { RETURN(CO_ORIG_NM); /* fully-qualified original name*/ }
1808 # line 358 "yaccParser/hslexer.flex"
1809 { RETURN(UNFOLD_ALWAYS); }
1813 # line 359 "yaccParser/hslexer.flex"
1814 { RETURN(UNFOLD_IF_ARGS); }
1818 # line 361 "yaccParser/hslexer.flex"
1819 { RETURN(NOREP_INTEGER); }
1823 # line 362 "yaccParser/hslexer.flex"
1824 { RETURN(NOREP_RATIONAL); }
1828 # line 363 "yaccParser/hslexer.flex"
1829 { RETURN(NOREP_STRING); }
1833 # line 365 "yaccParser/hslexer.flex"
1834 { POP_STATE; RETURN(END_PRAGMA); }
1838 # line 367 "yaccParser/hslexer.flex"
1840 PUSH_STATE(UserPragma);
1841 RETURN(SPECIALISE_UPRAGMA);
1846 # line 371 "yaccParser/hslexer.flex"
1848 PUSH_STATE(UserPragma);
1849 RETURN(INLINE_UPRAGMA);
1854 # line 375 "yaccParser/hslexer.flex"
1856 PUSH_STATE(UserPragma);
1857 RETURN(MAGIC_UNFOLDING_UPRAGMA);
1862 # line 379 "yaccParser/hslexer.flex"
1864 PUSH_STATE(UserPragma);
1865 RETURN(DEFOREST_UPRAGMA);
1870 # line 383 "yaccParser/hslexer.flex"
1872 PUSH_STATE(UserPragma);
1873 RETURN(ABSTRACT_UPRAGMA);
1878 # line 387 "yaccParser/hslexer.flex"
1879 { POP_STATE; RETURN(END_UPRAGMA); }
1883 * Haskell keywords. `scc' is actually a Glasgow extension, but it is
1884 * intentionally accepted as a keyword even for normal <Code>.
1889 # line 396 "yaccParser/hslexer.flex"
1894 # line 397 "yaccParser/hslexer.flex"
1899 # line 398 "yaccParser/hslexer.flex"
1904 # line 399 "yaccParser/hslexer.flex"
1905 { RETURN(DEFAULT); }
1909 # line 400 "yaccParser/hslexer.flex"
1910 { RETURN(DERIVING); }
1914 # line 401 "yaccParser/hslexer.flex"
1919 # line 402 "yaccParser/hslexer.flex"
1924 # line 403 "yaccParser/hslexer.flex"
1929 # line 404 "yaccParser/hslexer.flex"
1934 # line 405 "yaccParser/hslexer.flex"
1939 # line 406 "yaccParser/hslexer.flex"
1944 # line 407 "yaccParser/hslexer.flex"
1949 # line 408 "yaccParser/hslexer.flex"
1950 { RETURN(INSTANCE); }
1954 # line 409 "yaccParser/hslexer.flex"
1955 { RETURN(INTERFACE); }
1959 # line 410 "yaccParser/hslexer.flex"
1964 # line 411 "yaccParser/hslexer.flex"
1969 # line 412 "yaccParser/hslexer.flex"
1970 { RETURN(RENAMING); }
1974 # line 413 "yaccParser/hslexer.flex"
1979 # line 414 "yaccParser/hslexer.flex"
1984 # line 415 "yaccParser/hslexer.flex"
1989 # line 416 "yaccParser/hslexer.flex"
1994 # line 417 "yaccParser/hslexer.flex"
1999 # line 418 "yaccParser/hslexer.flex"
2004 # line 419 "yaccParser/hslexer.flex"
2009 # line 420 "yaccParser/hslexer.flex"
2010 { RETURN(CCALL_GC); }
2014 # line 421 "yaccParser/hslexer.flex"
2019 # line 422 "yaccParser/hslexer.flex"
2020 { RETURN(CASM_GC); }
2024 # line 423 "yaccParser/hslexer.flex"
2029 # line 424 "yaccParser/hslexer.flex"
2034 * Haskell operators. Nothing special about these.
2039 # line 432 "yaccParser/hslexer.flex"
2044 # line 433 "yaccParser/hslexer.flex"
2049 # line 434 "yaccParser/hslexer.flex"
2054 # line 435 "yaccParser/hslexer.flex"
2059 # line 436 "yaccParser/hslexer.flex"
2064 # line 437 "yaccParser/hslexer.flex"
2069 # line 438 "yaccParser/hslexer.flex"
2074 # line 439 "yaccParser/hslexer.flex"
2079 # line 440 "yaccParser/hslexer.flex"
2084 # line 441 "yaccParser/hslexer.flex"
2089 # line 442 "yaccParser/hslexer.flex"
2094 # line 443 "yaccParser/hslexer.flex"
2099 # line 444 "yaccParser/hslexer.flex"
2104 # line 445 "yaccParser/hslexer.flex"
2109 # line 446 "yaccParser/hslexer.flex"
2114 # line 447 "yaccParser/hslexer.flex"
2119 # line 448 "yaccParser/hslexer.flex"
2124 # line 449 "yaccParser/hslexer.flex"
2129 # line 450 "yaccParser/hslexer.flex"
2130 { RETURN(TYLAMBDA); }
2134 # line 451 "yaccParser/hslexer.flex"
2135 { RETURN(WILDCARD); }
2139 # line 452 "yaccParser/hslexer.flex"
2144 # line 453 "yaccParser/hslexer.flex"
2149 # line 454 "yaccParser/hslexer.flex"
2154 * Integers and (for Glasgow extensions) primitive integers. Note that
2155 * we pass all of the text on to the parser, because flex/C can't handle
2156 * arbitrary precision numbers.
2161 # line 464 "yaccParser/hslexer.flex"
2163 yylval.uid = xstrndup(yytext, yyleng - 1);
2169 # line 468 "yaccParser/hslexer.flex"
2171 yylval.uid = xstrndup(yytext, yyleng);
2177 # line 472 "yaccParser/hslexer.flex"
2179 yylval.uid = xstrndup(yytext, yyleng - 1);
2185 # line 476 "yaccParser/hslexer.flex"
2187 yylval.uid = xstrndup(yytext, yyleng);
2193 # line 480 "yaccParser/hslexer.flex"
2195 yylval.uid = xstrndup(yytext, yyleng - 1);
2201 # line 484 "yaccParser/hslexer.flex"
2203 yylval.uid = xstrndup(yytext, yyleng);
2209 * Floats and (for Glasgow extensions) primitive floats/doubles.
2214 # line 495 "yaccParser/hslexer.flex"
2216 yylval.uid = xstrndup(yytext, yyleng - 2);
2222 # line 499 "yaccParser/hslexer.flex"
2224 yylval.uid = xstrndup(yytext, yyleng - 1);
2230 # line 503 "yaccParser/hslexer.flex"
2232 yylval.uid = xstrndup(yytext, yyleng);
2238 * Funky ``foo'' style C literals for Glasgow extensions
2243 # line 514 "yaccParser/hslexer.flex"
2245 hsnewid(yytext + 2, yyleng - 4);
2251 * Identifiers, both variables and operators. The trailing hash is allowed
2252 * for Glasgow extensions.
2257 # line 526 "yaccParser/hslexer.flex"
2258 { hsnewid(yytext, yyleng); RETURN(CONID); }
2262 # line 527 "yaccParser/hslexer.flex"
2263 { hsnewid(yytext, yyleng); RETURN(CONID); }
2267 # line 528 "yaccParser/hslexer.flex"
2268 { hsnewid(yytext, yyleng); RETURN(TYVAR_TEMPLATE_ID); }
2272 # line 530 "yaccParser/hslexer.flex"
2274 hsnewid(yytext, yyleng);
2275 RETURN(_isconstr(yytext) ? CONID : VARID);
2279 /* This SHOULDNAE work in "Code" (sigh) */
2283 # line 537 "yaccParser/hslexer.flex"
2285 if (! (nonstandardFlag || in_interface)) {
2286 char errbuf[ERR_BUF_SIZE];
2287 sprintf(errbuf, "Non-standard identifier (leading underscore): %s\n", yytext);
2290 hsnewid(yytext, yyleng);
2291 RETURN(isconstr(yytext) ? CONID : VARID);
2292 /* NB: ^^^^^^^^ : not the macro! */
2297 # line 547 "yaccParser/hslexer.flex"
2299 hsnewid(yytext, yyleng);
2300 RETURN(_isconstr(yytext) ? CONID : VARID);
2305 # line 551 "yaccParser/hslexer.flex"
2307 hsnewid(yytext, yyleng);
2308 RETURN(_isconstr(yytext) ? CONSYM : VARSYM);
2312 /* Why is `{Id}#` matched this way, and `{Id}` lexed as three tokens? --JSM */
2314 /* Because we can make the former well-behaved (we defined them).
2316 Sadly, the latter is defined by Haskell, which allows such
2317 la-la land constructs as `{-a 900-line comment-} foo`. (WDP 94/12)
2322 # line 566 "yaccParser/hslexer.flex"
2324 hsnewid(yytext + 1, yyleng - 2);
2325 RETURN(_isconstr(yytext+1) ? CONSYM : VARSYM);
2330 * Character literals. The first form is the quick form, for character
2331 * literals that don't contain backslashes. Literals with backslashes are
2332 * lexed through multiple rules. First, we match the open ' and as many
2333 * normal characters as possible. This puts us into the <Char> state, where
2334 * a backslash is legal. Then, we match the backslash and move into the
2335 * <CharEsc> state. When we drop out of <CharEsc>, we collect more normal
2336 * characters and the close '. We may end up with too many characters, but
2337 * this allows us to easily share the lex rules with strings. Excess characters
2338 * are ignored with a warning.
2343 # line 585 "yaccParser/hslexer.flex"
2345 yylval.uhstring = installHstring(1, yytext+1);
2351 # line 589 "yaccParser/hslexer.flex"
2353 yylval.uhstring = installHstring(1, yytext+1);
2359 # line 593 "yaccParser/hslexer.flex"
2360 {char errbuf[ERR_BUF_SIZE];
2361 sprintf(errbuf, "'' is not a valid character (or string) literal\n");
2367 # line 597 "yaccParser/hslexer.flex"
2369 hsmlcolno = hspcolno;
2371 addtext(yytext+1, yyleng-1);
2377 # line 603 "yaccParser/hslexer.flex"
2382 addtext(yytext, yyleng - 2);
2383 text = fetchtext(&length);
2385 if (! (nonstandardFlag || in_interface)) {
2386 char errbuf[ERR_BUF_SIZE];
2387 sprintf(errbuf, "`Char-hash' literals are non-standard: %s\n", text);
2392 fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '",
2393 input_filename, hsplineno, hspcolno + 1);
2394 format_string(stderr, (unsigned char *) text, length);
2395 fputs("' too long\n", stderr);
2398 yylval.uhstring = installHstring(1, text);
2399 hspcolno = hsmlcolno;
2406 # line 628 "yaccParser/hslexer.flex"
2411 addtext(yytext, yyleng - 1);
2412 text = fetchtext(&length);
2415 fprintf(stderr, "\"%s\", line %d, column %d: Character literal '",
2416 input_filename, hsplineno, hspcolno + 1);
2417 format_string(stderr, (unsigned char *) text, length);
2418 fputs("' too long\n", stderr);
2421 yylval.uhstring = installHstring(1, text);
2422 hspcolno = hsmlcolno;
2429 # line 647 "yaccParser/hslexer.flex"
2430 { addtext(yytext, yyleng); }
2434 * String literals. The first form is the quick form, for string literals
2435 * that don't contain backslashes. Literals with backslashes are lexed
2436 * through multiple rules. First, we match the open " and as many normal
2437 * characters as possible. This puts us into the <String> state, where
2438 * a backslash is legal. Then, we match the backslash and move into the
2439 * <StringEsc> state. When we drop out of <StringEsc>, we collect more normal
2440 * characters, moving back and forth between <String> and <StringEsc> as more
2441 * backslashes are encountered. (We may even digress into <Comment> mode if we
2442 * find a comment in a gap between backslashes.) Finally, we read the last chunk
2443 * of normal characters and the close ".
2448 # line 665 "yaccParser/hslexer.flex"
2450 yylval.uhstring = installHstring(yyleng-3, yytext+1);
2451 /* the -3 accounts for the " on front, "# on the end */
2457 # line 670 "yaccParser/hslexer.flex"
2459 yylval.uhstring = installHstring(yyleng-2, yytext+1);
2465 # line 674 "yaccParser/hslexer.flex"
2467 hsmlcolno = hspcolno;
2469 addtext(yytext+1, yyleng-1);
2475 # line 680 "yaccParser/hslexer.flex"
2480 addtext(yytext, yyleng-2);
2481 text = fetchtext(&length);
2483 if (! (nonstandardFlag || in_interface)) {
2484 char errbuf[ERR_BUF_SIZE];
2485 sprintf(errbuf, "`String-hash' literals are non-standard: %s\n", text);
2489 yylval.uhstring = installHstring(length, text);
2490 hspcolno = hsmlcolno;
2497 # line 698 "yaccParser/hslexer.flex"
2502 addtext(yytext, yyleng-1);
2503 text = fetchtext(&length);
2505 yylval.uhstring = installHstring(length, text);
2506 hspcolno = hsmlcolno;
2513 # line 710 "yaccParser/hslexer.flex"
2514 { addtext(yytext, yyleng); }
2518 * Character and string escapes are roughly the same, but strings have the
2519 * extra `\&' sequence which is not allowed for characters. Also, comments
2520 * are allowed in the <StringEsc> state. (See the comment section much
2523 * NB: Backslashes and tabs are stored in strings as themselves.
2524 * But if we print them (in printtree.c), they must go out as
2525 * "\\\\" and "\\t" respectively. (This is because of the bogus
2526 * intermediate format that the parser produces. It uses '\t' fpr end of
2527 * string, so it needs to be able to escape tabs, which means that it
2528 * also needs to be able to escape the escape character ('\\'). Sigh.
2533 # line 728 "yaccParser/hslexer.flex"
2534 { PUSH_STATE(CharEsc); }
2538 # line 729 "yaccParser/hslexer.flex"
2543 # line 730 "yaccParser/hslexer.flex"
2544 { PUSH_STATE(StringEsc); noGap = TRUE; }
2548 # line 732 "yaccParser/hslexer.flex"
2549 { addchar(*yytext); POP_STATE; }
2553 # line 733 "yaccParser/hslexer.flex"
2554 { if (noGap) { addchar(*yytext); } POP_STATE; }
2558 # line 735 "yaccParser/hslexer.flex"
2559 { addchar(*yytext); POP_STATE; }
2563 # line 736 "yaccParser/hslexer.flex"
2564 { addchar('\000'); POP_STATE; }
2568 # line 737 "yaccParser/hslexer.flex"
2569 { addchar('\001'); POP_STATE; }
2573 # line 738 "yaccParser/hslexer.flex"
2574 { addchar('\002'); POP_STATE; }
2578 # line 739 "yaccParser/hslexer.flex"
2579 { addchar('\003'); POP_STATE; }
2583 # line 740 "yaccParser/hslexer.flex"
2584 { addchar('\004'); POP_STATE; }
2588 # line 741 "yaccParser/hslexer.flex"
2589 { addchar('\005'); POP_STATE; }
2593 # line 742 "yaccParser/hslexer.flex"
2594 { addchar('\006'); POP_STATE; }
2597 # line 744 "yaccParser/hslexer.flex"
2600 # line 744 "yaccParser/hslexer.flex"
2601 { addchar('\007'); POP_STATE; }
2604 # line 746 "yaccParser/hslexer.flex"
2607 # line 746 "yaccParser/hslexer.flex"
2608 { addchar('\010'); POP_STATE; }
2611 # line 748 "yaccParser/hslexer.flex"
2614 # line 748 "yaccParser/hslexer.flex"
2615 { addchar('\011'); POP_STATE; }
2618 # line 750 "yaccParser/hslexer.flex"
2621 # line 750 "yaccParser/hslexer.flex"
2622 { addchar('\012'); POP_STATE; }
2625 # line 752 "yaccParser/hslexer.flex"
2628 # line 752 "yaccParser/hslexer.flex"
2629 { addchar('\013'); POP_STATE; }
2632 # line 754 "yaccParser/hslexer.flex"
2635 # line 754 "yaccParser/hslexer.flex"
2636 { addchar('\014'); POP_STATE; }
2639 # line 756 "yaccParser/hslexer.flex"
2642 # line 756 "yaccParser/hslexer.flex"
2643 { addchar('\015'); POP_STATE; }
2647 # line 757 "yaccParser/hslexer.flex"
2648 { addchar('\016'); POP_STATE; }
2652 # line 758 "yaccParser/hslexer.flex"
2653 { addchar('\017'); POP_STATE; }
2657 # line 759 "yaccParser/hslexer.flex"
2658 { addchar('\020'); POP_STATE; }
2662 # line 760 "yaccParser/hslexer.flex"
2663 { addchar('\021'); POP_STATE; }
2667 # line 761 "yaccParser/hslexer.flex"
2668 { addchar('\022'); POP_STATE; }
2672 # line 762 "yaccParser/hslexer.flex"
2673 { addchar('\023'); POP_STATE; }
2677 # line 763 "yaccParser/hslexer.flex"
2678 { addchar('\024'); POP_STATE; }
2682 # line 764 "yaccParser/hslexer.flex"
2683 { addchar('\025'); POP_STATE; }
2687 # line 765 "yaccParser/hslexer.flex"
2688 { addchar('\026'); POP_STATE; }
2692 # line 766 "yaccParser/hslexer.flex"
2693 { addchar('\027'); POP_STATE; }
2697 # line 767 "yaccParser/hslexer.flex"
2698 { addchar('\030'); POP_STATE; }
2702 # line 768 "yaccParser/hslexer.flex"
2703 { addchar('\031'); POP_STATE; }
2707 # line 769 "yaccParser/hslexer.flex"
2708 { addchar('\032'); POP_STATE; }
2712 # line 770 "yaccParser/hslexer.flex"
2713 { addchar('\033'); POP_STATE; }
2717 # line 771 "yaccParser/hslexer.flex"
2718 { addchar('\034'); POP_STATE; }
2722 # line 772 "yaccParser/hslexer.flex"
2723 { addchar('\035'); POP_STATE; }
2727 # line 773 "yaccParser/hslexer.flex"
2728 { addchar('\036'); POP_STATE; }
2732 # line 774 "yaccParser/hslexer.flex"
2733 { addchar('\037'); POP_STATE; }
2737 # line 775 "yaccParser/hslexer.flex"
2738 { addchar('\040'); POP_STATE; }
2742 # line 776 "yaccParser/hslexer.flex"
2743 { addchar('\177'); POP_STATE; }
2747 # line 777 "yaccParser/hslexer.flex"
2748 { char c = yytext[1] - '@'; addchar(c); POP_STATE; }
2752 # line 778 "yaccParser/hslexer.flex"
2754 int i = strtol(yytext, NULL, 10);
2758 char errbuf[ERR_BUF_SIZE];
2759 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2768 # line 790 "yaccParser/hslexer.flex"
2770 int i = strtol(yytext + 1, NULL, 8);
2774 char errbuf[ERR_BUF_SIZE];
2775 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2784 # line 802 "yaccParser/hslexer.flex"
2786 int i = strtol(yytext + 1, NULL, 16);
2790 char errbuf[ERR_BUF_SIZE];
2791 sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
2800 * Simple comments and whitespace. Normally, we would just ignore these, but
2801 * in case we're processing a string escape, we need to note that we've seen
2806 # line 824 "yaccParser/hslexer.flex"
2809 # line 824 "yaccParser/hslexer.flex"
2814 * Nested comments. The major complication here is in trying to match the
2815 * longest lexemes possible, for better performance. (See the flex document.)
2816 * That's why the rules look so bizarre.
2821 # line 834 "yaccParser/hslexer.flex"
2823 noGap = FALSE; nested_comments = 1; PUSH_STATE(Comment);
2827 # line 839 "yaccParser/hslexer.flex"
2829 # line 840 "yaccParser/hslexer.flex"
2832 # line 840 "yaccParser/hslexer.flex"
2837 # line 841 "yaccParser/hslexer.flex"
2838 { nested_comments++; }
2842 # line 842 "yaccParser/hslexer.flex"
2843 { if (--nested_comments == 0) POP_STATE; }
2847 # line 843 "yaccParser/hslexer.flex"
2852 * Illegal characters. This used to be a single rule, but we might as well
2853 * pass on as much information as we have, so now we indicate our state in
2854 * the error message.
2859 # line 853 "yaccParser/hslexer.flex"
2861 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2862 input_filename, hsplineno, hspcolno + 1);
2863 format_string(stderr, (unsigned char *) yytext, 1);
2864 fputs("'\n", stderr);
2870 # line 860 "yaccParser/hslexer.flex"
2872 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2873 input_filename, hsplineno, hspcolno + 1);
2874 format_string(stderr, (unsigned char *) yytext, 1);
2875 fputs("' in a character literal\n", stderr);
2881 # line 867 "yaccParser/hslexer.flex"
2883 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\",
2884 input_filename, hsplineno, hspcolno + 1);
2885 format_string(stderr, (unsigned char *) yytext, 1);
2886 fputs("'\n", stderr);
2892 # line 874 "yaccParser/hslexer.flex"
2893 { if (nonstandardFlag) {
2894 addtext(yytext, yyleng);
2896 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2897 input_filename, hsplineno, hspcolno + 1);
2898 format_string(stderr, (unsigned char *) yytext, 1);
2899 fputs("' in a string literal\n", stderr);
2906 # line 884 "yaccParser/hslexer.flex"
2909 fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\",
2910 input_filename, hsplineno, hspcolno + 1);
2911 format_string(stderr, (unsigned char *) yytext, 1);
2912 fputs("'\n", stderr);
2915 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
2916 input_filename, hsplineno, hspcolno + 1);
2917 format_string(stderr, (unsigned char *) yytext, 1);
2918 fputs("' in a string gap\n", stderr);
2925 * End of file. In any sub-state, this is an error. However, for the primary
2926 * <Code> and <GlaExt> states, this is perfectly normal. We just return an EOF
2927 * and let the yylex() wrapper deal with whatever has to be done next (e.g.
2928 * adding virtual close curlies, or closing an interface and returning to the
2929 * primary source file.
2931 * Note that flex does not call YY_USER_ACTION for <<EOF>> rules. Hence the
2932 * line/column advancement has to be done by hand.
2935 case YY_STATE_EOF(Char):
2936 case YY_STATE_EOF(CharEsc):
2937 # line 913 "yaccParser/hslexer.flex"
2939 hsplineno = hslineno; hspcolno = hscolno;
2940 hsperror("unterminated character literal");
2943 case YY_STATE_EOF(Comment):
2944 # line 917 "yaccParser/hslexer.flex"
2946 hsplineno = hslineno; hspcolno = hscolno;
2947 hsperror("unterminated comment");
2950 case YY_STATE_EOF(String):
2951 case YY_STATE_EOF(StringEsc):
2952 # line 921 "yaccParser/hslexer.flex"
2954 hsplineno = hslineno; hspcolno = hscolno;
2955 hsperror("unterminated string literal");
2958 case YY_STATE_EOF(GhcPragma):
2959 # line 925 "yaccParser/hslexer.flex"
2961 hsplineno = hslineno; hspcolno = hscolno;
2962 hsperror("unterminated interface pragma");
2965 case YY_STATE_EOF(UserPragma):
2966 # line 929 "yaccParser/hslexer.flex"
2968 hsplineno = hslineno; hspcolno = hscolno;
2969 hsperror("unterminated user-specified pragma");
2972 case YY_STATE_EOF(Code):
2973 case YY_STATE_EOF(GlaExt):
2974 # line 933 "yaccParser/hslexer.flex"
2975 { hsplineno = hslineno; hspcolno = hscolno; return(EOF); }
2979 # line 935 "yaccParser/hslexer.flex"
2980 YY_FATAL_ERROR( "flex scanner jammed" );
2982 case YY_STATE_EOF(INITIAL):
2985 case YY_END_OF_BUFFER:
2987 /* Amount of text matched not including the EOB char. */
2988 int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;
2990 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2991 *yy_cp = yy_hold_char;
2993 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
2995 /* We're scanning a new file or input source. It's
2996 * possible that this happened because the user
2997 * just pointed yyin at a new source and called
2998 * yylex(). If so, then we have to assure
2999 * consistency between yy_current_buffer and our
3000 * globals. Here is the right place to do so, because
3001 * this is the first action (other than possibly a
3002 * back-up) that will match for the new input source.
3004 yy_n_chars = yy_current_buffer->yy_n_chars;
3005 yy_current_buffer->yy_input_file = yyin;
3006 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
3009 /* Note that here we test for yy_c_buf_p "<=" to the position
3010 * of the first EOB in the buffer, since yy_c_buf_p will
3011 * already have been incremented past the NUL character
3012 * (since all states make transitions on EOB to the
3013 * end-of-buffer state). Contrast this with the test
3016 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3017 { /* This was really a NUL. */
3018 yy_state_type yy_next_state;
3020 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
3022 yy_current_state = yy_get_previous_state();
3024 /* Okay, we're now positioned to make the NUL
3025 * transition. We couldn't have
3026 * yy_get_previous_state() go ahead and do it
3027 * for us because it doesn't know how to deal
3028 * with the possibility of jamming (and we don't
3029 * want to build jamming into it because then it
3030 * will run more slowly).
3033 yy_next_state = yy_try_NUL_trans( yy_current_state );
3035 yy_bp = yytext_ptr + YY_MORE_ADJ;
3037 if ( yy_next_state )
3039 /* Consume the NUL. */
3040 yy_cp = ++yy_c_buf_p;
3041 yy_current_state = yy_next_state;
3048 goto yy_find_action;
3052 else switch ( yy_get_next_buffer() )
3054 case EOB_ACT_END_OF_FILE:
3056 yy_did_buffer_switch_on_eof = 0;
3060 /* Note: because we've taken care in
3061 * yy_get_next_buffer() to have set up
3062 * yytext, we can now set up
3063 * yy_c_buf_p so that if some total
3064 * hoser (like flex itself) wants to
3065 * call the scanner after we return the
3066 * YY_NULL, it'll still work - another
3067 * YY_NULL will get returned.
3069 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3071 yy_act = YY_STATE_EOF(YY_START);
3077 if ( ! yy_did_buffer_switch_on_eof )
3083 case EOB_ACT_CONTINUE_SCAN:
3085 yytext_ptr + yy_amount_of_matched_text;
3087 yy_current_state = yy_get_previous_state();
3090 yy_bp = yytext_ptr + YY_MORE_ADJ;
3093 case EOB_ACT_LAST_MATCH:
3095 &yy_current_buffer->yy_ch_buf[yy_n_chars];
3097 yy_current_state = yy_get_previous_state();
3100 yy_bp = yytext_ptr + YY_MORE_ADJ;
3101 goto yy_find_action;
3108 "fatal flex scanner internal error--no action found" );
3109 } /* end of action switch */
3110 } /* end of scanning one token */
3111 } /* end of yylex */
3114 /* yy_get_next_buffer - try to read in a new buffer
3116 * Returns a code representing an action:
3117 * EOB_ACT_LAST_MATCH -
3118 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3119 * EOB_ACT_END_OF_FILE - end of file
3122 static int yy_get_next_buffer()
3124 register char *dest = yy_current_buffer->yy_ch_buf;
3125 register char *source = yytext_ptr - 1; /* copy prev. char, too */
3126 register int number_to_move, i;
3129 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
3131 "fatal flex scanner internal error--end of buffer missed" );
3133 if ( yy_current_buffer->yy_fill_buffer == 0 )
3134 { /* Don't try to fill the buffer, so this is an EOF. */
3135 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
3137 /* We matched a singled characater, the EOB, so
3138 * treat this as a final EOF.
3140 return EOB_ACT_END_OF_FILE;
3145 /* We matched some text prior to the EOB, first
3148 return EOB_ACT_LAST_MATCH;
3152 /* Try to read more data. */
3154 /* First move last chars to start of buffer. */
3155 number_to_move = yy_c_buf_p - yytext_ptr;
3157 for ( i = 0; i < number_to_move; ++i )
3158 *(dest++) = *(source++);
3160 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3161 /* don't do the read, it's not guaranteed to return an EOF,
3169 yy_current_buffer->yy_buf_size - number_to_move - 1;
3171 while ( num_to_read <= 0 )
3172 { /* Not enough room in the buffer - grow it. */
3173 #ifdef YY_USES_REJECT
3175 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3178 /* just a shorter name for the current buffer */
3179 YY_BUFFER_STATE b = yy_current_buffer;
3181 int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;
3183 b->yy_buf_size *= 2;
3184 b->yy_ch_buf = (char *)
3185 yy_flex_realloc( (void *) b->yy_ch_buf,
3188 if ( ! b->yy_ch_buf )
3190 "fatal error - scanner input buffer overflow" );
3192 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3194 num_to_read = yy_current_buffer->yy_buf_size -
3199 if ( num_to_read > YY_READ_BUF_SIZE )
3200 num_to_read = YY_READ_BUF_SIZE;
3202 /* Read in more data. */
3203 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
3204 yy_n_chars, num_to_read );
3207 if ( yy_n_chars == 0 )
3209 if ( number_to_move - YY_MORE_ADJ == 1 )
3211 ret_val = EOB_ACT_END_OF_FILE;
3217 ret_val = EOB_ACT_LAST_MATCH;
3218 yy_current_buffer->yy_buffer_status =
3219 YY_BUFFER_EOF_PENDING;
3224 ret_val = EOB_ACT_CONTINUE_SCAN;
3226 yy_n_chars += number_to_move;
3227 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
3228 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
3230 /* yytext begins at the second character in yy_ch_buf; the first
3231 * character is the one which preceded it before reading in the latest
3232 * buffer; it needs to be kept around in case it's a newline, so
3233 * yy_get_previous_state() will have with '^' rules active.
3236 yytext_ptr = &yy_current_buffer->yy_ch_buf[1];
3242 /* yy_get_previous_state - get the state just before the EOB char was reached */
3244 static yy_state_type yy_get_previous_state()
3246 register yy_state_type yy_current_state;
3247 register char *yy_cp;
3249 register char *yy_bp = yytext_ptr;
3251 yy_current_state = yy_start;
3252 if ( yy_bp[-1] == '\n' )
3255 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
3257 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3258 if ( yy_accept[yy_current_state] )
3260 yy_last_accepting_state = yy_current_state;
3261 yy_last_accepting_cpos = yy_cp;
3263 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3265 yy_current_state = (int) yy_def[yy_current_state];
3266 if ( yy_current_state >= 838 )
3267 yy_c = yy_meta[(unsigned int) yy_c];
3269 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3272 return yy_current_state;
3276 /* yy_try_NUL_trans - try to make a transition on the NUL character
3279 * next_state = yy_try_NUL_trans( current_state );
3282 #ifdef YY_USE_PROTOS
3283 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
3285 static yy_state_type yy_try_NUL_trans( yy_current_state )
3286 yy_state_type yy_current_state;
3289 register int yy_is_jam;
3290 register char *yy_cp = yy_c_buf_p;
3292 register YY_CHAR yy_c = 1;
3293 if ( yy_accept[yy_current_state] )
3295 yy_last_accepting_state = yy_current_state;
3296 yy_last_accepting_cpos = yy_cp;
3298 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3300 yy_current_state = (int) yy_def[yy_current_state];
3301 if ( yy_current_state >= 838 )
3302 yy_c = yy_meta[(unsigned int) yy_c];
3304 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3305 yy_is_jam = (yy_current_state == 837);
3307 return yy_is_jam ? 0 : yy_current_state;
3311 #ifdef YY_USE_PROTOS
3312 static void yyunput( int c, register char *yy_bp )
3314 static void yyunput( c, yy_bp )
3316 register char *yy_bp;
3319 register char *yy_cp = yy_c_buf_p;
3321 /* undo effects of setting up yytext */
3322 *yy_cp = yy_hold_char;
3324 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3325 { /* need to shift things up to make room */
3326 /* +2 for EOB chars. */
3327 register int number_to_move = yy_n_chars + 2;
3328 register char *dest = &yy_current_buffer->yy_ch_buf[
3329 yy_current_buffer->yy_buf_size + 2];
3330 register char *source =
3331 &yy_current_buffer->yy_ch_buf[number_to_move];
3333 while ( source > yy_current_buffer->yy_ch_buf )
3334 *--dest = *--source;
3336 yy_cp += dest - source;
3337 yy_bp += dest - source;
3338 yy_n_chars = yy_current_buffer->yy_buf_size;
3340 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3341 YY_FATAL_ERROR( "flex scanner push-back overflow" );
3344 if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
3347 *--yy_cp = (char) c;
3350 /* Note: the formal parameter *must* be called "yy_bp" for this
3351 * macro to now work correctly.
3353 YY_DO_BEFORE_ACTION; /* set up yytext again */
3358 static int yyinput()
3365 *yy_c_buf_p = yy_hold_char;
3367 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
3369 /* yy_c_buf_p now points to the character we want to return.
3370 * If this occurs *before* the EOB characters, then it's a
3371 * valid NUL; if not, then we've hit the end of the buffer.
3373 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3374 /* This was really a NUL. */
3378 { /* need more input */
3379 yytext_ptr = yy_c_buf_p;
3382 switch ( yy_get_next_buffer() )
3384 case EOB_ACT_END_OF_FILE:
3389 yytext_ptr + YY_MORE_ADJ;
3401 case EOB_ACT_CONTINUE_SCAN:
3402 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3405 case EOB_ACT_LAST_MATCH:
3408 "unexpected last match in yyinput()" );
3411 "unexpected last match in input()" );
3417 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
3418 *yy_c_buf_p = '\0'; /* preserve yytext */
3419 yy_hold_char = *++yy_c_buf_p;
3425 #ifdef YY_USE_PROTOS
3426 void yyrestart( FILE *input_file )
3428 void yyrestart( input_file )
3432 if ( ! yy_current_buffer )
3433 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
3435 yy_init_buffer( yy_current_buffer, input_file );
3436 yy_load_buffer_state();
3440 #ifdef YY_USE_PROTOS
3441 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
3443 void yy_switch_to_buffer( new_buffer )
3444 YY_BUFFER_STATE new_buffer;
3447 if ( yy_current_buffer == new_buffer )
3450 if ( yy_current_buffer )
3452 /* Flush out information for old buffer. */
3453 *yy_c_buf_p = yy_hold_char;
3454 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
3455 yy_current_buffer->yy_n_chars = yy_n_chars;
3458 yy_current_buffer = new_buffer;
3459 yy_load_buffer_state();
3461 /* We don't actually know whether we did this switch during
3462 * EOF (yywrap()) processing, but the only time this flag
3463 * is looked at is after yywrap() is called, so it's safe
3464 * to go ahead and always set it.
3466 yy_did_buffer_switch_on_eof = 1;
3470 #ifdef YY_USE_PROTOS
3471 void yy_load_buffer_state( void )
3473 void yy_load_buffer_state()
3476 yy_n_chars = yy_current_buffer->yy_n_chars;
3477 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
3478 yyin = yy_current_buffer->yy_input_file;
3479 yy_hold_char = *yy_c_buf_p;
3483 #ifdef YY_USE_PROTOS
3484 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
3486 YY_BUFFER_STATE yy_create_buffer( file, size )
3493 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3496 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3498 b->yy_buf_size = size;
3500 /* yy_ch_buf has to be 2 characters longer than the size given because
3501 * we need to put in 2 end-of-buffer characters.
3503 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
3505 if ( ! b->yy_ch_buf )
3506 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3508 yy_init_buffer( b, file );
3514 #ifdef YY_USE_PROTOS
3515 void yy_delete_buffer( YY_BUFFER_STATE b )
3517 void yy_delete_buffer( b )
3521 if ( b == yy_current_buffer )
3522 yy_current_buffer = (YY_BUFFER_STATE) 0;
3524 yy_flex_free( (void *) b->yy_ch_buf );
3525 yy_flex_free( (void *) b );
3529 #ifdef YY_USE_PROTOS
3530 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3532 void yy_init_buffer( b, file )
3537 b->yy_input_file = file;
3539 /* We put in the '\n' and start reading from [1] so that an
3540 * initial match-at-newline will be true.
3543 b->yy_ch_buf[0] = '\n';
3546 /* We always need two end-of-buffer characters. The first causes
3547 * a transition to the end-of-buffer state. The second causes
3548 * a jam in that state.
3550 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3551 b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
3553 b->yy_buf_pos = &b->yy_ch_buf[1];
3555 b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;
3557 b->yy_fill_buffer = 1;
3559 b->yy_buffer_status = YY_BUFFER_NEW;
3563 #ifdef YY_USE_PROTOS
3564 static void yy_push_state( int new_state )
3566 static void yy_push_state( new_state )
3570 if ( yy_start_stack_ptr >= yy_start_stack_depth )
3574 yy_start_stack_depth += YY_START_STACK_INCR;
3575 new_size = yy_start_stack_depth * sizeof( int );
3577 if ( ! yy_start_stack )
3578 yy_start_stack = (int *) yy_flex_alloc( new_size );
3581 yy_start_stack = (int *) yy_flex_realloc(
3582 (void *) yy_start_stack, new_size );
3584 if ( ! yy_start_stack )
3586 "out of memory expanding start-condition stack" );
3589 yy_start_stack[yy_start_stack_ptr++] = YY_START;
3595 static void yy_pop_state()
3597 if ( --yy_start_stack_ptr < 0 )
3598 YY_FATAL_ERROR( "start-condition stack underflow" );
3600 BEGIN(yy_start_stack[yy_start_stack_ptr]);
3604 static int yy_top_state()
3606 return yy_start_stack[yy_start_stack_ptr - 1];
3610 #ifdef YY_USE_PROTOS
3611 static void yy_fatal_error( const char msg[] )
3613 static void yy_fatal_error( msg )
3617 (void) fprintf( stderr, "%s\n", msg );
3623 /* Redefine yyless() so it works in section 3 code. */
3629 /* Undo effects of setting up yytext. */ \
3630 yytext[yyleng] = yy_hold_char; \
3631 yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
3632 yy_hold_char = *yy_c_buf_p; \
3633 *yy_c_buf_p = '\0'; \
3639 /* Internal utility routines. */
3642 #ifdef YY_USE_PROTOS
3643 static void yy_flex_strncpy( char *s1, const char *s2, int n )
3645 static void yy_flex_strncpy( s1, s2, n )
3652 for ( i = 0; i < n; ++i )
3658 #ifdef YY_USE_PROTOS
3659 static void *yy_flex_alloc( unsigned int size )
3661 static void *yy_flex_alloc( size )
3665 return (void *) malloc( size );
3668 #ifdef YY_USE_PROTOS
3669 static void *yy_flex_realloc( void *ptr, unsigned int size )
3671 static void *yy_flex_realloc( ptr, size )
3676 return (void *) realloc( ptr, size );
3679 #ifdef YY_USE_PROTOS
3680 static void yy_flex_free( void *ptr )
3682 static void yy_flex_free( ptr )
3688 # line 935 "yaccParser/hslexer.flex"
3691 /**********************************************************************
3694 * YACC/LEX Initialisation etc. *
3697 **********************************************************************/
3700 We initialise input_filename to "<stdin>".
3701 This allows unnamed sources to be piped into the parser.
3707 extern BOOLEAN acceptPrim;
3709 input_filename = xstrdup("<stdin>");
3711 /* We must initialize the input buffer _now_, because we call
3712 setyyin _before_ calling yylex for the first time! */
3713 yy_switch_to_buffer(yy_create_buffer(stdin, YY_BUF_SIZE));
3722 new_filename(f) /* This looks pretty dodgy to me (WDP) */
3725 if (input_filename != NULL)
3726 free(input_filename);
3727 input_filename = xstrdup(f);
3730 /**********************************************************************
3733 * Layout Processing *
3736 **********************************************************************/
3739 The following section deals with Haskell Layout conventions
3740 forcing insertion of ; or } as appropriate
3746 return (!forgetindent && INDENTON);
3750 /* Enter new context and set new indentation level */
3755 fprintf(stderr, "hssetindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
3759 * partain: first chk that new indent won't be less than current one; this code
3760 * doesn't make sense to me; hscolno tells the position of the _end_ of the
3761 * current token; what that has to do with indenting, I don't know.
3765 if (hscolno - 1 <= INDENTPT) {
3767 return; /* Empty input OK for Haskell 1.1 */
3769 char errbuf[ERR_BUF_SIZE];
3771 sprintf(errbuf, "Layout error -- indentation should be > %d cols", INDENTPT);
3775 hsentercontext((hspcolno << 1) | 1);
3779 /* Enter a new context without changing the indentation level */
3784 fprintf(stderr, "hsincindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
3786 hsentercontext(indenttab[icontexts] & ~1);
3790 /* Turn off indentation processing, usually because an explicit "{" has been seen */
3794 forgetindent = TRUE;
3798 /* Enter a new layout context. */
3800 hsentercontext(indent)
3803 /* Enter new context and set indentation as specified */
3804 if (++icontexts >= MAX_CONTEXTS) {
3805 char errbuf[ERR_BUF_SIZE];
3807 sprintf(errbuf, "`wheres' and `cases' nested too deeply (>%d)", MAX_CONTEXTS - 1);
3810 forgetindent = FALSE;
3811 indenttab[icontexts] = indent;
3813 fprintf(stderr, "hsentercontext:indent=%d,hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", indent, hscolno, hspcolno, icontexts, INDENTPT);
3818 /* Exit a layout context */
3824 fprintf(stderr, "hsendindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
3829 * Return checks the indentation level and returns ;, } or the specified token.
3840 if (hsshouldindent()) {
3841 if (hspcolno < INDENTPT) {
3843 fprintf(stderr, "inserted '}' before %d (%d:%d:%d:%d)\n", tok, hspcolno, hscolno, yyleng, INDENTPT);
3847 } else if (hspcolno == INDENTPT) {
3849 fprintf(stderr, "inserted ';' before %d (%d:%d)\n", tok, hspcolno, INDENTPT);
3857 fprintf(stderr, "returning %d (%d:%d)\n", tok, hspcolno, INDENTPT);
3864 * Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
3870 static BOOLEAN eof = FALSE;
3873 if (hssttok != -1) {
3881 endlineno = hslineno;
3882 if ((tok = yylex1()) != EOF)
3888 if (icontexts > icontexts_save) {
3891 indenttab[icontexts] = 0;
3894 hsperror("missing '}' at end of file");
3895 } else if (hsbuf_save != NULL) {
3897 yy_delete_buffer(YY_CURRENT_BUFFER);
3898 yy_switch_to_buffer(hsbuf_save);
3900 new_filename(filename_save);
3901 free(filename_save);
3902 hslineno = hslineno_save;
3903 hsplineno = hsplineno_save;
3904 hscolno = hscolno_save;
3905 hspcolno = hspcolno_save;
3907 in_interface = FALSE;
3908 icontexts = icontexts_save - 1;
3911 fprintf(stderr, "finished reading interface (%d:%d:%d)\n", hscolno, hspcolno, INDENTPT);
3918 abort(); /* should never get here! */
3922 /**********************************************************************
3925 * Input Processing for Interfaces *
3928 **********************************************************************/
3930 /* setyyin(file) open file as new lex input buffer */
3937 hsbuf_save = YY_CURRENT_BUFFER;
3938 if ((yyin = fopen(file, "r")) == NULL) {
3939 char errbuf[ERR_BUF_SIZE];
3941 sprintf(errbuf, "can't read \"%-.50s\"", file);
3944 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
3946 hslineno_save = hslineno;
3947 hsplineno_save = hsplineno;
3948 hslineno = hsplineno = 1;
3950 filename_save = input_filename;
3951 input_filename = NULL;
3953 hscolno_save = hscolno;
3954 hspcolno_save = hspcolno;
3955 hscolno = hspcolno = 0;
3956 in_interface = TRUE;
3957 etags_save = etags; /* do not do "etags" stuff in interfaces */
3958 etags = 0; /* We remember whether we are doing it in
3959 the module, so we can restore it later [WDP 94/09] */
3960 hsentercontext(-1); /* partain: changed this from 0 */
3961 icontexts_save = icontexts;
3963 fprintf(stderr, "reading %s (%d:%d:%d)\n", input_filename, hscolno_save, hspcolno_save, INDENTPT);
3968 layout_input(text, len)
3973 fprintf(stderr, "Scanning \"%s\"\n", text);
3976 hsplineno = hslineno;
3988 hscolno += 8 - (hscolno % 8); /* Tabs stops are 8 columns apart */
4002 startlineno = hsplineno;
4006 fprintf(stderr,"%u\tsetstartlineno (col %u)\n",startlineno,hscolno);
4010 /**********************************************************************
4016 **********************************************************************/
4018 #define CACHE_SIZE YY_BUF_SIZE
4024 } textcache = { 0, 0, NULL };
4029 /* fprintf(stderr, "cleartext\n"); */
4031 if (textcache.allocated == 0) {
4032 textcache.allocated = CACHE_SIZE;
4033 textcache.text = xmalloc(CACHE_SIZE);
4038 addtext(text, length)
4042 /* fprintf(stderr, "addtext: %d %s\n", length, text); */
4047 if (textcache.next + length + 1 >= textcache.allocated) {
4048 textcache.allocated += length + CACHE_SIZE;
4049 textcache.text = xrealloc(textcache.text, textcache.allocated);
4051 bcopy(text, textcache.text + textcache.next, length);
4052 textcache.next += length;
4063 /* fprintf(stderr, "addchar: %c\n", c); */
4065 if (textcache.next + 2 >= textcache.allocated) {
4066 textcache.allocated += CACHE_SIZE;
4067 textcache.text = xrealloc(textcache.text, textcache.allocated);
4069 textcache.text[textcache.next++] = c;
4076 /* fprintf(stderr, "fetchtext: %d\n", textcache.next); */
4078 *length = textcache.next;
4079 textcache.text[textcache.next] = '\0';
4080 return textcache.text;
4083 /**********************************************************************
4086 * Identifier Processing *
4089 **********************************************************************/
4092 hsnewid Enters an id of length n into the symbol table.
4096 hsnewid(name, length)
4100 char save = name[length];
4102 name[length] = '\0';
4103 yylval.uid = installid(name);
4104 name[length] = save;
4108 isconstr(s) /* walks past leading underscores before using the macro */
4113 for ( ; temp != NULL && *temp == '_' ; temp++ );
4115 return _isconstr(temp);