source: git/Singular/libparse.cc @ e24823

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