source: git/Singular/libparse.cc @ 76147f6

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