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