source: git/Singular/libparse.cc @ 6cf5e6

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