[project @ 1996-01-18 16:33:17 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / hslexer.c
1 /* A lexical scanner generated by flex */
2
3 /* Scanner skeleton version:
4  * $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/compiler/yaccParser/Attic/hslexer.c,v 1.3 1996/01/18 16:36:38 partain Exp $
5  */
6
7 #define FLEX_SCANNER
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
10
11 #include <stdio.h>
12
13
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15 #ifdef c_plusplus
16 #ifndef __cplusplus
17 #define __cplusplus
18 #endif
19 #endif
20
21
22 #ifdef __cplusplus
23
24 #include <stdlib.h>
25 #include <unistd.h>
26
27 /* Use prototypes in function declarations. */
28 #define YY_USE_PROTOS
29
30 /* The "const" storage-class-modifier is valid. */
31 #define YY_USE_CONST
32
33 #else   /* ! __cplusplus */
34
35 #if __STDC__
36
37 #define YY_USE_PROTOS
38 #define YY_USE_CONST
39
40 #endif  /* __STDC__ */
41 #endif  /* ! __cplusplus */
42
43 #ifdef __TURBOC__
44  #pragma warn -rch
45  #pragma warn -use
46 #include <io.h>
47 #include <stdlib.h>
48 #define YY_USE_CONST
49 #define YY_USE_PROTOS
50 #endif
51
52 #ifdef YY_USE_CONST
53 #define yyconst const
54 #else
55 #define yyconst
56 #endif
57
58
59 #ifdef YY_USE_PROTOS
60 #define YY_PROTO(proto) proto
61 #else
62 #define YY_PROTO(proto) ()
63 #endif
64
65 /* Returned upon end-of-file. */
66 #define YY_NULL 0
67
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69  * integer for use as an array index.  If the signed char is negative,
70  * we want to instead treat it as an 8-bit unsigned char, hence the
71  * double cast.
72  */
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
74
75 /* Enter a start condition.  This macro really ought to take a parameter,
76  * but we do it the disgusting crufty way forced on us by the ()-less
77  * definition of BEGIN.
78  */
79 #define BEGIN yy_start = 1 + 2 *
80
81 /* Translate the current start state into a value that can be later handed
82  * to BEGIN to return to the state.  The YYSTATE alias is for lex
83  * compatibility.
84  */
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
87
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
90
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
93
94 #define YY_END_OF_BUFFER_CHAR 0
95
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
98
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
100
101 extern int yyleng;
102 extern FILE *yyin, *yyout;
103
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
107
108 /* The funky do-while in the following #define is used to turn the definition
109  * int a single C statement (which needs a semi-colon terminator).  This
110  * avoids problems with code like:
111  *
112  *      if ( condition_holds )
113  *              yyless( 5 );
114  *      else
115  *              do_something_else();
116  *
117  * Prior to using the do-while the compiler would get upset at the
118  * "else" because it interpreted the "if" statement as being all
119  * done when it reached the ';' after the yyless() call.
120  */
121
122 /* Return all but the first 'n' matched characters back to the input stream. */
123
124 #define yyless(n) \
125         do \
126                 { \
127                 /* Undo effects of setting up yytext. */ \
128                 *yy_cp = yy_hold_char; \
129                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
130                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
131                 } \
132         while ( 0 )
133
134 #define unput(c) yyunput( c, yytext_ptr )
135
136 /* The following is because we cannot portably get our hands on size_t
137  * (without autoconf's help, which isn't available because we want
138  * flex-generated scanners to compile on their own).
139  */
140 typedef unsigned int yy_size_t;
141
142
143 struct yy_buffer_state
144         {
145         FILE *yy_input_file;
146
147         char *yy_ch_buf;                /* input buffer */
148         char *yy_buf_pos;               /* current position in input buffer */
149
150         /* Size of input buffer in bytes, not including room for EOB
151          * characters.
152          */
153         yy_size_t yy_buf_size;
154
155         /* Number of characters read into yy_ch_buf, not including EOB
156          * characters.
157          */
158         int yy_n_chars;
159
160         /* Whether we "own" the buffer - i.e., we know we created it,
161          * and can realloc() it to grow it, and should free() it to
162          * delete it.
163          */
164         int yy_is_our_buffer;
165
166         /* Whether this is an "interactive" input source; if so, and
167          * if we're using stdio for input, then we want to use getc()
168          * instead of fread(), to make sure we stop fetching input after
169          * each newline.
170          */
171         int yy_is_interactive;
172
173         /* Whether we're considered to be at the beginning of a line.
174          * If so, '^' rules will be active on the next match, otherwise
175          * not.
176          */
177         int yy_at_bol;
178
179         /* Whether to try to fill the input buffer when we reach the
180          * end of it.
181          */
182         int yy_fill_buffer;
183
184         int yy_buffer_status;
185 #define YY_BUFFER_NEW 0
186 #define YY_BUFFER_NORMAL 1
187         /* When an EOF's been seen but there's still some text to process
188          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
189          * shouldn't try reading from the input source any more.  We might
190          * still have a bunch of tokens to match, though, because of
191          * possible backing-up.
192          *
193          * When we actually see the EOF, we change the status to "new"
194          * (via yyrestart()), so that the user can continue scanning by
195          * just pointing yyin at a new input file.
196          */
197 #define YY_BUFFER_EOF_PENDING 2
198         };
199
200 static YY_BUFFER_STATE yy_current_buffer = 0;
201
202 /* We provide macros for accessing buffer states in case in the
203  * future we want to put the buffer states in a more general
204  * "scanner state".
205  */
206 #define YY_CURRENT_BUFFER yy_current_buffer
207
208
209 /* yy_hold_char holds the character lost when yytext is formed. */
210 static char yy_hold_char;
211
212 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
213
214
215 int yyleng;
216
217 /* Points to current character in buffer. */
218 static char *yy_c_buf_p = (char *) 0;
219 static int yy_init = 1;         /* whether we need to initialize */
220 static int yy_start = 0;        /* start state number */
221
222 /* Flag which is used to allow yywrap()'s to do buffer switches
223  * instead of setting up a fresh yyin.  A bit of a hack ...
224  */
225 static int yy_did_buffer_switch_on_eof;
226
227 void yyrestart YY_PROTO(( FILE *input_file ));
228
229 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
230 void yy_load_buffer_state YY_PROTO(( void ));
231 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
232 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
233 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
234 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
236
237 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
238 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
239 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
240
241 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
242 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
243 static void yy_flex_free YY_PROTO(( void * ));
244
245 #define yy_new_buffer yy_create_buffer
246
247 #define yy_set_interactive(is_interactive) \
248         { \
249         if ( ! yy_current_buffer ) \
250                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
251         yy_current_buffer->yy_is_interactive = is_interactive; \
252         }
253
254 #define yy_set_bol(at_bol) \
255         { \
256         if ( ! yy_current_buffer ) \
257                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
258         yy_current_buffer->yy_at_bol = at_bol; \
259         }
260
261 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
262
263 typedef unsigned char YY_CHAR;
264 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
265 typedef int yy_state_type;
266 extern char *yytext;
267 #define yytext_ptr yytext
268
269 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
270 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
271 static int yy_get_next_buffer YY_PROTO(( void ));
272 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
273
274 /* Done after the current pattern has been matched and before the
275  * corresponding action - sets up yytext.
276  */
277 #define YY_DO_BEFORE_ACTION \
278         yytext_ptr = yy_bp; \
279         yyleng = (int) (yy_cp - yy_bp); \
280         yy_hold_char = *yy_cp; \
281         *yy_cp = '\0'; \
282         yy_c_buf_p = yy_cp;
283
284 #define YY_NUM_RULES 202
285 #define YY_END_OF_BUFFER 203
286 static yyconst short int yy_accept[837] =
287     {   0,
288         0,    0,    0,    0,    0,    0,    0,    0,  191,  191,
289         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
290       203,  197,  198,  130,  129,  137,  199,  142,  185,  199,
291       199,  199,  199,  199,  199,  199,  199,  199,  199,  199,
292       199,  199,  199,  140,  199,  151,  153,  161,  157,  199,
293       163,  155,  159,  199,  189,  122,  133,  127,   92,   93,
294        98,   85,  105,  122,  111,  111,  122,   84,  122,   87,
295        99,  121,   94,  100,   95,  102,  103,  121,  121,  121,
296       121,  121,  121,  121,  121,  121,  121,  121,   96,   86,
297        97,  104,  122,  191,  196,  196,  133,  127,  105,  111,
298
299       111,  121,  102,  103,  121,  121,  121,  121,  121,  121,
300       121,  121,  121,  121,  121,  189,  127,  122,  111,  197,
301       121,  121,  121,  121,  121,   96,  122,  122,  122,  197,
302       197,  121,  121,  197,  200,  136,  135,  139,  201,  189,
303       142,  201,  185,  201,  201,  201,  201,  201,  201,  201,
304       201,  201,  201,  201,  201,  201,  201,  141,  201,  151,
305       153,  161,  157,  201,  163,  155,  159,  201,  201,  130,
306       129,  128,  185,    0,    0,  152,    0,  162,    0,    0,
307         0,  175,    0,    0,    0,    0,  160,  178,  179,  154,
308       156,    0,    0,  180,  165,  164,  182,    0,    0,    0,
309
310       181,  158,  184,  186,  187,  189,  122,  133,  132,  127,
311       126,  188,   89,   83,    0,  111,    0,    0,   91,   88,
312        90,  121,  120,    0,  120,  121,  121,  121,  121,  121,
313       121,   61,  121,   75,  121,  121,   69,  121,  121,   72,
314       121,  121,  190,    0,    0,  191,  192,    0,  195,  193,
315       194,    0,  133,  132,  127,    0,    0,  110,    0,  111,
316         0,    0,  119,  121,  120,    0,    0,  121,  121,  121,
317       121,  121,  121,   61,  121,   75,  121,  121,   69,  121,
318       121,   72,  121,  121,    0,  127,    0,  111,    0,    0,
319         0,  120,  120,  120,  120,  120,  120,  120,  120,  120,
320
321       120,  120,  120,  120,  120,  120,  120,    0,  121,  121,
322        75,  121,   69,  190,    0,  121,  136,  135,  134,  138,
323       149,  150,  174,  167,  168,  169,  170,  183,  166,  148,
324       147,  177,  173,  146,  171,  143,  144,  145,  176,  172,
325       127,  125,  188,  188,  188,  188,  114,  107,  109,  120,
326       120,  121,  121,  121,  121,  121,  121,  121,  121,  121,
327       121,  121,   76,  121,  121,  121,  121,  121,    0,    0,
328         1,    1,    0,  131,  125,    0,    0,  114,  107,  109,
329       120,  120,    0,    0,    0,  121,  121,  121,  121,  121,
330       121,  121,  121,  121,  121,  121,   76,  121,  121,  121,
331
332       121,  121,    0,    0,    0,   18,   19,    0,  120,  120,
333       120,  120,   12,  120,  120,  120,  120,  120,  120,   17,
334       120,   15,  120,  120,  120,   11,  120,  120,    6,  120,
335       120,  120,  120,   14,  120,  120,  120,   13,  120,  120,
336       118,  121,   76,   53,  188,    0,  120,   54,  121,   56,
337       121,  121,   59,  121,  121,  121,  121,  121,  121,  121,
338        71,   73,  121,    0,    0,   52,   52,   52,   52,   52,
339        52,    0,  124,    0,    0,  113,    0,  106,  108,  120,
340       120,  123,    0,   54,  121,   56,  121,  121,   59,  121,
341       121,  121,  121,  121,  121,  121,   71,   73,  121,   46,
342
343         0,  101,  120,  120,  120,  120,  120,  120,  120,  120,
344       120,  120,  120,  120,  120,  120,  120,   16,  120,    7,
345       120,  120,  120,  120,  120,  120,  120,  120,  120,  120,
346       120,  120,  118,   54,    0,  114,   81,   55,  121,  121,
347       121,  121,   63,  121,  121,  121,  121,   74,   52,   52,
348        52,   52,   52,   52,   52,    0,  112,    0,  114,  120,
349       120,  115,   55,  121,  121,  121,  121,   63,  121,  121,
350       121,  121,   74,    0,    0,  120,   22,  120,  120,   20,
351       120,  120,  120,  120,  120,  120,  120,  120,  120,  120,
352       120,  116,  120,  120,  120,  120,  120,  120,  120,  120,
353
354       120,  120,  120,  120,  121,  121,   60,   62,   64,   65,
355       121,  121,   68,  121,   52,   52,   52,   52,   52,   52,
356        52,    0,   79,  120,  121,  121,   60,   62,   64,   65,
357       121,  121,   68,  121,  120,  120,  120,  120,  120,  120,
358        35,  120,   36,  120,  120,  120,  120,   34,  120,  120,
359        40,  120,   23,  120,  120,   38,  117,  120,  120,   39,
360       120,   57,  121,  121,  121,  121,   52,   52,   52,   52,
361        52,   52,   52,    0,    2,    2,  120,   77,   57,  121,
362       121,  121,  121,  120,  120,  120,  120,  120,  120,  120,
363       120,  120,  120,  120,  120,  120,  120,   33,  120,   21,
364
365       120,  120,   58,   66,  121,   70,   52,   52,   52,   52,
366        52,   52,   52,  120,  120,   58,   66,  121,   70,  120,
367       120,   41,  120,   32,   37,  120,  120,  120,  120,   25,
368       120,  120,  120,  120,  120,  120,  120,   82,   67,   52,
369         0,   52,   52,   48,   52,   52,   80,  120,   67,  120,
370       120,   29,  120,   30,   31,   42,   43,   44,   45,  120,
371       120,  120,   28,   52,    0,    0,   52,   52,   52,   52,
372        78,    8,  120,    9,   24,  120,  120,   52,    0,   51,
373        50,   52,   52,  120,  120,  120,   52,    3,    3,   52,
374        52,  120,  120,   10,   52,   52,   47,  120,  120,   52,
375
376        52,   27,  120,    5,   52,  120,    0,   52,  120,    0,
377        52,  120,    0,   49,   26,    0,    0,    0,    0,    0,
378         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
379         0,    0,    0,    0,    4,    0
380     } ;
381
382 static yyconst int yy_ec[256] =
383     {   0,
384         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
385         2,    2,    4,    1,    1,    1,    1,    1,    1,    1,
386         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
387         1,    5,    6,    7,    8,    9,   10,   11,   12,   13,
388        14,   10,   15,   16,   17,   18,   19,   20,   21,   22,
389        23,   24,   25,   25,   25,   26,   26,   27,   28,   29,
390        30,   31,   10,   32,   33,   34,   35,   36,   37,   38,
391        39,   40,   41,   42,   43,   44,   45,   46,   47,   48,
392        49,   50,   51,   52,   53,   54,   55,   56,   57,   58,
393        59,   60,   61,   62,   63,   64,   65,   66,   67,   68,
394
395        69,   70,   71,   72,   73,   74,   74,   75,   76,   77,
396        78,   79,   74,   80,   81,   82,   83,   84,   85,   86,
397        87,   74,   88,   89,   90,   91,    1,    1,    1,    1,
398         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
399         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
400         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
401         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
402         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
403         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
404         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
405
406         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
407         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
408         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
409         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
410         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
411         1,    1,    1,    1,    1
412     } ;
413
414 static yyconst int yy_meta[92] =
415     {   0,
416         1,    2,    3,    2,    4,    5,    6,    7,    8,    5,
417         5,    9,    6,    6,    5,    6,   10,    5,    5,   11,
418        11,   11,   11,   11,   11,   11,    5,    6,    5,    5,
419         5,   12,   13,   13,   13,   13,   13,   13,   14,   14,
420        14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
421        14,   14,   14,   14,   14,   14,   14,   14,   15,   16,
422        15,   12,   17,   18,   19,   19,   19,   19,   19,   19,
423        20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
424        20,   20,   20,   20,   20,   20,   20,   21,    5,   22,
425         5
426
427     } ;
428
429 static yyconst short int yy_base[881] =
430     {   0,
431         0,    0,    0,    4,   58,  138,  224, 2450,    0,    1,
432       315, 2449,  402,    0,  487,    0,   25,   39,  578,    0,
433      2456, 2459, 2459, 2443, 2446, 2459, 2459, 2459,   13, 2418,
434         7,   12,   12,   21,   10, 2401, 2399, 2412,   18, 2398,
435        69, 2397, 2395, 2459,    0, 2459, 2459, 2459, 2459,    0,
436      2459, 2459, 2459,    0,   50,    0, 2439, 2433, 2459, 2459,
437         0, 2459,   46, 2426,  131,  415, 2416, 2459, 2425, 2410,
438         0,    0, 2459,    0, 2459,    6, 2459,   11,   36, 2365,
439      2366,   30, 2369, 2359, 2366, 2366,   47, 2362, 2416,    0,
440      2459,    0,   52,    0,   13,    2, 2425, 2419,  425,  662,
441
442       506, 2422,   66, 2365,   66,  452,  105,    2,  129,  124,
443       107,  131,  138,  663,   42,  407,    0,  148,  515,  745,
444         5,  158,  421,  449,  455, 2411,    0, 2410, 2395, 2362,
445      2360,  122,  135, 2406, 2459, 2415, 2413, 2409, 2459,  192,
446      2459, 2402,  652, 2383,  132,  169,  417,  497,  370, 2366,
447      2364, 2377,  137, 2363,  648, 2362, 2360, 2459,    0, 2459,
448      2459, 2459, 2459,  686, 2459, 2459, 2459,    0, 2394, 2398,
449      2401, 2459,  692, 2365, 2363, 2459, 2360, 2459,  669, 2361,
450      2367, 2459, 2354, 2350, 2366,  410, 2459, 2459, 2459, 2459,
451      2459, 2357, 2355, 2459, 2459, 2358, 2459, 2341, 2362, 2349,
452
453      2459, 2459, 2459,  699,    0,  723,    0, 2387, 2459, 2381,
454      2459,  727,    0,    0,  734,  745,  722,    0,    0, 2459,
455         0,    0,    0, 2329, 2324, 2309, 2324, 2306,  141, 2306,
456      2318,    0, 2306,  464, 2302, 2315,    0, 2305, 2312,    0,
457      2301, 2310, 2370,  210, 2304,    0,    0, 2359, 2459,    0,
458      2459, 2287, 2367, 2365, 2360,  796,  815, 2459,  822,  841,
459       752,    0, 2459, 2363,  114, 2362,    0,  410,  435,  424,
460       488,  489,  454, 2361,  495,  725,  484,  493, 2360,  726,
461       451, 2359,  673,  730, 2349, 2353,  830,  863, 2301, 2300,
462      2302,  846,  524,  772, 2298, 2322, 2296, 2321,  699,  738,
463
464      2307, 2306,  843,  641,  501, 2305, 2276,    0,  694,  819,
465       821,  823,  849, 2459, 2263,  753, 2345, 2343, 2459, 2459,
466      2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
467      2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
468      2338, 2459,  873,  893,  899,  908,  894,  901,    0,    0,
469      2282, 2279, 2266, 2281, 2280, 2271, 2274, 2269, 2263, 2267,
470      2257, 2269,    0, 2254, 2271, 2258, 2265, 2253,  925,  865,
471      2459,  869, 2255, 2459, 2323,  912,    0,  930,  957, 2322,
472      2248, 2263, 2263, 2318, 2313,  899,  779,  884,  931,  797,
473       900,  932,  671,  933,  934,  935, 2316,  936,  937,  816,
474
475       938,  731, 2233, 2314,  963, 2459, 2459, 2258, 2269,  918,
476      2271, 2266,    0, 2279, 2270, 2277, 2261, 2278, 2264,    0,
477      2248,    0, 2258, 2257, 2245,    0,  928,  897,    0, 2266,
478       953, 2255, 2268,    0, 2256, 2270, 2265,    0, 2258, 2220,
479         0,  966,  984, 2459, 1006, 1000, 2236,    0, 2217,    0,
480      2214, 2212,    0, 2218, 2214, 2207, 2227, 2211, 2215, 2213,
481         0,    0, 2219, 1025,  660, 1034, 1038, 1042, 1046, 1050,
482      1060, 2218, 2459, 1064, 2278, 2277, 1076, 2459, 2459, 2208,
483      2208, 2459, 2270, 2273,  990, 2272,  951,  989, 2271,  956,
484       987,  995, 1004, 1010, 1005, 1006, 2270, 2269, 1048, 2459,
485
486      1089, 2459, 2224, 2212, 2211, 2240, 2209, 2224, 2207, 2218,
487       408, 2222, 2215, 2230, 2232, 2214, 2223,    0, 2199,    0,
488      2224, 2224, 2220, 2214, 2212, 2219, 2220, 2191, 2205, 2202,
489      2201, 2185,    0, 1051, 1098, 1105,    0,    0, 2174, 2175,
490      2176, 2164, 1057, 2168, 2174, 2174, 2169,    0, 1131, 1136,
491      1140, 1144, 1148, 1154, 1158, 2236, 2459, 1144, 1164, 2177,
492      2164, 2459, 2230, 1099, 1108, 1023,  993, 1146, 1147,  140,
493      1165, 1167, 2229, 1176, 1186, 2186,    0, 2199, 2177,    0,
494      2170, 2197, 2179, 2167, 2179, 2165, 2164, 2163, 2175, 2168,
495      2115,    0, 2128, 2138, 2109, 2117, 2104, 2122, 1142, 1193,
496
497      2115, 2099, 2098, 2085, 2077, 2081,    0,    0,    0,    0,
498      2090, 2091,    0, 2069, 1225, 1233, 1239, 1243, 1247, 1251,
499      1259, 1074, 2092, 2066, 1097, 1195, 2120, 2117, 2115, 2098,
500      1172, 1168, 2087, 1196, 2060, 2051, 2038, 2052, 2050, 2032,
501         0, 2017,    0, 1999, 1988, 1973, 1943,    0, 1913, 1937,
502         0, 1936,    0, 1907, 1933,    0, 1245, 1901, 1928,    0,
503      1885,    0, 1887, 1859, 1842, 1823, 1272, 1278, 1282, 1293,
504      1298, 1302, 1306, 1219, 2459, 1228, 1857, 1852, 1880, 1249,
505      1250, 1251, 1270, 1851, 1841, 1806, 1825, 1796, 1795, 1802,
506      1816, 1815, 1796, 1782, 1271, 1799, 1798,    0, 1772,    0,
507
508      1746, 1696,    0,    0, 1679,    0, 1321, 1325, 1346, 1350,
509      1354, 1358, 1362, 1673, 1699, 1725, 1718, 1305, 1717, 1660,
510      1641,    0, 1616,    0,    0, 1626, 1614, 1612, 1611,    0,
511      1610, 1607, 1593, 1474, 1462, 1483, 1458,    0,    0, 1368,
512      1502, 1373, 1378, 1394, 1398, 1402,    0, 1455, 1495, 1439,
513      1450,    0, 1437,    0,    0,    0,    0,    0,    0, 1436,
514      1459, 1441,    0, 1407, 1464, 1203, 1411, 1420, 1428, 1432,
515         0,    0, 1416,    0,    0, 1436, 1434, 1439, 1435, 1445,
516      1451, 1455, 1462, 1393, 1392, 1357, 1288, 2459, 1400, 1287,
517      1424, 1359, 1338,    0, 1335, 1418, 1334, 1326, 1337, 1440,
518
519      1432,    0, 1321, 1301, 1429, 1305, 1290, 1438, 1296, 1262,
520      1446, 1236, 1252, 1368,    0, 1175, 1140, 1070, 1060, 1037,
521      1052,  894,  765,  744,  733,  741,  650,  527,  548, 1485,
522      1507,  408,  396,   96, 2459, 2459, 1533, 1555, 1577, 1599,
523      1621, 1640, 1651, 1475, 1664, 1677, 1696, 1710, 1718, 1738,
524      1760, 1782, 1800, 1819, 1835, 1843, 1860, 1876, 1893, 1912,
525      1934, 1503, 1948, 1960, 1980, 2002, 2024, 2044, 2061, 1504,
526      2077, 2097, 1297, 2113, 2130, 2151, 1709, 2160, 2180, 2202
527     } ;
528
529 static yyconst short int yy_def[881] =
530     {   0,
531       837,  837,  838,  838,  839,  839,  836,    7,  840,  840,
532       836,   11,   11,   13,   11,   15,  841,  841,  836,   19,
533       836,  836,  836,  842,  836,  836,  836,  836,  836,  836,
534       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
535       836,  836,  836,  836,  843,  836,  836,  836,  836,  836,
536       836,  836,  836,  844,  836,  845,  846,  847,  836,  836,
537       845,  836,  845,  845,  836,  836,  845,  836,  845,  845,
538       845,  848,  836,  845,  836,  849,  836,  848,  848,  848,
539       848,  848,  848,  848,  848,  848,  848,  848,  836,  845,
540       836,  845,  845,  850,  851,  852,  853,  854,  845,  836,
541
542       836,  855,  849,  856,  855,  855,  855,  855,  855,  855,
543       855,  855,  855,  855,  855,  836,  857,   99,  836,  849,
544       858,  858,  858,  858,  858,  836,  845,  845,  845,  849,
545       856,  855,  855,  836,  836,  859,  836,  836,  836,  836,
546       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
547       836,  836,  836,  836,  836,  836,  836,  836,  843,  836,
548       836,  836,  836,  836,  836,  836,  836,  844,  836,  842,
549       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
550       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
551       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
552
553       836,  836,  836,  836,  844,  836,  845,  846,  836,  860,
554       836,  861,  845,  845,  836,  836,  836,  862,  845,  836,
555       845,  863,  864,  849,  864,  863,  863,  863,  863,  863,
556       863,  863,  863,  863,  863,  863,  863,  863,  863,  863,
557       863,  863,  836,  865,  836,  866,  867,  867,  836,  868,
558       836,  868,  869,  836,  860,  836,  836,  836,  836,  836,
559       836,  870,  836,  855,  864,  871,  872,  855,  855,  855,
560       855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
561       855,  855,  855,  855,  836,  860,  836,  836,  836,  836,
562       836,  864,  864,  864,  864,  864,  864,  864,  864,  864,
563
564       864,  864,  864,  864,  864,  864,  864,  873,  874,  874,
565       874,  874,  874,  836,  836,  855,  875,  836,  836,  836,
566       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
567       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
568       860,  836,  861,  861,  836,  861,  836,  836,  862,  864,
569       864,  863,  863,  863,  863,  863,  863,  863,  863,  863,
570       863,  863,  863,  863,  863,  863,  863,  863,  876,  865,
571       836,  865,  836,  836,  836,  836,  877,  836,  836,  870,
572       864,  864,  836,  871,  872,  855,  855,  855,  855,  855,
573       855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
574
575       855,  855,  836,  836,  836,  836,  836,  836,  864,  864,
576       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
577       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
578       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
579       878,  874,  874,  836,  836,  836,  864,  863,  863,  863,
580       863,  863,  863,  863,  863,  863,  863,  863,  863,  863,
581       863,  863,  863,  876,  464,  876,  876,  876,  876,  876,
582       876,  836,  836,  836,  877,  836,  836,  836,  836,  864,
583       864,  836,  836,  855,  855,  855,  855,  855,  855,  855,
584       855,  855,  855,  855,  855,  855,  855,  855,  855,  836,
585
586       836,  836,  864,  864,  864,  864,  864,  864,  864,  864,
587       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
588       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
589       864,  864,  878,  874,  836,  836,  864,  863,  863,  863,
590       863,  863,  863,  863,  863,  863,  863,  863,  876,  876,
591       876,  876,  876,  876,  876,  836,  836,  836,  836,  864,
592       864,  836,  855,  855,  855,  855,  855,  855,  855,  855,
593       855,  855,  855,  836,  836,  864,  864,  864,  864,  864,
594       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
595       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
596
597       864,  864,  864,  864,  863,  863,  863,  863,  863,  863,
598       863,  863,  863,  863,  876,  876,  876,  876,  876,  876,
599       876,  879,  864,  864,  855,  855,  855,  855,  855,  855,
600       855,  855,  855,  855,  864,  864,  864,  864,  864,  864,
601       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
602       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
603       864,  863,  863,  863,  863,  863,  876,  876,  876,  876,
604       876,  876,  876,  879,  836,  879,  864,  864,  855,  855,
605       855,  855,  855,  864,  864,  864,  864,  864,  864,  864,
606       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
607
608       864,  864,  863,  863,  863,  863,  876,  876,  876,  876,
609       876,  876,  876,  864,  864,  855,  855,  855,  855,  864,
610       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
611       864,  864,  864,  864,  864,  864,  864,  864,  863,  876,
612       880,  876,  876,  876,  876,  876,  864,  864,  855,  864,
613       864,  864,  864,  864,  864,  864,  864,  864,  864,  864,
614       864,  864,  864,  876,  880,  880,  876,  876,  876,  876,
615       864,  864,  864,  864,  864,  864,  864,  876,  880,  876,
616       876,  876,  876,  864,  864,  864,  783,  836,  880,  783,
617       783,  864,  864,  864,  783,  783,  783,  864,  864,  783,
618
619       783,  864,  864,  836,  783,  864,  836,  783,  864,  836,
620       783,  864,  836,  783,  864,  836,  836,  836,  836,  836,
621       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
622       836,  836,  836,  836,  836,    0,  836,  836,  836,  836,
623       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
624       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
625       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
626       836,  836,  836,  836,  836,  836,  836,  836,  836,  836
627     } ;
628
629 static yyconst short int yy_nxt[2551] =
630     {   0,
631        23,   23,   23,   23,   23,   23,   23,   23,  836,  263,
632       836,   25,  263,  308,  836,   25,   95,   95,  251,  204,
633       204,  204,  204,  204,  204,  135,  135,  135,  135,  248,
634       836,  137,  173,  173,  173,  173,  173,  173,  173,  135,
635       135,  135,  135,  175,  177,  137,  179,  187,  180,  263,
636       192,  206,  206,  206,  206,  181,  244,  176,  836,   26,
637       188,  178,  212,   26,   28,  182,  183,  184,  224,   28,
638       193,  185,  186,  263,  273,  226,  213,   29,   29,   29,
639        29,   29,   29,   29,  138,  227,  225,   96,   96,  252,
640        30,   31,   32,   33,   34,   35,   36,   37,  138,  232,
641
642       228,   38,  249,   39,  229,  233,  234,   40,   41,  195,
643        42,   43,  263,  284,  263,  196,  197,   44,  239,   45,
644       198,  199,   46,   47,  240,  200,  245,   48,  224,  263,
645       268,  263,  265,  241,   49,   50,  263,   51,  263,   52,
646       269,   53,  263,   54,   28,  263,  225,  263,  215,   28,
647       216,  216,  216,  216,  216,  216,  216,   29,   29,   29,
648        29,   29,   29,   29,  836,  263,  308,  257,  175,  192,
649        30,   31,   32,   33,   34,   35,   36,   37,  381,  272,
650       382,   38,  176,   39,  278,  835,  270,   40,   41,  193,
651        42,   43,  277,  206,  206,  206,  206,   44,  274,   45,
652
653       279,  177,   46,   47,  275,  276,  280,   48,  217,  632,
654       355,  316,  371,  372,   49,   50,  218,   51,  178,   52,
655       356,   53,  310,   54,   22,   55,   55,   55,   55,   56,
656        57,   56,   56,   56,   56,   58,   59,   60,   61,   62,
657        63,   64,   56,   65,   66,   66,   66,   66,   66,   66,
658        67,   68,   69,   70,   56,   71,   72,   72,   72,   72,
659        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
660        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
661        72,   72,   73,   74,   75,   56,   76,   77,   72,   72,
662        78,   79,   80,   72,   72,   81,   82,   72,   83,   84,
663
664        72,   85,   72,   86,   72,   87,   72,   72,   88,   72,
665        72,   89,   90,   91,   92,   22,   55,   55,   55,   55,
666        56,   97,   56,   56,   56,   56,   98,   59,   60,   61,
667        62,   99,   64,   56,  100,  101,  101,  101,  101,  101,
668       101,   67,   68,   69,   70,   56,   71,  102,  102,  102,
669       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
670       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
671       102,  102,  102,   73,   74,   75,   56,  103,  104,  102,
672       102,  105,  106,  107,  102,  102,  108,  109,  102,  110,
673       111,  102,  112,  102,  113,  102,  114,  102,  102,  115,
674
675       102,  102,   89,   90,   91,   92,  116,  187,  206,  206,
676       206,  206,  834,  117,  285,  833,   56,  263,  118,   56,
677       188,  119,  119,  119,  119,  119,  119,  119,  263,  308,
678        56,  263,  215,   56,  216,  216,  216,  216,  216,  216,
679       216,  212,  263,  333,  256,  257,  257,  257,  257,  257,
680       257,  179,  584,  180,  585,  213,  263,  308,  263,  263,
681       181,  263,  263,  308,  120,  334,  121,  121,  122,  121,
682       121,  121,  121,  121,  123,  121,  124,  121,  121,  125,
683       121,  121,  121,  121,  121,  121,  121,  121,  121,  126,
684       386,  263,  127,   22,  128,  263,  263,  311,   22,  387,
685
686       263,   56,  263,  129,   56,  388,   22,   22,   22,   22,
687        22,   22,   22,  258,   22,   56,  270,  312,   56,  400,
688       271,  392,  258,  259,  313,  260,  260,  260,  260,  260,
689       260,  260,  287,  360,  288,  288,  288,  288,  288,  288,
690       288,  182,  183,  184,  361,  362,   56,  185,  186,  130,
691       131,  437,  830,  102,  132,  102,  414,  389,  102,  133,
692       398,  102,  102,  438,  102,  397,  102,  390,  102,  391,
693       415,  102,  829,  393,  134,   56,   22,  127,  139,  140,
694       140,  140,  140,  139,  141,  139,  139,  139,  139,  141,
695       139,  139,  139,  139,  142,  139,  139,  143,  143,  143,
696
697       143,  143,  143,  143,  139,  139,  139,  139,  139,  139,
698       144,  145,  146,  147,  148,  149,  150,  151,  139,  139,
699       139,  152,  139,  153,  139,  139,  139,  154,  155,  139,
700       156,  157,  139,  139,  139,  139,  139,  158,  139,  159,
701       139,  139,  160,  161,  139,  139,  139,  162,  139,  139,
702       139,  139,  139,  139,  163,  164,  139,  165,  139,  166,
703       139,  167,  139,  168,  139,  169,  139,  139,  139,  258,
704       263,  173,  173,  173,  173,  173,  173,  173,  263,  259,
705       263,  260,  260,  260,  260,  260,  260,  260,  195,  324,
706       325,  326,  327,  435,  196,  197,  828,  436,  549,  198,
707
708       199,  263,  308,  550,  200,  204,  204,  204,  204,  204,
709       204,  173,  173,  173,  173,  173,  173,  173,  204,  204,
710       204,  204,  204,  204,  206,  206,  206,  206,  344,  345,
711       346,  344,  263,  263,  281,  424,  425,  263,  263,  261,
712       282,  348,  348,  348,  348,  348,  348,  262,  491,  283,
713       289,  401,  290,  347,  347,  347,  347,  347,  347,  347,
714       263,  426,  215,  291,  216,  216,  216,  216,  216,  216,
715       216,  379,  379,  379,  379,  379,  379,  292,  427,  293,
716       294,  827,  295,  826,  428,  296,  263,  297,  298,  299,
717       300,  301,  302,  825,  394,  303,  304,  305,  402,  306,
718
719       429,  824,  399,  258,  263,  395,  396,  224,  416,  417,
720       499,  265,  418,  287,  307,  257,  257,  257,  257,  257,
721       257,  257,  258,  263,  419,  225,  263,  308,  263,  308,
722       263,  308,  287,  395,  257,  257,  257,  257,  257,  257,
723       257,  378,  378,  378,  378,  378,  378,  378,  258,  405,
724       405,  405,  405,  405,  405,  405,  263,  308,  259,  485,
725       260,  260,  260,  260,  260,  260,  260,  371,  372,  488,
726       258,  371,  372,  376,  344,  345,  346,  344,  432,  409,
727       287,  377,  288,  288,  288,  288,  288,  288,  288,  410,
728       433,  263,  497,  411,  344,  345,  346,  344,  412,  442,
729
730       445,  445,  445,  445,  443,  434,  263,  263,  413,  344,
731       345,  346,  344,  347,  347,  347,  347,  347,  347,  347,
732       348,  348,  348,  348,  348,  348,  464,  464,  464,  465,
733       446,  474,  474,  474,  474,  474,  474,  476,  263,  263,
734       263,  263,  263,  263,  263,  263,  521,  823,  486,  378,
735       378,  378,  378,  378,  378,  378,  504,  466,  263,  522,
736       468,  505,  446,  263,  478,  469,  477,  484,  489,  470,
737       476,  519,  506,  263,  308,  471,  379,  379,  379,  379,
738       379,  379,  405,  405,  405,  405,  405,  405,  405,  524,
739       520,  263,  308,  525,  263,  487,  263,  263,  477,  501,
740
741       263,  496,  263,  494,  490,  492,  498,  445,  445,  445,
742       445,  263,  263,  263,  535,  493,  535,  263,  495,  536,
743       536,  536,  536,  536,  536,  536,  464,  464,  464,  464,
744       263,  501,  566,  564,  534,  836,  836,  836,  836,  836,
745       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
746       836,  836,  836,  836,  836,  263,  822,  466,  263,  308,
747       468,  836,  836,  836,  836,  469,  567,  551,  569,  470,
748       563,  478,  565,  821,  628,  471,  675,  676,  552,  571,
749       568,  572,  554,  474,  474,  474,  474,  474,  474,  570,
750       558,  553,  558,  627,  820,  559,  559,  559,  559,  559,
751
752       559,  559,  819,  574,  263,  574,  263,  555,  575,  575,
753       575,  575,  575,  575,  575,  263,  573,  536,  536,  536,
754       536,  536,  536,  536,  536,  536,  536,  536,  536,  536,
755       536,  609,  836,  836,  836,  836,  610,  836,  836,  836,
756       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
757       836,  836,  836,  263,  263,  836,  836,  836,  836,  836,
758       836,  836,  836,  559,  559,  559,  559,  559,  559,  559,
759       615,  476,  263,  625,  263,  263,  616,  818,  679,  263,
760       626,  618,  655,  559,  559,  559,  559,  559,  559,  559,
761       617,  619,  620,  476,  621,  575,  575,  575,  575,  575,
762
763       575,  575,  263,  263,  656,  575,  575,  575,  575,  575,
764       575,  575,  657,  657,  657,  657,  657,  657,  657,  766,
765       629,  675,  676,  631,  817,  630,  836,  836,  836,  836,
766       675,  676,  682,  633,  836,  836,  836,  836,  681,  634,
767       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
768       836,  836,  836,  836,  836,  836,  263,  263,  263,  667,
769       836,  836,  836,  836,  657,  657,  657,  657,  657,  657,
770       657,  680,  683,  836,  836,  836,  836,  263,  668,  836,
771       836,  836,  836,  836,  836,  836,  836,  671,  816,  670,
772       669,  672,  779,  673,  836,  836,  836,  836,  815,  836,
773
774       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
775       836,  731,  263,  813,  708,  441,  441,  718,  717,  716,
776       732,  733,  836,  836,  836,  836,  836,  836,  836,  741,
777       812,  709,  795,  796,  707,  810,  712,  467,  467,  809,
778       719,  807,  710,  711,  467,  467,  713,  836,  836,  836,
779       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
780       836,  836,  836,  836,  836,  836,  836,  800,  740,  836,
781       836,  836,  836,  749,  836,  836,  836,  836,  742,  836,
782       836,  836,  836,  806,  467,  467,  743,  803,  802,  799,
783       744,  467,  467,  798,  746,  836,  836,  836,  836,  836,
784
785       836,  836,  836,  836,  836,  836,  836,  767,  836,  836,
786       836,  836,  836,  836,  836,  836,  766,  764,  467,  794,
787       745,  836,  836,  836,  836,  467,  793,  792,  768,  836,
788       836,  836,  836,  836,  836,  836,  836,  788,  789,  778,
789       836,  836,  836,  836,  804,  770,  836,  836,  836,  836,
790       769,  766,  836,  836,  836,  836,  836,  836,  836,  836,
791       797,  801,  780,  836,  836,  836,  836,  805,  467,  808,
792       786,  781,  783,  782,  467,  467,  785,  787,  784,  467,
793       766,  467,  467,  811,  814,  205,  467,  205,  467,  467,
794       467,  777,  790,  205,  776,  467,  467,  467,  775,  774,
795
796       773,  772,  263,  467,  831,  831,  831,  831,  831,  831,
797       831,  832,  791,  349,  380,  349,  380,  771,  766,  791,
798       763,  349,  380,  762,  761,  760,  831,  831,  831,  831,
799       831,  831,  831,   22,   22,   22,   22,   22,   22,   22,
800        22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
801        22,   22,   22,   22,   22,   24,   24,   24,   24,   24,
802        24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
803        24,   24,   24,   24,   24,   24,   24,   27,   27,   27,
804        27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
805        27,   27,   27,   27,   27,   27,   27,   27,   27,   94,
806
807        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
808        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
809        94,  136,  136,  136,  136,  136,  136,  136,  136,  136,
810       136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
811       136,  136,  136,  170,  170,  170,  170,  170,  170,  170,
812       170,  170,  170,  170,  170,  759,  170,  170,  170,  170,
813       170,  170,  203,  203,  203,  203,  203,  203,  207,  758,
814       207,  207,  757,  756,  755,  207,  754,  753,  752,  207,
815       208,  208,  208,  208,  208,  208,  208,  208,  208,  208,
816       208,  208,  751,  208,  208,  208,  208,  208,  208,  210,
817
818       210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
819       210,  750,  210,  210,  210,  210,  210,  210,  222,  475,
820       222,  475,  222,  222,  263,  263,  222,  475,  222,  222,
821       223,  223,  263,  748,  223,  747,  223,  223,  246,  246,
822       246,  246,  246,  246,  246,  246,  246,  739,  246,  246,
823       246,  246,  246,  246,  246,  246,  246,  246,  738,  246,
824       247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
825       247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
826       737,  247,  250,  250,  250,  250,  250,  250,  250,  250,
827       250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
828
829       250,  250,  250,  253,  253,  253,  253,  253,  253,  253,
830       253,  253,  253,  253,  253,  736,  253,  253,  253,  253,
831       253,  253,  255,  255,  255,  255,  255,  255,  255,  255,
832       255,  255,  255,  255,  735,  255,  255,  255,  255,  255,
833       255,  264,  734,  264,  730,  264,  729,  264,  264,  728,
834       727,  264,  726,  264,  264,  266,  266,  725,  724,  723,
835       266,  266,  266,  286,  286,  286,  286,  286,  722,  286,
836       286,  286,  286,  286,  286,  721,  286,  286,  286,  286,
837       286,  286,  309,  309,  309,  720,  309,  263,  309,  309,
838       715,  714,  309,  706,  309,  309,  317,  317,  317,  317,
839
840       317,  317,  317,  317,  317,  317,  317,  317,  705,  317,
841       317,  317,  317,  317,  317,  341,  341,  341,  341,  341,
842       341,  341,  341,  341,  341,  341,  341,  704,  341,  341,
843       341,  341,  341,  341,  343,  343,  343,  343,  343,  343,
844       343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
845       343,  343,  343,  343,  343,  343,  222,  703,  222,  702,
846       222,  222,  701,  700,  222,  699,  222,  222,  350,  698,
847       350,  697,  350,  350,  696,  695,  350,  694,  350,  350,
848       370,  370,  370,  370,  370,  370,  370,  370,  370,  370,
849       370,  370,  370,  370,  370,  370,  370,  370,  370,  370,
850
851       370,  370,  246,  246,  246,  246,  246,  246,  246,  246,
852       246,  693,  246,  246,  246,  246,  246,  246,  246,  246,
853       246,  246,  692,  246,  247,  247,  247,  247,  247,  247,
854       247,  247,  247,  691,  247,  247,  247,  247,  247,  247,
855       247,  247,  247,  247,  250,  250,  250,  250,  250,  250,
856       250,  250,  250,  690,  250,  250,  250,  250,  250,  250,
857       250,  250,  250,  250,  253,  253,  253,  253,  253,  253,
858       253,  253,  253,  253,  253,  253,  689,  253,  253,  253,
859       253,  253,  253,  384,  688,  384,  687,  384,  686,  384,
860       384,  685,  684,  384,  263,  384,  384,  385,  385,  385,
861
862       385,  385,  385,  385,  385,  263,  385,  385,  385,  385,
863       385,  385,  385,  385,  385,  385,  385,  385,  385,  309,
864       309,  309,  263,  309,  263,  309,  309,  263,  678,  309,
865       677,  309,  309,  317,  317,  317,  317,  317,  317,  317,
866       317,  317,  317,  317,  317,  666,  317,  317,  317,  317,
867       317,  317,  467,  467,  467,  665,  664,  663,  662,  661,
868       660,  659,  658,  467,  467,  654,  653,  467,  533,  652,
869       533,  651,  533,  533,  650,  649,  533,  648,  533,  533,
870       674,  674,  674,  674,  674,  674,  674,  674,  674,  674,
871       674,  674,  674,  674,  674,  674,  674,  674,  674,  674,
872
873       674,  674,  765,  765,  647,  765,  765,  765,  765,  765,
874       765,  765,  765,  765,  765,  765,  765,  765,  765,  765,
875       765,  765,  765,  765,  646,  645,  644,  643,  642,  641,
876       640,  639,  638,  637,  636,  635,  263,  263,  624,  623,
877       622,  614,  613,  612,  611,  608,  607,  606,  605,  604,
878       603,  602,  601,  600,  599,  598,  597,  596,  595,  594,
879       593,  592,  591,  590,  589,  588,  587,  586,  583,  582,
880       581,  580,  579,  578,  577,  576,  263,  263,  263,  263,
881       263,  562,  561,  560,  557,  479,  556,  548,  547,  546,
882       545,  544,  543,  542,  541,  540,  539,  538,  537,  532,
883
884       531,  530,  529,  528,  527,  526,  523,  518,  517,  516,
885       515,  514,  513,  512,  511,  510,  509,  508,  507,  503,
886       502,  473,  500,  263,  483,  383,  482,  481,  480,  479,
887       473,  472,  463,  462,  461,  460,  459,  458,  457,  456,
888       455,  454,  453,  452,  451,  450,  449,  448,  447,  836,
889       319,  318,  444,  440,  439,  431,  430,  423,  422,  421,
890       420,  408,  407,  406,  404,  403,  263,  263,  263,  383,
891       263,  375,  374,  254,  252,  248,  373,  369,  368,  367,
892       366,  365,  364,  363,  359,  358,  357,  354,  353,  352,
893       351,  224,  342,  209,  340,  339,  338,  337,  336,  335,
894
895       332,  331,  330,  329,  328,  323,  322,  321,  172,  171,
896       314,  202,  201,  194,  191,  190,  189,  174,  212,  320,
897       319,  318,  314,  836,  224,  213,  315,  314,  267,  263,
898       211,  254,  243,  242,  238,  237,  236,  235,  231,  230,
899       221,  220,  219,  214,  211,  209,  202,  201,  194,  191,
900       190,  189,  174,  172,  171,  836,   93,   93,   21,  836,
901       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
902       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
903       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
904       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
905
906       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
907       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
908       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
909       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
910       836,  836,  836,  836,  836,  836,  836,  836,  836,  836
911     } ;
912
913 static yyconst short int yy_chk[2551] =
914     {   0,
915         3,    3,    3,    3,    4,    4,    4,    4,    0,  108,
916         0,    3,  121,  121,    0,    4,    9,   10,   96,   50,
917        50,   50,   50,   50,   50,   17,   17,   17,   17,   95,
918         0,   17,   29,   29,   29,   29,   29,   29,   29,   18,
919        18,   18,   18,   31,   32,   18,   33,   35,   33,  115,
920        39,   55,   55,   55,   55,   33,   93,   31,    0,    3,
921        35,   32,   63,    4,    5,   34,   34,   34,   76,    5,
922        39,   34,   34,  105,  108,   78,   63,    5,    5,    5,
923         5,    5,    5,    5,   17,   78,   76,    9,   10,   96,
924         5,    5,    5,    5,    5,    5,    5,    5,   18,   82,
925
926        79,    5,   95,    5,   79,   82,   82,    5,    5,   41,
927         5,    5,  107,  115,  111,   41,   41,    5,   87,    5,
928        41,   41,    5,    5,   87,   41,   93,    5,  103,  132,
929       105,  110,  103,   87,    5,    5,  109,    5,  112,    5,
930       105,    5,  133,    5,    6,  113,  103,  570,   65,    6,
931        65,   65,   65,   65,   65,   65,   65,    6,    6,    6,
932         6,    6,    6,    6,  118,  122,  122,  118,  145,  153,
933         6,    6,    6,    6,    6,    6,    6,    6,  265,  107,
934       265,    6,  145,    6,  111,  834,  132,    6,    6,  153,
935         6,    6,  110,  140,  140,  140,  140,    6,  109,    6,
936
937       112,  146,    6,    6,  109,  109,  113,    6,   65,  570,
938       229,  133,  244,  244,    6,    6,   65,    6,  146,    6,
939       229,    6,  122,    6,    7,    7,    7,    7,    7,    7,
940         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
941         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
942         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
943         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
944         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
945         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
946         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
947
948         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
949         7,    7,    7,    7,    7,   11,   11,   11,   11,   11,
950        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
951        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
952        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
953        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
954        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
955        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
956        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
957        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
958
959        11,   11,   11,   11,   11,   11,   13,  149,  116,  116,
960       116,  116,  833,   13,  116,  832,   13,  268,   13,   13,
961       149,   13,   13,   13,   13,   13,   13,   13,  123,  123,
962        13,  270,   66,   13,   66,   66,   66,   66,   66,   66,
963        66,   99,  269,  186,   99,   99,   99,   99,   99,   99,
964        99,  147,  511,  147,  511,   99,  124,  124,  281,  106,
965       147,  273,  125,  125,   13,  186,   13,   13,   13,   13,
966        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
967        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
968       268,  277,   13,   15,   15,  271,  272,  123,   15,  269,
969
970       278,   15,  275,   15,   15,  270,   15,   15,   15,   15,
971        15,   15,   15,  101,   15,   15,  106,  124,   15,  281,
972       106,  273,  119,  101,  125,  101,  101,  101,  101,  101,
973       101,  101,  119,  234,  119,  119,  119,  119,  119,  119,
974       119,  148,  148,  148,  234,  234,   15,  148,  148,   15,
975        15,  305,  829,   15,   15,   15,  293,  271,   15,   15,
976       278,   15,   15,  305,   15,  277,   15,  271,   15,  272,
977       293,   15,  828,  275,   15,   15,   15,   15,   19,   19,
978        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
979        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
980
981        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
982        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
983        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
984        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
985        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
986        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
987        19,   19,   19,   19,   19,   19,   19,   19,   19,  100,
988       114,  143,  143,  143,  143,  143,  143,  143,  393,  100,
989       283,  100,  100,  100,  100,  100,  100,  100,  155,  179,
990       179,  179,  179,  304,  155,  155,  827,  304,  465,  155,
991
992       155,  309,  309,  465,  155,  164,  164,  164,  164,  164,
993       164,  173,  173,  173,  173,  173,  173,  173,  204,  204,
994       204,  204,  204,  204,  206,  206,  206,  206,  212,  212,
995       212,  212,  276,  280,  114,  299,  299,  284,  402,  100,
996       114,  217,  217,  217,  217,  217,  217,  100,  393,  114,
997       120,  283,  120,  215,  215,  215,  215,  215,  215,  215,
998       316,  299,  216,  120,  216,  216,  216,  216,  216,  216,
999       216,  261,  261,  261,  261,  261,  261,  120,  300,  120,
1000       120,  826,  120,  825,  300,  120,  387,  120,  120,  120,
1001       120,  120,  120,  824,  276,  120,  120,  120,  284,  120,
1002
1003       300,  823,  280,  256,  390,  276,  276,  120,  294,  294,
1004       402,  120,  294,  256,  120,  256,  256,  256,  256,  256,
1005       256,  256,  257,  400,  294,  120,  310,  310,  311,  311,
1006       312,  312,  257,  316,  257,  257,  257,  257,  257,  257,
1007       257,  259,  259,  259,  259,  259,  259,  259,  260,  287,
1008       287,  287,  287,  287,  287,  287,  313,  313,  260,  387,
1009       260,  260,  260,  260,  260,  260,  260,  370,  370,  390,
1010       288,  372,  372,  256,  343,  343,  343,  343,  303,  292,
1011       288,  256,  288,  288,  288,  288,  288,  288,  288,  292,
1012       303,  388,  400,  292,  344,  344,  344,  344,  292,  310,
1013
1014       345,  345,  345,  345,  312,  303,  386,  391,  292,  346,
1015       346,  346,  346,  347,  347,  347,  347,  347,  347,  347,
1016       348,  348,  348,  348,  348,  348,  369,  369,  369,  369,
1017       347,  376,  376,  376,  376,  376,  376,  378,  389,  392,
1018       394,  395,  396,  398,  399,  401,  428,  822,  388,  378,
1019       378,  378,  378,  378,  378,  378,  410,  369,  487,  428,
1020       369,  410,  347,  490,  379,  369,  378,  386,  391,  369,
1021       405,  427,  410,  442,  442,  369,  379,  379,  379,  379,
1022       379,  379,  405,  405,  405,  405,  405,  405,  405,  431,
1023       427,  443,  443,  431,  491,  389,  488,  485,  378,  405,
1024
1025       567,  399,  492,  396,  392,  394,  401,  445,  445,  445,
1026       445,  493,  495,  496,  446,  395,  446,  494,  398,  446,
1027       446,  446,  446,  446,  446,  446,  464,  464,  464,  464,
1028       566,  405,  490,  487,  442,  466,  466,  466,  466,  467,
1029       467,  467,  467,  468,  468,  468,  468,  469,  469,  469,
1030       469,  470,  470,  470,  470,  499,  821,  464,  534,  534,
1031       464,  471,  471,  471,  471,  464,  491,  466,  493,  464,
1032       485,  474,  488,  820,  567,  464,  622,  622,  468,  495,
1033       492,  496,  470,  474,  474,  474,  474,  474,  474,  494,
1034       477,  469,  477,  566,  819,  477,  477,  477,  477,  477,
1035
1036       477,  477,  818,  501,  625,  501,  564,  471,  501,  501,
1037       501,  501,  501,  501,  501,  565,  499,  535,  535,  535,
1038       535,  535,  535,  535,  536,  536,  536,  536,  536,  536,
1039       536,  543,  549,  549,  549,  549,  543,  550,  550,  550,
1040       550,  551,  551,  551,  551,  552,  552,  552,  552,  553,
1041       553,  553,  553,  568,  569,  554,  554,  554,  554,  555,
1042       555,  555,  555,  558,  558,  558,  558,  558,  558,  558,
1043       549,  559,  571,  564,  572,  632,  550,  817,  625,  631,
1044       565,  552,  599,  559,  559,  559,  559,  559,  559,  559,
1045       551,  553,  554,  575,  555,  574,  574,  574,  574,  574,
1046
1047       574,  574,  626,  634,  599,  575,  575,  575,  575,  575,
1048       575,  575,  600,  600,  600,  600,  600,  600,  600,  766,
1049       568,  674,  674,  569,  816,  568,  615,  615,  615,  615,
1050       676,  676,  632,  571,  616,  616,  616,  616,  631,  572,
1051       617,  617,  617,  617,  618,  618,  618,  618,  619,  619,
1052       619,  619,  620,  620,  620,  620,  680,  681,  682,  615,
1053       621,  621,  621,  621,  657,  657,  657,  657,  657,  657,
1054       657,  626,  634,  667,  667,  667,  667,  683,  616,  668,
1055       668,  668,  668,  669,  669,  669,  669,  619,  813,  618,
1056       617,  620,  766,  621,  670,  670,  670,  670,  812,  671,
1057
1058       671,  671,  671,  672,  672,  672,  672,  673,  673,  673,
1059       673,  695,  718,  810,  668,  873,  873,  682,  681,  680,
1060       695,  695,  707,  707,  707,  707,  708,  708,  708,  708,
1061       809,  669,  787,  790,  667,  807,  672,  790,  787,  806,
1062       683,  804,  670,  671,  790,  787,  673,  709,  709,  709,
1063       709,  710,  710,  710,  710,  711,  711,  711,  711,  712,
1064       712,  712,  712,  713,  713,  713,  713,  795,  707,  740,
1065       740,  740,  740,  718,  742,  742,  742,  742,  709,  743,
1066       743,  743,  743,  803,  797,  795,  710,  799,  798,  793,
1067       711,  797,  795,  792,  713,  744,  744,  744,  744,  745,
1068
1069       745,  745,  745,  746,  746,  746,  746,  742,  764,  764,
1070       764,  764,  767,  767,  767,  767,  789,  740,  814,  786,
1071       712,  768,  768,  768,  768,  814,  785,  784,  743,  769,
1072       769,  769,  769,  770,  770,  770,  770,  779,  779,  764,
1073       778,  778,  778,  778,  800,  746,  780,  780,  780,  780,
1074       745,  779,  781,  781,  781,  781,  782,  782,  782,  782,
1075       791,  796,  767,  783,  783,  783,  783,  801,  796,  805,
1076       777,  768,  770,  769,  791,  796,  776,  778,  773,  805,
1077       765,  791,  801,  808,  811,  844,  805,  844,  808,  801,
1078       800,  762,  782,  844,  761,  808,  811,  800,  760,  753,
1079
1080       751,  750,  749,  811,  830,  830,  830,  830,  830,  830,
1081       830,  831,  783,  862,  870,  862,  870,  748,  741,  783,
1082       737,  862,  870,  736,  735,  734,  831,  831,  831,  831,
1083       831,  831,  831,  837,  837,  837,  837,  837,  837,  837,
1084       837,  837,  837,  837,  837,  837,  837,  837,  837,  837,
1085       837,  837,  837,  837,  837,  838,  838,  838,  838,  838,
1086       838,  838,  838,  838,  838,  838,  838,  838,  838,  838,
1087       838,  838,  838,  838,  838,  838,  838,  839,  839,  839,
1088       839,  839,  839,  839,  839,  839,  839,  839,  839,  839,
1089       839,  839,  839,  839,  839,  839,  839,  839,  839,  840,
1090
1091       840,  840,  840,  840,  840,  840,  840,  840,  840,  840,
1092       840,  840,  840,  840,  840,  840,  840,  840,  840,  840,
1093       840,  841,  841,  841,  841,  841,  841,  841,  841,  841,
1094       841,  841,  841,  841,  841,  841,  841,  841,  841,  841,
1095       841,  841,  841,  842,  842,  842,  842,  842,  842,  842,
1096       842,  842,  842,  842,  842,  733,  842,  842,  842,  842,
1097       842,  842,  843,  843,  843,  843,  843,  843,  845,  732,
1098       845,  845,  731,  729,  728,  845,  727,  726,  723,  845,
1099       846,  846,  846,  846,  846,  846,  846,  846,  846,  846,
1100       846,  846,  721,  846,  846,  846,  846,  846,  846,  847,
1101
1102       847,  847,  847,  847,  847,  847,  847,  847,  847,  847,
1103       847,  720,  847,  847,  847,  847,  847,  847,  848,  877,
1104       848,  877,  848,  848,  719,  717,  848,  877,  848,  848,
1105       849,  849,  716,  715,  849,  714,  849,  849,  850,  850,
1106       850,  850,  850,  850,  850,  850,  850,  705,  850,  850,
1107       850,  850,  850,  850,  850,  850,  850,  850,  702,  850,
1108       851,  851,  851,  851,  851,  851,  851,  851,  851,  851,
1109       851,  851,  851,  851,  851,  851,  851,  851,  851,  851,
1110       701,  851,  852,  852,  852,  852,  852,  852,  852,  852,
1111       852,  852,  852,  852,  852,  852,  852,  852,  852,  852,
1112
1113       852,  852,  852,  853,  853,  853,  853,  853,  853,  853,
1114       853,  853,  853,  853,  853,  699,  853,  853,  853,  853,
1115       853,  853,  854,  854,  854,  854,  854,  854,  854,  854,
1116       854,  854,  854,  854,  697,  854,  854,  854,  854,  854,
1117       854,  855,  696,  855,  694,  855,  693,  855,  855,  692,
1118       691,  855,  690,  855,  855,  856,  856,  689,  688,  687,
1119       856,  856,  856,  857,  857,  857,  857,  857,  686,  857,
1120       857,  857,  857,  857,  857,  685,  857,  857,  857,  857,
1121       857,  857,  858,  858,  858,  684,  858,  679,  858,  858,
1122       678,  677,  858,  666,  858,  858,  859,  859,  859,  859,
1123
1124       859,  859,  859,  859,  859,  859,  859,  859,  665,  859,
1125       859,  859,  859,  859,  859,  860,  860,  860,  860,  860,
1126       860,  860,  860,  860,  860,  860,  860,  664,  860,  860,
1127       860,  860,  860,  860,  861,  861,  861,  861,  861,  861,
1128       861,  861,  861,  861,  861,  861,  861,  861,  861,  861,
1129       861,  861,  861,  861,  861,  861,  863,  663,  863,  661,
1130       863,  863,  659,  658,  863,  655,  863,  863,  864,  654,
1131       864,  652,  864,  864,  650,  649,  864,  647,  864,  864,
1132       865,  865,  865,  865,  865,  865,  865,  865,  865,  865,
1133       865,  865,  865,  865,  865,  865,  865,  865,  865,  865,
1134
1135       865,  865,  866,  866,  866,  866,  866,  866,  866,  866,
1136       866,  646,  866,  866,  866,  866,  866,  866,  866,  866,
1137       866,  866,  645,  866,  867,  867,  867,  867,  867,  867,
1138       867,  867,  867,  644,  867,  867,  867,  867,  867,  867,
1139       867,  867,  867,  867,  868,  868,  868,  868,  868,  868,
1140       868,  868,  868,  642,  868,  868,  868,  868,  868,  868,
1141       868,  868,  868,  868,  869,  869,  869,  869,  869,  869,
1142       869,  869,  869,  869,  869,  869,  640,  869,  869,  869,
1143       869,  869,  869,  871,  639,  871,  638,  871,  637,  871,
1144       871,  636,  635,  871,  633,  871,  871,  872,  872,  872,
1145
1146       872,  872,  872,  872,  872,  630,  872,  872,  872,  872,
1147       872,  872,  872,  872,  872,  872,  872,  872,  872,  874,
1148       874,  874,  629,  874,  628,  874,  874,  627,  624,  874,
1149       623,  874,  874,  875,  875,  875,  875,  875,  875,  875,
1150       875,  875,  875,  875,  875,  614,  875,  875,  875,  875,
1151       875,  875,  876,  876,  876,  612,  611,  606,  605,  604,
1152       603,  602,  601,  876,  876,  598,  597,  876,  878,  596,
1153       878,  595,  878,  878,  594,  593,  878,  591,  878,  878,
1154       879,  879,  879,  879,  879,  879,  879,  879,  879,  879,
1155       879,  879,  879,  879,  879,  879,  879,  879,  879,  879,
1156
1157       879,  879,  880,  880,  590,  880,  880,  880,  880,  880,
1158       880,  880,  880,  880,  880,  880,  880,  880,  880,  880,
1159       880,  880,  880,  880,  589,  588,  587,  586,  585,  584,
1160       583,  582,  581,  579,  578,  576,  573,  563,  561,  560,
1161       556,  547,  546,  545,  544,  542,  541,  540,  539,  532,
1162       531,  530,  529,  528,  527,  526,  525,  524,  523,  522,
1163       521,  519,  517,  516,  515,  514,  513,  512,  510,  509,
1164       508,  507,  506,  505,  504,  503,  498,  497,  489,  486,
1165       484,  483,  481,  480,  476,  475,  472,  463,  460,  459,
1166       458,  457,  456,  455,  454,  452,  451,  449,  447,  440,
1167
1168       439,  437,  436,  435,  433,  432,  430,  425,  424,  423,
1169       421,  419,  418,  417,  416,  415,  414,  412,  411,  409,
1170       408,  404,  403,  397,  385,  384,  383,  382,  381,  380,
1171       375,  373,  368,  367,  366,  365,  364,  362,  361,  360,
1172       359,  358,  357,  356,  355,  354,  353,  352,  351,  341,
1173       318,  317,  315,  307,  306,  302,  301,  298,  297,  296,
1174       295,  291,  290,  289,  286,  285,  282,  279,  274,  266,
1175       264,  255,  254,  253,  252,  248,  245,  243,  242,  241,
1176       239,  238,  236,  235,  233,  231,  230,  228,  227,  226,
1177       225,  224,  210,  208,  200,  199,  198,  196,  193,  192,
1178
1179       185,  184,  183,  181,  180,  177,  175,  174,  171,  170,
1180       169,  157,  156,  154,  152,  151,  150,  144,  142,  138,
1181       137,  136,  134,  131,  130,  129,  128,  126,  104,  102,
1182        98,   97,   89,   88,   86,   85,   84,   83,   81,   80,
1183        70,   69,   67,   64,   58,   57,   43,   42,   40,   38,
1184        37,   36,   30,   25,   24,   21,   12,    8,  836,  836,
1185       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1186       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1187       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1188       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1189
1190       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1191       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1192       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1193       836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
1194       836,  836,  836,  836,  836,  836,  836,  836,  836,  836
1195     } ;
1196
1197 static yy_state_type yy_last_accepting_state;
1198 static char *yy_last_accepting_cpos;
1199
1200 /* The intent behind this definition is that it'll catch
1201  * any uses of REJECT which flex missed.
1202  */
1203 #define REJECT reject_used_but_not_detected
1204 #define yymore() yymore_used_but_not_detected
1205 #define YY_MORE_ADJ 0
1206 char *yytext;
1207 #line 1 "yaccParser/hslexer.flex"
1208 #define INITIAL 0
1209 #line 2 "yaccParser/hslexer.flex"
1210 /**********************************************************************
1211 *                                                                     *
1212 *                                                                     *
1213 *       LEX grammar for Haskell.                                      *
1214 *       ------------------------                                      *
1215 *                                                                     *
1216 *       (c) Copyright K. Hammond, University of Glasgow,              *
1217 *               10th. February 1989                                   *
1218 *                                                                     *
1219 *       Modification History                                          *
1220 *       --------------------                                          *
1221 *                                                                     *
1222 *       22/08/91 kh             Initial Haskell 1.1 version.          *
1223 *       18/10/91 kh             Added 'ccall'.                        *
1224 *       19/11/91 kh             Tidied generally.                     *
1225 *       04/12/91 kh             Added Int#.                           *
1226 *       31/01/92 kh             Haskell 1.2 version.                  *
1227 *       24/04/92 ps             Added 'scc'.                          *
1228 *       03/06/92 kh             Changed Infix/Prelude Handling.       *
1229 *       23/08/93 jsm            Changed to support flex               *
1230 *                                                                     *
1231 *                                                                     *
1232 *       Known Problems:                                               *
1233 *                                                                     *
1234 *               None, any more.                                       *
1235 *                                                                     *
1236 **********************************************************************/
1237
1238 #include "../../includes/config.h"
1239
1240 #include <stdio.h>
1241
1242 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
1243 #include <string.h>
1244 /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
1245 #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
1246 #include <memory.h>
1247 #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
1248 #define index strchr
1249 #define rindex strrchr
1250 #define bcopy(s, d, n) memcpy ((d), (s), (n))
1251 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
1252 #define bzero(s, n) memset ((s), 0, (n))
1253 #else /* not STDC_HEADERS and not HAVE_STRING_H */
1254 #include <strings.h>
1255 /* memory.h and strings.h conflict on some systems.  */
1256 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
1257
1258 #include "hspincl.h"
1259 #include "hsparser.tab.h"
1260 #include "constants.h"
1261 #include "utils.h"
1262
1263 /* Our substitute for <ctype.h> */
1264
1265 #define NCHARS  256
1266 #define _S      0x1
1267 #define _D      0x2
1268 #define _H      0x4
1269 #define _O      0x8
1270 #define _C      0x10
1271
1272 #define _isconstr(s)    (CharTable[*s]&(_C))
1273 BOOLEAN isconstr PROTO((char *)); /* fwd decl */
1274
1275 static unsigned char CharTable[NCHARS] = {
1276 /* nul */       0,      0,      0,      0,      0,      0,      0,      0,
1277 /* bs  */       0,      _S,     _S,     _S,     _S,     0,      0,      0,
1278 /* dle */       0,      0,      0,      0,      0,      0,      0,      0,
1279 /* can */       0,      0,      0,      0,      0,      0,      0,      0,
1280 /* sp  */       _S,     0,      0,      0,      0,      0,      0,      0,
1281 /* '(' */       0,      0,      0,      0,      0,      0,      0,      0,
1282 /* '0' */       _D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,
1283 /* '8' */       _D|_H,  _D|_H,  _C,     0,      0,      0,      0,      0,
1284 /* '@' */       0,      _H|_C,  _H|_C,  _H|_C,  _H|_C,  _H|_C,  _H|_C,  _C,
1285 /* 'H' */       _C,     _C,     _C,     _C,     _C,     _C,     _C,     _C,
1286 /* 'P' */       _C,     _C,     _C,     _C,     _C,     _C,     _C,     _C,
1287 /* 'X' */       _C,     _C,     _C,     0,      0,      0,      0,      0,
1288 /* '`' */       0,      _H,     _H,     _H,     _H,     _H,     _H,     0,
1289 /* 'h' */       0,      0,      0,      0,      0,      0,      0,      0,
1290 /* 'p' */       0,      0,      0,      0,      0,      0,      0,      0,
1291 /* 'x' */       0,      0,      0,      0,      0,      0,      0,      0,
1292
1293 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1294 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1295 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1296 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1297 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1298 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1299 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1300 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1301 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1302 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1303 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1304 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1305 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1306 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1307 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1308 /*     */       0,      0,      0,      0,      0,      0,      0,      0,
1309 };
1310
1311 /**********************************************************************
1312 *                                                                     *
1313 *                                                                     *
1314 *      Declarations                                                   *
1315 *                                                                     *
1316 *                                                                     *
1317 **********************************************************************/
1318
1319 char *input_filename = NULL;    /* Always points to a dynamically allocated string */
1320
1321 /*
1322  * For my own sanity, things that are not part of the flex skeleton
1323  * have been renamed as hsXXXXX rather than yyXXXXX.  --JSM
1324  */
1325
1326 static int hslineno = 0;        /* Line number at end of token */
1327 int hsplineno = 0;              /* Line number at end of previous token */
1328
1329 static int hscolno = 0;         /* Column number at end of token */
1330 int hspcolno = 0;               /* Column number at end of previous token */
1331 static int hsmlcolno = 0;       /* Column number for multiple-rule lexemes */
1332
1333 int startlineno = 0;            /* The line number where something starts */
1334 int endlineno = 0;              /* The line number where something ends */
1335
1336 static BOOLEAN noGap = TRUE;    /* For checking string gaps */
1337 static BOOLEAN forgetindent = FALSE;    /* Don't bother applying indentation rules */
1338
1339 static int nested_comments;     /* For counting comment nesting depth */
1340
1341 /* Hacky definition of yywrap: see flex doc.
1342
1343    If we don't do this, then we'll have to get the default
1344    yywrap from the flex library, which is often something
1345    we are not good at locating.  This avoids that difficulty.
1346    (Besides which, this is the way old flexes (pre 2.4.x) did it.)
1347    WDP 94/09/05
1348 */
1349 #define yywrap() 1
1350
1351 /* Essential forward declarations */
1352
1353 static void hsnewid      PROTO((char *, int));
1354 static void layout_input PROTO((char *, int));
1355 static void cleartext    (NO_ARGS);
1356 static void addtext      PROTO((char *, unsigned));
1357 static void addchar      PROTO((char));
1358 static char *fetchtext   PROTO((unsigned *));
1359 static void new_filename PROTO((char *));
1360 static int  Return       PROTO((int));
1361 static void hsentercontext PROTO((int));
1362
1363 /* Special file handling for IMPORTS */
1364 /*  Note: imports only ever go *one deep* (hence no need for a stack) WDP 94/09 */
1365
1366 static YY_BUFFER_STATE hsbuf_save = NULL;       /* Saved input buffer    */
1367 static char *filename_save;             /* File Name                     */
1368 static int hslineno_save = 0,           /* Line Number                   */
1369  hsplineno_save = 0,                    /* Line Number of Prev. token    */
1370  hscolno_save = 0,                      /* Indentation                   */
1371  hspcolno_save = 0;                     /* Left Indentation              */
1372 static short icontexts_save = 0;        /* Indent Context Level          */
1373
1374 static BOOLEAN etags_save; /* saved: whether doing etags stuff or not */
1375 extern BOOLEAN etags;      /* that which is saved */
1376
1377 extern BOOLEAN nonstandardFlag; /* Glasgow extensions allowed */
1378
1379 static BOOLEAN in_interface = FALSE; /* TRUE if we are reading a .hi file */
1380
1381 extern BOOLEAN ignorePragmas;           /* True when we should ignore pragmas */
1382 extern int minAcceptablePragmaVersion;  /* see documentation in main.c */
1383 extern int maxAcceptablePragmaVersion;
1384 extern int thisIfacePragmaVersion;
1385
1386 static int hssttok = -1;        /* Stacked Token: -1   -- no token; -ve  -- ";"
1387                                  * inserted before token +ve  -- "}" inserted before
1388                                  * token */
1389
1390 short icontexts = 0;            /* Which context we're in */
1391
1392
1393
1394 /*
1395         Table of indentations:  right bit indicates whether to use
1396           indentation rules (1 = use rules; 0 = ignore)
1397
1398     partain:
1399     push one of these "contexts" at every "case" or "where"; the right bit says
1400     whether user supplied braces, etc., or not.  pop appropriately (hsendindent).
1401
1402     ALSO, a push/pop when enter/exit a new file (e.g., on importing).  A -1 is
1403     pushed (the "column" for "module", "interface" and EOF).  The -1 from the initial
1404     push is shown just below.
1405
1406 */
1407
1408
1409 static short indenttab[MAX_CONTEXTS] = {-1};
1410
1411 #define INDENTPT (indenttab[icontexts]>>1)
1412 #define INDENTON (indenttab[icontexts]&1)
1413
1414 #define RETURN(tok) return(Return(tok))
1415
1416 #undef YY_DECL
1417 #define YY_DECL int yylex1()
1418
1419 /* We should not peek at yy_act, but flex calls us even for the internal action
1420    triggered on 'end-of-buffer' (This is not true of flex 2.4.4 and up, but
1421    to support older versions of flex, we'll continue to peek for now.
1422  */
1423 #define YY_USER_ACTION \
1424     if (yy_act != YY_END_OF_BUFFER) layout_input(yytext, yyleng);
1425
1426 #if 0/*debug*/
1427 #undef YY_BREAK
1428 #define YY_BREAK if (etags) fprintf(stderr,"%d %d / %d %d / %d\n",hsplineno,hspcolno,hslineno,hscolno,startlineno); break;
1429 #endif
1430
1431 /* Each time we enter a new start state, we push it onto the state stack.
1432    Note that the rules do not allow us to underflow or overflow the stack.
1433    (At least, they shouldn't.)  The maximum expected depth is 4:
1434    0: Code -> 1: String -> 2: StringEsc -> 3: Comment
1435 */
1436 static int StateStack[5];
1437 static int StateDepth = -1;
1438
1439 #ifdef HSP_DEBUG
1440 #define PUSH_STATE(n)   do {\
1441     fprintf(stderr,"Pushing %d (%d)\n", n, StateDepth + 1);\
1442     StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1443 #define POP_STATE       do {--StateDepth;\
1444     fprintf(stderr,"Popping %d (%d)\n", StateStack[StateDepth], StateDepth);\
1445     BEGIN(StateStack[StateDepth]);} while(0)
1446 #else
1447 #define PUSH_STATE(n)   do {StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
1448 #define POP_STATE       do {--StateDepth; BEGIN(StateStack[StateDepth]);} while(0)
1449 #endif
1450
1451 /* The start states are:
1452    Code -- normal Haskell code (principal lexer)
1453    GlaExt -- Haskell code with Glasgow extensions
1454    Comment -- Nested comment processing
1455    String -- Inside a string literal with backslashes
1456    StringEsc -- Immediately following a backslash in a string literal
1457    Char -- Inside a character literal with backslashes
1458    CharEsc -- Immediately following a backslash in a character literal 
1459
1460    Note that the INITIAL state is unused.  Also note that these states
1461    are _exclusive_.  All rules should be prefixed with an appropriate
1462    list of start states.
1463  */
1464 #define Char 1
1465 #define CharEsc 2
1466 #define Code 3
1467 #define Comment 4
1468 #define GlaExt 5
1469 #define GhcPragma 6
1470 #define UserPragma 7
1471 #define String 8
1472 #define StringEsc 9
1473
1474
1475 /* Macros after this point can all be overridden by user definitions in
1476  * section 1.
1477  */
1478
1479 #ifndef YY_SKIP_YYWRAP
1480 #ifdef __cplusplus
1481 extern "C" int yywrap YY_PROTO(( void ));
1482 #else
1483 extern int yywrap YY_PROTO(( void ));
1484 #endif
1485 #endif
1486
1487 #ifndef YY_NO_UNPUT
1488 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1489 #endif
1490
1491 #ifndef yytext_ptr
1492 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1493 #endif
1494
1495 #ifndef YY_NO_INPUT
1496 #ifdef __cplusplus
1497 static int yyinput YY_PROTO(( void ));
1498 #else
1499 static int input YY_PROTO(( void ));
1500 #endif
1501 #endif
1502
1503 #if YY_STACK_USED
1504 static int yy_start_stack_ptr = 0;
1505 static int yy_start_stack_depth = 0;
1506 static int *yy_start_stack = 0;
1507 #ifndef YY_NO_PUSH_STATE
1508 static void yy_push_state YY_PROTO(( int new_state ));
1509 #endif
1510 #ifndef YY_NO_POP_STATE
1511 static void yy_pop_state YY_PROTO(( void ));
1512 #endif
1513 #ifndef YY_NO_TOP_STATE
1514 static int yy_top_state YY_PROTO(( void ));
1515 #endif
1516
1517 #else
1518 #define YY_NO_PUSH_STATE 1
1519 #define YY_NO_POP_STATE 1
1520 #define YY_NO_TOP_STATE 1
1521 #endif
1522
1523 #ifdef YY_MALLOC_DECL
1524 YY_MALLOC_DECL
1525 #else
1526 #if __STDC__
1527 #ifndef __cplusplus
1528 #include <stdlib.h>
1529 #endif
1530 #else
1531 /* Just try to get by without declaring the routines.  This will fail
1532  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1533  * or sizeof(void*) != sizeof(int).
1534  */
1535 #endif
1536 #endif
1537
1538 /* Amount of stuff to slurp up with each read. */
1539 #ifndef YY_READ_BUF_SIZE
1540 #define YY_READ_BUF_SIZE 8192
1541 #endif
1542
1543 /* Copy whatever the last rule matched to the standard output. */
1544
1545 #ifndef ECHO
1546 /* This used to be an fputs(), but since the string might contain NUL's,
1547  * we now use fwrite().
1548  */
1549 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1550 #endif
1551
1552 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1553  * is returned in "result".
1554  */
1555 #ifndef YY_INPUT
1556 #define YY_INPUT(buf,result,max_size) \
1557         if ( yy_current_buffer->yy_is_interactive ) \
1558                 { \
1559                 int c = '*', n; \
1560                 for ( n = 0; n < max_size && \
1561                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1562                         buf[n] = (char) c; \
1563                 if ( c == '\n' ) \
1564                         buf[n++] = (char) c; \
1565                 if ( c == EOF && ferror( yyin ) ) \
1566                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
1567                 result = n; \
1568                 } \
1569         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1570                   && ferror( yyin ) ) \
1571                 YY_FATAL_ERROR( "input in flex scanner failed" );
1572 #endif
1573
1574 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1575  * we don't want an extra ';' after the "return" because that will cause
1576  * some compilers to complain about unreachable statements.
1577  */
1578 #ifndef yyterminate
1579 #define yyterminate() return YY_NULL
1580 #endif
1581
1582 /* Number of entries by which start-condition stack grows. */
1583 #ifndef YY_START_STACK_INCR
1584 #define YY_START_STACK_INCR 25
1585 #endif
1586
1587 /* Report a fatal error. */
1588 #ifndef YY_FATAL_ERROR
1589 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1590 #endif
1591
1592 /* Default declaration of generated scanner - a define so the user can
1593  * easily add parameters.
1594  */
1595 #ifndef YY_DECL
1596 #define YY_DECL int yylex YY_PROTO(( void ))
1597 #endif
1598
1599 /* Code executed at the beginning of each rule, after yytext and yyleng
1600  * have been set up.
1601  */
1602 #ifndef YY_USER_ACTION
1603 #define YY_USER_ACTION
1604 #endif
1605
1606 /* Code executed at the end of each rule. */
1607 #ifndef YY_BREAK
1608 #define YY_BREAK break;
1609 #endif
1610
1611 #define YY_RULE_SETUP \
1612         if ( yyleng > 0 ) \
1613                 yy_current_buffer->yy_at_bol = \
1614                                 (yytext[yyleng - 1] == '\n'); \
1615         YY_USER_ACTION
1616
1617 YY_DECL
1618         {
1619         register yy_state_type yy_current_state;
1620         register char *yy_cp, *yy_bp;
1621         register int yy_act;
1622
1623 #line 277 "yaccParser/hslexer.flex"
1624
1625
1626
1627     /* 
1628      * Special GHC pragma rules.  Do we need a start state for interface files,
1629      * so these won't be matched in source files? --JSM
1630      */
1631
1632
1633
1634         if ( yy_init )
1635                 {
1636                 yy_init = 0;
1637
1638 #ifdef YY_USER_INIT
1639                 YY_USER_INIT;
1640 #endif
1641
1642                 if ( ! yy_start )
1643                         yy_start = 1;   /* first start state */
1644
1645                 if ( ! yyin )
1646                         yyin = stdin;
1647
1648                 if ( ! yyout )
1649                         yyout = stdout;
1650
1651                 if ( ! yy_current_buffer )
1652                         yy_current_buffer =
1653                                 yy_create_buffer( yyin, YY_BUF_SIZE );
1654
1655                 yy_load_buffer_state();
1656                 }
1657
1658         while ( 1 )             /* loops until end-of-file is reached */
1659                 {
1660                 yy_cp = yy_c_buf_p;
1661
1662                 /* Support of yytext. */
1663                 *yy_cp = yy_hold_char;
1664
1665                 /* yy_bp points to the position in yy_ch_buf of the start of
1666                  * the current run.
1667                  */
1668                 yy_bp = yy_cp;
1669
1670                 yy_current_state = yy_start;
1671                 yy_current_state += YY_AT_BOL();
1672 yy_match:
1673                 do
1674                         {
1675                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1676                         if ( yy_accept[yy_current_state] )
1677                                 {
1678                                 yy_last_accepting_state = yy_current_state;
1679                                 yy_last_accepting_cpos = yy_cp;
1680                                 }
1681                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1682                                 {
1683                                 yy_current_state = (int) yy_def[yy_current_state];
1684                                 if ( yy_current_state >= 837 )
1685                                         yy_c = yy_meta[(unsigned int) yy_c];
1686                                 }
1687                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1688                         ++yy_cp;
1689                         }
1690                 while ( yy_base[yy_current_state] != 2459 );
1691
1692 yy_find_action:
1693                 yy_act = yy_accept[yy_current_state];
1694                 if ( yy_act == 0 )
1695                         { /* have to back up */
1696                         yy_cp = yy_last_accepting_cpos;
1697                         yy_current_state = yy_last_accepting_state;
1698                         yy_act = yy_accept[yy_current_state];
1699                         }
1700
1701                 YY_DO_BEFORE_ACTION;
1702
1703
1704 do_action:      /* This label is used only to access EOF actions. */
1705
1706
1707                 switch ( yy_act )
1708         { /* beginning of action switch */
1709                         case 0: /* must back up */
1710                         /* undo the effects of YY_DO_BEFORE_ACTION */
1711                         *yy_cp = yy_hold_char;
1712                         yy_cp = yy_last_accepting_cpos;
1713                         yy_current_state = yy_last_accepting_state;
1714                         goto yy_find_action;
1715
1716 case 1:
1717 YY_RULE_SETUP
1718 #line 286 "yaccParser/hslexer.flex"
1719 {
1720                           char tempf[FILENAME_SIZE];
1721                           sscanf(yytext+1, "%d \"%[^\"]", &hslineno, tempf); 
1722                           new_filename(tempf);
1723                           hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1724                         }
1725         YY_BREAK
1726 case 2:
1727 YY_RULE_SETUP
1728 #line 293 "yaccParser/hslexer.flex"
1729 {
1730                           char tempf[FILENAME_SIZE];
1731                           sscanf(yytext+5, "%d \"%[^\"]", &hslineno, tempf); 
1732                           new_filename(tempf); 
1733                           hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1734                         }
1735         YY_BREAK
1736 case 3:
1737 YY_RULE_SETUP
1738 #line 300 "yaccParser/hslexer.flex"
1739
1740                           /* partain: pragma-style line directive */
1741                           char tempf[FILENAME_SIZE];
1742                           sscanf(yytext+9, "%d \"%[^\"]", &hslineno, tempf); 
1743                           new_filename(tempf);
1744                           hsplineno = hslineno; hscolno = 0; hspcolno = 0;
1745                         }
1746         YY_BREAK
1747 case 4:
1748 YY_RULE_SETUP
1749 #line 307 "yaccParser/hslexer.flex"
1750 {
1751                           sscanf(yytext+33,"%d ",&thisIfacePragmaVersion);
1752                         }
1753         YY_BREAK
1754 case 5:
1755 YY_RULE_SETUP
1756 #line 310 "yaccParser/hslexer.flex"
1757
1758                           if ( ignorePragmas ||
1759                                thisIfacePragmaVersion < minAcceptablePragmaVersion || 
1760                                thisIfacePragmaVersion > maxAcceptablePragmaVersion) {
1761                              nested_comments = 1;
1762                              PUSH_STATE(Comment);
1763                           } else {
1764                              PUSH_STATE(GhcPragma);
1765                              RETURN(GHC_PRAGMA);
1766                           }
1767                         }
1768         YY_BREAK
1769 case 6:
1770 YY_RULE_SETUP
1771 #line 321 "yaccParser/hslexer.flex"
1772 { RETURN(NO_PRAGMA); }
1773         YY_BREAK
1774 case 7:
1775 YY_RULE_SETUP
1776 #line 322 "yaccParser/hslexer.flex"
1777 { RETURN(NOINFO_PRAGMA); }
1778         YY_BREAK
1779 case 8:
1780 YY_RULE_SETUP
1781 #line 323 "yaccParser/hslexer.flex"
1782 { RETURN(ABSTRACT_PRAGMA); }
1783         YY_BREAK
1784 case 9:
1785 YY_RULE_SETUP
1786 #line 324 "yaccParser/hslexer.flex"
1787 { RETURN(DEFOREST_PRAGMA); }
1788         YY_BREAK
1789 case 10:
1790 YY_RULE_SETUP
1791 #line 325 "yaccParser/hslexer.flex"
1792 { RETURN(SPECIALISE_PRAGMA); }
1793         YY_BREAK
1794 case 11:
1795 YY_RULE_SETUP
1796 #line 326 "yaccParser/hslexer.flex"
1797 { RETURN(MODNAME_PRAGMA); }
1798         YY_BREAK
1799 case 12:
1800 YY_RULE_SETUP
1801 #line 327 "yaccParser/hslexer.flex"
1802 { RETURN(ARITY_PRAGMA); }
1803         YY_BREAK
1804 case 13:
1805 YY_RULE_SETUP
1806 #line 328 "yaccParser/hslexer.flex"
1807 { RETURN(UPDATE_PRAGMA); }
1808         YY_BREAK
1809 case 14:
1810 YY_RULE_SETUP
1811 #line 329 "yaccParser/hslexer.flex"
1812 { RETURN(STRICTNESS_PRAGMA); }
1813         YY_BREAK
1814 case 15:
1815 YY_RULE_SETUP
1816 #line 330 "yaccParser/hslexer.flex"
1817 { RETURN(KIND_PRAGMA); }
1818         YY_BREAK
1819 case 16:
1820 YY_RULE_SETUP
1821 #line 331 "yaccParser/hslexer.flex"
1822 { RETURN(MAGIC_UNFOLDING_PRAGMA); }
1823         YY_BREAK
1824 case 17:
1825 YY_RULE_SETUP
1826 #line 332 "yaccParser/hslexer.flex"
1827 { RETURN(UNFOLDING_PRAGMA); }
1828         YY_BREAK
1829 case 18:
1830 YY_RULE_SETUP
1831 #line 334 "yaccParser/hslexer.flex"
1832 { RETURN(COCON); }
1833         YY_BREAK
1834 case 19:
1835 YY_RULE_SETUP
1836 #line 335 "yaccParser/hslexer.flex"
1837 { RETURN(COPRIM); }
1838         YY_BREAK
1839 case 20:
1840 YY_RULE_SETUP
1841 #line 336 "yaccParser/hslexer.flex"
1842 { RETURN(COAPP); }
1843         YY_BREAK
1844 case 21:
1845 YY_RULE_SETUP
1846 #line 337 "yaccParser/hslexer.flex"
1847 { RETURN(COTYAPP); }
1848         YY_BREAK
1849 case 22:
1850 YY_RULE_SETUP
1851 #line 338 "yaccParser/hslexer.flex"
1852 { RETURN(CO_ALG_ALTS); }
1853         YY_BREAK
1854 case 23:
1855 YY_RULE_SETUP
1856 #line 339 "yaccParser/hslexer.flex"
1857 { RETURN(CO_PRIM_ALTS); }
1858         YY_BREAK
1859 case 24:
1860 YY_RULE_SETUP
1861 #line 340 "yaccParser/hslexer.flex"
1862 { RETURN(CO_NO_DEFAULT); }
1863         YY_BREAK
1864 case 25:
1865 YY_RULE_SETUP
1866 #line 341 "yaccParser/hslexer.flex"
1867 { RETURN(CO_LETREC); }
1868         YY_BREAK
1869 case 26:
1870 YY_RULE_SETUP
1871 #line 343 "yaccParser/hslexer.flex"
1872 { RETURN(CO_PRELUDE_DICTS_CC); }
1873         YY_BREAK
1874 case 27:
1875 YY_RULE_SETUP
1876 #line 344 "yaccParser/hslexer.flex"
1877 { RETURN(CO_ALL_DICTS_CC); }
1878         YY_BREAK
1879 case 28:
1880 YY_RULE_SETUP
1881 #line 345 "yaccParser/hslexer.flex"
1882 { RETURN(CO_USER_CC); }
1883         YY_BREAK
1884 case 29:
1885 YY_RULE_SETUP
1886 #line 346 "yaccParser/hslexer.flex"
1887 { RETURN(CO_AUTO_CC); }
1888         YY_BREAK
1889 case 30:
1890 YY_RULE_SETUP
1891 #line 347 "yaccParser/hslexer.flex"
1892 { RETURN(CO_DICT_CC); }
1893         YY_BREAK
1894 case 31:
1895 YY_RULE_SETUP
1896 #line 349 "yaccParser/hslexer.flex"
1897 { RETURN(CO_DUPD_CC); }
1898         YY_BREAK
1899 case 32:
1900 YY_RULE_SETUP
1901 #line 350 "yaccParser/hslexer.flex"
1902 { RETURN(CO_CAF_CC); }
1903         YY_BREAK
1904 case 33:
1905 YY_RULE_SETUP
1906 #line 352 "yaccParser/hslexer.flex"
1907 { RETURN(CO_SDSEL_ID); }
1908         YY_BREAK
1909 case 34:
1910 YY_RULE_SETUP
1911 #line 353 "yaccParser/hslexer.flex"
1912 { RETURN(CO_METH_ID); }
1913         YY_BREAK
1914 case 35:
1915 YY_RULE_SETUP
1916 #line 354 "yaccParser/hslexer.flex"
1917 { RETURN(CO_DEFM_ID); }
1918         YY_BREAK
1919 case 36:
1920 YY_RULE_SETUP
1921 #line 355 "yaccParser/hslexer.flex"
1922 { RETURN(CO_DFUN_ID); }
1923         YY_BREAK
1924 case 37:
1925 YY_RULE_SETUP
1926 #line 356 "yaccParser/hslexer.flex"
1927 { RETURN(CO_CONSTM_ID); }
1928         YY_BREAK
1929 case 38:
1930 YY_RULE_SETUP
1931 #line 357 "yaccParser/hslexer.flex"
1932 { RETURN(CO_SPEC_ID); }
1933         YY_BREAK
1934 case 39:
1935 YY_RULE_SETUP
1936 #line 358 "yaccParser/hslexer.flex"
1937 { RETURN(CO_WRKR_ID); }
1938         YY_BREAK
1939 case 40:
1940 YY_RULE_SETUP
1941 #line 359 "yaccParser/hslexer.flex"
1942 { RETURN(CO_ORIG_NM); /* fully-qualified original name*/ }
1943         YY_BREAK
1944 case 41:
1945 YY_RULE_SETUP
1946 #line 361 "yaccParser/hslexer.flex"
1947 { RETURN(UNFOLD_ALWAYS); }
1948         YY_BREAK
1949 case 42:
1950 YY_RULE_SETUP
1951 #line 362 "yaccParser/hslexer.flex"
1952 { RETURN(UNFOLD_IF_ARGS); }
1953         YY_BREAK
1954 case 43:
1955 YY_RULE_SETUP
1956 #line 364 "yaccParser/hslexer.flex"
1957 { RETURN(NOREP_INTEGER); }
1958         YY_BREAK
1959 case 44:
1960 YY_RULE_SETUP
1961 #line 365 "yaccParser/hslexer.flex"
1962 { RETURN(NOREP_RATIONAL); }
1963         YY_BREAK
1964 case 45:
1965 YY_RULE_SETUP
1966 #line 366 "yaccParser/hslexer.flex"
1967 { RETURN(NOREP_STRING); }
1968         YY_BREAK
1969 case 46:
1970 YY_RULE_SETUP
1971 #line 368 "yaccParser/hslexer.flex"
1972 { POP_STATE; RETURN(END_PRAGMA); }
1973         YY_BREAK
1974 case 47:
1975 YY_RULE_SETUP
1976 #line 370 "yaccParser/hslexer.flex"
1977 {
1978                               PUSH_STATE(UserPragma);
1979                               RETURN(SPECIALISE_UPRAGMA);
1980                             }
1981         YY_BREAK
1982 case 48:
1983 YY_RULE_SETUP
1984 #line 374 "yaccParser/hslexer.flex"
1985 {
1986                               PUSH_STATE(UserPragma);
1987                               RETURN(INLINE_UPRAGMA);
1988                             }
1989         YY_BREAK
1990 case 49:
1991 YY_RULE_SETUP
1992 #line 378 "yaccParser/hslexer.flex"
1993 {
1994                               PUSH_STATE(UserPragma);
1995                               RETURN(MAGIC_UNFOLDING_UPRAGMA);
1996                             }
1997         YY_BREAK
1998 case 50:
1999 YY_RULE_SETUP
2000 #line 382 "yaccParser/hslexer.flex"
2001 {
2002                               PUSH_STATE(UserPragma);
2003                               RETURN(DEFOREST_UPRAGMA);
2004                             }
2005         YY_BREAK
2006 case 51:
2007 YY_RULE_SETUP
2008 #line 386 "yaccParser/hslexer.flex"
2009 {
2010                               PUSH_STATE(UserPragma);
2011                               RETURN(ABSTRACT_UPRAGMA);
2012                             }
2013         YY_BREAK
2014 case 52:
2015 YY_RULE_SETUP
2016 #line 390 "yaccParser/hslexer.flex"
2017 {
2018                               fprintf(stderr, "Warning: \"%s\", line %d: Unrecognised pragma '",
2019                                 input_filename, hsplineno);
2020                               format_string(stderr, (unsigned char *) yytext, yyleng);
2021                               fputs("'\n", stderr);
2022                               nested_comments = 1;
2023                               PUSH_STATE(Comment);
2024                             }
2025         YY_BREAK
2026 case 53:
2027 YY_RULE_SETUP
2028 #line 398 "yaccParser/hslexer.flex"
2029 { POP_STATE; RETURN(END_UPRAGMA); }
2030         YY_BREAK
2031
2032     /*
2033      * Haskell keywords.  `scc' is actually a Glasgow extension, but it is
2034      * intentionally accepted as a keyword even for normal <Code>.
2035      */
2036
2037 case 54:
2038 YY_RULE_SETUP
2039 #line 407 "yaccParser/hslexer.flex"
2040 { RETURN(CASE); }
2041         YY_BREAK
2042 case 55:
2043 YY_RULE_SETUP
2044 #line 408 "yaccParser/hslexer.flex"
2045 { RETURN(CLASS); }
2046         YY_BREAK
2047 case 56:
2048 YY_RULE_SETUP
2049 #line 409 "yaccParser/hslexer.flex"
2050 { RETURN(DATA); }
2051         YY_BREAK
2052 case 57:
2053 YY_RULE_SETUP
2054 #line 410 "yaccParser/hslexer.flex"
2055 { RETURN(DEFAULT); }
2056         YY_BREAK
2057 case 58:
2058 YY_RULE_SETUP
2059 #line 411 "yaccParser/hslexer.flex"
2060 { RETURN(DERIVING); }
2061         YY_BREAK
2062 case 59:
2063 YY_RULE_SETUP
2064 #line 412 "yaccParser/hslexer.flex"
2065 { RETURN(ELSE); }
2066         YY_BREAK
2067 case 60:
2068 YY_RULE_SETUP
2069 #line 413 "yaccParser/hslexer.flex"
2070 { RETURN(HIDING); }
2071         YY_BREAK
2072 case 61:
2073 YY_RULE_SETUP
2074 #line 414 "yaccParser/hslexer.flex"
2075 { RETURN(IF); }
2076         YY_BREAK
2077 case 62:
2078 YY_RULE_SETUP
2079 #line 415 "yaccParser/hslexer.flex"
2080 { RETURN(IMPORT); }
2081         YY_BREAK
2082 case 63:
2083 YY_RULE_SETUP
2084 #line 416 "yaccParser/hslexer.flex"
2085 { RETURN(INFIX); }
2086         YY_BREAK
2087 case 64:
2088 YY_RULE_SETUP
2089 #line 417 "yaccParser/hslexer.flex"
2090 { RETURN(INFIXL); }
2091         YY_BREAK
2092 case 65:
2093 YY_RULE_SETUP
2094 #line 418 "yaccParser/hslexer.flex"
2095 { RETURN(INFIXR); }
2096         YY_BREAK
2097 case 66:
2098 YY_RULE_SETUP
2099 #line 419 "yaccParser/hslexer.flex"
2100 { RETURN(INSTANCE); }
2101         YY_BREAK
2102 case 67:
2103 YY_RULE_SETUP
2104 #line 420 "yaccParser/hslexer.flex"
2105 { RETURN(INTERFACE); }
2106         YY_BREAK
2107 case 68:
2108 YY_RULE_SETUP
2109 #line 421 "yaccParser/hslexer.flex"
2110 { RETURN(MODULE); }
2111         YY_BREAK
2112 case 69:
2113 YY_RULE_SETUP
2114 #line 422 "yaccParser/hslexer.flex"
2115 { RETURN(OF); }
2116         YY_BREAK
2117 case 70:
2118 YY_RULE_SETUP
2119 #line 423 "yaccParser/hslexer.flex"
2120 { RETURN(RENAMING); }
2121         YY_BREAK
2122 case 71:
2123 YY_RULE_SETUP
2124 #line 424 "yaccParser/hslexer.flex"
2125 { RETURN(THEN); }
2126         YY_BREAK
2127 case 72:
2128 YY_RULE_SETUP
2129 #line 425 "yaccParser/hslexer.flex"
2130 { RETURN(TO); }
2131         YY_BREAK
2132 case 73:
2133 YY_RULE_SETUP
2134 #line 426 "yaccParser/hslexer.flex"
2135 { RETURN(TYPE); }
2136         YY_BREAK
2137 case 74:
2138 YY_RULE_SETUP
2139 #line 427 "yaccParser/hslexer.flex"
2140 { RETURN(WHERE); }
2141         YY_BREAK
2142 case 75:
2143 YY_RULE_SETUP
2144 #line 428 "yaccParser/hslexer.flex"
2145 { RETURN(IN); }
2146         YY_BREAK
2147 case 76:
2148 YY_RULE_SETUP
2149 #line 429 "yaccParser/hslexer.flex"
2150 { RETURN(LET); }
2151         YY_BREAK
2152 case 77:
2153 YY_RULE_SETUP
2154 #line 430 "yaccParser/hslexer.flex"
2155 { RETURN(CCALL); }
2156         YY_BREAK
2157 case 78:
2158 YY_RULE_SETUP
2159 #line 431 "yaccParser/hslexer.flex"
2160 { RETURN(CCALL_GC); }
2161         YY_BREAK
2162 case 79:
2163 YY_RULE_SETUP
2164 #line 432 "yaccParser/hslexer.flex"
2165 { RETURN(CASM); }
2166         YY_BREAK
2167 case 80:
2168 YY_RULE_SETUP
2169 #line 433 "yaccParser/hslexer.flex"
2170 { RETURN(CASM_GC); }
2171         YY_BREAK
2172 case 81:
2173 YY_RULE_SETUP
2174 #line 434 "yaccParser/hslexer.flex"
2175 { RETURN(SCC); }
2176         YY_BREAK
2177 case 82:
2178 YY_RULE_SETUP
2179 #line 435 "yaccParser/hslexer.flex"
2180 { RETURN(FORALL); }
2181         YY_BREAK
2182
2183     /* 
2184      * Haskell operators.  Nothing special about these.
2185      */
2186
2187 case 83:
2188 YY_RULE_SETUP
2189 #line 443 "yaccParser/hslexer.flex"
2190 { RETURN(DOTDOT); }
2191         YY_BREAK
2192 case 84:
2193 YY_RULE_SETUP
2194 #line 444 "yaccParser/hslexer.flex"
2195 { RETURN(SEMI); }
2196         YY_BREAK
2197 case 85:
2198 YY_RULE_SETUP
2199 #line 445 "yaccParser/hslexer.flex"
2200 { RETURN(COMMA); }
2201         YY_BREAK
2202 case 86:
2203 YY_RULE_SETUP
2204 #line 446 "yaccParser/hslexer.flex"
2205 { RETURN(VBAR); }
2206         YY_BREAK
2207 case 87:
2208 YY_RULE_SETUP
2209 #line 447 "yaccParser/hslexer.flex"
2210 { RETURN(EQUAL); }
2211         YY_BREAK
2212 case 88:
2213 YY_RULE_SETUP
2214 #line 448 "yaccParser/hslexer.flex"
2215 { RETURN(LARROW); }
2216         YY_BREAK
2217 case 89:
2218 YY_RULE_SETUP
2219 #line 449 "yaccParser/hslexer.flex"
2220 { RETURN(RARROW); }
2221         YY_BREAK
2222 case 90:
2223 YY_RULE_SETUP
2224 #line 450 "yaccParser/hslexer.flex"
2225 { RETURN(DARROW); }
2226         YY_BREAK
2227 case 91:
2228 YY_RULE_SETUP
2229 #line 451 "yaccParser/hslexer.flex"
2230 { RETURN(DCOLON); }
2231         YY_BREAK
2232 case 92:
2233 YY_RULE_SETUP
2234 #line 452 "yaccParser/hslexer.flex"
2235 { RETURN(OPAREN); }
2236         YY_BREAK
2237 case 93:
2238 YY_RULE_SETUP
2239 #line 453 "yaccParser/hslexer.flex"
2240 { RETURN(CPAREN); }
2241         YY_BREAK
2242 case 94:
2243 YY_RULE_SETUP
2244 #line 454 "yaccParser/hslexer.flex"
2245 { RETURN(OBRACK); }
2246         YY_BREAK
2247 case 95:
2248 YY_RULE_SETUP
2249 #line 455 "yaccParser/hslexer.flex"
2250 { RETURN(CBRACK); }
2251         YY_BREAK
2252 case 96:
2253 YY_RULE_SETUP
2254 #line 456 "yaccParser/hslexer.flex"
2255 { RETURN(OCURLY); }
2256         YY_BREAK
2257 case 97:
2258 YY_RULE_SETUP
2259 #line 457 "yaccParser/hslexer.flex"
2260 { RETURN(CCURLY); }
2261         YY_BREAK
2262 case 98:
2263 YY_RULE_SETUP
2264 #line 458 "yaccParser/hslexer.flex"
2265 { RETURN(PLUS); }
2266         YY_BREAK
2267 case 99:
2268 YY_RULE_SETUP
2269 #line 459 "yaccParser/hslexer.flex"
2270 { RETURN(AT); }
2271         YY_BREAK
2272 case 100:
2273 YY_RULE_SETUP
2274 #line 460 "yaccParser/hslexer.flex"
2275 { RETURN(LAMBDA); }
2276         YY_BREAK
2277 case 101:
2278 YY_RULE_SETUP
2279 #line 461 "yaccParser/hslexer.flex"
2280 { RETURN(TYLAMBDA); }
2281         YY_BREAK
2282 case 102:
2283 YY_RULE_SETUP
2284 #line 462 "yaccParser/hslexer.flex"
2285 { RETURN(WILDCARD); }
2286         YY_BREAK
2287 case 103:
2288 YY_RULE_SETUP
2289 #line 463 "yaccParser/hslexer.flex"
2290 { RETURN(BQUOTE); }
2291         YY_BREAK
2292 case 104:
2293 YY_RULE_SETUP
2294 #line 464 "yaccParser/hslexer.flex"
2295 { RETURN(LAZY); }
2296         YY_BREAK
2297 case 105:
2298 YY_RULE_SETUP
2299 #line 465 "yaccParser/hslexer.flex"
2300 { RETURN(MINUS); }
2301         YY_BREAK
2302
2303     /*
2304      * Integers and (for Glasgow extensions) primitive integers.  Note that
2305      * we pass all of the text on to the parser, because flex/C can't handle
2306      * arbitrary precision numbers.
2307      */
2308
2309 case 106:
2310 YY_RULE_SETUP
2311 #line 475 "yaccParser/hslexer.flex"
2312 { /* octal */
2313                          yylval.uid = xstrndup(yytext, yyleng - 1);
2314                          RETURN(INTPRIM);
2315                         }
2316         YY_BREAK
2317 case 107:
2318 YY_RULE_SETUP
2319 #line 479 "yaccParser/hslexer.flex"
2320 { /* octal */
2321                          yylval.uid = xstrndup(yytext, yyleng);
2322                          RETURN(INTEGER);
2323                         }
2324         YY_BREAK
2325 case 108:
2326 YY_RULE_SETUP
2327 #line 483 "yaccParser/hslexer.flex"
2328 { /* hexadecimal */
2329                          yylval.uid = xstrndup(yytext, yyleng - 1);
2330                          RETURN(INTPRIM);
2331                         }
2332         YY_BREAK
2333 case 109:
2334 YY_RULE_SETUP
2335 #line 487 "yaccParser/hslexer.flex"
2336 { /* hexadecimal */
2337                          yylval.uid = xstrndup(yytext, yyleng);
2338                          RETURN(INTEGER);
2339                         }
2340         YY_BREAK
2341 case 110:
2342 YY_RULE_SETUP
2343 #line 491 "yaccParser/hslexer.flex"
2344 {
2345                          yylval.uid = xstrndup(yytext, yyleng - 1);
2346                          RETURN(INTPRIM);
2347                         }
2348         YY_BREAK
2349 case 111:
2350 YY_RULE_SETUP
2351 #line 495 "yaccParser/hslexer.flex"
2352 {
2353                          yylval.uid = xstrndup(yytext, yyleng);
2354                          RETURN(INTEGER);
2355                         }
2356         YY_BREAK
2357
2358     /*
2359      * Floats and (for Glasgow extensions) primitive floats/doubles.
2360      */
2361
2362 case 112:
2363 YY_RULE_SETUP
2364 #line 506 "yaccParser/hslexer.flex"
2365 {
2366                          yylval.uid = xstrndup(yytext, yyleng - 2);
2367                          RETURN(DOUBLEPRIM);
2368                         }
2369         YY_BREAK
2370 case 113:
2371 YY_RULE_SETUP
2372 #line 510 "yaccParser/hslexer.flex"
2373 {
2374                          yylval.uid = xstrndup(yytext, yyleng - 1);
2375                          RETURN(FLOATPRIM);
2376                         }
2377         YY_BREAK
2378 case 114:
2379 YY_RULE_SETUP
2380 #line 514 "yaccParser/hslexer.flex"
2381 {
2382                          yylval.uid = xstrndup(yytext, yyleng);
2383                          RETURN(FLOAT);
2384                         }
2385         YY_BREAK
2386
2387     /*
2388      * Funky ``foo'' style C literals for Glasgow extensions
2389      */
2390
2391 case 115:
2392 YY_RULE_SETUP
2393 #line 525 "yaccParser/hslexer.flex"
2394 {
2395                          hsnewid(yytext + 2, yyleng - 4);
2396                          RETURN(CLITLIT);
2397                         }
2398         YY_BREAK
2399
2400     /*
2401      * Identifiers, both variables and operators.  The trailing hash is allowed
2402      * for Glasgow extensions.
2403      */
2404
2405 case 116:
2406 YY_RULE_SETUP
2407 #line 537 "yaccParser/hslexer.flex"
2408 { hsnewid(yytext, yyleng); RETURN(CONID); }
2409         YY_BREAK
2410 case 117:
2411 YY_RULE_SETUP
2412 #line 538 "yaccParser/hslexer.flex"
2413 { hsnewid(yytext, yyleng); RETURN(CONID); }
2414         YY_BREAK
2415 case 118:
2416 YY_RULE_SETUP
2417 #line 539 "yaccParser/hslexer.flex"
2418 { hsnewid(yytext, yyleng); RETURN(TYVAR_TEMPLATE_ID); }
2419         YY_BREAK
2420 case 119:
2421 YY_RULE_SETUP
2422 #line 541 "yaccParser/hslexer.flex"
2423
2424                          hsnewid(yytext, yyleng);
2425                          RETURN(_isconstr(yytext) ? CONID : VARID);
2426                         }
2427         YY_BREAK
2428
2429 /* This SHOULDNAE work in "Code" (sigh) */
2430
2431 case 120:
2432 YY_RULE_SETUP
2433 #line 548 "yaccParser/hslexer.flex"
2434
2435                          if (! (nonstandardFlag || in_interface)) {
2436                             char errbuf[ERR_BUF_SIZE];
2437                             sprintf(errbuf, "Non-standard identifier (leading underscore): %s\n", yytext);
2438                             hsperror(errbuf);
2439                          }
2440                          hsnewid(yytext, yyleng);
2441                          RETURN(isconstr(yytext) ? CONID : VARID);
2442                          /* NB: ^^^^^^^^ : not the macro! */
2443                         }
2444         YY_BREAK
2445 case 121:
2446 YY_RULE_SETUP
2447 #line 558 "yaccParser/hslexer.flex"
2448 {
2449                          hsnewid(yytext, yyleng);
2450                          RETURN(_isconstr(yytext) ? CONID : VARID);
2451                         }
2452         YY_BREAK
2453 case 122:
2454 YY_RULE_SETUP
2455 #line 562 "yaccParser/hslexer.flex"
2456 {
2457                          hsnewid(yytext, yyleng);
2458                          RETURN(_isconstr(yytext) ? CONSYM : VARSYM);
2459                         }
2460         YY_BREAK
2461
2462     /* Why is `{Id}#` matched this way, and `{Id}` lexed as three tokens? --JSM */
2463
2464     /* Because we can make the former well-behaved (we defined them).
2465
2466        Sadly, the latter is defined by Haskell, which allows such
2467        la-la land constructs as `{-a 900-line comment-} foo`.  (WDP 94/12)
2468     */
2469
2470 case 123:
2471 YY_RULE_SETUP
2472 #line 577 "yaccParser/hslexer.flex"
2473 {       
2474                          hsnewid(yytext + 1, yyleng - 2);
2475                          RETURN(_isconstr(yytext+1) ? CONSYM : VARSYM);
2476                         }
2477         YY_BREAK
2478
2479     /*
2480      * Character literals.  The first form is the quick form, for character
2481      * literals that don't contain backslashes.  Literals with backslashes are
2482      * lexed through multiple rules.  First, we match the open ' and as many
2483      * normal characters as possible.  This puts us into the <Char> state, where
2484      * a backslash is legal.  Then, we match the backslash and move into the 
2485      * <CharEsc> state.  When we drop out of <CharEsc>, we collect more normal
2486      * characters and the close '.  We may end up with too many characters, but
2487      * this allows us to easily share the lex rules with strings.  Excess characters
2488      * are ignored with a warning.
2489      */
2490
2491 case 124:
2492 YY_RULE_SETUP
2493 #line 596 "yaccParser/hslexer.flex"
2494 {
2495                          yylval.uhstring = installHstring(1, yytext+1);
2496                          RETURN(CHARPRIM);
2497                         }
2498         YY_BREAK
2499 case 125:
2500 YY_RULE_SETUP
2501 #line 600 "yaccParser/hslexer.flex"
2502 {
2503                          yylval.uhstring = installHstring(1, yytext+1);
2504                          RETURN(CHAR);
2505                         }
2506         YY_BREAK
2507 case 126:
2508 YY_RULE_SETUP
2509 #line 604 "yaccParser/hslexer.flex"
2510 {char errbuf[ERR_BUF_SIZE];
2511                          sprintf(errbuf, "'' is not a valid character (or string) literal\n");
2512                          hsperror(errbuf);
2513                         }
2514         YY_BREAK
2515 case 127:
2516 YY_RULE_SETUP
2517 #line 608 "yaccParser/hslexer.flex"
2518 {
2519                          hsmlcolno = hspcolno;
2520                          cleartext();
2521                          addtext(yytext+1, yyleng-1);
2522                          PUSH_STATE(Char);
2523                         }
2524         YY_BREAK
2525 case 128:
2526 YY_RULE_SETUP
2527 #line 614 "yaccParser/hslexer.flex"
2528 {
2529                          unsigned length;
2530                          char *text;
2531
2532                          addtext(yytext, yyleng - 2);
2533                          text = fetchtext(&length);
2534
2535                          if (! (nonstandardFlag || in_interface)) {
2536                             char errbuf[ERR_BUF_SIZE];
2537                             sprintf(errbuf, "`Char-hash' literals are non-standard: %s\n", text);
2538                             hsperror(errbuf);
2539                          }
2540
2541                          if (length > 1) {
2542                             fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '",
2543                               input_filename, hsplineno, hspcolno + 1);
2544                             format_string(stderr, (unsigned char *) text, length);
2545                             fputs("' too long\n", stderr);
2546                             hsperror("");
2547                          }
2548                          yylval.uhstring = installHstring(1, text);
2549                          hspcolno = hsmlcolno;
2550                          POP_STATE;
2551                          RETURN(CHARPRIM); 
2552                         }
2553         YY_BREAK
2554 case 129:
2555 YY_RULE_SETUP
2556 #line 639 "yaccParser/hslexer.flex"
2557 {
2558                          unsigned length;
2559                          char *text;
2560
2561                          addtext(yytext, yyleng - 1);
2562                          text = fetchtext(&length);
2563
2564                          if (length > 1) {
2565                             fprintf(stderr, "\"%s\", line %d, column %d: Character literal '",
2566                               input_filename, hsplineno, hspcolno + 1);
2567                             format_string(stderr, (unsigned char *) text, length);
2568                             fputs("' too long\n", stderr);
2569                             hsperror("");
2570                          }
2571                          yylval.uhstring = installHstring(1, text);
2572                          hspcolno = hsmlcolno;
2573                          POP_STATE;
2574                          RETURN(CHAR); 
2575                         }
2576         YY_BREAK
2577 case 130:
2578 YY_RULE_SETUP
2579 #line 658 "yaccParser/hslexer.flex"
2580 { addtext(yytext, yyleng); }
2581         YY_BREAK
2582
2583     /*
2584      * String literals.  The first form is the quick form, for string literals
2585      * that don't contain backslashes.  Literals with backslashes are lexed
2586      * through multiple rules.  First, we match the open " and as many normal
2587      * characters as possible.  This puts us into the <String> state, where
2588      * a backslash is legal.  Then, we match the backslash and move into the 
2589      * <StringEsc> state.  When we drop out of <StringEsc>, we collect more normal
2590      * characters, moving back and forth between <String> and <StringEsc> as more
2591      * backslashes are encountered.  (We may even digress into <Comment> mode if we
2592      * find a comment in a gap between backslashes.)  Finally, we read the last chunk
2593      * of normal characters and the close ".
2594      */
2595
2596 case 131:
2597 YY_RULE_SETUP
2598 #line 676 "yaccParser/hslexer.flex"
2599 {
2600                          yylval.uhstring = installHstring(yyleng-3, yytext+1);
2601                             /* the -3 accounts for the " on front, "# on the end */
2602                          RETURN(STRINGPRIM); 
2603                         }
2604         YY_BREAK
2605 case 132:
2606 YY_RULE_SETUP
2607 #line 681 "yaccParser/hslexer.flex"
2608 {
2609                          yylval.uhstring = installHstring(yyleng-2, yytext+1);
2610                          RETURN(STRING); 
2611                         }
2612         YY_BREAK
2613 case 133:
2614 YY_RULE_SETUP
2615 #line 685 "yaccParser/hslexer.flex"
2616 {
2617                          hsmlcolno = hspcolno;
2618                          cleartext();
2619                          addtext(yytext+1, yyleng-1);
2620                          PUSH_STATE(String);
2621                         }
2622         YY_BREAK
2623 case 134:
2624 YY_RULE_SETUP
2625 #line 691 "yaccParser/hslexer.flex"
2626 {
2627                          unsigned length;
2628                          char *text;
2629
2630                          addtext(yytext, yyleng-2);
2631                          text = fetchtext(&length);
2632
2633                          if (! (nonstandardFlag || in_interface)) {
2634                             char errbuf[ERR_BUF_SIZE];
2635                             sprintf(errbuf, "`String-hash' literals are non-standard: %s\n", text);
2636                             hsperror(errbuf);
2637                          }
2638
2639                          yylval.uhstring = installHstring(length, text);
2640                          hspcolno = hsmlcolno;
2641                          POP_STATE;
2642                          RETURN(STRINGPRIM);
2643                         }
2644         YY_BREAK
2645 case 135:
2646 YY_RULE_SETUP
2647 #line 709 "yaccParser/hslexer.flex"
2648 {
2649                          unsigned length;
2650                          char *text;
2651
2652                          addtext(yytext, yyleng-1);
2653                          text = fetchtext(&length);
2654
2655                          yylval.uhstring = installHstring(length, text);
2656                          hspcolno = hsmlcolno;
2657                          POP_STATE;
2658                          RETURN(STRING); 
2659                         }
2660         YY_BREAK
2661 case 136:
2662 YY_RULE_SETUP
2663 #line 721 "yaccParser/hslexer.flex"
2664 { addtext(yytext, yyleng); }
2665         YY_BREAK
2666
2667     /*
2668      * Character and string escapes are roughly the same, but strings have the
2669      * extra `\&' sequence which is not allowed for characters.  Also, comments
2670      * are allowed in the <StringEsc> state.  (See the comment section much
2671      * further down.)
2672      *
2673      * NB: Backslashes and tabs are stored in strings as themselves.
2674      * But if we print them (in printtree.c), they must go out as
2675      * "\\\\" and "\\t" respectively.  (This is because of the bogus
2676      * intermediate format that the parser produces.  It uses '\t' fpr end of
2677      * string, so it needs to be able to escape tabs, which means that it
2678      * also needs to be able to escape the escape character ('\\').  Sigh.
2679      */
2680
2681 case 137:
2682 YY_RULE_SETUP
2683 #line 739 "yaccParser/hslexer.flex"
2684 { PUSH_STATE(CharEsc); }
2685         YY_BREAK
2686 case 138:
2687 YY_RULE_SETUP
2688 #line 740 "yaccParser/hslexer.flex"
2689 /* Ignore */ ;
2690         YY_BREAK
2691 case 139:
2692 YY_RULE_SETUP
2693 #line 741 "yaccParser/hslexer.flex"
2694 { PUSH_STATE(StringEsc); noGap = TRUE; }
2695         YY_BREAK
2696 case 140:
2697 YY_RULE_SETUP
2698 #line 743 "yaccParser/hslexer.flex"
2699 { addchar(*yytext); POP_STATE; }
2700         YY_BREAK
2701 case 141:
2702 YY_RULE_SETUP
2703 #line 744 "yaccParser/hslexer.flex"
2704 { if (noGap) { addchar(*yytext); } POP_STATE; }
2705         YY_BREAK
2706 case 142:
2707 YY_RULE_SETUP
2708 #line 746 "yaccParser/hslexer.flex"
2709 { addchar(*yytext); POP_STATE; }
2710         YY_BREAK
2711 case 143:
2712 YY_RULE_SETUP
2713 #line 747 "yaccParser/hslexer.flex"
2714 { addchar('\000'); POP_STATE; }
2715         YY_BREAK
2716 case 144:
2717 YY_RULE_SETUP
2718 #line 748 "yaccParser/hslexer.flex"
2719 { addchar('\001'); POP_STATE; }
2720         YY_BREAK
2721 case 145:
2722 YY_RULE_SETUP
2723 #line 749 "yaccParser/hslexer.flex"
2724 { addchar('\002'); POP_STATE; }
2725         YY_BREAK
2726 case 146:
2727 YY_RULE_SETUP
2728 #line 750 "yaccParser/hslexer.flex"
2729 { addchar('\003'); POP_STATE; }
2730         YY_BREAK
2731 case 147:
2732 YY_RULE_SETUP
2733 #line 751 "yaccParser/hslexer.flex"
2734 { addchar('\004'); POP_STATE; }
2735         YY_BREAK
2736 case 148:
2737 YY_RULE_SETUP
2738 #line 752 "yaccParser/hslexer.flex"
2739 { addchar('\005'); POP_STATE; }
2740         YY_BREAK
2741 case 149:
2742 YY_RULE_SETUP
2743 #line 753 "yaccParser/hslexer.flex"
2744 { addchar('\006'); POP_STATE; }
2745         YY_BREAK
2746 case 150:
2747 #line 755 "yaccParser/hslexer.flex"
2748 case 151:
2749 YY_RULE_SETUP
2750 #line 755 "yaccParser/hslexer.flex"
2751 { addchar('\007'); POP_STATE; }
2752         YY_BREAK
2753 case 152:
2754 #line 757 "yaccParser/hslexer.flex"
2755 case 153:
2756 YY_RULE_SETUP
2757 #line 757 "yaccParser/hslexer.flex"
2758 { addchar('\010'); POP_STATE; }
2759         YY_BREAK
2760 case 154:
2761 #line 759 "yaccParser/hslexer.flex"
2762 case 155:
2763 YY_RULE_SETUP
2764 #line 759 "yaccParser/hslexer.flex"
2765 { addchar('\011'); POP_STATE; }
2766         YY_BREAK
2767 case 156:
2768 #line 761 "yaccParser/hslexer.flex"
2769 case 157:
2770 YY_RULE_SETUP
2771 #line 761 "yaccParser/hslexer.flex"
2772 { addchar('\012'); POP_STATE; }
2773         YY_BREAK
2774 case 158:
2775 #line 763 "yaccParser/hslexer.flex"
2776 case 159:
2777 YY_RULE_SETUP
2778 #line 763 "yaccParser/hslexer.flex"
2779 { addchar('\013'); POP_STATE; }
2780         YY_BREAK
2781 case 160:
2782 #line 765 "yaccParser/hslexer.flex"
2783 case 161:
2784 YY_RULE_SETUP
2785 #line 765 "yaccParser/hslexer.flex"
2786 { addchar('\014'); POP_STATE; }
2787         YY_BREAK
2788 case 162:
2789 #line 767 "yaccParser/hslexer.flex"
2790 case 163:
2791 YY_RULE_SETUP
2792 #line 767 "yaccParser/hslexer.flex"
2793 { addchar('\015'); POP_STATE; }
2794         YY_BREAK
2795 case 164:
2796 YY_RULE_SETUP
2797 #line 768 "yaccParser/hslexer.flex"
2798 { addchar('\016'); POP_STATE; }
2799         YY_BREAK
2800 case 165:
2801 YY_RULE_SETUP
2802 #line 769 "yaccParser/hslexer.flex"
2803 { addchar('\017'); POP_STATE; }
2804         YY_BREAK
2805 case 166:
2806 YY_RULE_SETUP
2807 #line 770 "yaccParser/hslexer.flex"
2808 { addchar('\020'); POP_STATE; }
2809         YY_BREAK
2810 case 167:
2811 YY_RULE_SETUP
2812 #line 771 "yaccParser/hslexer.flex"
2813 { addchar('\021'); POP_STATE; }
2814         YY_BREAK
2815 case 168:
2816 YY_RULE_SETUP
2817 #line 772 "yaccParser/hslexer.flex"
2818 { addchar('\022'); POP_STATE; }
2819         YY_BREAK
2820 case 169:
2821 YY_RULE_SETUP
2822 #line 773 "yaccParser/hslexer.flex"
2823 { addchar('\023'); POP_STATE; }
2824         YY_BREAK
2825 case 170:
2826 YY_RULE_SETUP
2827 #line 774 "yaccParser/hslexer.flex"
2828 { addchar('\024'); POP_STATE; }
2829         YY_BREAK
2830 case 171:
2831 YY_RULE_SETUP
2832 #line 775 "yaccParser/hslexer.flex"
2833 { addchar('\025'); POP_STATE; }
2834         YY_BREAK
2835 case 172:
2836 YY_RULE_SETUP
2837 #line 776 "yaccParser/hslexer.flex"
2838 { addchar('\026'); POP_STATE; }
2839         YY_BREAK
2840 case 173:
2841 YY_RULE_SETUP
2842 #line 777 "yaccParser/hslexer.flex"
2843 { addchar('\027'); POP_STATE; }
2844         YY_BREAK
2845 case 174:
2846 YY_RULE_SETUP
2847 #line 778 "yaccParser/hslexer.flex"
2848 { addchar('\030'); POP_STATE; }
2849         YY_BREAK
2850 case 175:
2851 YY_RULE_SETUP
2852 #line 779 "yaccParser/hslexer.flex"
2853 { addchar('\031'); POP_STATE; }
2854         YY_BREAK
2855 case 176:
2856 YY_RULE_SETUP
2857 #line 780 "yaccParser/hslexer.flex"
2858 { addchar('\032'); POP_STATE; }
2859         YY_BREAK
2860 case 177:
2861 YY_RULE_SETUP
2862 #line 781 "yaccParser/hslexer.flex"
2863 { addchar('\033'); POP_STATE; }
2864         YY_BREAK
2865 case 178:
2866 YY_RULE_SETUP
2867 #line 782 "yaccParser/hslexer.flex"
2868 { addchar('\034'); POP_STATE; }
2869         YY_BREAK
2870 case 179:
2871 YY_RULE_SETUP
2872 #line 783 "yaccParser/hslexer.flex"
2873 { addchar('\035'); POP_STATE; }
2874         YY_BREAK
2875 case 180:
2876 YY_RULE_SETUP
2877 #line 784 "yaccParser/hslexer.flex"
2878 { addchar('\036'); POP_STATE; }
2879         YY_BREAK
2880 case 181:
2881 YY_RULE_SETUP
2882 #line 785 "yaccParser/hslexer.flex"
2883 { addchar('\037'); POP_STATE; }
2884         YY_BREAK
2885 case 182:
2886 YY_RULE_SETUP
2887 #line 786 "yaccParser/hslexer.flex"
2888 { addchar('\040'); POP_STATE; }
2889         YY_BREAK
2890 case 183:
2891 YY_RULE_SETUP
2892 #line 787 "yaccParser/hslexer.flex"
2893 { addchar('\177'); POP_STATE; }
2894         YY_BREAK
2895 case 184:
2896 YY_RULE_SETUP
2897 #line 788 "yaccParser/hslexer.flex"
2898 { char c = yytext[1] - '@'; addchar(c); POP_STATE; }
2899         YY_BREAK
2900 case 185:
2901 YY_RULE_SETUP
2902 #line 789 "yaccParser/hslexer.flex"
2903 {
2904                           int i = strtol(yytext, NULL, 10);
2905                           if (i < NCHARS) {
2906                              addchar((char) i);
2907                           } else {
2908                              char errbuf[ERR_BUF_SIZE];
2909                              sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n", 
2910                                 yytext);
2911                              hsperror(errbuf);
2912                           }
2913                           POP_STATE;
2914                         }
2915         YY_BREAK
2916 case 186:
2917 YY_RULE_SETUP
2918 #line 801 "yaccParser/hslexer.flex"
2919 {
2920                           int i = strtol(yytext + 1, NULL, 8);
2921                           if (i < NCHARS) {
2922                              addchar((char) i);
2923                           } else {
2924                              char errbuf[ERR_BUF_SIZE];
2925                              sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n", 
2926                                 yytext);
2927                              hsperror(errbuf);
2928                           }
2929                           POP_STATE;
2930                         }
2931         YY_BREAK
2932 case 187:
2933 YY_RULE_SETUP
2934 #line 813 "yaccParser/hslexer.flex"
2935 {
2936                           int i = strtol(yytext + 1, NULL, 16);
2937                           if (i < NCHARS) {
2938                              addchar((char) i);
2939                           } else {
2940                              char errbuf[ERR_BUF_SIZE];
2941                              sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n", 
2942                                 yytext);
2943                              hsperror(errbuf);
2944                           }
2945                           POP_STATE;
2946                         }
2947         YY_BREAK
2948
2949     /*
2950      * Simple comments and whitespace.  Normally, we would just ignore these, but
2951      * in case we're processing a string escape, we need to note that we've seen
2952      * a gap.
2953      *
2954      * Note that we cater for a comment line that *doesn't* end in a newline.
2955      * This is incorrect, strictly speaking, but seems like the right thing
2956      * to do.  Reported by Rajiv Mirani.  (WDP 95/08)
2957      */
2958
2959 case 188:
2960 #line 839 "yaccParser/hslexer.flex"
2961 case 189:
2962 YY_RULE_SETUP
2963 #line 839 "yaccParser/hslexer.flex"
2964 { noGap = FALSE; }
2965         YY_BREAK
2966
2967     /*
2968      * Nested comments.  The major complication here is in trying to match the
2969      * longest lexemes possible, for better performance.  (See the flex document.)
2970      * That's why the rules look so bizarre.
2971      */
2972
2973 case 190:
2974 YY_RULE_SETUP
2975 #line 849 "yaccParser/hslexer.flex"
2976
2977                           noGap = FALSE; nested_comments = 1; PUSH_STATE(Comment); 
2978                         }
2979         YY_BREAK
2980 case 191:
2981 #line 854 "yaccParser/hslexer.flex"
2982 case 192:
2983 #line 855 "yaccParser/hslexer.flex"
2984 case 193:
2985 YY_RULE_SETUP
2986 #line 855 "yaccParser/hslexer.flex"
2987 ;
2988         YY_BREAK
2989 case 194:
2990 YY_RULE_SETUP
2991 #line 856 "yaccParser/hslexer.flex"
2992 { nested_comments++; }
2993         YY_BREAK
2994 case 195:
2995 YY_RULE_SETUP
2996 #line 857 "yaccParser/hslexer.flex"
2997 { if (--nested_comments == 0) POP_STATE; }
2998         YY_BREAK
2999 case 196:
3000 YY_RULE_SETUP
3001 #line 858 "yaccParser/hslexer.flex"
3002 ;
3003         YY_BREAK
3004
3005     /*
3006      * Illegal characters.  This used to be a single rule, but we might as well
3007      * pass on as much information as we have, so now we indicate our state in
3008      * the error message.
3009      */
3010
3011 case 197:
3012 YY_RULE_SETUP
3013 #line 868 "yaccParser/hslexer.flex"
3014
3015                          fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `", 
3016                             input_filename, hsplineno, hspcolno + 1); 
3017                          format_string(stderr, (unsigned char *) yytext, 1);
3018                          fputs("'\n", stderr);
3019                          hsperror("");
3020                         }
3021         YY_BREAK
3022 case 198:
3023 YY_RULE_SETUP
3024 #line 875 "yaccParser/hslexer.flex"
3025
3026                          fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3027                             input_filename, hsplineno, hspcolno + 1); 
3028                          format_string(stderr, (unsigned char *) yytext, 1);
3029                          fputs("' in a character literal\n", stderr);
3030                          hsperror("");
3031                         }
3032         YY_BREAK
3033 case 199:
3034 YY_RULE_SETUP
3035 #line 882 "yaccParser/hslexer.flex"
3036 {
3037                          fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\",
3038                             input_filename, hsplineno, hspcolno + 1); 
3039                          format_string(stderr, (unsigned char *) yytext, 1);
3040                          fputs("'\n", stderr);
3041                          hsperror("");
3042                         }
3043         YY_BREAK
3044 case 200:
3045 YY_RULE_SETUP
3046 #line 889 "yaccParser/hslexer.flex"
3047 { if (nonstandardFlag) {
3048                              addtext(yytext, yyleng);
3049                           } else { 
3050                                 fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `", 
3051                                 input_filename, hsplineno, hspcolno + 1); 
3052                                 format_string(stderr, (unsigned char *) yytext, 1);
3053                                 fputs("' in a string literal\n", stderr);
3054                                 hsperror("");
3055                           }
3056                         }
3057         YY_BREAK
3058 case 201:
3059 YY_RULE_SETUP
3060 #line 899 "yaccParser/hslexer.flex"
3061 {
3062                          if (noGap) {
3063                              fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\", 
3064                                 input_filename, hsplineno, hspcolno + 1); 
3065                              format_string(stderr, (unsigned char *) yytext, 1);
3066                              fputs("'\n", stderr);
3067                              hsperror("");
3068                          } else {
3069                              fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
3070                                 input_filename, hsplineno, hspcolno + 1);
3071                              format_string(stderr, (unsigned char *) yytext, 1);
3072                              fputs("' in a string gap\n", stderr);
3073                              hsperror("");
3074                          }
3075                         }
3076         YY_BREAK
3077
3078     /*
3079      * End of file.  In any sub-state, this is an error.  However, for the primary
3080      * <Code> and <GlaExt> states, this is perfectly normal.  We just return an EOF
3081      * and let the yylex() wrapper deal with whatever has to be done next (e.g.
3082      * adding virtual close curlies, or closing an interface and returning to the
3083      * primary source file.
3084      *
3085      * Note that flex does not call YY_USER_ACTION for <<EOF>> rules.  Hence the
3086      * line/column advancement has to be done by hand.
3087      */
3088
3089 case YY_STATE_EOF(Char):
3090 case YY_STATE_EOF(CharEsc):
3091 #line 928 "yaccParser/hslexer.flex"
3092
3093                           hsplineno = hslineno; hspcolno = hscolno;
3094                           hsperror("unterminated character literal");
3095                         }
3096         YY_BREAK
3097 case YY_STATE_EOF(Comment):
3098 #line 932 "yaccParser/hslexer.flex"
3099
3100                           hsplineno = hslineno; hspcolno = hscolno;
3101                           hsperror("unterminated comment"); 
3102                         }
3103         YY_BREAK
3104 case YY_STATE_EOF(String):
3105 case YY_STATE_EOF(StringEsc):
3106 #line 936 "yaccParser/hslexer.flex"
3107
3108                           hsplineno = hslineno; hspcolno = hscolno;
3109                           hsperror("unterminated string literal"); 
3110                         }
3111         YY_BREAK
3112 case YY_STATE_EOF(GhcPragma):
3113 #line 940 "yaccParser/hslexer.flex"
3114 {
3115                           hsplineno = hslineno; hspcolno = hscolno;
3116                           hsperror("unterminated interface pragma"); 
3117                         }
3118         YY_BREAK
3119 case YY_STATE_EOF(UserPragma):
3120 #line 944 "yaccParser/hslexer.flex"
3121 {
3122                           hsplineno = hslineno; hspcolno = hscolno;
3123                           hsperror("unterminated user-specified pragma"); 
3124                         }
3125         YY_BREAK
3126 case YY_STATE_EOF(Code):
3127 case YY_STATE_EOF(GlaExt):
3128 #line 948 "yaccParser/hslexer.flex"
3129 { hsplineno = hslineno; hspcolno = hscolno; return(EOF); }
3130         YY_BREAK
3131 case 202:
3132 YY_RULE_SETUP
3133 #line 950 "yaccParser/hslexer.flex"
3134 YY_FATAL_ERROR( "flex scanner jammed" );
3135         YY_BREAK
3136 case YY_STATE_EOF(INITIAL):
3137         yyterminate();
3138
3139         case YY_END_OF_BUFFER:
3140                 {
3141                 /* Amount of text matched not including the EOB char. */
3142                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
3143
3144                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
3145                 *yy_cp = yy_hold_char;
3146
3147                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
3148                         {
3149                         /* We're scanning a new file or input source.  It's
3150                          * possible that this happened because the user
3151                          * just pointed yyin at a new source and called
3152                          * yylex().  If so, then we have to assure
3153                          * consistency between yy_current_buffer and our
3154                          * globals.  Here is the right place to do so, because
3155                          * this is the first action (other than possibly a
3156                          * back-up) that will match for the new input source.
3157                          */
3158                         yy_n_chars = yy_current_buffer->yy_n_chars;
3159                         yy_current_buffer->yy_input_file = yyin;
3160                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
3161                         }
3162
3163                 /* Note that here we test for yy_c_buf_p "<=" to the position
3164                  * of the first EOB in the buffer, since yy_c_buf_p will
3165                  * already have been incremented past the NUL character
3166                  * (since all states make transitions on EOB to the
3167                  * end-of-buffer state).  Contrast this with the test
3168                  * in input().
3169                  */
3170                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3171                         { /* This was really a NUL. */
3172                         yy_state_type yy_next_state;
3173
3174                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
3175
3176                         yy_current_state = yy_get_previous_state();
3177
3178                         /* Okay, we're now positioned to make the NUL
3179                          * transition.  We couldn't have
3180                          * yy_get_previous_state() go ahead and do it
3181                          * for us because it doesn't know how to deal
3182                          * with the possibility of jamming (and we don't
3183                          * want to build jamming into it because then it
3184                          * will run more slowly).
3185                          */
3186
3187                         yy_next_state = yy_try_NUL_trans( yy_current_state );
3188
3189                         yy_bp = yytext_ptr + YY_MORE_ADJ;
3190
3191                         if ( yy_next_state )
3192                                 {
3193                                 /* Consume the NUL. */
3194                                 yy_cp = ++yy_c_buf_p;
3195                                 yy_current_state = yy_next_state;
3196                                 goto yy_match;
3197                                 }
3198
3199                         else
3200                                 {
3201                                 yy_cp = yy_c_buf_p;
3202                                 goto yy_find_action;
3203                                 }
3204                         }
3205
3206                 else switch ( yy_get_next_buffer() )
3207                         {
3208                         case EOB_ACT_END_OF_FILE:
3209                                 {
3210                                 yy_did_buffer_switch_on_eof = 0;
3211
3212                                 if ( yywrap() )
3213                                         {
3214                                         /* Note: because we've taken care in
3215                                          * yy_get_next_buffer() to have set up
3216                                          * yytext, we can now set up
3217                                          * yy_c_buf_p so that if some total
3218                                          * hoser (like flex itself) wants to
3219                                          * call the scanner after we return the
3220                                          * YY_NULL, it'll still work - another
3221                                          * YY_NULL will get returned.
3222                                          */
3223                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3224
3225                                         yy_act = YY_STATE_EOF(YY_START);
3226                                         goto do_action;
3227                                         }
3228
3229                                 else
3230                                         {
3231                                         if ( ! yy_did_buffer_switch_on_eof )
3232                                                 YY_NEW_FILE;
3233                                         }
3234                                 break;
3235                                 }
3236
3237                         case EOB_ACT_CONTINUE_SCAN:
3238                                 yy_c_buf_p =
3239                                         yytext_ptr + yy_amount_of_matched_text;
3240
3241                                 yy_current_state = yy_get_previous_state();
3242
3243                                 yy_cp = yy_c_buf_p;
3244                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
3245                                 goto yy_match;
3246
3247                         case EOB_ACT_LAST_MATCH:
3248                                 yy_c_buf_p =
3249                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
3250
3251                                 yy_current_state = yy_get_previous_state();
3252
3253                                 yy_cp = yy_c_buf_p;
3254                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
3255                                 goto yy_find_action;
3256                         }
3257                 break;
3258                 }
3259
3260         default:
3261                 YY_FATAL_ERROR(
3262                         "fatal flex scanner internal error--no action found" );
3263         } /* end of action switch */
3264                 } /* end of scanning one token */
3265         } /* end of yylex */
3266
3267
3268 /* yy_get_next_buffer - try to read in a new buffer
3269  *
3270  * Returns a code representing an action:
3271  *      EOB_ACT_LAST_MATCH -
3272  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3273  *      EOB_ACT_END_OF_FILE - end of file
3274  */
3275
3276 static int yy_get_next_buffer()
3277         {
3278         register char *dest = yy_current_buffer->yy_ch_buf;
3279         register char *source = yytext_ptr;
3280         register int number_to_move, i;
3281         int ret_val;
3282
3283         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
3284                 YY_FATAL_ERROR(
3285                 "fatal flex scanner internal error--end of buffer missed" );
3286
3287         if ( yy_current_buffer->yy_fill_buffer == 0 )
3288                 { /* Don't try to fill the buffer, so this is an EOF. */
3289                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
3290                         {
3291                         /* We matched a singled characater, the EOB, so
3292                          * treat this as a final EOF.
3293                          */
3294                         return EOB_ACT_END_OF_FILE;
3295                         }
3296
3297                 else
3298                         {
3299                         /* We matched some text prior to the EOB, first
3300                          * process it.
3301                          */
3302                         return EOB_ACT_LAST_MATCH;
3303                         }
3304                 }
3305
3306         /* Try to read more data. */
3307
3308         /* First move last chars to start of buffer. */
3309         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
3310
3311         for ( i = 0; i < number_to_move; ++i )
3312                 *(dest++) = *(source++);
3313
3314         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3315                 /* don't do the read, it's not guaranteed to return an EOF,
3316                  * just force an EOF
3317                  */
3318                 yy_n_chars = 0;
3319
3320         else
3321                 {
3322                 int num_to_read =
3323                         yy_current_buffer->yy_buf_size - number_to_move - 1;
3324
3325                 while ( num_to_read <= 0 )
3326                         { /* Not enough room in the buffer - grow it. */
3327 #ifdef YY_USES_REJECT
3328                         YY_FATAL_ERROR(
3329 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3330 #else
3331
3332                         /* just a shorter name for the current buffer */
3333                         YY_BUFFER_STATE b = yy_current_buffer;
3334
3335                         int yy_c_buf_p_offset =
3336                                 (int) (yy_c_buf_p - b->yy_ch_buf);
3337
3338                         if ( b->yy_is_our_buffer )
3339                                 {
3340                                 int new_size = b->yy_buf_size * 2;
3341
3342                                 if ( new_size <= 0 )
3343                                         b->yy_buf_size += b->yy_buf_size / 8;
3344                                 else
3345                                         b->yy_buf_size *= 2;
3346
3347                                 b->yy_ch_buf = (char *)
3348                                         /* Include room in for 2 EOB chars. */
3349                                         yy_flex_realloc( (void *) b->yy_ch_buf,
3350                                                          b->yy_buf_size + 2 );
3351                                 }
3352                         else
3353                                 /* Can't grow it, we don't own it. */
3354                                 b->yy_ch_buf = 0;
3355
3356                         if ( ! b->yy_ch_buf )
3357                                 YY_FATAL_ERROR(
3358                                 "fatal error - scanner input buffer overflow" );
3359
3360                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3361
3362                         num_to_read = yy_current_buffer->yy_buf_size -
3363                                                 number_to_move - 1;
3364 #endif
3365                         }
3366
3367                 if ( num_to_read > YY_READ_BUF_SIZE )
3368                         num_to_read = YY_READ_BUF_SIZE;
3369
3370                 /* Read in more data. */
3371                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
3372                         yy_n_chars, num_to_read );
3373                 }
3374
3375         if ( yy_n_chars == 0 )
3376                 {
3377                 if ( number_to_move == YY_MORE_ADJ )
3378                         {
3379                         ret_val = EOB_ACT_END_OF_FILE;
3380                         yyrestart( yyin );
3381                         }
3382
3383                 else
3384                         {
3385                         ret_val = EOB_ACT_LAST_MATCH;
3386                         yy_current_buffer->yy_buffer_status =
3387                                 YY_BUFFER_EOF_PENDING;
3388                         }
3389                 }
3390
3391         else
3392                 ret_val = EOB_ACT_CONTINUE_SCAN;
3393
3394         yy_n_chars += number_to_move;
3395         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
3396         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
3397
3398         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
3399
3400         return ret_val;
3401         }
3402
3403
3404 /* yy_get_previous_state - get the state just before the EOB char was reached */
3405
3406 static yy_state_type yy_get_previous_state()
3407         {
3408         register yy_state_type yy_current_state;
3409         register char *yy_cp;
3410
3411         yy_current_state = yy_start;
3412         yy_current_state += YY_AT_BOL();
3413
3414         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
3415                 {
3416                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3417                 if ( yy_accept[yy_current_state] )
3418                         {
3419                         yy_last_accepting_state = yy_current_state;
3420                         yy_last_accepting_cpos = yy_cp;
3421                         }
3422                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3423                         {
3424                         yy_current_state = (int) yy_def[yy_current_state];
3425                         if ( yy_current_state >= 837 )
3426                                 yy_c = yy_meta[(unsigned int) yy_c];
3427                         }
3428                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3429                 }
3430
3431         return yy_current_state;
3432         }
3433
3434
3435 /* yy_try_NUL_trans - try to make a transition on the NUL character
3436  *
3437  * synopsis
3438  *      next_state = yy_try_NUL_trans( current_state );
3439  */
3440
3441 #ifdef YY_USE_PROTOS
3442 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
3443 #else
3444 static yy_state_type yy_try_NUL_trans( yy_current_state )
3445 yy_state_type yy_current_state;
3446 #endif
3447         {
3448         register int yy_is_jam;
3449         register char *yy_cp = yy_c_buf_p;
3450
3451         register YY_CHAR yy_c = 1;
3452         if ( yy_accept[yy_current_state] )
3453                 {
3454                 yy_last_accepting_state = yy_current_state;
3455                 yy_last_accepting_cpos = yy_cp;
3456                 }
3457         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3458                 {
3459                 yy_current_state = (int) yy_def[yy_current_state];
3460                 if ( yy_current_state >= 837 )
3461                         yy_c = yy_meta[(unsigned int) yy_c];
3462                 }
3463         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3464         yy_is_jam = (yy_current_state == 836);
3465
3466         return yy_is_jam ? 0 : yy_current_state;
3467         }
3468
3469
3470 #ifndef YY_NO_UNPUT
3471 #ifdef YY_USE_PROTOS
3472 static void yyunput( int c, register char *yy_bp )
3473 #else
3474 static void yyunput( c, yy_bp )
3475 int c;
3476 register char *yy_bp;
3477 #endif
3478         {
3479         register char *yy_cp = yy_c_buf_p;
3480
3481         /* undo effects of setting up yytext */
3482         *yy_cp = yy_hold_char;
3483
3484         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3485                 { /* need to shift things up to make room */
3486                 /* +2 for EOB chars. */
3487                 register int number_to_move = yy_n_chars + 2;
3488                 register char *dest = &yy_current_buffer->yy_ch_buf[
3489                                         yy_current_buffer->yy_buf_size + 2];
3490                 register char *source =
3491                                 &yy_current_buffer->yy_ch_buf[number_to_move];
3492
3493                 while ( source > yy_current_buffer->yy_ch_buf )
3494                         *--dest = *--source;
3495
3496                 yy_cp += (int) (dest - source);
3497                 yy_bp += (int) (dest - source);
3498                 yy_n_chars = yy_current_buffer->yy_buf_size;
3499
3500                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3501                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
3502                 }
3503
3504         *--yy_cp = (char) c;
3505
3506
3507         yytext_ptr = yy_bp;
3508         yy_hold_char = *yy_cp;
3509         yy_c_buf_p = yy_cp;
3510         }
3511 #endif  /* ifndef YY_NO_UNPUT */
3512
3513
3514 #ifdef __cplusplus
3515 static int yyinput()
3516 #else
3517 static int input()
3518 #endif
3519         {
3520         int c;
3521
3522         *yy_c_buf_p = yy_hold_char;
3523
3524         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
3525                 {
3526                 /* yy_c_buf_p now points to the character we want to return.
3527                  * If this occurs *before* the EOB characters, then it's a
3528                  * valid NUL; if not, then we've hit the end of the buffer.
3529                  */
3530                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3531                         /* This was really a NUL. */
3532                         *yy_c_buf_p = '\0';
3533
3534                 else
3535                         { /* need more input */
3536                         yytext_ptr = yy_c_buf_p;
3537                         ++yy_c_buf_p;
3538
3539                         switch ( yy_get_next_buffer() )
3540                                 {
3541                                 case EOB_ACT_END_OF_FILE:
3542                                         {
3543                                         if ( yywrap() )
3544                                                 {
3545                                                 yy_c_buf_p =
3546                                                 yytext_ptr + YY_MORE_ADJ;
3547                                                 return EOF;
3548                                                 }
3549
3550                                         if ( ! yy_did_buffer_switch_on_eof )
3551                                                 YY_NEW_FILE;
3552 #ifdef __cplusplus
3553                                         return yyinput();
3554 #else
3555                                         return input();
3556 #endif
3557                                         }
3558
3559                                 case EOB_ACT_CONTINUE_SCAN:
3560                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3561                                         break;
3562
3563                                 case EOB_ACT_LAST_MATCH:
3564 #ifdef __cplusplus
3565                                         YY_FATAL_ERROR(
3566                                         "unexpected last match in yyinput()" );
3567 #else
3568                                         YY_FATAL_ERROR(
3569                                         "unexpected last match in input()" );
3570 #endif
3571                                 }
3572                         }
3573                 }
3574
3575         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
3576         *yy_c_buf_p = '\0';     /* preserve yytext */
3577         yy_hold_char = *++yy_c_buf_p;
3578
3579         yy_current_buffer->yy_at_bol = (c == '\n');
3580
3581         return c;
3582         }
3583
3584
3585 #ifdef YY_USE_PROTOS
3586 void yyrestart( FILE *input_file )
3587 #else
3588 void yyrestart( input_file )
3589 FILE *input_file;
3590 #endif
3591         {
3592         if ( ! yy_current_buffer )
3593                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
3594
3595         yy_init_buffer( yy_current_buffer, input_file );
3596         yy_load_buffer_state();
3597         }
3598
3599
3600 #ifdef YY_USE_PROTOS
3601 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
3602 #else
3603 void yy_switch_to_buffer( new_buffer )
3604 YY_BUFFER_STATE new_buffer;
3605 #endif
3606         {
3607         if ( yy_current_buffer == new_buffer )
3608                 return;
3609
3610         if ( yy_current_buffer )
3611                 {
3612                 /* Flush out information for old buffer. */
3613                 *yy_c_buf_p = yy_hold_char;
3614                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
3615                 yy_current_buffer->yy_n_chars = yy_n_chars;
3616                 }
3617
3618         yy_current_buffer = new_buffer;
3619         yy_load_buffer_state();
3620
3621         /* We don't actually know whether we did this switch during
3622          * EOF (yywrap()) processing, but the only time this flag
3623          * is looked at is after yywrap() is called, so it's safe
3624          * to go ahead and always set it.
3625          */
3626         yy_did_buffer_switch_on_eof = 1;
3627         }
3628
3629
3630 #ifdef YY_USE_PROTOS
3631 void yy_load_buffer_state( void )
3632 #else
3633 void yy_load_buffer_state()
3634 #endif
3635         {
3636         yy_n_chars = yy_current_buffer->yy_n_chars;
3637         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
3638         yyin = yy_current_buffer->yy_input_file;
3639         yy_hold_char = *yy_c_buf_p;
3640         }
3641
3642
3643 #ifdef YY_USE_PROTOS
3644 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
3645 #else
3646 YY_BUFFER_STATE yy_create_buffer( file, size )
3647 FILE *file;
3648 int size;
3649 #endif
3650         {
3651         YY_BUFFER_STATE b;
3652
3653         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3654         if ( ! b )
3655                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3656
3657         b->yy_buf_size = size;
3658
3659         /* yy_ch_buf has to be 2 characters longer than the size given because
3660          * we need to put in 2 end-of-buffer characters.
3661          */
3662         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
3663         if ( ! b->yy_ch_buf )
3664                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3665
3666         b->yy_is_our_buffer = 1;
3667
3668         yy_init_buffer( b, file );
3669
3670         return b;
3671         }
3672
3673
3674 #ifdef YY_USE_PROTOS
3675 void yy_delete_buffer( YY_BUFFER_STATE b )
3676 #else
3677 void yy_delete_buffer( b )
3678 YY_BUFFER_STATE b;
3679 #endif
3680         {
3681         if ( ! b )
3682                 return;
3683
3684         if ( b == yy_current_buffer )
3685                 yy_current_buffer = (YY_BUFFER_STATE) 0;
3686
3687         if ( b->yy_is_our_buffer )
3688                 yy_flex_free( (void *) b->yy_ch_buf );
3689
3690         yy_flex_free( (void *) b );
3691         }
3692
3693
3694 #ifndef YY_ALWAYS_INTERACTIVE
3695 #ifndef YY_NEVER_INTERACTIVE
3696 extern int isatty YY_PROTO(( int ));
3697 #endif
3698 #endif
3699
3700 #ifdef YY_USE_PROTOS
3701 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3702 #else
3703 void yy_init_buffer( b, file )
3704 YY_BUFFER_STATE b;
3705 FILE *file;
3706 #endif
3707
3708
3709         {
3710         yy_flush_buffer( b );
3711
3712         b->yy_input_file = file;
3713         b->yy_fill_buffer = 1;
3714
3715 #if YY_ALWAYS_INTERACTIVE
3716         b->yy_is_interactive = 1;
3717 #else
3718 #if YY_NEVER_INTERACTIVE
3719         b->yy_is_interactive = 0;
3720 #else
3721         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3722 #endif
3723 #endif
3724         }
3725
3726
3727 #ifdef YY_USE_PROTOS
3728 void yy_flush_buffer( YY_BUFFER_STATE b )
3729 #else
3730 void yy_flush_buffer( b )
3731 YY_BUFFER_STATE b;
3732 #endif
3733
3734         {
3735         b->yy_n_chars = 0;
3736
3737         /* We always need two end-of-buffer characters.  The first causes
3738          * a transition to the end-of-buffer state.  The second causes
3739          * a jam in that state.
3740          */
3741         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3742         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3743
3744         b->yy_buf_pos = &b->yy_ch_buf[0];
3745
3746         b->yy_at_bol = 1;
3747         b->yy_buffer_status = YY_BUFFER_NEW;
3748
3749         if ( b == yy_current_buffer )
3750                 yy_load_buffer_state();
3751         }
3752
3753
3754 #ifndef YY_NO_SCAN_BUFFER
3755 #ifdef YY_USE_PROTOS
3756 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
3757 #else
3758 YY_BUFFER_STATE yy_scan_buffer( base, size )
3759 char *base;
3760 yy_size_t size;
3761 #endif
3762         {
3763         YY_BUFFER_STATE b;
3764
3765         if ( size < 2 ||
3766              base[size-2] != YY_END_OF_BUFFER_CHAR ||
3767              base[size-1] != YY_END_OF_BUFFER_CHAR )
3768                 /* They forgot to leave room for the EOB's. */
3769                 return 0;
3770
3771         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3772         if ( ! b )
3773                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3774
3775         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
3776         b->yy_buf_pos = b->yy_ch_buf = base;
3777         b->yy_is_our_buffer = 0;
3778         b->yy_input_file = 0;
3779         b->yy_n_chars = b->yy_buf_size;
3780         b->yy_is_interactive = 0;
3781         b->yy_at_bol = 1;
3782         b->yy_fill_buffer = 0;
3783         b->yy_buffer_status = YY_BUFFER_NEW;
3784
3785         yy_switch_to_buffer( b );
3786
3787         return b;
3788         }
3789 #endif
3790
3791
3792 #ifndef YY_NO_SCAN_STRING
3793 #ifdef YY_USE_PROTOS
3794 YY_BUFFER_STATE yy_scan_string( yyconst char *str )
3795 #else
3796 YY_BUFFER_STATE yy_scan_string( str )
3797 yyconst char *str;
3798 #endif
3799         {
3800         int len;
3801         for ( len = 0; str[len]; ++len )
3802                 ;
3803
3804         return yy_scan_bytes( str, len );
3805         }
3806 #endif
3807
3808
3809 #ifndef YY_NO_SCAN_BYTES
3810 #ifdef YY_USE_PROTOS
3811 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
3812 #else
3813 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
3814 yyconst char *bytes;
3815 int len;
3816 #endif
3817         {
3818         YY_BUFFER_STATE b;
3819         char *buf;
3820         yy_size_t n;
3821         int i;
3822
3823         /* Get memory for full buffer, including space for trailing EOB's. */
3824         n = len + 2;
3825         buf = (char *) yy_flex_alloc( n );
3826         if ( ! buf )
3827                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3828
3829         for ( i = 0; i < len; ++i )
3830                 buf[i] = bytes[i];
3831
3832         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
3833
3834         b = yy_scan_buffer( buf, n );
3835         if ( ! b )
3836                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3837
3838         /* It's okay to grow etc. this buffer, and we should throw it
3839          * away when we're done.
3840          */
3841         b->yy_is_our_buffer = 1;
3842
3843         return b;
3844         }
3845 #endif
3846
3847
3848 #ifndef YY_NO_PUSH_STATE
3849 #ifdef YY_USE_PROTOS
3850 static void yy_push_state( int new_state )
3851 #else
3852 static void yy_push_state( new_state )
3853 int new_state;
3854 #endif
3855         {
3856         if ( yy_start_stack_ptr >= yy_start_stack_depth )
3857                 {
3858                 yy_size_t new_size;
3859
3860                 yy_start_stack_depth += YY_START_STACK_INCR;
3861                 new_size = yy_start_stack_depth * sizeof( int );
3862
3863                 if ( ! yy_start_stack )
3864                         yy_start_stack = (int *) yy_flex_alloc( new_size );
3865
3866                 else
3867                         yy_start_stack = (int *) yy_flex_realloc(
3868                                         (void *) yy_start_stack, new_size );
3869
3870                 if ( ! yy_start_stack )
3871                         YY_FATAL_ERROR(
3872                         "out of memory expanding start-condition stack" );
3873                 }
3874
3875         yy_start_stack[yy_start_stack_ptr++] = YY_START;
3876
3877         BEGIN(new_state);
3878         }
3879 #endif
3880
3881
3882 #ifndef YY_NO_POP_STATE
3883 static void yy_pop_state()
3884         {
3885         if ( --yy_start_stack_ptr < 0 )
3886                 YY_FATAL_ERROR( "start-condition stack underflow" );
3887
3888         BEGIN(yy_start_stack[yy_start_stack_ptr]);
3889         }
3890 #endif
3891
3892
3893 #ifndef YY_NO_TOP_STATE
3894 static int yy_top_state()
3895         {
3896         return yy_start_stack[yy_start_stack_ptr - 1];
3897         }
3898 #endif
3899
3900 #ifndef YY_EXIT_FAILURE
3901 #define YY_EXIT_FAILURE 2
3902 #endif
3903
3904 #ifdef YY_USE_PROTOS
3905 static void yy_fatal_error( yyconst char msg[] )
3906 #else
3907 static void yy_fatal_error( msg )
3908 char msg[];
3909 #endif
3910         {
3911         (void) fprintf( stderr, "%s\n", msg );
3912         exit( YY_EXIT_FAILURE );
3913         }
3914
3915
3916
3917 /* Redefine yyless() so it works in section 3 code. */
3918
3919 #undef yyless
3920 #define yyless(n) \
3921         do \
3922                 { \
3923                 /* Undo effects of setting up yytext. */ \
3924                 yytext[yyleng] = yy_hold_char; \
3925                 yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
3926                 yy_hold_char = *yy_c_buf_p; \
3927                 *yy_c_buf_p = '\0'; \
3928                 yyleng = n; \
3929                 } \
3930         while ( 0 )
3931
3932
3933 /* Internal utility routines. */
3934
3935 #ifndef yytext_ptr
3936 #ifdef YY_USE_PROTOS
3937 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3938 #else
3939 static void yy_flex_strncpy( s1, s2, n )
3940 char *s1;
3941 yyconst char *s2;
3942 int n;
3943 #endif
3944         {
3945         register int i;
3946         for ( i = 0; i < n; ++i )
3947                 s1[i] = s2[i];
3948         }
3949 #endif
3950
3951
3952 #ifdef YY_USE_PROTOS
3953 static void *yy_flex_alloc( yy_size_t size )
3954 #else
3955 static void *yy_flex_alloc( size )
3956 yy_size_t size;
3957 #endif
3958         {
3959         return (void *) malloc( size );
3960         }
3961
3962 #ifdef YY_USE_PROTOS
3963 static void *yy_flex_realloc( void *ptr, yy_size_t size )
3964 #else
3965 static void *yy_flex_realloc( ptr, size )
3966 void *ptr;
3967 yy_size_t size;
3968 #endif
3969         {
3970         /* The cast to (char *) in the following accommodates both
3971          * implementations that use char* generic pointers, and those
3972          * that use void* generic pointers.  It works with the latter
3973          * because both ANSI C and C++ allow castless assignment from
3974          * any pointer type to void*, and deal with argument conversions
3975          * as though doing an assignment.
3976          */
3977         return (void *) realloc( (char *) ptr, size );
3978         }
3979
3980 #ifdef YY_USE_PROTOS
3981 static void yy_flex_free( void *ptr )
3982 #else
3983 static void yy_flex_free( ptr )
3984 void *ptr;
3985 #endif
3986         {
3987         free( ptr );
3988         }
3989
3990 #if YY_MAIN
3991 int main()
3992         {
3993         yylex();
3994         return 0;
3995         }
3996 #endif
3997 #line 950 "yaccParser/hslexer.flex"
3998
3999
4000 /**********************************************************************
4001 *                                                                     *
4002 *                                                                     *
4003 *     YACC/LEX Initialisation etc.                                    *
4004 *                                                                     *
4005 *                                                                     *
4006 **********************************************************************/
4007
4008 /*
4009    We initialise input_filename to "<stdin>".
4010    This allows unnamed sources to be piped into the parser.
4011 */
4012
4013 extern BOOLEAN acceptPrim;
4014
4015 void
4016 yyinit(void)
4017 {
4018     input_filename = xstrdup("<stdin>");
4019
4020     /* We must initialize the input buffer _now_, because we call
4021        setyyin _before_ calling yylex for the first time! */
4022     yy_switch_to_buffer(yy_create_buffer(stdin, YY_BUF_SIZE));
4023
4024     if (acceptPrim)
4025         PUSH_STATE(GlaExt);
4026     else
4027         PUSH_STATE(Code);
4028 }
4029
4030 static void
4031 new_filename(char *f) /* This looks pretty dodgy to me (WDP) */
4032 {
4033     if (input_filename != NULL)
4034         free(input_filename);
4035     input_filename = xstrdup(f);
4036 }
4037
4038 /**********************************************************************
4039 *                                                                     *
4040 *                                                                     *
4041 *     Layout Processing                                               *
4042 *                                                                     *
4043 *                                                                     *
4044 **********************************************************************/
4045
4046 /*
4047         The following section deals with Haskell Layout conventions
4048         forcing insertion of ; or } as appropriate
4049 */
4050
4051 static BOOLEAN
4052 hsshouldindent(void)
4053 {
4054     return (!forgetindent && INDENTON);
4055 }
4056
4057
4058 /* Enter new context and set new indentation level */
4059 void
4060 hssetindent(void)
4061 {
4062 #ifdef HSP_DEBUG
4063     fprintf(stderr, "hssetindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4064 #endif
4065
4066     /*
4067      * partain: first chk that new indent won't be less than current one; this code
4068      * doesn't make sense to me; hscolno tells the position of the _end_ of the
4069      * current token; what that has to do with indenting, I don't know.
4070      */
4071
4072
4073     if (hscolno - 1 <= INDENTPT) {
4074         if (INDENTPT == -1)
4075             return;             /* Empty input OK for Haskell 1.1 */
4076         else {
4077             char errbuf[ERR_BUF_SIZE];
4078
4079             sprintf(errbuf, "Layout error -- indentation should be > %d cols", INDENTPT);
4080             hsperror(errbuf);
4081         }
4082     }
4083     hsentercontext((hspcolno << 1) | 1);
4084 }
4085
4086
4087 /* Enter a new context without changing the indentation level */
4088 void
4089 hsincindent(void)
4090 {
4091 #ifdef HSP_DEBUG
4092     fprintf(stderr, "hsincindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4093 #endif
4094     hsentercontext(indenttab[icontexts] & ~1);
4095 }
4096
4097
4098 /* Turn off indentation processing, usually because an explicit "{" has been seen */
4099 void
4100 hsindentoff(void)
4101 {
4102     forgetindent = TRUE;
4103 }
4104
4105
4106 /* Enter a new layout context. */
4107 static void
4108 hsentercontext(int indent)
4109 {
4110     /* Enter new context and set indentation as specified */
4111     if (++icontexts >= MAX_CONTEXTS) {
4112         char errbuf[ERR_BUF_SIZE];
4113
4114         sprintf(errbuf, "`wheres' and `cases' nested too deeply (>%d)", MAX_CONTEXTS - 1);
4115         hsperror(errbuf);
4116     }
4117     forgetindent = FALSE;
4118     indenttab[icontexts] = indent;
4119 #ifdef HSP_DEBUG
4120     fprintf(stderr, "hsentercontext:indent=%d,hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", indent, hscolno, hspcolno, icontexts, INDENTPT);
4121 #endif
4122 }
4123
4124
4125 /* Exit a layout context */
4126 void
4127 hsendindent(void)
4128 {
4129     --icontexts;
4130 #ifdef HSP_DEBUG
4131     fprintf(stderr, "hsendindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
4132 #endif
4133 }
4134
4135 /*
4136  *      Return checks the indentation level and returns ;, } or the specified token.
4137  */
4138
4139 static int
4140 Return(int tok)
4141 {
4142 #ifdef HSP_DEBUG
4143     extern int yyleng;
4144 #endif
4145
4146     if (hsshouldindent()) {
4147         if (hspcolno < INDENTPT) {
4148 #ifdef HSP_DEBUG
4149             fprintf(stderr, "inserted '}' before %d (%d:%d:%d:%d)\n", tok, hspcolno, hscolno, yyleng, INDENTPT);
4150 #endif
4151             hssttok = tok;
4152             return (VCCURLY);
4153         } else if (hspcolno == INDENTPT) {
4154 #ifdef HSP_DEBUG
4155             fprintf(stderr, "inserted ';' before %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4156 #endif
4157             hssttok = -tok;
4158             return (SEMI);
4159         }
4160     }
4161     hssttok = -1;
4162 #ifdef HSP_DEBUG
4163     fprintf(stderr, "returning %d (%d:%d)\n", tok, hspcolno, INDENTPT);
4164 #endif
4165     return (tok);
4166 }
4167
4168
4169 /*
4170  *      Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
4171  */
4172 int
4173 yylex()
4174 {
4175     int tok;
4176     static BOOLEAN eof = FALSE;
4177
4178     if (!eof) {
4179         if (hssttok != -1) {
4180             if (hssttok < 0) {
4181                 tok = -hssttok;
4182                 hssttok = -1;
4183                 return tok;
4184             }
4185             RETURN(hssttok);
4186         } else {
4187             endlineno = hslineno;
4188             if ((tok = yylex1()) != EOF)
4189                 return tok;
4190             else
4191                 eof = TRUE;
4192         }
4193     }
4194     if (icontexts > icontexts_save) {
4195         if (INDENTON) {
4196             eof = TRUE;
4197             indenttab[icontexts] = 0;
4198             return (VCCURLY);
4199         } else
4200             hsperror("missing '}' at end of file");
4201     } else if (hsbuf_save != NULL) {
4202         fclose(yyin);
4203         yy_delete_buffer(YY_CURRENT_BUFFER);
4204         yy_switch_to_buffer(hsbuf_save);
4205         hsbuf_save = NULL;
4206         new_filename(filename_save);
4207         free(filename_save);
4208         hslineno = hslineno_save;
4209         hsplineno = hsplineno_save;
4210         hscolno = hscolno_save;
4211         hspcolno = hspcolno_save;
4212         etags = etags_save;
4213         in_interface = FALSE;
4214         icontexts = icontexts_save - 1;
4215         icontexts_save = 0;
4216 #ifdef HSP_DEBUG
4217         fprintf(stderr, "finished reading interface (%d:%d:%d)\n", hscolno, hspcolno, INDENTPT);
4218 #endif
4219         eof = FALSE;
4220         RETURN(LEOF);
4221     } else {
4222         yyterminate();
4223     }
4224     abort(); /* should never get here! */
4225     return(0);
4226 }
4227
4228 /**********************************************************************
4229 *                                                                     *
4230 *                                                                     *
4231 *     Input Processing for Interfaces                                 *
4232 *                                                                     *
4233 *                                                                     *
4234 **********************************************************************/
4235
4236 /* setyyin(file)        open file as new lex input buffer */
4237 extern FILE *yyin;
4238
4239 void
4240 setyyin(char *file)
4241 {
4242     hsbuf_save = YY_CURRENT_BUFFER;
4243     if ((yyin = fopen(file, "r")) == NULL) {
4244         char errbuf[ERR_BUF_SIZE];
4245
4246         sprintf(errbuf, "can't read \"%-.50s\"", file);
4247         hsperror(errbuf);
4248     }
4249     yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
4250
4251     hslineno_save = hslineno;
4252     hsplineno_save = hsplineno;
4253     hslineno = hsplineno = 1;
4254
4255     filename_save = input_filename;
4256     input_filename = NULL;
4257     new_filename(file);
4258     hscolno_save = hscolno;
4259     hspcolno_save = hspcolno;
4260     hscolno = hspcolno = 0;
4261     in_interface = TRUE;
4262     etags_save = etags; /* do not do "etags" stuff in interfaces */
4263     etags = 0;          /* We remember whether we are doing it in
4264                            the module, so we can restore it later [WDP 94/09] */
4265     hsentercontext(-1);         /* partain: changed this from 0 */
4266     icontexts_save = icontexts;
4267 #ifdef HSP_DEBUG
4268     fprintf(stderr, "reading %s (%d:%d:%d)\n", input_filename, hscolno_save, hspcolno_save, INDENTPT);
4269 #endif
4270 }
4271
4272 static void
4273 layout_input(char *text, int len)
4274 {
4275 #ifdef HSP_DEBUG
4276     fprintf(stderr, "Scanning \"%s\"\n", text);
4277 #endif
4278
4279     hsplineno = hslineno;
4280     hspcolno = hscolno;
4281
4282     while (len-- > 0) {
4283         switch (*text++) {
4284         case '\n':
4285         case '\r':
4286         case '\f':
4287             hslineno++;
4288             hscolno = 0;
4289             break;
4290         case '\t':
4291             hscolno += 8 - (hscolno % 8);       /* Tabs stops are 8 columns apart */
4292             break;
4293         case '\v':
4294             break;
4295         default:
4296             ++hscolno;
4297             break;
4298         }
4299     }
4300 }
4301
4302 void
4303 setstartlineno(void)
4304 {
4305     startlineno = hsplineno;
4306 #if 1/*etags*/
4307 #else
4308     if (etags)
4309         fprintf(stderr,"%u\tsetstartlineno (col %u)\n",startlineno,hscolno);
4310 #endif
4311 }
4312
4313 /**********************************************************************
4314 *                                                                     *
4315 *                                                                     *
4316 *                      Text Caching                                   *
4317 *                                                                     *
4318 *                                                                     *
4319 **********************************************************************/
4320
4321 #define CACHE_SIZE YY_BUF_SIZE
4322
4323 static struct {
4324     unsigned allocated;
4325     unsigned next;
4326     char *text;
4327 } textcache = { 0, 0, NULL };
4328
4329 static void
4330 cleartext(void)
4331 {
4332 /*  fprintf(stderr, "cleartext\n"); */
4333     textcache.next = 0;
4334     if (textcache.allocated == 0) {
4335         textcache.allocated = CACHE_SIZE;
4336         textcache.text = xmalloc(CACHE_SIZE);
4337     }
4338 }
4339
4340 static void
4341 addtext(char *text, unsigned length)
4342 {
4343 /*  fprintf(stderr, "addtext: %d %s\n", length, text); */
4344
4345     if (length == 0)
4346         return;
4347
4348     if (textcache.next + length + 1 >= textcache.allocated) {
4349         textcache.allocated += length + CACHE_SIZE;
4350         textcache.text = xrealloc(textcache.text, textcache.allocated);
4351     }
4352     bcopy(text, textcache.text + textcache.next, length);
4353     textcache.next += length;
4354 }
4355
4356 static void
4357 addchar(char c)
4358 {
4359 /*  fprintf(stderr, "addchar: %c\n", c); */
4360
4361     if (textcache.next + 2 >= textcache.allocated) {
4362         textcache.allocated += CACHE_SIZE;
4363         textcache.text = xrealloc(textcache.text, textcache.allocated);
4364     }
4365     textcache.text[textcache.next++] = c;
4366 }
4367
4368 static char *
4369 fetchtext(unsigned *length)
4370 {
4371 /*  fprintf(stderr, "fetchtext: %d\n", textcache.next); */
4372
4373     *length = textcache.next;
4374     textcache.text[textcache.next] = '\0';
4375     return textcache.text;
4376 }
4377
4378 /**********************************************************************
4379 *                                                                     *
4380 *                                                                     *
4381 *    Identifier Processing                                             *
4382 *                                                                     *
4383 *                                                                     *
4384 **********************************************************************/
4385
4386 /*
4387         hsnewid         Enters an id of length n into the symbol table.
4388 */
4389
4390 static void
4391 hsnewid(char *name, int length)
4392 {
4393     char save = name[length];
4394
4395     name[length] = '\0';
4396     yylval.uid = installid(name);
4397     name[length] = save;
4398 }
4399
4400 BOOLEAN 
4401 isconstr(char *s) /* walks past leading underscores before using the macro */
4402 {
4403     char *temp = s;
4404
4405     for ( ; temp != NULL && *temp == '_' ; temp++ );
4406
4407     return _isconstr(temp);
4408 }