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