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