source: git/Singular/libparse.cc @ 85e68dd

spielwiese
Last change on this file since 85e68dd was 85e68dd, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: gcc 4.2 git-svn-id: file:///usr/local/Singular/svn/trunk@10634 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 107.4 KB
Line 
1#define yy_create_buffer yylp_create_buffer
2#define yy_delete_buffer yylp_delete_buffer
3#define yy_scan_buffer yylp_scan_buffer
4#define yy_scan_string yylp_scan_string
5#define yy_scan_bytes yylp_scan_bytes
6#define yy_flex_debug yylp_flex_debug
7#define yy_init_buffer yylp_init_buffer
8#define yy_flush_buffer yylp_flush_buffer
9#define yy_load_buffer_state yylp_load_buffer_state
10#define yy_switch_to_buffer yylp_switch_to_buffer
11#define yyin yylpin
12#define yyleng yylpleng
13#define yylex yylplex
14#define yyout yylpout
15#define yyrestart yylprestart
16#define yytext yylptext
17#define yywrap yylpwrap
18
19/* A lexical scanner generated by flex */
20
21/* Scanner skeleton version:
22 * $Header: /exports/cvsroot-2/cvsroot/Singular/libparse.cc,v 1.13 2008-03-19 17:44:35 Singular Exp $
23 */
24
25#define FLEX_SCANNER
26#define YY_FLEX_MAJOR_VERSION 2
27#define YY_FLEX_MINOR_VERSION 5
28
29#include <stdio.h>
30
31
32/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
33#ifdef c_plusplus
34#ifndef __cplusplus
35#define __cplusplus
36#endif
37#endif
38
39
40#ifdef __cplusplus
41
42#include <stdlib.h>
43#include <unistd.h>
44
45/* Use prototypes in function declarations. */
46#define YY_USE_PROTOS
47
48/* The "const" storage-class-modifier is valid. */
49#define YY_USE_CONST
50
51#else   /* ! __cplusplus */
52
53#if __STDC__
54
55#define YY_USE_PROTOS
56#define YY_USE_CONST
57
58#endif  /* __STDC__ */
59#endif  /* ! __cplusplus */
60
61#ifdef __TURBOC__
62 #pragma warn -rch
63 #pragma warn -use
64#include <io.h>
65#include <stdlib.h>
66#define YY_USE_CONST
67#define YY_USE_PROTOS
68#endif
69
70#ifdef YY_USE_CONST
71#define yyconst const
72#else
73#define yyconst
74#endif
75
76
77#ifdef YY_USE_PROTOS
78#define YY_PROTO(proto) proto
79#else
80#define YY_PROTO(proto) ()
81#endif
82
83/* Returned upon end-of-file. */
84#define YY_NULL 0
85
86/* Promotes a possibly negative, possibly signed char to an unsigned
87 * integer for use as an array index.  If the signed char is negative,
88 * we want to instead treat it as an 8-bit unsigned char, hence the
89 * double cast.
90 */
91#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
92
93/* Enter a start condition.  This macro really ought to take a parameter,
94 * but we do it the disgusting crufty way forced on us by the ()-less
95 * definition of BEGIN.
96 */
97#define BEGIN yy_start = 1 + 2 *
98
99/* Translate the current start state into a value that can be later handed
100 * to BEGIN to return to the state.  The YYSTATE alias is for lex
101 * compatibility.
102 */
103#define YY_START ((yy_start - 1) / 2)
104#define YYSTATE YY_START
105
106/* Action number for EOF rule of a given start state. */
107#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
108
109/* Special action meaning "start processing a new file". */
110#define YY_NEW_FILE yyrestart( yyin )
111
112#define YY_END_OF_BUFFER_CHAR 0
113
114/* Size of default input buffer. */
115#define YY_BUF_SIZE 16384
116
117typedef struct yy_buffer_state *YY_BUFFER_STATE;
118
119extern int yyleng;
120extern FILE *yyin, *yyout;
121
122#define EOB_ACT_CONTINUE_SCAN 0
123#define EOB_ACT_END_OF_FILE 1
124#define EOB_ACT_LAST_MATCH 2
125
126/* The funky do-while in the following #define is used to turn the definition
127 * int a single C statement (which needs a semi-colon terminator).  This
128 * avoids problems with code like:
129 *
130 *      if ( condition_holds )
131 *              yyless( 5 );
132 *      else
133 *              do_something_else();
134 *
135 * Prior to using the do-while the compiler would get upset at the
136 * "else" because it interpreted the "if" statement as being all
137 * done when it reached the ';' after the yyless() call.
138 */
139
140/* Return all but the first 'n' matched characters back to the input stream. */
141
142#define yyless(n) \
143        do \
144                { \
145                /* Undo effects of setting up yytext. */ \
146                *yy_cp = yy_hold_char; \
147                YY_RESTORE_YY_MORE_OFFSET \
148                yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
149                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
150                } \
151        while ( 0 )
152
153#define unput(c) yyunput( c, yytext_ptr )
154
155/* The following is because we cannot portably get our hands on size_t
156 * (without autoconf's help, which isn't available because we want
157 * flex-generated scanners to compile on their own).
158 */
159typedef unsigned int yy_size_t;
160
161
162struct yy_buffer_state
163        {
164        FILE *yy_input_file;
165
166        char *yy_ch_buf;                /* input buffer */
167        char *yy_buf_pos;               /* current position in input buffer */
168
169        /* Size of input buffer in bytes, not including room for EOB
170         * characters.
171         */
172        yy_size_t yy_buf_size;
173
174        /* Number of characters read into yy_ch_buf, not including EOB
175         * characters.
176         */
177        int yy_n_chars;
178
179        /* Whether we "own" the buffer - i.e., we know we created it,
180         * and can realloc() it to grow it, and should free() it to
181         * delete it.
182         */
183        int yy_is_our_buffer;
184
185        /* Whether this is an "interactive" input source; if so, and
186         * if we're using stdio for input, then we want to use getc()
187         * instead of fread(), to make sure we stop fetching input after
188         * each newline.
189         */
190        int yy_is_interactive;
191
192        /* Whether we're considered to be at the beginning of a line.
193         * If so, '^' rules will be active on the next match, otherwise
194         * not.
195         */
196        int yy_at_bol;
197
198        /* Whether to try to fill the input buffer when we reach the
199         * end of it.
200         */
201        int yy_fill_buffer;
202
203        int yy_buffer_status;
204#define YY_BUFFER_NEW 0
205#define YY_BUFFER_NORMAL 1
206        /* When an EOF's been seen but there's still some text to process
207         * then we mark the buffer as YY_EOF_PENDING, to indicate that we
208         * shouldn't try reading from the input source any more.  We might
209         * still have a bunch of tokens to match, though, because of
210         * possible backing-up.
211         *
212         * When we actually see the EOF, we change the status to "new"
213         * (via yyrestart()), so that the user can continue scanning by
214         * just pointing yyin at a new input file.
215         */
216#define YY_BUFFER_EOF_PENDING 2
217        };
218
219static YY_BUFFER_STATE yy_current_buffer = 0;
220
221/* We provide macros for accessing buffer states in case in the
222 * future we want to put the buffer states in a more general
223 * "scanner state".
224 */
225#define YY_CURRENT_BUFFER yy_current_buffer
226
227
228/* yy_hold_char holds the character lost when yytext is formed. */
229static char yy_hold_char;
230
231static int yy_n_chars;          /* number of characters read into yy_ch_buf */
232
233
234int yyleng;
235
236/* Points to current character in buffer. */
237static char *yy_c_buf_p = (char *) 0;
238static int yy_init = 1;         /* whether we need to initialize */
239static int yy_start = 0;        /* start state number */
240
241/* Flag which is used to allow yywrap()'s to do buffer switches
242 * instead of setting up a fresh yyin.  A bit of a hack ...
243 */
244static int yy_did_buffer_switch_on_eof;
245
246void yyrestart YY_PROTO(( FILE *input_file ));
247
248void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
249void yy_load_buffer_state YY_PROTO(( void ));
250YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
251void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
252void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
253void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
255
256YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
257YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
258YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
259
260static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
261static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
262static void yy_flex_free YY_PROTO(( void * ));
263
264#define yy_new_buffer yy_create_buffer
265
266#define yy_set_interactive(is_interactive) \
267        { \
268        if ( ! yy_current_buffer ) \
269                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
270        yy_current_buffer->yy_is_interactive = is_interactive; \
271        }
272
273#define yy_set_bol(at_bol) \
274        { \
275        if ( ! yy_current_buffer ) \
276                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
277        yy_current_buffer->yy_at_bol = at_bol; \
278        }
279
280#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
281
282typedef unsigned char YY_CHAR;
283FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
284typedef int yy_state_type;
285extern char *yytext;
286#define yytext_ptr yytext
287
288static yy_state_type yy_get_previous_state YY_PROTO(( void ));
289static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
290static int yy_get_next_buffer YY_PROTO(( void ));
291static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
292
293/* Done after the current pattern has been matched and before the
294 * corresponding action - sets up yytext.
295 */
296#define YY_DO_BEFORE_ACTION \
297        yytext_ptr = yy_bp; \
298        yytext_ptr -= yy_more_len; \
299        yyleng = (int) (yy_cp - yytext_ptr); \
300        yy_hold_char = *yy_cp; \
301        *yy_cp = '\0'; \
302        yy_c_buf_p = yy_cp;
303
304#define YY_NUM_RULES 96
305#define YY_END_OF_BUFFER 97
306static yyconst short int yy_accept[485] =
307    {   0,
308        0,    0,    0,    0,   28,   28,    0,    0,    0,    0,
309        0,    0,    0,    0,    0,    0,   49,   49,    0,    0,
310        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
311        0,    0,    0,    0,    0,    0,    0,    0,   97,   95,
312        1,   92,   93,    2,   94,   95,   95,   95,   95,   95,
313       95,   95,   95,   95,   20,   19,   20,   20,   20,   20,
314       20,   20,   20,   20,   29,   28,   27,   29,   29,   29,
315       29,   29,   29,   29,   29,   96,   30,   96,   96,   96,
316       39,   32,   36,   33,   34,   38,   35,   43,   43,   96,
317       43,   43,   43,   43,   43,   43,   42,   47,   46,   47,
318
319       45,   49,   51,   48,   50,   63,   62,   53,   58,   59,
320       63,   60,   61,   63,   56,   57,   83,   82,   75,   78,
321       79,   83,   80,   81,   76,   77,   88,   87,   84,   88,
322       73,   72,   70,   73,   91,   90,   91,   66,   65,   64,
323       69,   68,   67,    0,    1,    0,    0,    0,    0,    0,
324        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
325        0,    0,    0,   28,   28,    0,    0,    0,    0,    0,
326        0,    0,    0,   30,    0,   31,    0,    0,   37,    0,
327        0,    0,    0,    0,    0,    0,   42,    0,    0,    0,
328        0,    0,   42,   42,   44,   49,   52,    0,   74,   86,
329
330       85,   71,   89,    0,    1,    1,    0,    1,    0,    0,
331        0,    0,    0,    0,    0,    0,    0,    0,   14,   13,
332        0,    0,    0,    0,    0,    0,   28,   28,   28,   28,
333       22,   21,    0,    0,    0,    0,    0,    0,   37,   37,
334        0,    0,    0,   41,    0,   42,    0,    0,    0,    0,
335        0,   52,    0,   74,    0,    0,    0,    1,    0,    0,
336        0,    0,    0,    0,    0,    0,    0,    0,   14,   13,
337       13,    0,    0,    0,    0,    0,    0,    0,   28,   22,
338       21,   21,    0,    0,    0,    0,    0,    0,    0,    0,
339        0,   41,    0,    0,   40,    0,   41,    0,    0,    0,
340
341       10,   11,    0,    0,    0,    0,    0,    0,    0,    0,
342        0,    0,    0,   13,    0,    0,    0,    0,   16,    0,
343       17,    0,   15,   21,    0,    0,    0,    0,   23,    0,
344       25,    0,   24,    0,    0,   40,    0,    0,    0,    0,
345        0,    0,    0,    0,    0,    8,    8,    7,    0,    0,
346        5,    0,    0,    0,    0,   12,    0,    0,    0,   18,
347        0,    0,    0,   26,    0,    0,    0,    0,    0,   55,
348        0,    0,    8,    8,    0,    9,    0,    0,    3,    0,
349        0,    8,    8,    8,    5,    5,    0,    0,   12,   12,
350       12,    0,    0,    0,    0,    0,    0,    8,    8,    8,
351
352        0,    3,    3,    0,    0,    0,    0,    0,    0,    0,
353        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
354        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
355        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
356        0,    6,    0,    0,   12,    0,    0,    0,    0,    0,
357        0,   54,    0,    0,    0,    0,    0,    4,    0,    0,
358        6,    6,   12,   12,   12,    0,    0,    0,    0,    0,
359        0,    0,    4,    4,    0,    0,    0,    0,    0,    0,
360        0,    0,    0,    0
361    } ;
362
363static yyconst int yy_ec[256] =
364    {   0,
365        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
366        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
367        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
368        1,    5,    6,    7,    8,    9,   10,   11,   12,   13,
369       14,   15,   11,   16,   11,   10,   17,   18,   18,   18,
370       18,   18,   18,   18,   18,   18,   18,   19,   20,   11,
371       21,   11,   11,   12,   22,   23,   22,   22,   22,   22,
372       22,   24,   25,   22,   22,   26,   22,   22,   22,   22,
373       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
374       27,   28,   29,   30,   31,   11,   32,   22,   33,   34,
375
376       35,   36,   37,   22,   38,   22,   22,   39,   40,   41,
377       42,   43,   22,   44,   45,   46,   47,   48,   22,   49,
378       50,   22,   51,   11,   52,   11,    1,    1,    1,    1,
379        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
380        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
381        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
382        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
383        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
384        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
385        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
386
387        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
388        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
389        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
390        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
391        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
392        1,    1,    1,    1,    1
393    } ;
394
395static yyconst int yy_meta[53] =
396    {   0,
397        1,    2,    3,    4,    2,    1,    5,    6,    1,    5,
398        1,    7,    8,    9,    5,   10,    5,   11,    5,    1,
399        1,    7,    7,    7,    7,    7,    1,    1,    1,    5,
400        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
401        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
402        4,    1
403    } ;
404
405static yyconst short int yy_base[533] =
406    {   0,
407        0,   47,    6,   93,  140,  187,  235,  287,  339,  391,
408        5,   11,  443,    0,    9,   12,   63,   69,  493,  543,
409        0,    0,  593,  643,   72,   80,   81,   90,   26,   31,
410       24,   52,   54,   95,    0,    0,    0,    0, 1250, 2200,
411     1202, 2200, 2200, 1226, 2200, 1213, 1221, 1183, 1164, 1170,
412     1162, 1105, 1106, 1114, 2200, 2200, 1131,   61, 1115, 1105,
413     1100, 1108, 1117, 1096, 2200,   84, 2200, 1121,   95, 1105,
414     1095, 1091, 1098, 1100, 1073, 2200, 2200, 1109, 1099, 1101,
415     2200, 2200, 2200, 2200, 2200, 1083, 2200, 2200,  694,    0,
416        0,  125,  745,  144,  151,  157, 2200, 2200, 2200, 1048,
417
418     2200,   99, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200,
419     1080, 2200, 2200, 1052, 2200, 2200, 2200, 2200, 2200, 2200,
420     2200, 1073, 2200, 2200, 2200, 2200, 2200, 2200, 2200,    4,
421     2200, 2200, 2200,   14, 2200, 2200, 1071, 2200, 2200, 2200,
422     2200, 2200, 2200, 1041, 1066, 1056, 1071, 1029, 1042, 1032,
423     1024, 1033, 1024, 1002,  163, 1039, 1027,  984,  992,  983,
424      976,  986,  966,  111,  796,  985,  972,  941,  945,  936,
425      874,  894,  874, 2200,  908, 2200,  900,  906,  895,    0,
426        0,  172,    0,  179,  191,  207, 2200,  904,  903,  219,
427      902,   74,  847,  198, 2200,  119,    0,  866,    0, 2200,
428
429     2200, 2200, 2200,  865,    0,  889,  213,    0,  869,  760,
430      757,  659,  645,  263,  645,  245,   82,  672,    0,  671,
431      651,  643,  274,  639,  132,  650,  665,  651,  649,  642,
432        0,  632,  612,  601,  278,  593,  133,  601,    0,  611,
433      318,  324,  330,    0,  375,  612,    0,    0,  381,    0,
434      609,    0,  578,    0,  576,  349,  594,    0,  562,  555,
435      368,  161,  559,  404,  509,  547,  548,  547,    0,    0,
436      560,  538,  500,  412,  522,  536,  422,  564,    0,    0,
437        0,  551,  530,  550,  530,  559,  527,  571,  553,  586,
438      610, 2200,  622,  628,    0,  307, 2200,  536,  226,  214,
439
440     2200, 2200,  507,  509,  600,  660,  577,  514,  898,  918,
441      495,  491,  500,  501,  475,  637,  969,  975, 2200,  473,
442     2200,  502, 2200,  491,  459,  650,  981,  990, 2200,  457,
443     2200,  491, 2200,  996, 1001,    0,  646, 1051, 1010, 1101,
444     1005,  453,  406, 1014, 1151,  121, 2200, 2200,  433,  432,
445        0,  431,  430,  390,  396, 1203,  384, 1022,  381, 2200,
446      369, 1055,  362, 2200, 1029,  227,  370,  270,  526, 2200,
447      269,    0,  287, 2200,  349, 2200,  380,  358,    0,  357,
448      350,  288,  318,  343, 2200,  348, 1046,  312,    0, 1255,
449      311,  274, 1068,  254, 1089, 1093, 1076,  345,  403,  405,
450
451     1223, 2200,  290, 1118, 1124,  241, 1231, 1216, 1244, 1237,
452     1275, 1287, 1110,  101, 1307, 1293, 1314, 1344, 1334, 1351,
453     1364, 1374, 1394,  254, 1445, 1449, 1455, 1469, 1475, 1481,
454      662, 1300,  238,    0,  239, 1313,  154, 1490, 1510,  245,
455      200,    0,  199,  192, 1562, 1590, 1596, 1591,  605,  214,
456     1035, 2200, 1610, 1332, 1607,  190,  184,    0,  143,  137,
457     2200,  126,    0, 1641,  103, 1622,  155, 1692, 1655, 1673,
458     1722, 1712, 2200,  104, 1618,    0,   91, 1685,  220, 1728,
459      656,  230, 1734, 2200, 1765, 1776, 1787, 1798, 1809, 1820,
460     1831, 1842, 1853, 1864, 1875, 1886, 1897, 1908, 1919, 1926,
461
462     1933, 1944, 1955, 1966, 1977, 1988, 1999, 2010, 2021, 2032,
463     2042, 2048, 2054, 2064, 2065, 2076,   92, 2081, 2092, 2102,
464     2112, 2118, 2124, 2129,   51, 2140, 2150, 2160, 2167, 2177,
465     2183, 2188
466    } ;
467
468static yyconst short int yy_def[533] =
469    {   0,
470      485,  485,  486,  486,  487,  487,  488,  488,  489,  489,
471      490,  490,  484,   13,  491,  491,  492,  492,  493,  493,
472      492,  492,  494,  494,  495,  495,  496,  496,  497,  497,
473      498,  498,  499,  499,  492,  492,  492,  492,  484,  484,
474      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
475      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
476      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
477      484,  484,  484,  484,  484,  484,  484,  500,  484,  501,
478      484,  484,  484,  484,  484,  484,  484,  484,  484,   89,
479       89,   89,  484,   89,   89,   89,  484,  484,  484,  484,
480
481      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
482      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
483      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
484      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
485      484,  484,  484,  484,  502,  484,  484,  484,  484,  484,
486      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
487      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
488      484,  484,  484,  484,  500,  484,  484,  501,  503,   89,
489       89,   89,   93,   89,   89,   89,  484,   93,   93,   93,
490       93,   93,  484,   89,  484,  484,  504,  484,  505,  484,
491
492      484,  484,  484,  484,  502,  502,  484,  506,  484,  484,
493      484,  484,  484,  484,  484,  484,  484,  484,  507,  508,
494      484,  484,  484,  484,  484,  484,  165,  165,  165,  165,
495      509,  510,  484,  484,  484,  484,  484,  484,  503,  503,
496       89,   93,   93,  193,   93,   93,  193,  193,  484,  193,
497      193,  504,  484,  505,  484,  484,  484,  506,  484,  484,
498      484,  484,  484,  484,  484,  484,  484,  484,  507,  508,
499      508,  484,  484,  484,  484,  484,  484,  484,  165,  509,
500      510,  510,  484,  484,  484,  484,  484,  484,  484,   89,
501       89,  484,   93,   93,  193,  484,  484,  193,  511,  484,
502
503      484,  484,  484,  484,  484,  484,  512,  484,  484,  484,
504      484,  484,  484,  508,  484,  484,  484,  484,  484,  484,
505      484,  484,  484,  510,  484,  484,  484,  484,  484,  484,
506      484,  484,  484,  193,  193,  193,  511,  513,  511,  513,
507      514,  484,  484,  484,  484,  515,  484,  484,  310,  310,
508      310,  310,  310,  484,  484,  516,  484,  484,  484,  484,
509      484,  484,  484,  484,  484,  340,  517,  340,  340,  484,
510      339,  340,  518,  484,  484,  484,  345,  345,  345,  345,
511      345,  515,  515,  515,  484,  310,  484,  484,  519,  516,
512      390,  484,  484,  484,  484,  520,  521,  518,  518,  518,
513
514      484,  484,  345,  484,  484,  484,  484,  484,  484,  484,
515      484,  484,  522,  484,  523,  520,  520,  523,  521,  484,
516      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
517      524,  484,  525,  418,  484,  417,  417,  484,  484,  423,
518      423,  423,  423,  423,  526,  484,  484,  524,  484,  484,
519      484,  484,  527,  528,  524,  439,  439,  439,  439,  439,
520      484,  423,  529,  526,  464,  530,  484,  531,  527,  527,
521      531,  528,  484,  439,  532,  471,  484,  470,  470,  532,
522      484,  484,  532,    0,  484,  484,  484,  484,  484,  484,
523      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
524
525      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
526      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
527      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
528      484,  484
529    } ;
530
531static yyconst short int yy_nxt[2253] =
532    {   0,
533      484,   41,   42,   43,   41,  484,   82,   83,   56,   82,
534      200,   99,   82,   83,   99,   82,   44,   84,   85,   45,
535      202,   86,   57,   84,   85,   46,  139,   86,  136,   47,
536      140,  201,   48,  136,   49,   58,  100,   50,   59,  100,
537      137,  202,   51,   60,   52,  137,   53,   54,   41,   42,
538       43,   41,   61,   62,  139,   87,  142,  453,  140,  101,
539      143,   87,  101,   44,  102,  103,   45,  102,  156,  104,
540      102,  103,   46,  102,  128,  104,   47,  157,  129,   48,
541      245,   49,  128,  132,   50,  164,  129,  133,  164,   51,
542      217,   52,  132,   53,   54,   56,  133,  142,  396,  130,
543
544      196,  143,  166,  196,  483,  267,  268,  130,  134,   57,
545      473,  167,  164,  105,  432,  164,  433,  134,   63,  105,
546      196,  465,   58,  196,  246,   59,  182,  185,  185,  182,
547       60,  185,  461,  277,  288,   64,  277,  288,  383,   61,
548       62,   66,   67,  474,   66,  182,  185,  185,  182,  473,
549      185,  384,  182,  185,  185,  182,   68,  185,  182,  185,
550      185,  182,  307,  185,  216,  307,  435,  216,  432,   69,
551      433,  217,   70,  182,  185,  185,  182,   71,  185,  218,
552      182,  185,  185,  182,  437,  185,   72,   73,   66,   67,
553      473,   66,  182,  185,  185,  182,  473,  185,  462,  182,
554
555      185,  185,  182,   68,  185,  461,  461,  194,  182,  185,
556      185,  182,   74,  185,  256,  341,   69,  256,  341,   70,
557      242,  243,  243,  242,   71,  257,  435,  337,  365,   75,
558      337,  365,  477,   72,   73,   76,   76,   76,   76,   76,
559       76,   77,  477,   76,  450,   76,  216,   76,   76,  216,
560      479,  461,  455,  217,   76,   76,  339,  194,  340,  366,
561      482,   76,   76,   76,  264,  264,  264,  264,  454,  244,
562      371,  365,  445,  371,  365,  274,  274,  274,  274,  285,
563      285,  285,  285,  265,  424,   76,   76,   76,   76,   76,
564       76,   76,   76,   77,  275,   76,  402,   76,  286,   76,
565
566       76,  214,  366,  410,  399,  383,   76,   76,  296,  296,
567      296,  296,  223,   76,   76,   76,  235,  400,  384,  290,
568      291,  291,  290,  407,  241,  242,  243,  243,  242,  391,
569      241,  242,  243,  243,  242,  383,  241,   76,   76,   76,
570       76,   76,   76,   76,   76,   79,  406,   76,  384,   76,
571      256,   76,   76,  256,  385,  301,  403,  297,   76,   76,
572      383,  257,  399,  402,  402,   76,   76,   76,  292,  305,
573      305,  305,  305,  384,  244,  400,  293,  294,  294,  293,
574      244,  241,  296,  296,  296,  296,  402,  249,  306,   76,
575       76,   76,   76,   76,   76,   76,   76,   79,  401,   76,
576
577      397,   76,  395,   76,   76,  264,  264,  264,  264,  261,
578       76,   76,  394,  274,  274,  274,  274,   76,   76,   76,
579      399,  393,  399,  277,  265,  295,  277,  392,  321,  388,
580      387,  297,  275,  400,  322,  400,  386,  385,  385,  385,
581      376,   76,   76,   88,   89,   90,   91,   89,   92,   93,
582       92,   94,   92,   92,   94,   92,   92,   92,   92,   92,
583       94,   92,   92,   92,   95,   95,   95,   95,   95,   92,
584       96,   92,   92,   92,   95,   95,   95,   95,   95,   95,
585       95,   95,   95,   95,   95,   95,   95,   95,   95,   95,
586       95,   95,   95,   97,   92,  107,  375,  364,  363,  108,
587
588      361,  316,  316,  316,  316,  109,  110,  282,  360,  111,
589      309,  309,  309,  309,  359,  310,  357,  271,  356,  112,
590      317,  113,  355,  318,  318,  318,  318,  365,  319,  265,
591      365,  285,  285,  285,  285,  114,  354,  334,  335,  335,
592      334,  273,  275,  115,  116,  107,  348,  343,  342,  108,
593      286,  326,  326,  326,  326,  109,  110,  333,  366,  111,
594      328,  328,  328,  328,  330,  329,  325,  324,  323,  112,
595      327,  113,  288,  320,  315,  288,  314,  331,  307,  286,
596      313,  307,  312,  332,  311,  114,  336,  290,  291,  291,
597      290,  284,  185,  115,  116,  118,  308,  304,  303,  119,
598
599      302,  305,  305,  305,  305,  120,  121,  347,  300,  122,
600      299,  290,  291,  291,  290,  298,  185,  435,  241,  123,
601      306,  124,  449,  293,  294,  294,  293,  240,  241,  293,
602      294,  294,  293,  289,  241,  450,  292,  287,  316,  316,
603      316,  316,  284,  125,  126,  118,  283,  337,  282,  119,
604      337,  326,  326,  326,  326,  120,  121,  317,  279,  122,
605      292,  344,  344,  344,  344,  227,  345,  227,  477,  123,
606      327,  124,  295,  481,  435,  432,  339,  433,  295,  449,
607      306,  227,  278,  276,  273,  272,  482,  271,  155,  266,
608      263,  262,  450,  125,  126,  180,  181,  181,  180,  182,
609
610      183,  182,  184,  182,  182,  184,  182,  182,  182,  182,
611      182,  184,  182,  182,  182,  185,  185,  185,  185,  185,
612      182,  186,  182,  182,  182,  185,  185,  185,  185,  185,
613      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
614      185,  185,  185,  185,  187,  182,  188,  189,  189,  188,
615      188,  190,  188,  191,  188,  188,  191,  188,  188,  188,
616      188,  188,  191,  188,  188,  188,  189,  189,  189,  189,
617      189,  188,  192,  188,  188,  188,  189,  189,  189,  189,
618      189,  189,  189,  189,  189,  189,  189,  189,  189,  189,
619      189,  189,  189,  189,  189,  193,  188,  227,  261,  260,
620
621      227,  227,  228,  227,  229,  227,  227,  229,  227,  227,
622      227,  227,  230,  229,  227,  227,  227,  228,  228,  228,
623      228,  228,  227,  227,  227,  227,  227,  228,  228,  228,
624      228,  228,  228,  228,  228,  228,  228,  228,  228,  228,
625      228,  228,  228,  228,  228,  228,  227,  227,  247,  248,
626      248,  247,  247,  249,  247,  250,  247,  247,  250,  247,
627      247,  247,  247,  247,  250,  247,  247,  247,  248,  248,
628      248,  248,  248,  247,  251,  247,  247,  247,  248,  248,
629      248,  248,  248,  248,  248,  248,  248,  248,  248,  248,
630      248,  248,  248,  248,  248,  248,  248,  247,  247,  309,
631
632      309,  309,  309,  259,  310,  206,  255,  253,  241,  241,
633      241,  240,  177,  176,  174,  238,  237,  236,  265,  349,
634      350,  350,  349,  349,  351,  349,  352,  349,  349,  352,
635      349,  349,  349,  349,  349,  352,  349,  349,  349,  350,
636      350,  350,  350,  350,  349,  353,  349,  349,  349,  350,
637      350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
638      350,  350,  350,  350,  350,  350,  350,  350,  349,  349,
639      358,  358,  358,  358,  235,  319,  318,  318,  318,  318,
640      234,  319,  362,  362,  362,  362,  233,  329,  232,  317,
641      231,  328,  328,  328,  328,  275,  329,  334,  335,  335,
642
643      334,  327,  334,  335,  335,  334,  341,  226,  225,  341,
644      286,  365,  365,  365,  365,  344,  344,  344,  344,  224,
645      345,  223,  367,  358,  358,  358,  358,  222,  319,  221,
646      365,  365,  365,  365,  306,  374,  451,  451,  451,  451,
647      339,  367,  317,  220,  219,  215,  336,  404,  404,  404,
648      404,  336,  365,  365,  365,  365,  362,  362,  362,  362,
649      370,  329,  214,  367,  213,  212,  405,  211,  368,  408,
650      408,  408,  408,  210,  209,  327,  208,  413,  207,  370,
651      413,  369,  206,  414,  204,  452,  387,  203,  409,  199,
652      411,  411,  411,  411,  413,  198,  197,  413,  195,  179,
653
654      414,  370,  371,  365,  365,  371,  419,  177,  393,  412,
655      416,  413,  176,  367,  413,  174,  173,  414,  368,  404,
656      404,  404,  404,  417,  172,  422,  422,  422,  422,  395,
657      423,  369,  171,  372,  170,  169,  168,  165,  405,  163,
658      414,  162,  161,  160,  405,  159,  158,  155,  154,  153,
659      152,  370,  377,  378,  378,  377,  377,  379,  377,  380,
660      377,  377,  380,  377,  377,  377,  377,  377,  380,  377,
661      377,  377,  378,  378,  378,  378,  378,  377,  381,  377,
662      377,  377,  378,  378,  378,  378,  378,  378,  378,  378,
663      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
664
665      378,  377,  377,  389,  389,  151,  389,  389,  389,  389,
666      150,  389,  149,  389,  148,  389,  389,  408,  408,  408,
667      408,  391,  389,  389,  420,  420,  420,  420,  147,  389,
668      389,  389,  425,  425,  425,  425,  409,  146,  428,  428,
669      428,  428,  145,  421,  144,  427,  427,  427,  427,  484,
670      319,  426,  484,  389,  389,  389,  389,  429,  389,  389,
671      389,  389,  484,  389,  409,  389,  484,  389,  389,  484,
672      484,  484,  401,  484,  389,  389,  411,  411,  411,  411,
673      407,  389,  389,  389,  484,  484,  410,  484,  430,  430,
674      430,  430,  484,  329,  413,  412,  484,  413,  484,  484,
675
676      414,  451,  451,  451,  451,  389,  389,  412,  413,  484,
677      416,  413,  367,  484,  414,  413,  484,  484,  413,  435,
678      432,  414,  433,  417,  436,  435,  484,  432,  484,  433,
679      436,  416,  484,  466,  484,  413,  466,  437,  413,  467,
680      484,  414,  484,  437,  417,  413,  484,  432,  413,  433,
681      452,  414,  420,  420,  420,  420,  435,  432,  484,  433,
682      484,  436,  472,  484,  419,  438,  438,  438,  438,  484,
683      439,  421,  484,  484,  437,  422,  422,  422,  422,  484,
684      423,  484,  484,  484,  421,  484,  484,  484,  484,  484,
685      484,  484,  484,  484,  405,  440,  441,  441,  440,  440,
686
687      442,  440,  443,  440,  440,  443,  440,  440,  440,  440,
688      440,  443,  440,  440,  440,  441,  441,  441,  441,  441,
689      440,  444,  440,  440,  440,  441,  441,  441,  441,  441,
690      441,  441,  441,  441,  441,  441,  441,  441,  441,  441,
691      441,  441,  441,  441,  440,  440,  425,  425,  425,  425,
692      446,  446,  446,  446,  484,  319,  427,  427,  427,  427,
693      484,  319,  484,  484,  484,  426,  484,  484,  484,  426,
694      428,  428,  428,  428,  484,  409,  447,  447,  447,  447,
695      484,  329,  430,  430,  430,  430,  484,  329,  484,  429,
696      484,  438,  438,  438,  438,  429,  439,  484,  484,  484,
697
698      484,  412,  484,  484,  484,  484,  484,  484,  484,  484,
699      421,  456,  457,  457,  456,  456,  458,  456,  459,  456,
700      456,  459,  456,  456,  456,  456,  456,  459,  456,  456,
701      456,  457,  457,  457,  457,  457,  456,  460,  456,  456,
702      456,  457,  457,  457,  457,  457,  457,  457,  457,  457,
703      457,  457,  457,  457,  457,  457,  457,  457,  457,  457,
704      456,  456,  463,  463,  484,  463,  463,  463,  463,  484,
705      463,  484,  463,  484,  463,  463,  484,  484,  484,  484,
706      465,  463,  463,  484,  484,  484,  484,  484,  463,  463,
707      463,  446,  446,  446,  446,  484,  319,  447,  447,  447,
708
709      447,  484,  329,  435,  484,  484,  484,  484,  449,  484,
710      426,  466,  463,  463,  466,  484,  429,  467,  484,  435,
711      432,  450,  433,  466,  449,  484,  466,  469,  484,  467,
712      477,  432,  484,  433,  484,  481,  484,  450,  484,  484,
713      470,  463,  463,  484,  463,  463,  463,  463,  482,  463,
714      484,  463,  467,  463,  463,  484,  466,  484,  484,  466,
715      463,  463,  467,  484,  484,  484,  484,  463,  463,  463,
716      484,  484,  469,  484,  466,  484,  484,  466,  484,  484,
717      467,  484,  484,  484,  484,  470,  432,  484,  433,  484,
718      469,  463,  463,  466,  484,  484,  466,  477,  484,  467,
719
720      484,  484,  478,  470,  477,  432,  484,  433,  484,  478,
721      484,  484,  484,  466,  484,  479,  466,  484,  484,  467,
722      484,  484,  479,  466,  484,  432,  466,  433,  484,  467,
723      484,  484,  484,  484,  477,  432,  484,  433,  484,  478,
724      477,  484,  472,  484,  484,  481,  477,  432,  484,  433,
725      484,  481,  479,  484,  484,  484,  484,  484,  482,  484,
726      484,  484,  484,  484,  482,   40,   40,   40,   40,   40,
727       40,   40,   40,   40,   40,   40,   55,   55,   55,   55,
728       55,   55,   55,   55,   55,   55,   55,   65,   65,   65,
729       65,   65,   65,   65,   65,   65,   65,   65,   78,   78,
730
731       78,   78,   78,   78,   78,   78,   78,   78,   78,   80,
732       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
733       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
734       81,   98,   98,   98,   98,   98,   98,   98,   98,   98,
735       98,   98,   76,   76,   76,   76,   76,   76,   76,   76,
736       76,   76,   76,  106,  106,  106,  106,  106,  106,  106,
737      106,  106,  106,  106,  117,  117,  117,  117,  117,  117,
738      117,  117,  117,  117,  117,  127,  127,  127,  127,  127,
739      127,  127,  127,  127,  127,  127,  131,  131,  131,  131,
740      131,  131,  131,  131,  131,  131,  131,  135,  135,  135,
741
742      135,  135,  135,  135,  135,  135,  135,  135,  138,  138,
743      138,  138,  138,  138,  138,  138,  138,  138,  138,  141,
744      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
745      175,  175,  175,  484,  484,  175,  175,  178,  178,  178,
746      484,  484,  178,  178,  205,  205,  484,  205,  205,  205,
747      205,  205,  205,  205,  205,  239,  239,  484,  239,  239,
748      239,  239,  239,  239,  239,  239,  252,  252,  484,  252,
749      252,  252,  252,  252,  252,  252,  252,  254,  254,  484,
750      254,  254,  254,  254,  254,  254,  254,  254,  258,  258,
751      484,  258,  258,  258,  258,  258,  258,  258,  258,  269,
752
753      269,  484,  269,  269,  269,  269,  269,  269,  269,  269,
754      270,  270,  484,  270,  270,  270,  270,  270,  270,  270,
755      270,  280,  280,  484,  280,  280,  280,  280,  280,  280,
756      280,  280,  281,  281,  484,  281,  281,  281,  281,  281,
757      281,  281,  281,  338,  484,  484,  484,  484,  338,  346,
758      484,  484,  484,  484,  346,  366,  366,  366,  484,  484,
759      366,  366,  484,  484,  366,  373,  484,  484,  484,  484,
760      373,  382,  484,  484,  484,  382,  390,  390,  484,  390,
761      390,  390,  390,  390,  390,  390,  390,  398,  484,  484,
762      484,  398,  389,  389,  484,  389,  389,  389,  389,  389,
763
764      389,  389,  389,  415,  484,  484,  484,  415,  415,  484,
765      484,  484,  415,  418,  484,  484,  484,  418,  418,  431,
766      484,  484,  484,  431,  431,  434,  484,  484,  484,  434,
767      434,  434,  434,  434,  434,  448,  448,  448,  448,  448,
768      464,  464,  484,  464,  464,  464,  464,  464,  464,  464,
769      464,  468,  484,  484,  484,  468,  468,  484,  484,  484,
770      468,  471,  484,  484,  484,  471,  471,  463,  463,  484,
771      463,  463,  463,  463,  463,  463,  463,  463,  475,  484,
772      484,  484,  475,  475,  476,  484,  484,  484,  476,  476,
773      476,  476,  476,  476,  480,  480,  480,  480,  480,   39,
774
775      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
776      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
777      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
778      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
779      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
780      484,  484
781    } ;
782
783static yyconst short int yy_chk[2253] =
784    {   0,
785        0,    1,    1,    1,    1,    0,   11,   11,    3,   11,
786      130,   15,   12,   12,   16,   12,    1,   11,   11,    1,
787      134,   11,    3,   12,   12,    1,   31,   12,   29,    1,
788       31,  130,    1,   30,    1,    3,   15,    1,    3,   16,
789       29,  134,    1,    3,    1,   30,    1,    1,    2,    2,
790        2,    2,    3,    3,   32,   11,   33,  525,   32,   15,
791       33,   12,   16,    2,   17,   17,    2,   17,   58,   17,
792       18,   18,    2,   18,   25,   18,    2,   58,   25,    2,
793      192,    2,   26,   27,    2,   66,   26,   27,   66,    2,
794      217,    2,   28,    2,    2,    4,   28,   34,  517,   25,
795
796      102,   34,   69,  102,  477,  217,  217,   26,   27,    4,
797      474,   69,  164,   17,  414,  164,  414,   28,    4,   18,
798      196,  465,    4,  196,  192,    4,   92,   92,   92,   92,
799        4,   92,  462,  225,  237,    4,  225,  237,  346,    4,
800        4,    5,    5,  460,    5,   94,   94,   94,   94,  459,
801       94,  346,   95,   95,   95,   95,    5,   95,   96,   96,
802       96,   96,  262,   96,  155,  262,  437,  155,  467,    5,
803      467,  155,    5,  182,  182,  182,  182,    5,  182,  155,
804      184,  184,  184,  184,  437,  184,    5,    5,    6,    6,
805      457,    6,  185,  185,  185,  185,  456,  185,  444,  194,
806
807      194,  194,  194,    6,  194,  443,  441,   96,  186,  186,
808      186,  186,    6,  186,  207,  300,    6,  207,  300,    6,
809      190,  190,  190,  190,    6,  207,  450,  299,  366,    6,
810      299,  366,  479,    6,    6,    7,    7,    7,    7,    7,
811        7,    7,  482,    7,  450,    7,  216,    7,    7,  216,
812      479,  440,  435,  216,    7,    7,  299,  186,  299,  366,
813      482,    7,    7,    7,  214,  214,  214,  214,  433,  190,
814      371,  368,  424,  371,  368,  223,  223,  223,  223,  235,
815      235,  235,  235,  214,  406,    7,    7,    8,    8,    8,
816        8,    8,    8,    8,  223,    8,  403,    8,  235,    8,
817
818        8,  214,  368,  394,  373,  382,    8,    8,  296,  296,
819      296,  296,  223,    8,    8,    8,  235,  373,  382,  241,
820      241,  241,  241,  392,  241,  242,  242,  242,  242,  391,
821      242,  243,  243,  243,  243,  383,  243,    8,    8,    9,
822        9,    9,    9,    9,    9,    9,  388,    9,  383,    9,
823      256,    9,    9,  256,  386,  256,  381,  296,    9,    9,
824      384,  256,  398,  380,  378,    9,    9,    9,  241,  261,
825      261,  261,  261,  384,  242,  398,  245,  245,  245,  245,
826      243,  245,  249,  249,  249,  249,  377,  249,  261,    9,
827        9,   10,   10,   10,   10,   10,   10,   10,  375,   10,
828
829      367,   10,  363,   10,   10,  264,  264,  264,  264,  261,
830       10,   10,  361,  274,  274,  274,  274,   10,   10,   10,
831      399,  359,  400,  277,  264,  245,  277,  357,  277,  355,
832      354,  249,  274,  399,  277,  400,  353,  352,  350,  349,
833      343,   10,   10,   13,   13,   13,   13,   13,   13,   13,
834       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
835       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
836       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
837       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
838       13,   13,   13,   13,   13,   19,  342,  332,  330,   19,
839
840      325,  273,  273,  273,  273,   19,   19,  324,  322,   19,
841      265,  265,  265,  265,  320,  265,  315,  314,  313,   19,
842      273,   19,  312,  275,  275,  275,  275,  369,  275,  265,
843      369,  285,  285,  285,  285,   19,  311,  298,  298,  298,
844      298,  273,  275,   19,   19,   20,  308,  304,  303,   20,
845      285,  284,  284,  284,  284,   20,   20,  289,  369,   20,
846      286,  286,  286,  286,  287,  286,  283,  282,  278,   20,
847      284,   20,  288,  276,  272,  288,  271,  288,  307,  286,
848      268,  307,  267,  288,  266,   20,  298,  290,  290,  290,
849      290,  284,  290,   20,   20,   23,  263,  260,  259,   23,
850
851      257,  305,  305,  305,  305,   23,   23,  307,  255,   23,
852      253,  291,  291,  291,  291,  251,  291,  449,  246,   23,
853      305,   23,  449,  293,  293,  293,  293,  240,  293,  294,
854      294,  294,  294,  238,  294,  449,  290,  236,  316,  316,
855      316,  316,  234,   23,   23,   24,  233,  337,  232,   24,
856      337,  326,  326,  326,  326,   24,   24,  316,  230,   24,
857      291,  306,  306,  306,  306,  229,  306,  228,  481,   24,
858      326,   24,  293,  481,  431,  431,  337,  431,  294,  431,
859      306,  227,  226,  224,  222,  221,  481,  220,  218,  215,
860      213,  212,  431,   24,   24,   89,   89,   89,   89,   89,
861
862       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
863       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
864       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
865       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
866       89,   89,   89,   89,   89,   89,   93,   93,   93,   93,
867       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
868       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
869       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
870       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
871       93,   93,   93,   93,   93,   93,   93,  165,  211,  210,
872
873      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
874      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
875      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
876      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
877      165,  165,  165,  165,  165,  165,  165,  165,  193,  193,
878      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
879      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
880      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
881      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
882      193,  193,  193,  193,  193,  193,  193,  193,  193,  309,
883
884      309,  309,  309,  209,  309,  206,  204,  198,  191,  189,
885      188,  179,  178,  177,  175,  173,  172,  171,  309,  310,
886      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
887      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
888      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
889      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
890      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
891      317,  317,  317,  317,  170,  317,  318,  318,  318,  318,
892      169,  318,  327,  327,  327,  327,  168,  327,  167,  317,
893      166,  328,  328,  328,  328,  318,  328,  334,  334,  334,
894
895      334,  327,  335,  335,  335,  335,  341,  163,  162,  341,
896      328,  339,  339,  339,  339,  344,  344,  344,  344,  161,
897      344,  160,  339,  358,  358,  358,  358,  159,  358,  158,
898      365,  365,  365,  365,  344,  341,  451,  451,  451,  451,
899      339,  365,  358,  157,  156,  154,  334,  387,  387,  387,
900      387,  335,  338,  338,  338,  338,  362,  362,  362,  362,
901      339,  362,  153,  338,  152,  151,  387,  150,  338,  393,
902      393,  393,  393,  149,  148,  362,  147,  397,  146,  365,
903      397,  338,  145,  397,  144,  451,  387,  137,  393,  122,
904      395,  395,  395,  395,  396,  114,  111,  396,  100,   86,
905
906      396,  338,  340,  340,  340,  340,  397,   80,  393,  395,
907      396,  413,   79,  340,  413,   78,   75,  413,  340,  404,
908      404,  404,  404,  396,   74,  405,  405,  405,  405,  395,
909      405,  340,   73,  340,   72,   71,   70,   68,  404,   64,
910      413,   63,   62,   61,  405,   60,   59,   57,   54,   53,
911       52,  340,  345,  345,  345,  345,  345,  345,  345,  345,
912      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
913      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
914      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
915      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
916
917      345,  345,  345,  356,  356,   51,  356,  356,  356,  356,
918       50,  356,   49,  356,   48,  356,  356,  408,  408,  408,
919      408,  356,  356,  356,  401,  401,  401,  401,   47,  356,
920      356,  356,  407,  407,  407,  407,  408,   46,  410,  410,
921      410,  410,   44,  401,   41,  409,  409,  409,  409,   39,
922      409,  407,    0,  356,  356,  390,  390,  410,  390,  390,
923      390,  390,    0,  390,  409,  390,    0,  390,  390,    0,
924        0,    0,  401,    0,  390,  390,  411,  411,  411,  411,
925      407,  390,  390,  390,    0,    0,  410,    0,  412,  412,
926      412,  412,    0,  412,  416,  411,    0,  416,    0,    0,
927
928      416,  432,  432,  432,  432,  390,  390,  412,  415,    0,
929      416,  415,  432,    0,  415,  417,    0,    0,  417,  415,
930      415,  417,  415,  416,  415,  436,  436,  417,  436,  417,
931      436,  417,    0,  454,    0,  419,  454,  415,  419,  454,
932        0,  419,    0,  436,  417,  418,    0,  419,  418,  419,
933      432,  418,  420,  420,  420,  420,  418,  418,    0,  418,
934        0,  418,  454,    0,  419,  421,  421,  421,  421,    0,
935      421,  420,    0,    0,  418,  422,  422,  422,  422,    0,
936      422,    0,    0,    0,  421,    0,    0,    0,    0,    0,
937        0,    0,    0,    0,  422,  423,  423,  423,  423,  423,
938
939      423,  423,  423,  423,  423,  423,  423,  423,  423,  423,
940      423,  423,  423,  423,  423,  423,  423,  423,  423,  423,
941      423,  423,  423,  423,  423,  423,  423,  423,  423,  423,
942      423,  423,  423,  423,  423,  423,  423,  423,  423,  423,
943      423,  423,  423,  423,  423,  423,  425,  425,  425,  425,
944      426,  426,  426,  426,    0,  426,  427,  427,  427,  427,
945        0,  427,    0,    0,    0,  425,    0,    0,    0,  426,
946      428,  428,  428,  428,    0,  427,  429,  429,  429,  429,
947        0,  429,  430,  430,  430,  430,    0,  430,    0,  428,
948        0,  438,  438,  438,  438,  429,  438,    0,    0,    0,
949
950        0,  430,    0,    0,    0,    0,    0,    0,    0,    0,
951      438,  439,  439,  439,  439,  439,  439,  439,  439,  439,
952      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
953      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
954      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
955      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
956      439,  439,  445,  445,    0,  445,  445,  445,  445,    0,
957      445,    0,  445,    0,  445,  445,    0,    0,    0,    0,
958      445,  445,  445,    0,    0,    0,    0,    0,  445,  445,
959      445,  446,  446,  446,  446,    0,  446,  447,  447,  447,
960
961      447,    0,  447,  448,  448,    0,  448,    0,  448,    0,
962      446,  453,  445,  445,  453,    0,  447,  453,    0,  455,
963      455,  448,  455,  466,  455,    0,  466,  453,    0,  466,
964      475,  475,    0,  475,    0,  475,    0,  455,    0,    0,
965      453,  464,  464,    0,  464,  464,  464,  464,  475,  464,
966        0,  464,  466,  464,  464,    0,  469,    0,    0,  469,
967      464,  464,  469,    0,    0,    0,    0,  464,  464,  464,
968        0,    0,  469,    0,  470,    0,    0,  470,    0,    0,
969      470,    0,    0,    0,    0,  469,  470,    0,  470,    0,
970      470,  464,  464,  468,    0,    0,  468,  478,  478,  468,
971
972      478,    0,  478,  470,  468,  468,    0,  468,    0,  468,
973        0,    0,    0,  472,    0,  478,  472,    0,    0,  472,
974        0,    0,  468,  471,    0,  472,  471,  472,    0,  471,
975        0,    0,    0,    0,  471,  471,    0,  471,    0,  471,
976      480,  480,  472,  480,    0,  480,  483,  483,    0,  483,
977        0,  483,  471,    0,    0,    0,    0,    0,  480,    0,
978        0,    0,    0,    0,  483,  485,  485,  485,  485,  485,
979      485,  485,  485,  485,  485,  485,  486,  486,  486,  486,
980      486,  486,  486,  486,  486,  486,  486,  487,  487,  487,
981      487,  487,  487,  487,  487,  487,  487,  487,  488,  488,
982
983      488,  488,  488,  488,  488,  488,  488,  488,  488,  489,
984      489,  489,  489,  489,  489,  489,  489,  489,  489,  489,
985      490,  490,  490,  490,  490,  490,  490,  490,  490,  490,
986      490,  491,  491,  491,  491,  491,  491,  491,  491,  491,
987      491,  491,  492,  492,  492,  492,  492,  492,  492,  492,
988      492,  492,  492,  493,  493,  493,  493,  493,  493,  493,
989      493,  493,  493,  493,  494,  494,  494,  494,  494,  494,
990      494,  494,  494,  494,  494,  495,  495,  495,  495,  495,
991      495,  495,  495,  495,  495,  495,  496,  496,  496,  496,
992      496,  496,  496,  496,  496,  496,  496,  497,  497,  497,
993
994      497,  497,  497,  497,  497,  497,  497,  497,  498,  498,
995      498,  498,  498,  498,  498,  498,  498,  498,  498,  499,
996      499,  499,  499,  499,  499,  499,  499,  499,  499,  499,
997      500,  500,  500,    0,    0,  500,  500,  501,  501,  501,
998        0,    0,  501,  501,  502,  502,    0,  502,  502,  502,
999      502,  502,  502,  502,  502,  503,  503,    0,  503,  503,
1000      503,  503,  503,  503,  503,  503,  504,  504,    0,  504,
1001      504,  504,  504,  504,  504,  504,  504,  505,  505,    0,
1002      505,  505,  505,  505,  505,  505,  505,  505,  506,  506,
1003        0,  506,  506,  506,  506,  506,  506,  506,  506,  507,
1004
1005      507,    0,  507,  507,  507,  507,  507,  507,  507,  507,
1006      508,  508,    0,  508,  508,  508,  508,  508,  508,  508,
1007      508,  509,  509,    0,  509,  509,  509,  509,  509,  509,
1008      509,  509,  510,  510,    0,  510,  510,  510,  510,  510,
1009      510,  510,  510,  511,    0,    0,    0,    0,  511,  512,
1010        0,    0,    0,    0,  512,  513,  513,  513,    0,    0,
1011      513,  513,    0,    0,  513,  514,    0,    0,    0,    0,
1012      514,  515,    0,    0,    0,  515,  516,  516,    0,  516,
1013      516,  516,  516,  516,  516,  516,  516,  518,    0,    0,
1014        0,  518,  519,  519,    0,  519,  519,  519,  519,  519,
1015
1016      519,  519,  519,  520,    0,    0,    0,  520,  520,    0,
1017        0,    0,  520,  521,    0,    0,    0,  521,  521,  522,
1018        0,    0,    0,  522,  522,  523,    0,    0,    0,  523,
1019      523,  523,  523,  523,  523,  524,  524,  524,  524,  524,
1020      526,  526,    0,  526,  526,  526,  526,  526,  526,  526,
1021      526,  527,    0,    0,    0,  527,  527,    0,    0,    0,
1022      527,  528,    0,    0,    0,  528,  528,  529,  529,    0,
1023      529,  529,  529,  529,  529,  529,  529,  529,  530,    0,
1024        0,    0,  530,  530,  531,    0,    0,    0,  531,  531,
1025      531,  531,  531,  531,  532,  532,  532,  532,  532,  484,
1026
1027      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
1028      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
1029      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
1030      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
1031      484,  484,  484,  484,  484,  484,  484,  484,  484,  484,
1032      484,  484
1033    } ;
1034
1035static yy_state_type yy_last_accepting_state;
1036static char *yy_last_accepting_cpos;
1037
1038/* The intent behind this definition is that it'll catch
1039 * any uses of REJECT which flex missed.
1040 */
1041#define REJECT reject_used_but_not_detected
1042static int yy_more_flag = 0;
1043static int yy_more_len = 0;
1044#define yymore() (yy_more_flag = 1)
1045#define YY_MORE_ADJ yy_more_len
1046#define YY_RESTORE_YY_MORE_OFFSET
1047char *yytext;
1048#line 1 "libparse.l"
1049#define INITIAL 0
1050#line 2 "libparse.l"
1051/****************************************
1052*  Computer Algebra System SINGULAR     *
1053****************************************/
1054/* $Id: libparse.cc,v 1.13 2008-03-19 17:44:35 Singular Exp $ */
1055#include <stdio.h>
1056#include <string.h>
1057#include <stdlib.h>
1058#include <ctype.h>
1059#include "mod2.h"
1060#ifdef STANDALONE_PARSER
1061  #include "utils.h"
1062  #define HAVE_LIBPARSER
1063  #define YYLPDEBUG 1
1064  #include "../kernel/febase.cc"
1065#else
1066  #include "subexpr.h"
1067  #include "grammar.h"
1068  #include "ipshell.h"
1069  #include "ipid.h"
1070  #include "tok.h"
1071  #include "febase.h"
1072  #include "omalloc.h"
1073#endif
1074#include "libparse.h"
1075
1076#ifdef HAVE_LIBPARSER
1077#define YY_SKIP_YYWRAP
1078
1079typedef enum { LP_NONE, LP_INFO, LP_CATEGORY, LP_URL, LP_VERSION} lib_cmds;
1080
1081int libread(FILE* f, char* buf, int max_size);
1082int current_pos(int i);
1083void print_version(lp_modes mode, char *p);
1084void copy_string(lp_modes mode);
1085extern void piCleanUp(procinfov pi);
1086void make_version(char *p, int what);
1087
1088int brace1 = 0;  /* { } */
1089int brace2 = 0;  /* ( ) */
1090int brace3 = 0;  /* [ ] */
1091int quote  = 0;  /* " */
1092int offset = 0;
1093BOOLEAN p_static = FALSE;
1094int old_state = 0;
1095lib_cmds last_cmd = LP_NONE;
1096
1097char libnamebuf[128];
1098char *text_buffer=NULL;
1099long string_start;
1100
1101char *yylp_buffer_start;
1102int yylplineno = 1;
1103int lpverbose = 0, check = 0;
1104int texinfo_out = 0;
1105int found_info=0,
1106    found_cat=0,
1107    found_version=0,
1108    found_oldhelp = 0,
1109    found_proc_in_proc = 0;
1110
1111const char *yylp_errlist[]= {
1112   "",
1113   "missing close bracket ')' for proc definition in line %d.",  /*  1 */
1114   "missing close bracket ')' for procbody in line %d.",         /*  2 */
1115   "missing close bracket ']' for procbody in line %d.",         /*  3 */
1116   "too many ')' closed brackets in line %d.",                   /*  4 */
1117   "too many ']' closed brackets in line %d.",                   /*  5 */
1118   "missing close bracket ')' for example in line %d.",          /*  6 */
1119   "missing close bracket ']' for example in line %d.",          /*  7 */
1120   "cannot assign character '%c' in line %d to any group.",      /*  8 */
1121   "there must be a quote missing somewhere before line %d.",    /*  9 */
1122   "missing close bracket '}' at end of library in line %d.",    /* 10 */
1123   "missing close bracket ')' at end of library in line %d.",    /* 11 */
1124   "missing close bracket ']' at end of library in line %d.",    /* 12 */
1125   NULL
1126};
1127int yylp_errno = 0;
1128
1129#ifdef STANDALONE_PARSER
1130procinfov pi;
1131int category_out = 0;
1132void printpi(procinfov pi);
1133void pi_clear(procinfov pi);
1134extern "C" {
1135  int yylpwrap();
1136}
1137void main_init(int argc, char *argv[]);
1138void main_result(char *libname);
1139#else /* STANDALONE_PARSER */
1140idhdl h0;
1141#ifdef HAVE_NS
1142idhdl h_top;
1143#endif
1144#define pi IDPROC(h0)
1145extern "C"
1146{
1147  int yylpwrap();
1148}
1149extern libstackv library_stack;
1150#endif /* STANDALONE_PARSER */
1151
1152static unsigned long help_chksum;
1153
1154#define SET_DEF_END(mode, pi, p) \
1155  if ( mode == LOAD_LIB) pi->data.s.def_end = p;
1156#define SET_HELP_START(mode, pi, p) \
1157  if ( mode == LOAD_LIB) {pi->data.s.help_start = p; help_chksum = 0;}
1158#define SET_HELP_END(mode, pi, p) \
1159  if ( mode == LOAD_LIB) {pi->data.s.help_end = p;  \
1160              pi->data.s.help_chksum = help_chksum;}
1161
1162#define SET_BODY_START(mode, pi, l, p) \
1163     if ( mode == LOAD_LIB)            \
1164     {                                 \
1165       pi->data.s.body_lineno = l;     \
1166       pi->data.s.body_start = p;      \
1167     }
1168#define SET_BODY_END(mode, pi, p) \
1169     if ( mode == LOAD_LIB)       \
1170     {                            \
1171       pi->data.s.body_end = p-1; \
1172       pi->data.s.proc_end = p-1; \
1173     }
1174
1175#define SET_EXAMPLE_START(mode, pi, l, p) \
1176   if ( mode == LOAD_LIB)                 \
1177   {                                      \
1178     pi->data.s.example_lineno = l;       \
1179     pi->data.s.example_start = p;        \
1180   }
1181#define SET_PROC_END(mode, pi, p)   \
1182     if ( mode == LOAD_LIB)         \
1183     {                              \
1184       pi->data.s.proc_end = p-1;   \
1185       if(pi->data.s.body_end==0)   \
1186         pi->data.s.body_end = p-1; \
1187     }
1188
1189#define ROTATE_RIGHT(c) if ((c) & 01) (c) = ((c) >>1) + 0x8000; else (c) >>= 1;
1190#define IncrCheckSum(c)                          \
1191do                                            \
1192{                                             \
1193  ROTATE_RIGHT(help_chksum);                  \
1194  help_chksum += c;                           \
1195  help_chksum &= 0xffff;                      \
1196}                                             \
1197while(0)
1198
1199#undef YY_DECL
1200#ifdef HAVE_NS
1201#define YY_DECL int yylex(char *newlib, char *libfile, \
1202                           lib_style_types *lib_style, \
1203                           idhdl pl, BOOLEAN autoexport, lp_modes mode)
1204#else
1205#define YY_DECL int yylex(char *newlib, char *libfile, \
1206                           lib_style_types *lib_style, \
1207                           lp_modes mode)
1208#endif /* HAVE_NS */
1209
1210#undef YY_INPUT
1211#define YY_INPUT(buf,result,max_size) \
1212          if ( ((result = libread( (yyin), (char *) buf, max_size )) < 0 ) \
1213                  && ferror( yyin ) ) \
1214                YY_FATAL_ERROR( "read in flex scanner failed" );
1215
1216#define YY_USER_INIT { \
1217       BEGIN(header); \
1218       yylplineno = 1; \
1219       yylp_errno = 0; \
1220       *lib_style = OLD_LIBSTYLE; \
1221       strcpy(libnamebuf,"(**unknown version**)"); \
1222     }
1223
1224#if 0
1225<pbody>proc[ \t]+{name}  {
1226                           printf("MISSING: PROC-cmd found. ERROR!\n"); }
1227<pbody>example[ \t]*\n   {
1228                           yylplineno++;
1229                           printf("MISSING: EXAMPLE-cmd found. ERROR!\n"); }
1230info=+"\"" {
1231#endif
1232
1233/* %start START */
1234#define header 1
1235
1236#define help 2
1237
1238#define libcmd 3
1239
1240#define libcmd2 4
1241
1242#define pdef 5
1243
1244#define phead 6
1245
1246#define poldhelp 7
1247
1248#define phelp 8
1249
1250#define pbody 9
1251
1252#define pstr 10
1253
1254#define pexample 11
1255
1256#define pestr 12
1257
1258#define string 13
1259
1260#define comment 14
1261
1262#define info 15
1263
1264#define category 16
1265
1266#define url 17
1267
1268#define version 18
1269
1270
1271/* Macros after this point can all be overridden by user definitions in
1272 * section 1.
1273 */
1274
1275#ifndef YY_SKIP_YYWRAP
1276#ifdef __cplusplus
1277extern "C" int yywrap YY_PROTO(( void ));
1278#else
1279extern int yywrap YY_PROTO(( void ));
1280#endif
1281#endif
1282
1283#ifndef YY_NO_UNPUT
1284static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1285#endif
1286
1287#ifndef yytext_ptr
1288static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1289#endif
1290
1291#ifdef YY_NEED_STRLEN
1292static int yy_flex_strlen YY_PROTO(( yyconst char * ));
1293#endif
1294
1295#ifndef YY_NO_INPUT
1296#ifdef __cplusplus
1297static int yyinput YY_PROTO(( void ));
1298#else
1299static int input YY_PROTO(( void ));
1300#endif
1301#endif
1302
1303#if YY_STACK_USED
1304static int yy_start_stack_ptr = 0;
1305static int yy_start_stack_depth = 0;
1306static int *yy_start_stack = 0;
1307#ifndef YY_NO_PUSH_STATE
1308static void yy_push_state YY_PROTO(( int new_state ));
1309#endif
1310#ifndef YY_NO_POP_STATE
1311static void yy_pop_state YY_PROTO(( void ));
1312#endif
1313#ifndef YY_NO_TOP_STATE
1314static int yy_top_state YY_PROTO(( void ));
1315#endif
1316
1317#else
1318#define YY_NO_PUSH_STATE 1
1319#define YY_NO_POP_STATE 1
1320#define YY_NO_TOP_STATE 1
1321#endif
1322
1323#ifdef YY_MALLOC_DECL
1324YY_MALLOC_DECL
1325#else
1326#if __STDC__
1327#ifndef __cplusplus
1328#include <stdlib.h>
1329#endif
1330#else
1331/* Just try to get by without declaring the routines.  This will fail
1332 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1333 * or sizeof(void*) != sizeof(int).
1334 */
1335#endif
1336#endif
1337
1338/* Amount of stuff to slurp up with each read. */
1339#ifndef YY_READ_BUF_SIZE
1340#define YY_READ_BUF_SIZE 8192
1341#endif
1342
1343/* Copy whatever the last rule matched to the standard output. */
1344
1345#ifndef ECHO
1346/* This used to be an fputs(), but since the string might contain NUL's,
1347 * we now use fwrite().
1348 */
1349#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1350#endif
1351
1352/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1353 * is returned in "result".
1354 */
1355#ifndef YY_INPUT
1356#define YY_INPUT(buf,result,max_size) \
1357        if ( yy_current_buffer->yy_is_interactive ) \
1358                { \
1359                int c = '*', n; \
1360                for ( n = 0; n < max_size && \
1361                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1362                        buf[n] = (char) c; \
1363                if ( c == '\n' ) \
1364                        buf[n++] = (char) c; \
1365                if ( c == EOF && ferror( yyin ) ) \
1366                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
1367                result = n; \
1368                } \
1369        else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1370                  && ferror( yyin ) ) \
1371                YY_FATAL_ERROR( "input in flex scanner failed" );
1372#endif
1373
1374/* No semi-colon after return; correct usage is to write "yyterminate();" -
1375 * we don't want an extra ';' after the "return" because that will cause
1376 * some compilers to complain about unreachable statements.
1377 */
1378#ifndef yyterminate
1379#define yyterminate() return YY_NULL
1380#endif
1381
1382/* Number of entries by which start-condition stack grows. */
1383#ifndef YY_START_STACK_INCR
1384#define YY_START_STACK_INCR 25
1385#endif
1386
1387/* Report a fatal error. */
1388#ifndef YY_FATAL_ERROR
1389#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1390#endif
1391
1392/* Default declaration of generated scanner - a define so the user can
1393 * easily add parameters.
1394 */
1395#ifndef YY_DECL
1396#define YY_DECL int yylex YY_PROTO(( void ))
1397#endif
1398
1399/* Code executed at the beginning of each rule, after yytext and yyleng
1400 * have been set up.
1401 */
1402#ifndef YY_USER_ACTION
1403#define YY_USER_ACTION
1404#endif
1405
1406/* Code executed at the end of each rule. */
1407#ifndef YY_BREAK
1408#define YY_BREAK break;
1409#endif
1410
1411#define YY_RULE_SETUP \
1412        if ( yyleng > 0 ) \
1413                yy_current_buffer->yy_at_bol = \
1414                                (yytext[yyleng - 1] == '\n'); \
1415        YY_USER_ACTION
1416
1417YY_DECL
1418        {
1419        register yy_state_type yy_current_state;
1420        register char *yy_cp = NULL, *yy_bp = NULL;
1421        register int yy_act;
1422
1423#line 237 "libparse.l"
1424
1425
1426        if ( yy_init )
1427                {
1428                yy_init = 0;
1429
1430#ifdef YY_USER_INIT
1431                YY_USER_INIT;
1432#endif
1433
1434                if ( ! yy_start )
1435                        yy_start = 1;   /* first start state */
1436
1437                if ( ! yyin )
1438                        yyin = stdin;
1439
1440                if ( ! yyout )
1441                        yyout = stdout;
1442
1443                if ( ! yy_current_buffer )
1444                        yy_current_buffer =
1445                                yy_create_buffer( yyin, YY_BUF_SIZE );
1446
1447                yy_load_buffer_state();
1448                }
1449
1450        while ( 1 )             /* loops until end-of-file is reached */
1451                {
1452                yy_more_len = 0;
1453                if ( yy_more_flag )
1454                        {
1455                        yy_more_len = yy_c_buf_p - yytext_ptr;
1456                        yy_more_flag = 0;
1457                        }
1458                yy_cp = yy_c_buf_p;
1459
1460                /* Support of yytext. */
1461                *yy_cp = yy_hold_char;
1462
1463                /* yy_bp points to the position in yy_ch_buf of the start of
1464                 * the current run.
1465                 */
1466                yy_bp = yy_cp;
1467
1468                yy_current_state = yy_start;
1469                yy_current_state += YY_AT_BOL();
1470yy_match:
1471                do
1472                        {
1473                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1474                        if ( yy_accept[yy_current_state] )
1475                                {
1476                                yy_last_accepting_state = yy_current_state;
1477                                yy_last_accepting_cpos = yy_cp;
1478                                }
1479                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1480                                {
1481                                yy_current_state = (int) yy_def[yy_current_state];
1482                                if ( yy_current_state >= 485 )
1483                                        yy_c = yy_meta[(unsigned int) yy_c];
1484                                }
1485                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1486                        ++yy_cp;
1487                        }
1488                while ( yy_base[yy_current_state] != 2200 );
1489
1490yy_find_action:
1491                yy_act = yy_accept[yy_current_state];
1492                if ( yy_act == 0 )
1493                        { /* have to back up */
1494                        yy_cp = yy_last_accepting_cpos;
1495                        yy_current_state = yy_last_accepting_state;
1496                        yy_act = yy_accept[yy_current_state];
1497                        }
1498
1499                YY_DO_BEFORE_ACTION;
1500
1501
1502do_action:      /* This label is used only to access EOF actions. */
1503
1504
1505                switch ( yy_act )
1506        { /* beginning of action switch */
1507                        case 0: /* must back up */
1508                        /* undo the effects of YY_DO_BEFORE_ACTION */
1509                        *yy_cp = yy_hold_char;
1510                        yy_cp = yy_last_accepting_cpos;
1511                        yy_current_state = yy_last_accepting_state;
1512                        goto yy_find_action;
1513
1514case 1:
1515YY_RULE_SETUP
1516#line 238 "libparse.l"
1517{ }
1518        YY_BREAK
1519case 2:
1520YY_RULE_SETUP
1521#line 239 "libparse.l"
1522{ old_state = YYSTATE; BEGIN(comment); }
1523        YY_BREAK
1524case 3:
1525YY_RULE_SETUP
1526#line 241 "libparse.l"
1527{
1528         yyless(4); old_state = YYSTATE; BEGIN(info);
1529       }
1530        YY_BREAK
1531case 4:
1532YY_RULE_SETUP
1533#line 244 "libparse.l"
1534{
1535         yyless(8); old_state = YYSTATE; BEGIN(category);
1536       }
1537        YY_BREAK
1538case 5:
1539YY_RULE_SETUP
1540#line 247 "libparse.l"
1541{
1542             if ( mode != GET_INFO )
1543             {
1544               #ifdef STANDALONE_PARSER
1545               if (texinfo_out)
1546               {
1547                 char *c = yytext;
1548                 printf("$url = \"");
1549                 while ((*c != '\0') && (*c != '"')) c++;
1550                 c++;
1551                 while ((*c != '\0') && (*c != '"'))
1552                 {
1553                    if (*c != '\r') putchar(*c);
1554                    c++;
1555                 }
1556                 printf("\";\n");
1557               }
1558               #endif
1559             }
1560       }
1561        YY_BREAK
1562case 6:
1563YY_RULE_SETUP
1564#line 268 "libparse.l"
1565{
1566             found_version++;
1567             if ( mode != GET_INFO )
1568             {
1569               make_version(yytext,1);
1570               #ifdef STANDALONE_PARSER
1571               if (texinfo_out)
1572               {
1573                 char *c = libnamebuf;
1574                 printf("$version = \"");
1575                 while (*c != '\0')
1576                 {
1577                    if (*== '$' || *== '@') putchar('\\');
1578                    if (*c != '\r') putchar(*c);
1579                    if (*== '\\')
1580                    {
1581                      c++;
1582                      if (*c != '"') putchar('\\');
1583                    }
1584                    else
1585                      c++;
1586                 }
1587                 printf("\";\n");
1588               }
1589               else if (!category_out)
1590                 printf("Version:%s;\n", libnamebuf);
1591               #else
1592               if (text_buffer!=NULL) omFree((ADDRESS)text_buffer);
1593               text_buffer = omStrDup(libnamebuf);
1594               omMarkAsStaticAddr(text_buffer);
1595               #endif
1596             }
1597           }
1598        YY_BREAK
1599case 7:
1600YY_RULE_SETUP
1601#line 302 "libparse.l"
1602{ p_static=TRUE; }
1603        YY_BREAK
1604case 8:
1605YY_RULE_SETUP
1606#line 304 "libparse.l"
1607{
1608             char proc[256];
1609             BEGIN(pdef);
1610             found_proc_in_proc = 0;
1611             proc[0]='\0';
1612             sscanf( yytext, "%*[^p]proc %s", proc);
1613             if(strlen(proc)<1) sscanf( yytext, "proc %s", proc);
1614             #if YYLPDEBUG > 1
1615             printf("Newlib:%s\n", newlib);
1616             #endif
1617             #ifdef STANDALONE_PARSER
1618             if ( pi != NULL )
1619             {
1620               printpi(pi);
1621               pi_clear(pi);
1622             }
1623             #ifdef STANDALONE_PARSER
1624             pi = (procinfo *)malloc(sizeof(procinfo));
1625             #else
1626             pi = (procinfo *)omAlloc(sizeof(procinfo));
1627             #endif
1628             iiInitSingularProcinfo(pi, newlib, proc, yylplineno,
1629                                    current_pos(0), p_static);
1630             #else /*STANDALONE_PARSER*/
1631             if( mode == LOAD_LIB)
1632             {
1633               #ifdef HAVE_NS
1634               h0 = enterid( proc, 0 /*myynest*/, PROC_CMD,
1635                                 &(IDPACKAGE(pl)->idroot), TRUE);
1636               if (h0==NULL) return(1);
1637               if((!p_static) && autoexport)
1638               {
1639                  package save=currPack;
1640                  currPack=basePack;
1641                  h_top = enterid( proc, 0 /*myynest*/, PROC_CMD,
1642                                 &(basePack->idroot), FALSE );
1643                  currPack=save;
1644                  if (h_top==NULL) return(1);
1645               }
1646               #else
1647               h0 = enterid( proc, 0 /*myynest*/, PROC_CMD,
1648                                   &IDROOT, TRUE );
1649               #endif /* HAVE_NS */
1650               /* omCheckAddr(IDID(h0)); */
1651               if (h0!=NULL)
1652               {
1653                 iiInitSingularProcinfo(IDPROC(h0), newlib, proc,
1654                                yylplineno, current_pos(0),p_static);
1655                 #ifdef HAVE_NS
1656                 if ((!p_static) && (h_top != NULL) && autoexport)
1657                 {
1658                   if(IDPROC(h_top)!=NULL) piCleanUp((procinfo *)IDPROC(h_top));
1659                   IDPROC(h_top)=IDPROC(h0);
1660                   IDPROC(h_top)->ref++;
1661                 }
1662                 IDPROC(h0)->pack=IDPACKAGE(pl);
1663                 #endif /* HAVE_NS */
1664                 if (BVERBOSE(V_LOAD_PROC))
1665                   Warn( "     proc '%s' registered", proc );
1666               }
1667               #endif /*STANDALONE_PARSER*/
1668               SET_DEF_END(mode, pi, current_pos(yyleng+1));
1669               #if YYLPDEBUG
1670               if(lpverbose)
1671               {
1672                  printf("// PROCEDURE '%s' status: %s, ", proc,
1673                      p_static ? "local" : "global");
1674                  printf("starting at line %d,%d: definition end: %d (%d).\n",
1675                      yylplineno, current_pos(0), (int)pi->data.s.def_end, brace1);
1676               }
1677               #endif
1678               p_static=FALSE;
1679             #ifndef STANDALONE_PARSER
1680             }
1681             #endif /*STANDALONE_PARSER*/
1682           }
1683        YY_BREAK
1684case 9:
1685YY_RULE_SETUP
1686#line 380 "libparse.l"
1687{
1688             BEGIN(pexample);
1689             SET_EXAMPLE_START(mode, pi, yylplineno, current_pos(0));
1690             #if YYLPDEBUG
1691             if(lpverbose)
1692             {
1693                printf("//     EXAMPLE at line %d,%d (%d)\n", yylplineno,
1694                    current_pos(0), brace1);
1695             }
1696             #endif
1697           }
1698        YY_BREAK
1699case 10:
1700YY_RULE_SETUP
1701#line 392 "libparse.l"
1702{ quote++;
1703             BEGIN(libcmd);
1704           }
1705        YY_BREAK
1706case 11:
1707YY_RULE_SETUP
1708#line 396 "libparse.l"
1709{ quote++; brace2++;
1710             BEGIN(libcmd2);
1711           }
1712        YY_BREAK
1713case 12:
1714YY_RULE_SETUP
1715#line 400 "libparse.l"
1716{
1717             make_version(yytext, 0);
1718             #if YYLPDEBUG > 1
1719             printf("+(id)HEAD:%s\n", yytext);
1720             #endif
1721           }
1722        YY_BREAK
1723case 13:
1724YY_RULE_SETUP
1725#line 406 "libparse.l"
1726{
1727             #if YYLPDEBUG
1728             printf("+(cmt)HEAD:%s\n", yytext);
1729             #endif
1730           }
1731        YY_BREAK
1732case 14:
1733YY_RULE_SETUP
1734#line 411 "libparse.l"
1735{
1736             #if YYLPDEBUG > 1
1737             printf("-HEAD:%s\n", yytext);
1738             #endif
1739           }
1740        YY_BREAK
1741case 15:
1742YY_RULE_SETUP
1743#line 416 "libparse.l"
1744{ yyless(0);
1745             BEGIN(INITIAL);
1746             yymore();
1747           }
1748        YY_BREAK
1749case 16:
1750YY_RULE_SETUP
1751#line 420 "libparse.l"
1752{
1753             yyless(0);
1754             *lib_style = NEW_LIBSTYLE;
1755             BEGIN(INITIAL);
1756             yymore();
1757           }
1758        YY_BREAK
1759case 17:
1760YY_RULE_SETUP
1761#line 427 "libparse.l"
1762{ quote++;
1763             BEGIN(libcmd);
1764           }
1765        YY_BREAK
1766case 18:
1767YY_RULE_SETUP
1768#line 430 "libparse.l"
1769{ quote++; brace2++;
1770             BEGIN(libcmd2);
1771           }
1772        YY_BREAK
1773case 19:
1774YY_RULE_SETUP
1775#line 433 "libparse.l"
1776{ yylplineno++; }
1777        YY_BREAK
1778case 20:
1779YY_RULE_SETUP
1780#line 434 "libparse.l"
1781{
1782             #if YYLPDEBUG > 1
1783             printf(" HEAD:%s\n", yytext);
1784             #endif
1785             yyless(0);
1786             BEGIN(help);
1787           }
1788        YY_BREAK
1789case 21:
1790YY_RULE_SETUP
1791#line 441 "libparse.l"
1792{
1793             #if YYLPDEBUG > 1
1794             printf(" HELP:%s\n", yytext);
1795             #endif
1796             BEGIN(INITIAL); }
1797        YY_BREAK
1798case 22:
1799YY_RULE_SETUP
1800#line 446 "libparse.l"
1801{
1802             #if YYLPDEBUG > 1
1803             printf(" HELP:%s\n", yytext);
1804             #endif
1805             BEGIN(INITIAL);
1806           }
1807        YY_BREAK
1808case 23:
1809YY_RULE_SETUP
1810#line 452 "libparse.l"
1811{
1812             yyless(0);
1813             *lib_style = NEW_LIBSTYLE;
1814             BEGIN(INITIAL);
1815             yymore();
1816           }
1817        YY_BREAK
1818case 24:
1819YY_RULE_SETUP
1820#line 458 "libparse.l"
1821{
1822             yyless(0);
1823             //printf("2) proc found.\n");
1824             BEGIN(INITIAL);
1825             yymore();
1826           }
1827        YY_BREAK
1828case 25:
1829YY_RULE_SETUP
1830#line 464 "libparse.l"
1831{ quote++;
1832             BEGIN(libcmd);
1833           }
1834        YY_BREAK
1835case 26:
1836YY_RULE_SETUP
1837#line 467 "libparse.l"
1838{ quote++; brace2++;
1839             BEGIN(libcmd2);
1840           }
1841        YY_BREAK
1842case 27:
1843YY_RULE_SETUP
1844#line 471 "libparse.l"
1845{ yylplineno++; }
1846        YY_BREAK
1847case 28:
1848YY_RULE_SETUP
1849#line 472 "libparse.l"
1850{
1851             #if YYLPDEBUG
1852             if(lpverbose>2) printf("--->%s<---\n", yytext);
1853             #endif
1854           }
1855        YY_BREAK
1856case 29:
1857YY_RULE_SETUP
1858#line 477 "libparse.l"
1859{
1860             found_oldhelp=1;
1861             #if YYLPDEBUG > 1
1862             printf("-HELP:%s\n", yytext);
1863             #endif
1864           }
1865        YY_BREAK
1866case 30:
1867YY_RULE_SETUP
1868#line 485 "libparse.l"
1869{ quote--;
1870             yytext[yyleng-1] = '\0';
1871             #ifndef STANDALONE_PARSER
1872             if ( mode == LOAD_LIB )
1873             {
1874               library_stack->push(newlib, yytext);
1875             }
1876             #endif /* STANDALONE_PARSER */
1877             #if YYLPDEBUG
1878             if(lpverbose>1) printf("LIB:'%s'\n", yytext);
1879             #endif
1880             BEGIN(INITIAL);
1881           }
1882        YY_BREAK
1883case 31:
1884YY_RULE_SETUP
1885#line 498 "libparse.l"
1886{ quote--; brace2--;
1887             yytext[yyleng-1] = '\0';
1888             #ifndef STANDALONE_PARSER
1889             if ( mode == LOAD_LIB )
1890             {
1891               library_stack->push(newlib, yytext);
1892             }
1893             #endif /* STANDALONE_PARSER */
1894             #if YYLPDEBUG
1895             if(lpverbose>1) printf("LIB:'%s'\n", yytext);
1896             #endif
1897             BEGIN(INITIAL);
1898           }
1899        YY_BREAK
1900case 32:
1901YY_RULE_SETUP
1902#line 512 "libparse.l"
1903{ }
1904        YY_BREAK
1905case 33:
1906YY_RULE_SETUP
1907#line 513 "libparse.l"
1908{
1909             brace2++;
1910             #if YYLPDEBUG > 1
1911             printf("%s", yytext);
1912             #endif
1913           }
1914        YY_BREAK
1915case 34:
1916YY_RULE_SETUP
1917#line 519 "libparse.l"
1918{
1919             brace2--;
1920             #if YYLPDEBUG > 1
1921             printf(">%s<\n", yytext);
1922             printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3);
1923             #endif
1924             if(brace2<=0)
1925             {
1926               #if YYLPDEBUG > 1
1927               printf("BEGIN(phead){=%d, (=%d, [=%d\n", brace1, brace2, brace3);
1928               #endif
1929               SET_DEF_END(mode, pi, current_pos(yyleng));
1930               BEGIN(phead);
1931             }
1932           }
1933        YY_BREAK
1934case 35:
1935YY_RULE_SETUP
1936#line 534 "libparse.l"
1937{
1938             if(brace2>0)
1939             {
1940               #if YYLPDEBUG > 1
1941               printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3);
1942               #endif
1943               yylp_errno = YYLP_DEF_BR2;
1944               return(1);
1945             }
1946             else
1947             {
1948               brace1++; BEGIN(pbody);
1949               if(lpverbose)
1950                  printf("//     BODY at line %d,%d (%d)\n", yylplineno,
1951                      current_pos(0), brace1);
1952               SET_BODY_START(mode, pi, yylplineno, current_pos(0));
1953             }
1954           }
1955        YY_BREAK
1956case 36:
1957YY_RULE_SETUP
1958#line 552 "libparse.l"
1959{ yylplineno++;
1960              if(brace2<=0)
1961              {
1962#if YYLPDEBUG > 1
1963                printf("BEGIN(phead-2){=%d, (=%d, [=%d\n", brace1, brace2, brace3);
1964#endif
1965                BEGIN(phead);
1966              }
1967            }
1968        YY_BREAK
1969case 37:
1970YY_RULE_SETUP
1971#line 561 "libparse.l"
1972{ }
1973        YY_BREAK
1974case 38:
1975YY_RULE_SETUP
1976#line 562 "libparse.l"
1977{ old_state = YYSTATE; BEGIN(comment); }
1978        YY_BREAK
1979case 39:
1980YY_RULE_SETUP
1981#line 563 "libparse.l"
1982{
1983             if(brace2<=0)
1984             {
1985               BEGIN(phead);
1986               yyless(0);
1987             }
1988           }
1989        YY_BREAK
1990case 40:
1991YY_RULE_SETUP
1992#line 571 "libparse.l"
1993{
1994              #if YYLPDEBUG
1995              if(lpverbose>2)printf("0-Len=%d;\n", yyleng);
1996              #endif
1997              if(check)
1998              {
1999                printf("Procedure %s (line %d) has OLD-STYLE-HELP!\n",
2000                       pi->procname, pi->data.s.proc_lineno);
2001              }
2002              SET_HELP_START(mode, pi, current_pos(0));
2003              BEGIN(poldhelp);
2004              yyless(0);
2005           }
2006        YY_BREAK
2007case 41:
2008YY_RULE_SETUP
2009#line 584 "libparse.l"
2010{
2011              #if YYLPDEBUG
2012              if(lpverbose>2)printf("1-Len=%d;\n", yyleng);
2013              #endif
2014              BEGIN(phelp);
2015              yyless(0);
2016           }
2017        YY_BREAK
2018case 42:
2019YY_RULE_SETUP
2020#line 591 "libparse.l"
2021{
2022              if(check && yyleng>2)
2023              {
2024                printf("Procedure %s (line %d) has OLD-STYLE-HELP!\n",
2025                       pi->procname, pi->data.s.proc_lineno);
2026              }
2027              #if YYLPDEBUG
2028              if(lpverbose>2 && yyleng>2)
2029                 printf("2-Len=%d, %s;\n", yyleng, pi->procname);
2030              #endif
2031              SET_HELP_START(mode, pi, current_pos(0));
2032              BEGIN(poldhelp);
2033              yyless(0);
2034           }
2035        YY_BREAK
2036case 43:
2037YY_RULE_SETUP
2038#line 605 "libparse.l"
2039{ printf("[%s]", yytext); }
2040        YY_BREAK
2041case 44:
2042YY_RULE_SETUP
2043#line 607 "libparse.l"
2044{ }
2045        YY_BREAK
2046case 45:
2047YY_RULE_SETUP
2048#line 608 "libparse.l"
2049{
2050                SET_HELP_END(mode, pi, current_pos(0));
2051                brace1++; BEGIN(pbody);
2052                if(lpverbose)
2053                {
2054                   printf("//     HELP from %d to %d\n",
2055                       (int)pi->data.s.help_start, (int)pi->data.s.help_end);
2056                   printf("//     BODY at line %d,%d (%d)\n", yylplineno,
2057                       current_pos(0), brace1);
2058                }
2059#if YYLPDEBUG > 1
2060                printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3);
2061#endif
2062                SET_BODY_START(mode, pi, yylplineno, current_pos(0));
2063#if YYLPDEBUG > 1
2064                printf("BODY at %d/%d", yylplineno, current_pos(0));
2065#endif
2066              }
2067        YY_BREAK
2068case 46:
2069YY_RULE_SETUP
2070#line 626 "libparse.l"
2071{ yylplineno++; }
2072        YY_BREAK
2073case 47:
2074YY_RULE_SETUP
2075#line 627 "libparse.l"
2076{ }
2077        YY_BREAK
2078case 48:
2079YY_RULE_SETUP
2080#line 629 "libparse.l"
2081{
2082             old_state = YYSTATE;
2083             BEGIN(string);
2084             SET_HELP_START(mode, pi, current_pos(1));
2085           }
2086        YY_BREAK
2087case 49:
2088YY_RULE_SETUP
2089#line 634 "libparse.l"
2090{}
2091        YY_BREAK
2092case 50:
2093YY_RULE_SETUP
2094#line 635 "libparse.l"
2095{
2096             brace1++; BEGIN(pbody);
2097             if(lpverbose)
2098             {
2099                printf("//     HELP from %d to %d\n",
2100                    (int)pi->data.s.help_start, (int)pi->data.s.help_end);
2101                printf("//     BODY at line %d,%d (%d)\n", yylplineno,
2102                    current_pos(0), brace1);
2103             }
2104             #if YYLPDEBUG > 1
2105             printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3);
2106             #endif
2107             SET_BODY_START(mode, pi, yylplineno, current_pos(0));
2108             #if YYLPDEBUG > 1
2109             printf("BODY at %d/%d", yylplineno, current_pos(0));
2110             #endif
2111           }
2112        YY_BREAK
2113case 51:
2114YY_RULE_SETUP
2115#line 652 "libparse.l"
2116{ yylplineno++;}
2117        YY_BREAK
2118case 52:
2119YY_RULE_SETUP
2120#line 654 "libparse.l"
2121{ }
2122        YY_BREAK
2123case 53:
2124YY_RULE_SETUP
2125#line 655 "libparse.l"
2126{ quote++; old_state = YYSTATE;
2127                 BEGIN(string); /* printf("%s", yytext); */
2128               }
2129        YY_BREAK
2130case 54:
2131YY_RULE_SETUP
2132#line 659 "libparse.l"
2133{
2134             if(check) printf("*** found 2 proc whithin procedure '%s'.\n",
2135                          pi->procname);
2136             yyless(yyleng-1);
2137           }
2138        YY_BREAK
2139case 55:
2140YY_RULE_SETUP
2141#line 664 "libparse.l"
2142{
2143             if(check) printf("*** found 1 proc whithin procedure '%s'.\n",
2144                          pi->procname);
2145             yyless(yyleng-1);
2146           }
2147        YY_BREAK
2148case 56:
2149YY_RULE_SETUP
2150#line 669 "libparse.l"
2151{
2152                 brace1++;
2153                 #if YYLPDEBUG > 1
2154                 printf("line: %d, (%d)%s\n", yylplineno, brace1, yytext);
2155                 #endif
2156                }
2157        YY_BREAK
2158case 57:
2159YY_RULE_SETUP
2160#line 675 "libparse.l"
2161{
2162                           #if YYLPDEBUG > 1
2163                           printf("line: %d, (%d)%s\n",
2164                             yylplineno, brace1, yytext);
2165                           #endif
2166                           brace1--;
2167                           if(brace2>0)
2168                           {
2169                             yylp_errno = YYLP_BODY_BR2;
2170                             return(1);
2171                           }
2172                           if(brace3>0)
2173                           {
2174                             yylp_errno = YYLP_BODY_BR3;
2175                             return(1);
2176                           }
2177                           if(brace1<=0)
2178                           {
2179                             SET_BODY_END(mode, pi, current_pos(yyleng));
2180                             SET_PROC_END(mode, pi, current_pos(yyleng));
2181                             #if YYLPDEBUG > 1
2182                               printf("-%d\n", current_pos(0));
2183                             #endif
2184                             BEGIN(INITIAL);
2185                           }
2186                         }
2187        YY_BREAK
2188case 58:
2189YY_RULE_SETUP
2190#line 701 "libparse.l"
2191{
2192                           brace2++; /* printf("%s", yytext); */
2193                         }
2194        YY_BREAK
2195case 59:
2196YY_RULE_SETUP
2197#line 704 "libparse.l"
2198{
2199                           brace2--; /* printf("%s", yytext); */
2200                           if(brace2<0) {
2201                             yylp_errno = YYLP_BODY_TMBR2;
2202                             return(1);
2203                           }
2204                         }
2205        YY_BREAK
2206case 60:
2207YY_RULE_SETUP
2208#line 711 "libparse.l"
2209{
2210                           brace3++; /* printf("%s", yytext); */
2211                         }
2212        YY_BREAK
2213case 61:
2214YY_RULE_SETUP
2215#line 714 "libparse.l"
2216{
2217                           brace3--; /* printf("%s", yytext); */
2218                           if(brace3<0) {
2219                             yylp_errno = YYLP_BODY_TMBR3;
2220                             return(1);
2221                           }
2222                         }
2223        YY_BREAK
2224case 62:
2225YY_RULE_SETUP
2226#line 721 "libparse.l"
2227{ yylplineno++; }
2228        YY_BREAK
2229case 63:
2230YY_RULE_SETUP
2231#line 722 "libparse.l"
2232{ }
2233        YY_BREAK
2234case 64:
2235YY_RULE_SETUP
2236#line 724 "libparse.l"
2237{
2238             quote++; BEGIN(string);
2239             found_info++;
2240             string_start = current_pos(yyleng);
2241             *lib_style = NEW_LIBSTYLE;
2242             last_cmd = LP_INFO;
2243       }
2244        YY_BREAK
2245case 65:
2246YY_RULE_SETUP
2247#line 731 "libparse.l"
2248{ yylplineno++; }
2249        YY_BREAK
2250case 66:
2251YY_RULE_SETUP
2252#line 732 "libparse.l"
2253{ }
2254        YY_BREAK
2255case 67:
2256YY_RULE_SETUP
2257#line 734 "libparse.l"
2258{
2259             quote++; BEGIN(string);
2260             found_cat++;
2261             string_start = current_pos(yyleng);
2262             *lib_style = NEW_LIBSTYLE;
2263             last_cmd = LP_CATEGORY;
2264       }
2265        YY_BREAK
2266case 68:
2267YY_RULE_SETUP
2268#line 741 "libparse.l"
2269{ yylplineno++; }
2270        YY_BREAK
2271case 69:
2272YY_RULE_SETUP
2273#line 742 "libparse.l"
2274{ }
2275        YY_BREAK
2276case 70:
2277YY_RULE_SETUP
2278#line 745 "libparse.l"
2279{ quote--;
2280                           copy_string(mode);
2281                           last_cmd = LP_NONE;
2282                           if(old_state==phelp)
2283                           {
2284                              SET_HELP_END(mode, pi, current_pos(0));
2285                           }
2286                           BEGIN(old_state); /* printf("%s", yytext); */
2287                         }
2288        YY_BREAK
2289case 71:
2290YY_RULE_SETUP
2291#line 754 "libparse.l"
2292{ if (old_state == phelp) IncrCheckSum(*yytext);}
2293        YY_BREAK
2294case 72:
2295YY_RULE_SETUP
2296#line 755 "libparse.l"
2297{ yylplineno++; if (old_state == phelp) IncrCheckSum('\n');}
2298        YY_BREAK
2299case 73:
2300YY_RULE_SETUP
2301#line 756 "libparse.l"
2302{ if (old_state == phelp) IncrCheckSum(*yytext);}
2303        YY_BREAK
2304case 74:
2305YY_RULE_SETUP
2306#line 758 "libparse.l"
2307{ }
2308        YY_BREAK
2309case 75:
2310YY_RULE_SETUP
2311#line 759 "libparse.l"
2312{ quote++; old_state = YYSTATE;
2313                           BEGIN(string); /* printf("%s", yytext); */
2314                         }
2315        YY_BREAK
2316case 76:
2317YY_RULE_SETUP
2318#line 762 "libparse.l"
2319{
2320                           brace1++; /* printf("(%d)%s", brace1, yytext); */
2321                         }
2322        YY_BREAK
2323case 77:
2324YY_RULE_SETUP
2325#line 765 "libparse.l"
2326{
2327                           brace1--; /* printf("(%d)%s", brace1, yytext); */
2328                           if(brace1<=0) {
2329                             if(brace2>0) { yylp_errno=YYLP_EX_BR2; return(1); }
2330                             if(brace3>0) { yylp_errno=YYLP_EX_BR3; return(1); }
2331                             BEGIN(INITIAL);
2332                             SET_PROC_END(mode, pi, current_pos(yyleng));
2333                           }
2334                         }
2335        YY_BREAK
2336case 78:
2337YY_RULE_SETUP
2338#line 774 "libparse.l"
2339{
2340                           brace2++; /* printf("%s", yytext); */
2341                         }
2342        YY_BREAK
2343case 79:
2344YY_RULE_SETUP
2345#line 777 "libparse.l"
2346{
2347                           brace2--; /* printf("%s", yytext); */
2348                         }
2349        YY_BREAK
2350case 80:
2351YY_RULE_SETUP
2352#line 780 "libparse.l"
2353{
2354                           brace3++; /* printf("%s", yytext); */
2355                         }
2356        YY_BREAK
2357case 81:
2358YY_RULE_SETUP
2359#line 783 "libparse.l"
2360{
2361                           brace3--; /* printf("%s", yytext); */
2362                         }
2363        YY_BREAK
2364case 82:
2365YY_RULE_SETUP
2366#line 786 "libparse.l"
2367{ yylplineno++; }
2368        YY_BREAK
2369case 83:
2370YY_RULE_SETUP
2371#line 787 "libparse.l"
2372{ }
2373        YY_BREAK
2374case 84:
2375YY_RULE_SETUP
2376#line 789 "libparse.l"
2377{ quote--;
2378                           BEGIN(pexample); /* printf("%s", yytext); */
2379                         }
2380        YY_BREAK
2381case 85:
2382YY_RULE_SETUP
2383#line 792 "libparse.l"
2384{ }
2385        YY_BREAK
2386case 86:
2387YY_RULE_SETUP
2388#line 793 "libparse.l"
2389{ }
2390        YY_BREAK
2391case 87:
2392YY_RULE_SETUP
2393#line 794 "libparse.l"
2394{ yylplineno++; }
2395        YY_BREAK
2396case 88:
2397YY_RULE_SETUP
2398#line 795 "libparse.l"
2399{ }
2400        YY_BREAK
2401case 89:
2402YY_RULE_SETUP
2403#line 797 "libparse.l"
2404{ BEGIN(old_state); }
2405        YY_BREAK
2406case 90:
2407YY_RULE_SETUP
2408#line 798 "libparse.l"
2409{ yylplineno++; }
2410        YY_BREAK
2411case 91:
2412YY_RULE_SETUP
2413#line 799 "libparse.l"
2414{ }
2415        YY_BREAK
2416case 92:
2417YY_RULE_SETUP
2418#line 801 "libparse.l"
2419{ yylplineno++; }
2420        YY_BREAK
2421case 93:
2422YY_RULE_SETUP
2423#line 802 "libparse.l"
2424{ }
2425        YY_BREAK
2426case 94:
2427YY_RULE_SETUP
2428#line 803 "libparse.l"
2429{ p_static = FALSE;
2430                            #if YYLPDEBUG > 1
2431                            printf("%s", yytext);
2432                            #endif
2433                         }
2434        YY_BREAK
2435case 95:
2436YY_RULE_SETUP
2437#line 808 "libparse.l"
2438{ p_static = FALSE;
2439                           yylp_errno = YYLP_BAD_CHAR;
2440                           #ifdef STANDALONE_PARSER
2441                           printf("[%d]", *yytext);
2442                           #else
2443                           if (text_buffer!=NULL) omFree((ADDRESS)text_buffer);
2444                           text_buffer = omStrDup(yytext);
2445                           omMarkAsStaticAddr(text_buffer);
2446                           #endif
2447                           #if YYLPDEBUG > 1
2448                             printf("[%s]", yytext);
2449                           #endif
2450                           return(1);
2451                         }
2452        YY_BREAK
2453case 96:
2454YY_RULE_SETUP
2455#line 823 "libparse.l"
2456ECHO;
2457        YY_BREAK
2458case YY_STATE_EOF(INITIAL):
2459case YY_STATE_EOF(header):
2460case YY_STATE_EOF(help):
2461case YY_STATE_EOF(libcmd):
2462case YY_STATE_EOF(libcmd2):
2463case YY_STATE_EOF(pdef):
2464case YY_STATE_EOF(phead):
2465case YY_STATE_EOF(poldhelp):
2466case YY_STATE_EOF(phelp):
2467case YY_STATE_EOF(pbody):
2468case YY_STATE_EOF(pstr):
2469case YY_STATE_EOF(pexample):
2470case YY_STATE_EOF(pestr):
2471case YY_STATE_EOF(string):
2472case YY_STATE_EOF(comment):
2473case YY_STATE_EOF(info):
2474case YY_STATE_EOF(category):
2475case YY_STATE_EOF(url):
2476case YY_STATE_EOF(version):
2477        yyterminate();
2478
2479        case YY_END_OF_BUFFER:
2480                {
2481                /* Amount of text matched not including the EOB char. */
2482                int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
2483
2484                /* Undo the effects of YY_DO_BEFORE_ACTION. */
2485                *yy_cp = yy_hold_char;
2486                YY_RESTORE_YY_MORE_OFFSET
2487
2488                if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
2489                        {
2490                        /* We're scanning a new file or input source.  It's
2491                         * possible that this happened because the user
2492                         * just pointed yyin at a new source and called
2493                         * yylex().  If so, then we have to assure
2494                         * consistency between yy_current_buffer and our
2495                         * globals.  Here is the right place to do so, because
2496                         * this is the first action (other than possibly a
2497                         * back-up) that will match for the new input source.
2498                         */
2499                        yy_n_chars = yy_current_buffer->yy_n_chars;
2500                        yy_current_buffer->yy_input_file = yyin;
2501                        yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
2502                        }
2503
2504                /* Note that here we test for yy_c_buf_p "<=" to the position
2505                 * of the first EOB in the buffer, since yy_c_buf_p will
2506                 * already have been incremented past the NUL character
2507                 * (since all states make transitions on EOB to the
2508                 * end-of-buffer state).  Contrast this with the test
2509                 * in input().
2510                 */
2511                if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2512                        { /* This was really a NUL. */
2513                        yy_state_type yy_next_state;
2514
2515                        yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
2516
2517                        yy_current_state = yy_get_previous_state();
2518
2519                        /* Okay, we're now positioned to make the NUL
2520                         * transition.  We couldn't have
2521                         * yy_get_previous_state() go ahead and do it
2522                         * for us because it doesn't know how to deal
2523                         * with the possibility of jamming (and we don't
2524                         * want to build jamming into it because then it
2525                         * will run more slowly).
2526                         */
2527
2528                        yy_next_state = yy_try_NUL_trans( yy_current_state );
2529
2530                        yy_bp = yytext_ptr + YY_MORE_ADJ;
2531
2532                        if ( yy_next_state )
2533                                {
2534                                /* Consume the NUL. */
2535                                yy_cp = ++yy_c_buf_p;
2536                                yy_current_state = yy_next_state;
2537                                goto yy_match;
2538                                }
2539
2540                        else
2541                                {
2542                                yy_cp = yy_c_buf_p;
2543                                goto yy_find_action;
2544                                }
2545                        }
2546
2547                else switch ( yy_get_next_buffer() )
2548                        {
2549                        case EOB_ACT_END_OF_FILE:
2550                                {
2551                                yy_did_buffer_switch_on_eof = 0;
2552
2553                                if ( yywrap() )
2554                                        {
2555                                        /* Note: because we've taken care in
2556                                         * yy_get_next_buffer() to have set up
2557                                         * yytext, we can now set up
2558                                         * yy_c_buf_p so that if some total
2559                                         * hoser (like flex itself) wants to
2560                                         * call the scanner after we return the
2561                                         * YY_NULL, it'll still work - another
2562                                         * YY_NULL will get returned.
2563                                         */
2564                                        yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
2565
2566                                        yy_act = YY_STATE_EOF(YY_START);
2567                                        goto do_action;
2568                                        }
2569
2570                                else
2571                                        {
2572                                        if ( ! yy_did_buffer_switch_on_eof )
2573                                                YY_NEW_FILE;
2574                                        }
2575                                break;
2576                                }
2577
2578                        case EOB_ACT_CONTINUE_SCAN:
2579                                yy_c_buf_p =
2580                                        yytext_ptr + yy_amount_of_matched_text;
2581
2582                                yy_current_state = yy_get_previous_state();
2583
2584                                yy_cp = yy_c_buf_p;
2585                                yy_bp = yytext_ptr + YY_MORE_ADJ;
2586                                goto yy_match;
2587
2588                        case EOB_ACT_LAST_MATCH:
2589                                yy_c_buf_p =
2590                                &yy_current_buffer->yy_ch_buf[yy_n_chars];
2591
2592                                yy_current_state = yy_get_previous_state();
2593
2594                                yy_cp = yy_c_buf_p;
2595                                yy_bp = yytext_ptr + YY_MORE_ADJ;
2596                                goto yy_find_action;
2597                        }
2598                break;
2599                }
2600
2601        default:
2602                YY_FATAL_ERROR(
2603                        "fatal flex scanner internal error--no action found" );
2604        } /* end of action switch */
2605                } /* end of scanning one token */
2606        } /* end of yylex */
2607
2608
2609/* yy_get_next_buffer - try to read in a new buffer
2610 *
2611 * Returns a code representing an action:
2612 *      EOB_ACT_LAST_MATCH -
2613 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2614 *      EOB_ACT_END_OF_FILE - end of file
2615 */
2616
2617static int yy_get_next_buffer()
2618        {
2619        register char *dest = yy_current_buffer->yy_ch_buf;
2620        register char *source = yytext_ptr;
2621        register int number_to_move, i;
2622        int ret_val;
2623
2624        if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
2625                YY_FATAL_ERROR(
2626                "fatal flex scanner internal error--end of buffer missed" );
2627
2628        if ( yy_current_buffer->yy_fill_buffer == 0 )
2629                { /* Don't try to fill the buffer, so this is an EOF. */
2630                if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
2631                        {
2632                        /* We matched a single character, the EOB, so
2633                         * treat this as a final EOF.
2634                         */
2635                        return EOB_ACT_END_OF_FILE;
2636                        }
2637
2638                else
2639                        {
2640                        /* We matched some text prior to the EOB, first
2641                         * process it.
2642                         */
2643                        return EOB_ACT_LAST_MATCH;
2644                        }
2645                }
2646
2647        /* Try to read more data. */
2648
2649        /* First move last chars to start of buffer. */
2650        number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
2651
2652        for ( i = 0; i < number_to_move; ++i )
2653                *(dest++) = *(source++);
2654
2655        if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2656                /* don't do the read, it's not guaranteed to return an EOF,
2657                 * just force an EOF
2658                 */
2659                yy_current_buffer->yy_n_chars = yy_n_chars = 0;
2660
2661        else
2662                {
2663                int num_to_read =
2664                        yy_current_buffer->yy_buf_size - number_to_move - 1;
2665
2666                while ( num_to_read <= 0 )
2667                        { /* Not enough room in the buffer - grow it. */
2668#ifdef YY_USES_REJECT
2669                        YY_FATAL_ERROR(
2670"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2671#else
2672
2673                        /* just a shorter name for the current buffer */
2674                        YY_BUFFER_STATE b = yy_current_buffer;
2675
2676                        int yy_c_buf_p_offset =
2677                                (int) (yy_c_buf_p - b->yy_ch_buf);
2678
2679                        if ( b->yy_is_our_buffer )
2680                                {
2681                                int new_size = b->yy_buf_size * 2;
2682
2683                                if ( new_size <= 0 )
2684                                        b->yy_buf_size += b->yy_buf_size / 8;
2685                                else
2686                                        b->yy_buf_size *= 2;
2687
2688                                b->yy_ch_buf = (char *)
2689                                        /* Include room in for 2 EOB chars. */
2690                                        yy_flex_realloc( (void *) b->yy_ch_buf,
2691                                                         b->yy_buf_size + 2 );
2692                                }
2693                        else
2694                                /* Can't grow it, we don't own it. */
2695                                b->yy_ch_buf = 0;
2696
2697                        if ( ! b->yy_ch_buf )
2698                                YY_FATAL_ERROR(
2699                                "fatal error - scanner input buffer overflow" );
2700
2701                        yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2702
2703                        num_to_read = yy_current_buffer->yy_buf_size -
2704                                                number_to_move - 1;
2705#endif
2706                        }
2707
2708                if ( num_to_read > YY_READ_BUF_SIZE )
2709                        num_to_read = YY_READ_BUF_SIZE;
2710
2711                /* Read in more data. */
2712                YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
2713                        yy_n_chars, num_to_read );
2714
2715                yy_current_buffer->yy_n_chars = yy_n_chars;
2716                }
2717
2718        if ( yy_n_chars == 0 )
2719                {
2720                if ( number_to_move == YY_MORE_ADJ )
2721                        {
2722                        ret_val = EOB_ACT_END_OF_FILE;
2723                        yyrestart( yyin );
2724                        }
2725
2726                else
2727                        {
2728                        ret_val = EOB_ACT_LAST_MATCH;
2729                        yy_current_buffer->yy_buffer_status =
2730                                YY_BUFFER_EOF_PENDING;
2731                        }
2732                }
2733
2734        else
2735                ret_val = EOB_ACT_CONTINUE_SCAN;
2736
2737        yy_n_chars += number_to_move;
2738        yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2739        yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2740
2741        yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
2742
2743        return ret_val;
2744        }
2745
2746
2747/* yy_get_previous_state - get the state just before the EOB char was reached */
2748
2749static yy_state_type yy_get_previous_state()
2750        {
2751        register yy_state_type yy_current_state;
2752        register char *yy_cp;
2753
2754        yy_current_state = yy_start;
2755        yy_current_state += YY_AT_BOL();
2756
2757        for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
2758                {
2759                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2760                if ( yy_accept[yy_current_state] )
2761                        {
2762                        yy_last_accepting_state = yy_current_state;
2763                        yy_last_accepting_cpos = yy_cp;
2764                        }
2765                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2766                        {
2767                        yy_current_state = (int) yy_def[yy_current_state];
2768                        if ( yy_current_state >= 485 )
2769                                yy_c = yy_meta[(unsigned int) yy_c];
2770                        }
2771                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2772                }
2773
2774        return yy_current_state;
2775        }
2776
2777
2778/* yy_try_NUL_trans - try to make a transition on the NUL character
2779 *
2780 * synopsis
2781 *      next_state = yy_try_NUL_trans( current_state );
2782 */
2783
2784#ifdef YY_USE_PROTOS
2785static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2786#else
2787static yy_state_type yy_try_NUL_trans( yy_current_state )
2788yy_state_type yy_current_state;
2789#endif
2790        {
2791        register int yy_is_jam;
2792        register char *yy_cp = yy_c_buf_p;
2793
2794        register YY_CHAR yy_c = 1;
2795        if ( yy_accept[yy_current_state] )
2796                {
2797                yy_last_accepting_state = yy_current_state;
2798                yy_last_accepting_cpos = yy_cp;
2799                }
2800        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2801                {
2802                yy_current_state = (int) yy_def[yy_current_state];
2803                if ( yy_current_state >= 485 )
2804                        yy_c = yy_meta[(unsigned int) yy_c];
2805                }
2806        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2807        yy_is_jam = (yy_current_state == 484);
2808
2809        return yy_is_jam ? 0 : yy_current_state;
2810        }
2811
2812
2813#ifndef YY_NO_UNPUT
2814#ifdef YY_USE_PROTOS
2815static void yyunput( int c, register char *yy_bp )
2816#else
2817static void yyunput( c, yy_bp )
2818int c;
2819register char *yy_bp;
2820#endif
2821        {
2822        register char *yy_cp = yy_c_buf_p;
2823
2824        /* undo effects of setting up yytext */
2825        *yy_cp = yy_hold_char;
2826
2827        if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2828                { /* need to shift things up to make room */
2829                /* +2 for EOB chars. */
2830                register int number_to_move = yy_n_chars + 2;
2831                register char *dest = &yy_current_buffer->yy_ch_buf[
2832                                        yy_current_buffer->yy_buf_size + 2];
2833                register char *source =
2834                                &yy_current_buffer->yy_ch_buf[number_to_move];
2835
2836                while ( source > yy_current_buffer->yy_ch_buf )
2837                        *--dest = *--source;
2838
2839                yy_cp += (int) (dest - source);
2840                yy_bp += (int) (dest - source);
2841                yy_current_buffer->yy_n_chars =
2842                        yy_n_chars = yy_current_buffer->yy_buf_size;
2843
2844                if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2845                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
2846                }
2847
2848        *--yy_cp = (char) c;
2849
2850
2851        yytext_ptr = yy_bp;
2852        yy_hold_char = *yy_cp;
2853        yy_c_buf_p = yy_cp;
2854        }
2855#endif  /* ifndef YY_NO_UNPUT */
2856
2857
2858#ifdef __cplusplus
2859static int yyinput()
2860#else
2861static int input()
2862#endif
2863        {
2864        int c;
2865
2866        *yy_c_buf_p = yy_hold_char;
2867
2868        if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2869                {
2870                /* yy_c_buf_p now points to the character we want to return.
2871                 * If this occurs *before* the EOB characters, then it's a
2872                 * valid NUL; if not, then we've hit the end of the buffer.
2873                 */
2874                if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2875                        /* This was really a NUL. */
2876                        *yy_c_buf_p = '\0';
2877
2878                else
2879                        { /* need more input */
2880                        int offset = yy_c_buf_p - yytext_ptr;
2881                        ++yy_c_buf_p;
2882
2883                        switch ( yy_get_next_buffer() )
2884                                {
2885                                case EOB_ACT_LAST_MATCH:
2886                                        /* This happens because yy_g_n_b()
2887                                         * sees that we've accumulated a
2888                                         * token and flags that we need to
2889                                         * try matching the token before
2890                                         * proceeding.  But for input(),
2891                                         * there's no matching to consider.
2892                                         * So convert the EOB_ACT_LAST_MATCH
2893                                         * to EOB_ACT_END_OF_FILE.
2894                                         */
2895
2896                                        /* Reset buffer status. */
2897                                        yyrestart( yyin );
2898
2899                                        /* fall through */
2900
2901                                case EOB_ACT_END_OF_FILE:
2902                                        {
2903                                        if ( yywrap() )
2904                                                return EOF;
2905
2906                                        if ( ! yy_did_buffer_switch_on_eof )
2907                                                YY_NEW_FILE;
2908#ifdef __cplusplus
2909                                        return yyinput();
2910#else
2911                                        return input();
2912#endif
2913                                        }
2914
2915                                case EOB_ACT_CONTINUE_SCAN:
2916                                        yy_c_buf_p = yytext_ptr + offset;
2917                                        break;
2918                                }
2919                        }
2920                }
2921
2922        c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
2923        *yy_c_buf_p = '\0';     /* preserve yytext */
2924        yy_hold_char = *++yy_c_buf_p;
2925
2926        yy_current_buffer->yy_at_bol = (c == '\n');
2927
2928        return c;
2929        }
2930
2931
2932#ifdef YY_USE_PROTOS
2933void yyrestart( FILE *input_file )
2934#else
2935void yyrestart( input_file )
2936FILE *input_file;
2937#endif
2938        {
2939        if ( ! yy_current_buffer )
2940                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2941
2942        yy_init_buffer( yy_current_buffer, input_file );
2943        yy_load_buffer_state();
2944        }
2945
2946
2947#ifdef YY_USE_PROTOS
2948void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2949#else
2950void yy_switch_to_buffer( new_buffer )
2951YY_BUFFER_STATE new_buffer;
2952#endif
2953        {
2954        if ( yy_current_buffer == new_buffer )
2955                return;
2956
2957        if ( yy_current_buffer )
2958                {
2959                /* Flush out information for old buffer. */
2960                *yy_c_buf_p = yy_hold_char;
2961                yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2962                yy_current_buffer->yy_n_chars = yy_n_chars;
2963                }
2964
2965        yy_current_buffer = new_buffer;
2966        yy_load_buffer_state();
2967
2968        /* We don't actually know whether we did this switch during
2969         * EOF (yywrap()) processing, but the only time this flag
2970         * is looked at is after yywrap() is called, so it's safe
2971         * to go ahead and always set it.
2972         */
2973        yy_did_buffer_switch_on_eof = 1;
2974        }
2975
2976
2977#ifdef YY_USE_PROTOS
2978void yy_load_buffer_state( void )
2979#else
2980void yy_load_buffer_state()
2981#endif
2982        {
2983        yy_n_chars = yy_current_buffer->yy_n_chars;
2984        yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2985        yyin = yy_current_buffer->yy_input_file;
2986        yy_hold_char = *yy_c_buf_p;
2987        }
2988
2989
2990#ifdef YY_USE_PROTOS
2991YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2992#else
2993YY_BUFFER_STATE yy_create_buffer( file, size )
2994FILE *file;
2995int size;
2996#endif
2997        {
2998        YY_BUFFER_STATE b;
2999
3000        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3001        if ( ! b )
3002                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3003
3004        b->yy_buf_size = size;
3005
3006        /* yy_ch_buf has to be 2 characters longer than the size given because
3007         * we need to put in 2 end-of-buffer characters.
3008         */
3009        b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
3010        if ( ! b->yy_ch_buf )
3011                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3012
3013        b->yy_is_our_buffer = 1;
3014
3015        yy_init_buffer( b, file );
3016
3017        return b;
3018        }
3019
3020
3021#ifdef YY_USE_PROTOS
3022void yy_delete_buffer( YY_BUFFER_STATE b )
3023#else
3024void yy_delete_buffer( b )
3025YY_BUFFER_STATE b;
3026#endif
3027        {
3028        if ( ! b )
3029                return;
3030
3031        if ( b == yy_current_buffer )
3032                yy_current_buffer = (YY_BUFFER_STATE) 0;
3033
3034        if ( b->yy_is_our_buffer )
3035                yy_flex_free( (void *) b->yy_ch_buf );
3036
3037        yy_flex_free( (void *) b );
3038        }
3039
3040
3041#ifndef YY_ALWAYS_INTERACTIVE
3042#ifndef YY_NEVER_INTERACTIVE
3043extern int isatty YY_PROTO(( int ));
3044#endif
3045#endif
3046
3047#ifdef YY_USE_PROTOS
3048void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3049#else
3050void yy_init_buffer( b, file )
3051YY_BUFFER_STATE b;
3052FILE *file;
3053#endif
3054
3055
3056        {
3057        yy_flush_buffer( b );
3058
3059        b->yy_input_file = file;
3060        b->yy_fill_buffer = 1;
3061
3062#if YY_ALWAYS_INTERACTIVE
3063        b->yy_is_interactive = 1;
3064#else
3065#if YY_NEVER_INTERACTIVE
3066        b->yy_is_interactive = 0;
3067#else
3068        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3069#endif
3070#endif
3071        }
3072
3073
3074#ifdef YY_USE_PROTOS
3075void yy_flush_buffer( YY_BUFFER_STATE b )
3076#else
3077void yy_flush_buffer( b )
3078YY_BUFFER_STATE b;
3079#endif
3080
3081        {
3082        if ( ! b )
3083                return;
3084
3085        b->yy_n_chars = 0;
3086
3087        /* We always need two end-of-buffer characters.  The first causes
3088         * a transition to the end-of-buffer state.  The second causes
3089         * a jam in that state.
3090         */
3091        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3092        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3093
3094        b->yy_buf_pos = &b->yy_ch_buf[0];
3095
3096        b->yy_at_bol = 1;
3097        b->yy_buffer_status = YY_BUFFER_NEW;
3098
3099        if ( b == yy_current_buffer )
3100                yy_load_buffer_state();
3101        }
3102
3103
3104#ifndef YY_NO_SCAN_BUFFER
3105#ifdef YY_USE_PROTOS
3106YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
3107#else
3108YY_BUFFER_STATE yy_scan_buffer( base, size )
3109char *base;
3110yy_size_t size;
3111#endif
3112        {
3113        YY_BUFFER_STATE b;
3114
3115        if ( size < 2 ||
3116             base[size-2] != YY_END_OF_BUFFER_CHAR ||
3117             base[size-1] != YY_END_OF_BUFFER_CHAR )
3118                /* They forgot to leave room for the EOB's. */
3119                return 0;
3120
3121        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3122        if ( ! b )
3123                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3124
3125        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
3126        b->yy_buf_pos = b->yy_ch_buf = base;
3127        b->yy_is_our_buffer = 0;
3128        b->yy_input_file = 0;
3129        b->yy_n_chars = b->yy_buf_size;
3130        b->yy_is_interactive = 0;
3131        b->yy_at_bol = 1;
3132        b->yy_fill_buffer = 0;
3133        b->yy_buffer_status = YY_BUFFER_NEW;
3134
3135        yy_switch_to_buffer( b );
3136
3137        return b;
3138        }
3139#endif
3140
3141
3142#ifndef YY_NO_SCAN_STRING
3143#ifdef YY_USE_PROTOS
3144YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
3145#else
3146YY_BUFFER_STATE yy_scan_string( yy_str )
3147yyconst char *yy_str;
3148#endif
3149        {
3150        int len;
3151        for ( len = 0; yy_str[len]; ++len )
3152                ;
3153
3154        return yy_scan_bytes( yy_str, len );
3155        }
3156#endif
3157
3158
3159#ifndef YY_NO_SCAN_BYTES
3160#ifdef YY_USE_PROTOS
3161YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
3162#else
3163YY_BUFFER_STATE yy_scan_bytes( bytes, len )
3164yyconst char *bytes;
3165int len;
3166#endif
3167        {
3168        YY_BUFFER_STATE b;
3169        char *buf;
3170        yy_size_t n;
3171        int i;
3172
3173        /* Get memory for full buffer, including space for trailing EOB's. */
3174        n = len + 2;
3175        buf = (char *) yy_flex_alloc( n );
3176        if ( ! buf )
3177                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3178
3179        for ( i = 0; i < len; ++i )
3180                buf[i] = bytes[i];
3181
3182        buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
3183
3184        b = yy_scan_buffer( buf, n );
3185        if ( ! b )
3186                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3187
3188        /* It's okay to grow etc. this buffer, and we should throw it
3189         * away when we're done.
3190         */
3191        b->yy_is_our_buffer = 1;
3192
3193        return b;
3194        }
3195#endif
3196
3197
3198#ifndef YY_NO_PUSH_STATE
3199#ifdef YY_USE_PROTOS
3200static void yy_push_state( int new_state )
3201#else
3202static void yy_push_state( new_state )
3203int new_state;
3204#endif
3205        {
3206        if ( yy_start_stack_ptr >= yy_start_stack_depth )
3207                {
3208                yy_size_t new_size;
3209
3210                yy_start_stack_depth += YY_START_STACK_INCR;
3211                new_size = yy_start_stack_depth * sizeof( int );
3212
3213                if ( ! yy_start_stack )
3214                        yy_start_stack = (int *) yy_flex_alloc( new_size );
3215
3216                else
3217                        yy_start_stack = (int *) yy_flex_realloc(
3218                                        (void *) yy_start_stack, new_size );
3219
3220                if ( ! yy_start_stack )
3221                        YY_FATAL_ERROR(
3222                        "out of memory expanding start-condition stack" );
3223                }
3224
3225        yy_start_stack[yy_start_stack_ptr++] = YY_START;
3226
3227        BEGIN(new_state);
3228        }
3229#endif
3230
3231
3232#ifndef YY_NO_POP_STATE
3233static void yy_pop_state()
3234        {
3235        if ( --yy_start_stack_ptr < 0 )
3236                YY_FATAL_ERROR( "start-condition stack underflow" );
3237
3238        BEGIN(yy_start_stack[yy_start_stack_ptr]);
3239        }
3240#endif
3241
3242
3243#ifndef YY_NO_TOP_STATE
3244static int yy_top_state()
3245        {
3246        return yy_start_stack[yy_start_stack_ptr - 1];
3247        }
3248#endif
3249
3250#ifndef YY_EXIT_FAILURE
3251#define YY_EXIT_FAILURE 2
3252#endif
3253
3254#ifdef YY_USE_PROTOS
3255static void yy_fatal_error( yyconst char msg[] )
3256#else
3257static void yy_fatal_error( msg )
3258char msg[];
3259#endif
3260        {
3261        (void) fprintf( stderr, "%s\n", msg );
3262        exit( YY_EXIT_FAILURE );
3263        }
3264
3265
3266
3267/* Redefine yyless() so it works in section 3 code. */
3268
3269#undef yyless
3270#define yyless(n) \
3271        do \
3272                { \
3273                /* Undo effects of setting up yytext. */ \
3274                yytext[yyleng] = yy_hold_char; \
3275                yy_c_buf_p = yytext + n; \
3276                yy_hold_char = *yy_c_buf_p; \
3277                *yy_c_buf_p = '\0'; \
3278                yyleng = n; \
3279                } \
3280        while ( 0 )
3281
3282
3283/* Internal utility routines. */
3284
3285#ifndef yytext_ptr
3286#ifdef YY_USE_PROTOS
3287static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3288#else
3289static void yy_flex_strncpy( s1, s2, n )
3290char *s1;
3291yyconst char *s2;
3292int n;
3293#endif
3294        {
3295        register int i;
3296        for ( i = 0; i < n; ++i )
3297                s1[i] = s2[i];
3298        }
3299#endif
3300
3301#ifdef YY_NEED_STRLEN
3302#ifdef YY_USE_PROTOS
3303static int yy_flex_strlen( yyconst char *s )
3304#else
3305static int yy_flex_strlen( s )
3306yyconst char *s;
3307#endif
3308        {
3309        register int n;
3310        for ( n = 0; s[n]; ++n )
3311                ;
3312
3313        return n;
3314        }
3315#endif
3316
3317
3318#ifdef YY_USE_PROTOS
3319static void *yy_flex_alloc( yy_size_t size )
3320#else
3321static void *yy_flex_alloc( size )
3322yy_size_t size;
3323#endif
3324        {
3325        return (void *) malloc( size );
3326        }
3327
3328#ifdef YY_USE_PROTOS
3329static void *yy_flex_realloc( void *ptr, yy_size_t size )
3330#else
3331static void *yy_flex_realloc( ptr, size )
3332void *ptr;
3333yy_size_t size;
3334#endif
3335        {
3336        /* The cast to (char *) in the following accommodates both
3337         * implementations that use char* generic pointers, and those
3338         * that use void* generic pointers.  It works with the latter
3339         * because both ANSI C and C++ allow castless assignment from
3340         * any pointer type to void*, and deal with argument conversions
3341         * as though doing an assignment.
3342         */
3343        return (void *) realloc( (char *) ptr, size );
3344        }
3345
3346#ifdef YY_USE_PROTOS
3347static void yy_flex_free( void *ptr )
3348#else
3349static void yy_flex_free( ptr )
3350void *ptr;
3351#endif
3352        {
3353        free( ptr );
3354        }
3355
3356#if YY_MAIN
3357int main()
3358        {
3359        yylex();
3360        return 0;
3361        }
3362#endif
3363#line 823 "libparse.l"
3364
3365
3366int current_pos(int i)
3367{
3368  return(i+offset+(int)(yytext-yylp_buffer_start));
3369}
3370
3371int libread(FILE* f, char* buf, int max_size)
3372{ int rc;
3373
3374  offset = ftell(f);
3375  rc  = myfread( buf, 1, max_size, f );
3376  #if YYLPDEBUG >2
3377    printf("fread: %d of %d\n", rc, max_size);
3378  #endif
3379  yylp_buffer_start = buf;
3380  return rc;
3381}
3382
3383extern "C" {
3384  int yylpwrap()
3385  {
3386    //printf("======================= YYWRAP ====================\n");
3387    if(brace1>0) { yylp_errno=YYLP_MISS_BR1; }
3388    if(brace2>0) { yylp_errno=YYLP_MISS_BR2; }
3389    if(brace3>0) { yylp_errno=YYLP_MISS_BR3; }
3390    if(quote>0) { yylp_errno=YYLP_MISSQUOT; }
3391    /* printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3);/**/
3392    if(feof(yyin)) return 1; else return 0;
3393  }
3394}
3395
3396void reinit_yylp()
3397{
3398   brace1 = 0;
3399   brace2 = 0;
3400   brace3 = 0;
3401   quote  = 0;
3402   yy_init=1;
3403   yy_delete_buffer(yy_current_buffer);
3404}
3405
3406void make_version(char *p,int what)
3407{
3408  char ver[10];
3409  char date[16];
3410  ver[0]='?'; ver[1]='.'; ver[2]='?'; ver[3]='\0';
3411  date[0]='?'; date[1]='\0';
3412  if(what) sscanf(p,"%*[^=]= %*s %*s %10s %16s",ver,date);
3413  else sscanf(p,"// %*s %*s %10s %16s",ver,date);
3414  strcpy(libnamebuf,"(");
3415  strcat(libnamebuf,ver);
3416  strcat(libnamebuf,",");
3417  strcat(libnamebuf,date);
3418  strcat(libnamebuf,")");
3419  if(what && strcmp(libnamebuf, "(?.?,?)")==0)
3420  {
3421    sscanf(p,"%*[^\"]\"%[^\"]\"",libnamebuf);
3422  }
3423  //printf("ID=(%d)%s; \n", what, p);
3424}
3425
3426void copy_string(lp_modes mode)
3427{
3428#ifdef STANDALONE_PARSER
3429  if ((texinfo_out
3430     && (last_cmd == LP_INFO || last_cmd == LP_CATEGORY || last_cmd == LP_URL))
3431  || (category_out && last_cmd == LP_CATEGORY)
3432)
3433  {
3434    long current_location = ftell(yylpin), i = string_start, quote = 0;
3435    char c;
3436    if (texinfo_out)
3437    {
3438     if (last_cmd == LP_INFO)
3439     {
3440       printf("$info = <<EOT;\n");
3441     }
3442     else if (last_cmd == LP_URL)
3443     {
3444       printf("$url = <<EOT;\n");
3445     }
3446     else
3447     {
3448       printf("$category = <<EOT;\n");
3449     }
3450    }
3451    fseek (yylpin, i, SEEK_SET);
3452    while (i< current_location)
3453    {
3454      c = fgetc(yylpin);
3455      if (c == '\\')
3456      {
3457        quote = (! quote);
3458      }
3459      else if (c == '"')
3460      {
3461        if (! quote) break;
3462      }
3463      else
3464        quote = 0;
3465      if (c == '@' || c == '$') putchar('\\');
3466      if (c != '\r') putchar(c);
3467      i++;
3468    }
3469    if (category_out) exit(0);
3470    fseek (yylpin, current_location, SEEK_SET);
3471    printf("\nEOT\n");
3472  }
3473#else
3474  if((last_cmd == LP_INFO)&&(mode == GET_INFO))
3475  {
3476    int i, offset=0;
3477    long current_location = ftell(yylpin);
3478    int len = (int)(current_pos(0) - string_start);
3479    fseek(yylpin, string_start, SEEK_SET);
3480    if (text_buffer!=NULL) omFree((ADDRESS)text_buffer);
3481    text_buffer = (char *)omAlloc(len+2);
3482    omMarkAsStaticAddr(text_buffer);
3483    myfread(text_buffer, len, 1, yylpin);
3484    fseek(yylpin, current_location, SEEK_SET);
3485    text_buffer[len]='\0';
3486    offset=0;
3487    for(i=0;i<=len; i++)
3488    {
3489      if(text_buffer[i]=='\\' &&
3490         (text_buffer[i+1]=='\"' || text_buffer[i+1]=='{' ||
3491          text_buffer[i+1]=='}' || text_buffer[i+1]=='\\'))
3492      {
3493        i++;
3494        offset++;
3495      }
3496      if(offset>0) text_buffer[i-offset] = text_buffer[i];
3497    }
3498  }
3499#endif /* STANDALONE_PARSER */
3500}
3501
3502void print_init()
3503{
3504   printf("Init=%d\n", yy_init);
3505}
3506
3507void print_version(lp_modes mode, char *p)
3508{
3509#ifdef STANDALONE_PARSER
3510  //printf("loading %s%s", p, libnamebuf);
3511#else
3512  if ( mode == LOAD_LIB )
3513  {
3514    if (BVERBOSE(V_LOAD_LIB) && p!=NULL ) Print(" %s...", p);
3515       //Warn( "loading %s%s", p, libnamebuf);
3516  }
3517#endif
3518}
3519
3520#ifdef STANDALONE_PARSER
3521main( int argc, char *argv[] )
3522{
3523  lib_style_types lib_style;
3524  main_init(argc, argv);
3525  if(yyin == NULL) {
3526    fprintf(stderr, "No library found to parse.\n");
3527    exit(1);
3528  }
3529  if (! (texinfo_out || category_out))
3530  {
3531    if(lpverbose)printf("Verbose level=%d\n", lpverbose);
3532    if(check)printf("Reporting most possible annomalies.\n");
3533    if(lpverbose||check)printf("\n");
3534
3535    printf( "  %-15s  %20s      %s,%s    %s,%s     %s,%s\n", "Library",
3536            "function", "line", "start-eod", "line", "body-eob",
3537            "line", "example-eoe");
3538  }
3539#ifdef HAVE_NS
3540  yylplex(argv[0], argv[0], &lib_style,NULL);
3541#else
3542  yylplex(argv[0], argv[0], &lib_style);
3543#endif
3544  if(yylp_errno) {
3545    printf("ERROR occured: [%d] ", yylp_errno);
3546    printf(yylp_errlist[yylp_errno], yylplineno);
3547    printf("\n");
3548  }
3549  else if(pi!=NULL) printpi(pi);
3550  if (texinfo_out)
3551    printf("1;");
3552  exit(0);
3553}
3554
3555#endif /* STANDALONE_PARSER */
3556#endif /* HAVE_LIBPARSE */
Note: See TracBrowser for help on using the repository browser.