lac : 699b9eb7445870c74a2dc65727af3009bf6af1c7
1:
2: #line 3 "lex.c"
3:
4: #define YY_INT_ALIGNED short int
5:
6: /* A lexical scanner generated by flex */
7:
8: #define FLEX_SCANNER
9: #define YY_FLEX_MAJOR_VERSION 2
10: #define YY_FLEX_MINOR_VERSION 6
11: #define YY_FLEX_SUBMINOR_VERSION 0
12: #if YY_FLEX_SUBMINOR_VERSION > 0
13: #define FLEX_BETA
14: #endif
15:
16: /* First, we deal with platform-specific or compiler-specific issues. */
17:
18: /* begin standard C headers. */
19: #include <stdio.h>
20: #include <string.h>
21: #include <errno.h>
22: #include <stdlib.h>
23:
24: /* end standard C headers. */
25:
26: /* flex integer type definitions */
27:
28: #ifndef FLEXINT_H
29: #define FLEXINT_H
30:
31: /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32:
33: #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34:
35: /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36: * if you want the limit (max/min) macros for int types.
37: */
38: #ifndef __STDC_LIMIT_MACROS
39: #define __STDC_LIMIT_MACROS 1
40: #endif
41:
42: #include <inttypes.h>
43: typedef int8_t flex_int8_t;
44: typedef uint8_t flex_uint8_t;
45: typedef int16_t flex_int16_t;
46: typedef uint16_t flex_uint16_t;
47: typedef int32_t flex_int32_t;
48: typedef uint32_t flex_uint32_t;
49: #else
50: typedef signed char flex_int8_t;
51: typedef short int flex_int16_t;
52: typedef int flex_int32_t;
53: typedef unsigned char flex_uint8_t;
54: typedef unsigned short int flex_uint16_t;
55: typedef unsigned int flex_uint32_t;
56:
57: /* Limits of integral types. */
58: #ifndef INT8_MIN
59: #define INT8_MIN (-128)
60: #endif
61: #ifndef INT16_MIN
62: #define INT16_MIN (-32767-1)
63: #endif
64: #ifndef INT32_MIN
65: #define INT32_MIN (-2147483647-1)
66: #endif
67: #ifndef INT8_MAX
68: #define INT8_MAX (127)
69: #endif
70: #ifndef INT16_MAX
71: #define INT16_MAX (32767)
72: #endif
73: #ifndef INT32_MAX
74: #define INT32_MAX (2147483647)
75: #endif
76: #ifndef UINT8_MAX
77: #define UINT8_MAX (255U)
78: #endif
79: #ifndef UINT16_MAX
80: #define UINT16_MAX (65535U)
81: #endif
82: #ifndef UINT32_MAX
83: #define UINT32_MAX (4294967295U)
84: #endif
85:
86: #endif /* ! C99 */
87:
88: #endif /* ! FLEXINT_H */
89:
90: #ifdef __cplusplus
91:
92: /* The "const" storage-class-modifier is valid. */
93: #define YY_USE_CONST
94:
95: #else /* ! __cplusplus */
96:
97: /* C99 requires __STDC__ to be defined as 1. */
98: #if defined (__STDC__)
99:
100: #define YY_USE_CONST
101:
102: #endif /* defined (__STDC__) */
103: #endif /* ! __cplusplus */
104:
105: #ifdef YY_USE_CONST
106: #define yyconst const
107: #else
108: #define yyconst
109: #endif
110:
111: /* Returned upon end-of-file. */
112: #define YY_NULL 0
113:
114: /* Promotes a possibly negative, possibly signed char to an unsigned
115: * integer for use as an array index. If the signed char is negative,
116: * we want to instead treat it as an 8-bit unsigned char, hence the
117: * double cast.
118: */
119: #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120:
121: /* An opaque pointer. */
122: #ifndef YY_TYPEDEF_YY_SCANNER_T
123: #define YY_TYPEDEF_YY_SCANNER_T
124: typedef void* yyscan_t;
125: #endif
126:
127: /* For convenience, these vars (plus the bison vars far below)
128: are macros in the reentrant scanner. */
129: #define yyin yyg->yyin_r
130: #define yyout yyg->yyout_r
131: #define yyextra yyg->yyextra_r
132: #define yyleng yyg->yyleng_r
133: #define yytext yyg->yytext_r
134: #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135: #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136: #define yy_flex_debug yyg->yy_flex_debug_r
137:
138: /* Enter a start condition. This macro really ought to take a parameter,
139: * but we do it the disgusting crufty way forced on us by the ()-less
140: * definition of BEGIN.
141: */
142: #define BEGIN yyg->yy_start = 1 + 2 *
143:
144: /* Translate the current start state into a value that can be later handed
145: * to BEGIN to return to the state. The YYSTATE alias is for lex
146: * compatibility.
147: */
148: #define YY_START ((yyg->yy_start - 1) / 2)
149: #define YYSTATE YY_START
150:
151: /* Action number for EOF rule of a given start state. */
152: #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153:
154: /* Special action meaning "start processing a new file". */
155: #define YY_NEW_FILE yyrestart(yyin ,yyscanner )
156:
157: #define YY_END_OF_BUFFER_CHAR 0
158:
159: /* Size of default input buffer. */
160: #ifndef YY_BUF_SIZE
161: #ifdef __ia64__
162: /* On IA-64, the buffer size is 16k, not 8k.
163: * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
164: * Ditto for the __ia64__ case accordingly.
165: */
166: #define YY_BUF_SIZE 32768
167: #else
168: #define YY_BUF_SIZE 16384
169: #endif /* __ia64__ */
170: #endif
171:
172: /* The state buf must be large enough to hold one state per character in the main buffer.
173: */
174: #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
175:
176: #ifndef YY_TYPEDEF_YY_BUFFER_STATE
177: #define YY_TYPEDEF_YY_BUFFER_STATE
178: typedef struct yy_buffer_state *YY_BUFFER_STATE;
179: #endif
180:
181: #ifndef YY_TYPEDEF_YY_SIZE_T
182: #define YY_TYPEDEF_YY_SIZE_T
183: typedef size_t yy_size_t;
184: #endif
185:
186: #define EOB_ACT_CONTINUE_SCAN 0
187: #define EOB_ACT_END_OF_FILE 1
188: #define EOB_ACT_LAST_MATCH 2
189:
190: #define YY_LESS_LINENO(n)
191: #define YY_LINENO_REWIND_TO(ptr)
192:
193: /* Return all but the first "n" matched characters back to the input stream. */
194: #define yyless(n) \
195: do \
196: { \
197: /* Undo effects of setting up yytext. */ \
198: yy_size_t yyless_macro_arg = (n); \
199: YY_LESS_LINENO(yyless_macro_arg);\
200: *yy_cp = yyg->yy_hold_char; \
201: YY_RESTORE_YY_MORE_OFFSET \
202: yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
203: YY_DO_BEFORE_ACTION; /* set up yytext again */ \
204: } \
205: while ( 0 )
206:
207: #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
208:
209: #ifndef YY_STRUCT_YY_BUFFER_STATE
210: #define YY_STRUCT_YY_BUFFER_STATE
211: struct yy_buffer_state
212: {
213: FILE *yy_input_file;
214:
215: char *yy_ch_buf; /* input buffer */
216: char *yy_buf_pos; /* current position in input buffer */
217:
218: /* Size of input buffer in bytes, not including room for EOB
219: * characters.
220: */
221: yy_size_t yy_buf_size;
222:
223: /* Number of characters read into yy_ch_buf, not including EOB
224: * characters.
225: */
226: yy_size_t yy_n_chars;
227:
228: /* Whether we "own" the buffer - i.e., we know we created it,
229: * and can realloc() it to grow it, and should free() it to
230: * delete it.
231: */
232: int yy_is_our_buffer;
233:
234: /* Whether this is an "interactive" input source; if so, and
235: * if we're using stdio for input, then we want to use getc()
236: * instead of fread(), to make sure we stop fetching input after
237: * each newline.
238: */
239: int yy_is_interactive;
240:
241: /* Whether we're considered to be at the beginning of a line.
242: * If so, '^' rules will be active on the next match, otherwise
243: * not.
244: */
245: int yy_at_bol;
246:
247: int yy_bs_lineno; /**< The line count. */
248: int yy_bs_column; /**< The column count. */
249:
250: /* Whether to try to fill the input buffer when we reach the
251: * end of it.
252: */
253: int yy_fill_buffer;
254:
255: int yy_buffer_status;
256:
257: #define YY_BUFFER_NEW 0
258: #define YY_BUFFER_NORMAL 1
259: /* When an EOF's been seen but there's still some text to process
260: * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261: * shouldn't try reading from the input source any more. We might
262: * still have a bunch of tokens to match, though, because of
263: * possible backing-up.
264: *
265: * When we actually see the EOF, we change the status to "new"
266: * (via yyrestart()), so that the user can continue scanning by
267: * just pointing yyin at a new input file.
268: */
269: #define YY_BUFFER_EOF_PENDING 2
270:
271: };
272: #endif /* !YY_STRUCT_YY_BUFFER_STATE */
273:
274: /* We provide macros for accessing buffer states in case in the
275: * future we want to put the buffer states in a more general
276: * "scanner state".
277: *
278: * Returns the top of the stack, or NULL.
279: */
280: #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281: ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
282: : NULL)
283:
284: /* Same as previous macro, but useful when we know that the buffer stack is not
285: * NULL or when we need an lvalue. For internal use only.
286: */
287: #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
288:
289: void yyrestart (FILE *input_file ,yyscan_t yyscanner );
290: void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
291: YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
292: void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
293: void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
294: void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
295: void yypop_buffer_state (yyscan_t yyscanner );
296:
297: static void yyensure_buffer_stack (yyscan_t yyscanner );
298: static void yy_load_buffer_state (yyscan_t yyscanner );
299: static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
300:
301: #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
302:
303: YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
304: YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
305: YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
306:
307: void *yyalloc (yy_size_t ,yyscan_t yyscanner );
308: void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
309: void yyfree (void * ,yyscan_t yyscanner );
310:
311: #define yy_new_buffer yy_create_buffer
312:
313: #define yy_set_interactive(is_interactive) \
314: { \
315: if ( ! YY_CURRENT_BUFFER ){ \
316: yyensure_buffer_stack (yyscanner); \
317: YY_CURRENT_BUFFER_LVALUE = \
318: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
319: } \
320: YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321: }
322:
323: #define yy_set_bol(at_bol) \
324: { \
325: if ( ! YY_CURRENT_BUFFER ){\
326: yyensure_buffer_stack (yyscanner); \
327: YY_CURRENT_BUFFER_LVALUE = \
328: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
329: } \
330: YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331: }
332:
333: #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
334:
335: /* Begin user sect3 */
336:
337: #define yywrap(yyscanner) (/*CONSTCOND*/1)
338: #define YY_SKIP_YYWRAP
339:
340: typedef unsigned char YY_CHAR;
341:
342: typedef int yy_state_type;
343:
344: #define yytext_ptr yytext_r
345:
346: static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
347: static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
348: static int yy_get_next_buffer (yyscan_t yyscanner );
349: #if defined(__GNUC__) && __GNUC__ >= 3
350: __attribute__((__noreturn__))
351: #endif
352: static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
353:
354: /* Done after the current pattern has been matched and before the
355: * corresponding action - sets up yytext.
356: */
357: #define YY_DO_BEFORE_ACTION \
358: yyg->yytext_ptr = yy_bp; \
359: yyleng = (size_t) (yy_cp - yy_bp); \
360: yyg->yy_hold_char = *yy_cp; \
361: *yy_cp = '\0'; \
362: yyg->yy_c_buf_p = yy_cp;
363:
364: #define YY_NUM_RULES 10
365: #define YY_END_OF_BUFFER 11
366: /* This struct is not used in this scanner,
367: but its presence is necessary. */
368: struct yy_trans_info
369: {
370: flex_int32_t yy_verify;
371: flex_int32_t yy_nxt;
372: };
373: static yyconst flex_int16_t yy_accept[34] =
374: { 0,
375: 0, 0, 11, 9, 2, 2, 7, 9, 7, 7,
376: 9, 3, 3, 1, 7, 7, 9, 7, 0, 6,
377: 7, 3, 8, 7, 3, 7, 1, 7, 7, 3,
378: 4, 5, 0
379: } ;
380:
381: static yyconst YY_CHAR yy_ec[256] =
382: { 0,
383: 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
384: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386: 1, 2, 4, 5, 6, 4, 4, 4, 1, 1,
387: 1, 4, 7, 8, 7, 9, 4, 10, 11, 11,
388: 11, 11, 11, 11, 11, 11, 11, 4, 12, 4,
389: 4, 4, 4, 13, 14, 14, 14, 14, 14, 14,
390: 15, 15, 16, 15, 15, 17, 15, 18, 15, 15,
391: 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
392: 1, 1, 1, 4, 4, 1, 14, 14, 14, 14,
393:
394: 14, 14, 15, 15, 19, 15, 15, 20, 15, 21,
395: 15, 15, 15, 15, 15, 15, 15, 15, 15, 22,
396: 15, 15, 1, 23, 1, 4, 1, 1, 1, 1,
397: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404:
405: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410: 1, 1, 1, 1, 1
411: } ;
412:
413: static yyconst YY_CHAR yy_meta[24] =
414: { 0,
415: 1, 1, 2, 3, 1, 1, 3, 3, 3, 3,
416: 3, 1, 1, 3, 3, 3, 3, 3, 3, 3,
417: 3, 3, 1
418: } ;
419:
420: static yyconst flex_uint16_t yy_base[38] =
421: { 0,
422: 0, 0, 57, 58, 58, 58, 0, 51, 33, 14,
423: 41, 16, 18, 0, 37, 33, 20, 0, 46, 58,
424: 22, 24, 58, 0, 29, 0, 0, 33, 29, 31,
425: 0, 0, 58, 44, 42, 34, 45
426: } ;
427:
428: static yyconst flex_int16_t yy_def[38] =
429: { 0,
430: 33, 1, 33, 33, 33, 33, 34, 35, 34, 34,
431: 33, 36, 36, 37, 34, 34, 33, 34, 35, 33,
432: 34, 34, 33, 34, 36, 21, 37, 34, 34, 33,
433: 21, 34, 0, 33, 33, 33, 33
434: } ;
435:
436: static yyconst flex_uint16_t yy_nxt[82] =
437: { 0,
438: 4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
439: 13, 14, 4, 7, 7, 7, 7, 15, 7, 7,
440: 16, 7, 17, 22, 22, 25, 25, 25, 25, 30,
441: 30, 31, 31, 22, 22, 31, 24, 26, 25, 25,
442: 30, 30, 19, 19, 19, 27, 18, 27, 32, 32,
443: 20, 29, 28, 23, 21, 20, 33, 3, 33, 33,
444: 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
445: 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
446: 33
447: } ;
448:
449: static yyconst flex_int16_t yy_chk[82] =
450: { 0,
451: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453: 1, 1, 1, 10, 10, 12, 12, 13, 13, 17,
454: 17, 21, 21, 22, 22, 21, 36, 12, 25, 25,
455: 30, 30, 35, 35, 35, 37, 34, 37, 29, 28,
456: 19, 16, 15, 11, 9, 8, 3, 33, 33, 33,
457: 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
458: 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
459: 33
460: } ;
461:
462: /* The intent behind this definition is that it'll catch
463: * any uses of REJECT which flex missed.
464: */
465: #define REJECT reject_used_but_not_detected
466: #define yymore() yymore_used_but_not_detected
467: #define YY_MORE_ADJ 0
468: #define YY_RESTORE_YY_MORE_OFFSET
469: #line 1 "lex.l"
470: /*
471: lac -- a lisp interpreter
472: Copyright (C) 2010 Gianluca Guida
473:
474: This program is free software; you can redistribute it and/or modify
475: it under the terms of the GNU General Public License as published by
476: the Free Software Foundation; either version 2 of the License, or
477: (at your option) any later version.
478:
479: This program is distributed in the hope that it will be useful,
480: but WITHOUT ANY WARRANTY; without even the implied warranty of
481: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
482: GNU General Public License for more details.
483:
484: You should have received a copy of the GNU General Public License along
485: with this program; if not, write to the Free Software Foundation, Inc.,
486: 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
487: */
488: #line 21 "lex.l"
489: #define YYSTYPE lreg_t
490: #define YY_DECL int yylex(YYSTYPE *lvalp,void *yyscanner)
491: #define YY_NO_INPUT
492: #include <ctype.h>
493: #include <strings.h>
494:
495: #include "config.h"
496: #include "lac.h"
497: #include "sexpr_parse.h"
498:
499:
500: #ifdef HAVE_READLINE
501: #ifdef HAVE_READLINE_READLINE_H
502: #include <readline/readline.h>
503: #else
504: #include <readline.h>
505: #endif
506: #ifdef HAVE_READLINE_HISTORY_H
507: #include <readline/history.h>
508: #else
509: #include <history.h>
510: #endif
511:
512: static int readline_getc(void)
513: {
514: static int curchar = 0;
515: static char *buf = NULL;
516:
517: /* First run */
518: if ( buf == NULL ) {
519: buf = readline("LAC>");
520: if ( buf != NULL && *buf != '\0' )
521: add_history(buf);
522: curchar = 0;
523: }
524:
525: if ( buf == NULL )
526: return EOF;
527: if ( buf[curchar] == '\0' ) {
528: free(buf);
529: buf = NULL;
530: return '\n';
531: }
532:
533: return buf[curchar++];
534: }
535:
536: #else
537: #define readline_getc() getchar()
538: #endif
539:
540: #define YY_INPUT(buf,result,max_size) \
541: if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
542: { \
543: int c = '*'; \
544: size_t n; \
545: for ( n = 0; n < max_size && \
546: (c = readline_getc())!=EOF && c!='\n'; ++n ) \
547: buf[n] = (char) c; \
548: if ( c == '\n' ) \
549: buf[n++] = (char) c; \
550: if ( c == EOF && ferror( yyin ) ) \
551: YY_FATAL_ERROR( "input in flex scanner failed" ); \
552: result = n; \
553: } \
554: else \
555: { \
556: errno=0; \
557: while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
558: { \
559: if( errno != EINTR) \
560: { \
561: YY_FATAL_ERROR( "input in flex scanner failed" ); \
562: break; \
563: } \
564: errno=0; \
565: clearerr(yyin); \
566: } \
567: }\
568:
569: #line 570 "lex.c"
570:
571: #define INITIAL 0
572:
573: #ifndef YY_NO_UNISTD_H
574: /* Special case for "unistd.h", since it is non-ANSI. We include it way
575: * down here because we want the user's section 1 to have been scanned first.
576: * The user has a chance to override it with an option.
577: */
578: #include <unistd.h>
579: #endif
580:
581: #ifndef YY_EXTRA_TYPE
582: #define YY_EXTRA_TYPE void *
583: #endif
584:
585: /* Holds the entire state of the reentrant scanner. */
586: struct yyguts_t
587: {
588:
589: /* User-defined. Not touched by flex. */
590: YY_EXTRA_TYPE yyextra_r;
591:
592: /* The rest are the same as the globals declared in the non-reentrant scanner. */
593: FILE *yyin_r, *yyout_r;
594: size_t yy_buffer_stack_top; /**< index of top of stack. */
595: size_t yy_buffer_stack_max; /**< capacity of stack. */
596: YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
597: char yy_hold_char;
598: yy_size_t yy_n_chars;
599: yy_size_t yyleng_r;
600: char *yy_c_buf_p;
601: int yy_init;
602: int yy_start;
603: int yy_did_buffer_switch_on_eof;
604: int yy_start_stack_ptr;
605: int yy_start_stack_depth;
606: int *yy_start_stack;
607: yy_state_type yy_last_accepting_state;
608: char* yy_last_accepting_cpos;
609:
610: int yylineno_r;
611: int yy_flex_debug_r;
612:
613: char *yytext_r;
614: int yy_more_flag;
615: int yy_more_len;
616:
617: }; /* end struct yyguts_t */
618:
619: static int yy_init_globals (yyscan_t yyscanner );
620:
621: int yylex_init (yyscan_t* scanner);
622:
623: int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
624:
625: /* Accessor methods to globals.
626: These are made visible to non-reentrant scanners for convenience. */
627:
628: int yylex_destroy (yyscan_t yyscanner );
629:
630: int yyget_debug (yyscan_t yyscanner );
631:
632: void yyset_debug (int debug_flag ,yyscan_t yyscanner );
633:
634: YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
635:
636: void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
637:
638: FILE *yyget_in (yyscan_t yyscanner );
639:
640: void yyset_in (FILE * _in_str ,yyscan_t yyscanner );
641:
642: FILE *yyget_out (yyscan_t yyscanner );
643:
644: void yyset_out (FILE * _out_str ,yyscan_t yyscanner );
645:
646: yy_size_t yyget_leng (yyscan_t yyscanner );
647:
648: char *yyget_text (yyscan_t yyscanner );
649:
650: int yyget_lineno (yyscan_t yyscanner );
651:
652: void yyset_lineno (int _line_number ,yyscan_t yyscanner );
653:
654: int yyget_column (yyscan_t yyscanner );
655:
656: void yyset_column (int _column_no ,yyscan_t yyscanner );
657:
658: /* Macros after this point can all be overridden by user definitions in
659: * section 1.
660: */
661:
662: #ifndef YY_SKIP_YYWRAP
663: #ifdef __cplusplus
664: extern "C" int yywrap (yyscan_t yyscanner );
665: #else
666: extern int yywrap (yyscan_t yyscanner );
667: #endif
668: #endif
669:
670: #ifndef YY_NO_UNPUT
671:
672: static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
673:
674: #endif
675:
676: #ifndef yytext_ptr
677: static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
678: #endif
679:
680: #ifdef YY_NEED_STRLEN
681: static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
682: #endif
683:
684: #ifndef YY_NO_INPUT
685:
686: #ifdef __cplusplus
687: static int yyinput (yyscan_t yyscanner );
688: #else
689: static int input (yyscan_t yyscanner );
690: #endif
691:
692: #endif
693:
694: /* Amount of stuff to slurp up with each read. */
695: #ifndef YY_READ_BUF_SIZE
696: #ifdef __ia64__
697: /* On IA-64, the buffer size is 16k, not 8k */
698: #define YY_READ_BUF_SIZE 16384
699: #else
700: #define YY_READ_BUF_SIZE 8192
701: #endif /* __ia64__ */
702: #endif
703:
704: /* Copy whatever the last rule matched to the standard output. */
705: #ifndef ECHO
706: /* This used to be an fputs(), but since the string might contain NUL's,
707: * we now use fwrite().
708: */
709: #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
710: #endif
711:
712: /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
713: * is returned in "result".
714: */
715: #ifndef YY_INPUT
716: #define YY_INPUT(buf,result,max_size) \
717: if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
718: { \
719: int c = '*'; \
720: size_t n; \
721: for ( n = 0; n < max_size && \
722: (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
723: buf[n] = (char) c; \
724: if ( c == '\n' ) \
725: buf[n++] = (char) c; \
726: if ( c == EOF && ferror( yyin ) ) \
727: YY_FATAL_ERROR( "input in flex scanner failed" ); \
728: result = n; \
729: } \
730: else \
731: { \
732: errno=0; \
733: while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
734: { \
735: if( errno != EINTR) \
736: { \
737: YY_FATAL_ERROR( "input in flex scanner failed" ); \
738: break; \
739: } \
740: errno=0; \
741: clearerr(yyin); \
742: } \
743: }\
744: \
745:
746: #endif
747:
748: /* No semi-colon after return; correct usage is to write "yyterminate();" -
749: * we don't want an extra ';' after the "return" because that will cause
750: * some compilers to complain about unreachable statements.
751: */
752: #ifndef yyterminate
753: #define yyterminate() return YY_NULL
754: #endif
755:
756: /* Number of entries by which start-condition stack grows. */
757: #ifndef YY_START_STACK_INCR
758: #define YY_START_STACK_INCR 25
759: #endif
760:
761: /* Report a fatal error. */
762: #ifndef YY_FATAL_ERROR
763: #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
764: #endif
765:
766: /* end tables serialization structures and prototypes */
767:
768: /* Default declaration of generated scanner - a define so the user can
769: * easily add parameters.
770: */
771: #ifndef YY_DECL
772: #define YY_DECL_IS_OURS 1
773:
774: extern int yylex (yyscan_t yyscanner);
775:
776: #define YY_DECL int yylex (yyscan_t yyscanner)
777: #endif /* !YY_DECL */
778:
779: /* Code executed at the beginning of each rule, after yytext and yyleng
780: * have been set up.
781: */
782: #ifndef YY_USER_ACTION
783: #define YY_USER_ACTION
784: #endif
785:
786: /* Code executed at the end of each rule. */
787: #ifndef YY_BREAK
788: #define YY_BREAK /*LINTED*/break;
789: #endif
790:
791: #define YY_RULE_SETUP \
792: YY_USER_ACTION
793:
794: /** The main scanner function which does all the work.
795: */
796: YY_DECL
797: {
798: yy_state_type yy_current_state;
799: char *yy_cp, *yy_bp;
800: int yy_act;
801: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
802:
803: if ( !yyg->yy_init )
804: {
805: yyg->yy_init = 1;
806:
807: #ifdef YY_USER_INIT
808: YY_USER_INIT;
809: #endif
810:
811: if ( ! yyg->yy_start )
812: yyg->yy_start = 1; /* first start state */
813:
814: if ( ! yyin )
815: yyin = stdin;
816:
817: if ( ! yyout )
818: yyout = stdout;
819:
820: if ( ! YY_CURRENT_BUFFER ) {
821: yyensure_buffer_stack (yyscanner);
822: YY_CURRENT_BUFFER_LVALUE =
823: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
824: }
825:
826: yy_load_buffer_state(yyscanner );
827: }
828:
829: {
830: #line 114 "lex.l"
831:
832:
833: #line 834 "lex.c"
834:
835: while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
836: {
837: yy_cp = yyg->yy_c_buf_p;
838:
839: /* Support of yytext. */
840: *yy_cp = yyg->yy_hold_char;
841:
842: /* yy_bp points to the position in yy_ch_buf of the start of
843: * the current run.
844: */
845: yy_bp = yy_cp;
846:
847: yy_current_state = yyg->yy_start;
848: yy_match:
849: do
850: {
851: YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
852: if ( yy_accept[yy_current_state] )
853: {
854: yyg->yy_last_accepting_state = yy_current_state;
855: yyg->yy_last_accepting_cpos = yy_cp;
856: }
857: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
858: {
859: yy_current_state = (int) yy_def[yy_current_state];
860: if ( yy_current_state >= 34 )
861: yy_c = yy_meta[(unsigned int) yy_c];
862: }
863: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
864: ++yy_cp;
865: }
866: while ( yy_base[yy_current_state] != 58 );
867:
868: yy_find_action:
869: yy_act = yy_accept[yy_current_state];
870: if ( yy_act == 0 )
871: { /* have to back up */
872: yy_cp = yyg->yy_last_accepting_cpos;
873: yy_current_state = yyg->yy_last_accepting_state;
874: yy_act = yy_accept[yy_current_state];
875: }
876:
877: YY_DO_BEFORE_ACTION;
878:
879: do_action: /* This label is used only to access EOF actions. */
880:
881: switch ( yy_act )
882: { /* beginning of action switch */
883: case 0: /* must back up */
884: /* undo the effects of YY_DO_BEFORE_ACTION */
885: *yy_cp = yyg->yy_hold_char;
886: yy_cp = yyg->yy_last_accepting_cpos;
887: yy_current_state = yyg->yy_last_accepting_state;
888: goto yy_find_action;
889:
890: case 1:
891: YY_RULE_SETUP
892: #line 116 "lex.l"
893:
894: YY_BREAK
895: case 2:
896: /* rule 2 can match eol */
897: YY_RULE_SETUP
898: #line 117 "lex.l"
899:
900: YY_BREAK
901: case 3:
902: YY_RULE_SETUP
903: #line 119 "lex.l"
904: {
905: intptr_t n;
906:
907: errno = 0;
908: n = strtol(yytext, (char **)NULL, 10);
909: if ( errno == ERANGE )
910: raise_exception("Integer overflow in input", NIL);
911: *lvalp = lac_extty_box(LREG_INTEGER, (void *)n, 0);
912: return INTEGER;
913: }
914: YY_BREAK
915: case 4:
916: YY_RULE_SETUP
917: #line 130 "lex.l"
918: {
919: intptr_t n;
920:
921: errno = 0;
922: n = strtol(yytext+2, (char **)NULL, 16);
923: if ( errno == ERANGE )
924: raise_exception("Integer overflow in input", NIL);
925: *lvalp = lac_extty_box(LREG_INTEGER, (void *)n, 0);
926: return INTEGER;
927: }
928: YY_BREAK
929: case 5:
930: YY_RULE_SETUP
931: #line 141 "lex.l"
932: {
933: *lvalp = NIL;
934: return NIHIL;
935: }
936: YY_BREAK
937: case 6:
938: /* rule 6 can match eol */
939: YY_RULE_SETUP
940: #line 146 "lex.l"
941: {
942: size_t len = strlen(yytext);
943: char *s = lac_alloc(len - 1);
944: memcpy(s, yytext+1, len - 2);
945: *lvalp = lreg_raw(s, LREG_STRING);
946: return STRING;
947: }
948: YY_BREAK
949: case 7:
950: YY_RULE_SETUP
951: #line 154 "lex.l"
952: {
953: int i;
954: size_t len = strlen(yytext);
955: char *s = lac_alloc(len + 1);
956: for (i = 0; i < len; i++)
957: *(s+i) = toupper((int)*(yytext+i));
958: *lvalp = intern_symbol(s);
959: return SYMBOL;
960: };
961: YY_BREAK
962: case 8:
963: YY_RULE_SETUP
964: #line 164 "lex.l"
965: { return COMMA_AT; }
966: YY_BREAK
967: case YY_STATE_EOF(INITIAL):
968: #line 166 "lex.l"
969: { return ENDOFFILE; }
970: YY_BREAK
971: case 9:
972: YY_RULE_SETUP
973: #line 168 "lex.l"
974: { return *yytext; }
975: YY_BREAK
976: case 10:
977: YY_RULE_SETUP
978: #line 171 "lex.l"
979: ECHO;
980: YY_BREAK
981: #line 982 "lex.c"
982:
983: case YY_END_OF_BUFFER:
984: {
985: /* Amount of text matched not including the EOB char. */
986: int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
987:
988: /* Undo the effects of YY_DO_BEFORE_ACTION. */
989: *yy_cp = yyg->yy_hold_char;
990: YY_RESTORE_YY_MORE_OFFSET
991:
992: if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
993: {
994: /* We're scanning a new file or input source. It's
995: * possible that this happened because the user
996: * just pointed yyin at a new source and called
997: * yylex(). If so, then we have to assure
998: * consistency between YY_CURRENT_BUFFER and our
999: * globals. Here is the right place to do so, because
1000: * this is the first action (other than possibly a
1001: * back-up) that will match for the new input source.
1002: */
1003: yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1004: YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1005: YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1006: }
1007:
1008: /* Note that here we test for yy_c_buf_p "<=" to the position
1009: * of the first EOB in the buffer, since yy_c_buf_p will
1010: * already have been incremented past the NUL character
1011: * (since all states make transitions on EOB to the
1012: * end-of-buffer state). Contrast this with the test
1013: * in input().
1014: */
1015: if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1016: { /* This was really a NUL. */
1017: yy_state_type yy_next_state;
1018:
1019: yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1020:
1021: yy_current_state = yy_get_previous_state( yyscanner );
1022:
1023: /* Okay, we're now positioned to make the NUL
1024: * transition. We couldn't have
1025: * yy_get_previous_state() go ahead and do it
1026: * for us because it doesn't know how to deal
1027: * with the possibility of jamming (and we don't
1028: * want to build jamming into it because then it
1029: * will run more slowly).
1030: */
1031:
1032: yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1033:
1034: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1035:
1036: if ( yy_next_state )
1037: {
1038: /* Consume the NUL. */
1039: yy_cp = ++yyg->yy_c_buf_p;
1040: yy_current_state = yy_next_state;
1041: goto yy_match;
1042: }
1043:
1044: else
1045: {
1046: yy_cp = yyg->yy_c_buf_p;
1047: goto yy_find_action;
1048: }
1049: }
1050:
1051: else switch ( yy_get_next_buffer( yyscanner ) )
1052: {
1053: case EOB_ACT_END_OF_FILE:
1054: {
1055: yyg->yy_did_buffer_switch_on_eof = 0;
1056:
1057: if ( yywrap(yyscanner ) )
1058: {
1059: /* Note: because we've taken care in
1060: * yy_get_next_buffer() to have set up
1061: * yytext, we can now set up
1062: * yy_c_buf_p so that if some total
1063: * hoser (like flex itself) wants to
1064: * call the scanner after we return the
1065: * YY_NULL, it'll still work - another
1066: * YY_NULL will get returned.
1067: */
1068: yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1069:
1070: yy_act = YY_STATE_EOF(YY_START);
1071: goto do_action;
1072: }
1073:
1074: else
1075: {
1076: if ( ! yyg->yy_did_buffer_switch_on_eof )
1077: YY_NEW_FILE;
1078: }
1079: break;
1080: }
1081:
1082: case EOB_ACT_CONTINUE_SCAN:
1083: yyg->yy_c_buf_p =
1084: yyg->yytext_ptr + yy_amount_of_matched_text;
1085:
1086: yy_current_state = yy_get_previous_state( yyscanner );
1087:
1088: yy_cp = yyg->yy_c_buf_p;
1089: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1090: goto yy_match;
1091:
1092: case EOB_ACT_LAST_MATCH:
1093: yyg->yy_c_buf_p =
1094: &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1095:
1096: yy_current_state = yy_get_previous_state( yyscanner );
1097:
1098: yy_cp = yyg->yy_c_buf_p;
1099: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1100: goto yy_find_action;
1101: }
1102: break;
1103: }
1104:
1105: default:
1106: YY_FATAL_ERROR(
1107: "fatal flex scanner internal error--no action found" );
1108: } /* end of action switch */
1109: } /* end of scanning one token */
1110: } /* end of user's declarations */
1111: } /* end of yylex */
1112:
1113: /* yy_get_next_buffer - try to read in a new buffer
1114: *
1115: * Returns a code representing an action:
1116: * EOB_ACT_LAST_MATCH -
1117: * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1118: * EOB_ACT_END_OF_FILE - end of file
1119: */
1120: static int yy_get_next_buffer (yyscan_t yyscanner)
1121: {
1122: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1123: char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1124: char *source = yyg->yytext_ptr;
1125: yy_size_t number_to_move, i;
1126: int ret_val;
1127:
1128: if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1129: YY_FATAL_ERROR(
1130: "fatal flex scanner internal error--end of buffer missed" );
1131:
1132: if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1133: { /* Don't try to fill the buffer, so this is an EOF. */
1134: if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1135: {
1136: /* We matched a single character, the EOB, so
1137: * treat this as a final EOF.
1138: */
1139: return EOB_ACT_END_OF_FILE;
1140: }
1141:
1142: else
1143: {
1144: /* We matched some text prior to the EOB, first
1145: * process it.
1146: */
1147: return EOB_ACT_LAST_MATCH;
1148: }
1149: }
1150:
1151: /* Try to read more data. */
1152:
1153: /* First move last chars to start of buffer. */
1154: number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1155:
1156: for ( i = 0; i < number_to_move; ++i )
1157: *(dest++) = *(source++);
1158:
1159: if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1160: /* don't do the read, it's not guaranteed to return an EOF,
1161: * just force an EOF
1162: */
1163: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1164:
1165: else
1166: {
1167: int num_to_read =
1168: YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1169:
1170: while ( num_to_read <= 0 )
1171: { /* Not enough room in the buffer - grow it. */
1172:
1173: /* just a shorter name for the current buffer */
1174: YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1175:
1176: int yy_c_buf_p_offset =
1177: (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1178:
1179: if ( b->yy_is_our_buffer )
1180: {
1181: yy_size_t new_size = b->yy_buf_size * 2;
1182:
1183: if ( new_size <= 0 )
1184: b->yy_buf_size += b->yy_buf_size / 8;
1185: else
1186: b->yy_buf_size *= 2;
1187:
1188: b->yy_ch_buf = (char *)
1189: /* Include room in for 2 EOB chars. */
1190: yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1191: }
1192: else
1193: /* Can't grow it, we don't own it. */
1194: b->yy_ch_buf = 0;
1195:
1196: if ( ! b->yy_ch_buf )
1197: YY_FATAL_ERROR(
1198: "fatal error - scanner input buffer overflow" );
1199:
1200: yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1201:
1202: num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1203: number_to_move - 1;
1204:
1205: }
1206:
1207: if ( num_to_read > YY_READ_BUF_SIZE )
1208: num_to_read = YY_READ_BUF_SIZE;
1209:
1210: /* Read in more data. */
1211: YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1212: yyg->yy_n_chars, num_to_read );
1213:
1214: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1215: }
1216:
1217: if ( yyg->yy_n_chars == 0 )
1218: {
1219: if ( number_to_move == YY_MORE_ADJ )
1220: {
1221: ret_val = EOB_ACT_END_OF_FILE;
1222: yyrestart(yyin ,yyscanner);
1223: }
1224:
1225: else
1226: {
1227: ret_val = EOB_ACT_LAST_MATCH;
1228: YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1229: YY_BUFFER_EOF_PENDING;
1230: }
1231: }
1232:
1233: else
1234: ret_val = EOB_ACT_CONTINUE_SCAN;
1235:
1236: if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1237: /* Extend the array by 50%, plus the number we really need. */
1238: yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1239: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1240: if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1241: YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1242: }
1243:
1244: yyg->yy_n_chars += number_to_move;
1245: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1246: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1247:
1248: yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1249:
1250: return ret_val;
1251: }
1252:
1253: /* yy_get_previous_state - get the state just before the EOB char was reached */
1254:
1255: static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1256: {
1257: yy_state_type yy_current_state;
1258: char *yy_cp;
1259: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1260:
1261: yy_current_state = yyg->yy_start;
1262:
1263: for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1264: {
1265: YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1266: if ( yy_accept[yy_current_state] )
1267: {
1268: yyg->yy_last_accepting_state = yy_current_state;
1269: yyg->yy_last_accepting_cpos = yy_cp;
1270: }
1271: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1272: {
1273: yy_current_state = (int) yy_def[yy_current_state];
1274: if ( yy_current_state >= 34 )
1275: yy_c = yy_meta[(unsigned int) yy_c];
1276: }
1277: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1278: }
1279:
1280: return yy_current_state;
1281: }
1282:
1283: /* yy_try_NUL_trans - try to make a transition on the NUL character
1284: *
1285: * synopsis
1286: * next_state = yy_try_NUL_trans( current_state );
1287: */
1288: static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1289: {
1290: int yy_is_jam;
1291: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1292: char *yy_cp = yyg->yy_c_buf_p;
1293:
1294: YY_CHAR yy_c = 1;
1295: if ( yy_accept[yy_current_state] )
1296: {
1297: yyg->yy_last_accepting_state = yy_current_state;
1298: yyg->yy_last_accepting_cpos = yy_cp;
1299: }
1300: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1301: {
1302: yy_current_state = (int) yy_def[yy_current_state];
1303: if ( yy_current_state >= 34 )
1304: yy_c = yy_meta[(unsigned int) yy_c];
1305: }
1306: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1307: yy_is_jam = (yy_current_state == 33);
1308:
1309: (void)yyg;
1310: return yy_is_jam ? 0 : yy_current_state;
1311: }
1312:
1313: #ifndef YY_NO_UNPUT
1314:
1315: static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
1316: {
1317: char *yy_cp;
1318: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1319:
1320: yy_cp = yyg->yy_c_buf_p;
1321:
1322: /* undo effects of setting up yytext */
1323: *yy_cp = yyg->yy_hold_char;
1324:
1325: if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1326: { /* need to shift things up to make room */
1327: /* +2 for EOB chars. */
1328: yy_size_t number_to_move = yyg->yy_n_chars + 2;
1329: char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1330: YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1331: char *source =
1332: &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1333:
1334: while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1335: *--dest = *--source;
1336:
1337: yy_cp += (int) (dest - source);
1338: yy_bp += (int) (dest - source);
1339: YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1340: yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1341:
1342: if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1343: YY_FATAL_ERROR( "flex scanner push-back overflow" );
1344: }
1345:
1346: *--yy_cp = (char) c;
1347:
1348: yyg->yytext_ptr = yy_bp;
1349: yyg->yy_hold_char = *yy_cp;
1350: yyg->yy_c_buf_p = yy_cp;
1351: }
1352:
1353: #endif
1354:
1355: #ifndef YY_NO_INPUT
1356: #ifdef __cplusplus
1357: static int yyinput (yyscan_t yyscanner)
1358: #else
1359: static int input (yyscan_t yyscanner)
1360: #endif
1361:
1362: {
1363: int c;
1364: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1365:
1366: *yyg->yy_c_buf_p = yyg->yy_hold_char;
1367:
1368: if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1369: {
1370: /* yy_c_buf_p now points to the character we want to return.
1371: * If this occurs *before* the EOB characters, then it's a
1372: * valid NUL; if not, then we've hit the end of the buffer.
1373: */
1374: if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1375: /* This was really a NUL. */
1376: *yyg->yy_c_buf_p = '\0';
1377:
1378: else
1379: { /* need more input */
1380: yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1381: ++yyg->yy_c_buf_p;
1382:
1383: switch ( yy_get_next_buffer( yyscanner ) )
1384: {
1385: case EOB_ACT_LAST_MATCH:
1386: /* This happens because yy_g_n_b()
1387: * sees that we've accumulated a
1388: * token and flags that we need to
1389: * try matching the token before
1390: * proceeding. But for input(),
1391: * there's no matching to consider.
1392: * So convert the EOB_ACT_LAST_MATCH
1393: * to EOB_ACT_END_OF_FILE.
1394: */
1395:
1396: /* Reset buffer status. */
1397: yyrestart(yyin ,yyscanner);
1398:
1399: /*FALLTHROUGH*/
1400:
1401: case EOB_ACT_END_OF_FILE:
1402: {
1403: if ( yywrap(yyscanner ) )
1404: return EOF;
1405:
1406: if ( ! yyg->yy_did_buffer_switch_on_eof )
1407: YY_NEW_FILE;
1408: #ifdef __cplusplus
1409: return yyinput(yyscanner);
1410: #else
1411: return input(yyscanner);
1412: #endif
1413: }
1414:
1415: case EOB_ACT_CONTINUE_SCAN:
1416: yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1417: break;
1418: }
1419: }
1420: }
1421:
1422: c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1423: *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1424: yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1425:
1426: return c;
1427: }
1428: #endif /* ifndef YY_NO_INPUT */
1429:
1430: /** Immediately switch to a different input stream.
1431: * @param input_file A readable stream.
1432: * @param yyscanner The scanner object.
1433: * @note This function does not reset the start condition to @c INITIAL .
1434: */
1435: void yyrestart (FILE * input_file , yyscan_t yyscanner)
1436: {
1437: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1438:
1439: if ( ! YY_CURRENT_BUFFER ){
1440: yyensure_buffer_stack (yyscanner);
1441: YY_CURRENT_BUFFER_LVALUE =
1442: yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1443: }
1444:
1445: yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1446: yy_load_buffer_state(yyscanner );
1447: }
1448:
1449: /** Switch to a different input buffer.
1450: * @param new_buffer The new input buffer.
1451: * @param yyscanner The scanner object.
1452: */
1453: void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1454: {
1455: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1456:
1457: /* TODO. We should be able to replace this entire function body
1458: * with
1459: * yypop_buffer_state();
1460: * yypush_buffer_state(new_buffer);
1461: */
1462: yyensure_buffer_stack (yyscanner);
1463: if ( YY_CURRENT_BUFFER == new_buffer )
1464: return;
1465:
1466: if ( YY_CURRENT_BUFFER )
1467: {
1468: /* Flush out information for old buffer. */
1469: *yyg->yy_c_buf_p = yyg->yy_hold_char;
1470: YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1471: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1472: }
1473:
1474: YY_CURRENT_BUFFER_LVALUE = new_buffer;
1475: yy_load_buffer_state(yyscanner );
1476:
1477: /* We don't actually know whether we did this switch during
1478: * EOF (yywrap()) processing, but the only time this flag
1479: * is looked at is after yywrap() is called, so it's safe
1480: * to go ahead and always set it.
1481: */
1482: yyg->yy_did_buffer_switch_on_eof = 1;
1483: }
1484:
1485: static void yy_load_buffer_state (yyscan_t yyscanner)
1486: {
1487: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1488: yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1489: yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1490: yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1491: yyg->yy_hold_char = *yyg->yy_c_buf_p;
1492: }
1493:
1494: /** Allocate and initialize an input buffer state.
1495: * @param file A readable stream.
1496: * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1497: * @param yyscanner The scanner object.
1498: * @return the allocated buffer state.
1499: */
1500: YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1501: {
1502: YY_BUFFER_STATE b;
1503:
1504: b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1505: if ( ! b )
1506: YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1507:
1508: b->yy_buf_size = (yy_size_t)size;
1509:
1510: /* yy_ch_buf has to be 2 characters longer than the size given because
1511: * we need to put in 2 end-of-buffer characters.
1512: */
1513: b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner );
1514: if ( ! b->yy_ch_buf )
1515: YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1516:
1517: b->yy_is_our_buffer = 1;
1518:
1519: yy_init_buffer(b,file ,yyscanner);
1520:
1521: return b;
1522: }
1523:
1524: /** Destroy the buffer.
1525: * @param b a buffer created with yy_create_buffer()
1526: * @param yyscanner The scanner object.
1527: */
1528: void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1529: {
1530: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1531:
1532: if ( ! b )
1533: return;
1534:
1535: if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1536: YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1537:
1538: if ( b->yy_is_our_buffer )
1539: yyfree((void *) b->yy_ch_buf ,yyscanner );
1540:
1541: yyfree((void *) b ,yyscanner );
1542: }
1543:
1544: /* Initializes or reinitializes a buffer.
1545: * This function is sometimes called more than once on the same buffer,
1546: * such as during a yyrestart() or at EOF.
1547: */
1548: static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1549:
1550: {
1551: int oerrno = errno;
1552: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1553:
1554: yy_flush_buffer(b ,yyscanner);
1555:
1556: b->yy_input_file = file;
1557: b->yy_fill_buffer = 1;
1558:
1559: /* If b is the current buffer, then yy_init_buffer was _probably_
1560: * called from yyrestart() or through yy_get_next_buffer.
1561: * In that case, we don't want to reset the lineno or column.
1562: */
1563: if (b != YY_CURRENT_BUFFER){
1564: b->yy_bs_lineno = 1;
1565: b->yy_bs_column = 0;
1566: }
1567:
1568: b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1569:
1570: errno = oerrno;
1571: }
1572:
1573: /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1574: * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1575: * @param yyscanner The scanner object.
1576: */
1577: void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1578: {
1579: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1580: if ( ! b )
1581: return;
1582:
1583: b->yy_n_chars = 0;
1584:
1585: /* We always need two end-of-buffer characters. The first causes
1586: * a transition to the end-of-buffer state. The second causes
1587: * a jam in that state.
1588: */
1589: b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1590: b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1591:
1592: b->yy_buf_pos = &b->yy_ch_buf[0];
1593:
1594: b->yy_at_bol = 1;
1595: b->yy_buffer_status = YY_BUFFER_NEW;
1596:
1597: if ( b == YY_CURRENT_BUFFER )
1598: yy_load_buffer_state(yyscanner );
1599: }
1600:
1601: /** Pushes the new state onto the stack. The new state becomes
1602: * the current state. This function will allocate the stack
1603: * if necessary.
1604: * @param new_buffer The new state.
1605: * @param yyscanner The scanner object.
1606: */
1607: void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1608: {
1609: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1610: if (new_buffer == NULL)
1611: return;
1612:
1613: yyensure_buffer_stack(yyscanner);
1614:
1615: /* This block is copied from yy_switch_to_buffer. */
1616: if ( YY_CURRENT_BUFFER )
1617: {
1618: /* Flush out information for old buffer. */
1619: *yyg->yy_c_buf_p = yyg->yy_hold_char;
1620: YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1621: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1622: }
1623:
1624: /* Only push if top exists. Otherwise, replace top. */
1625: if (YY_CURRENT_BUFFER)
1626: yyg->yy_buffer_stack_top++;
1627: YY_CURRENT_BUFFER_LVALUE = new_buffer;
1628:
1629: /* copied from yy_switch_to_buffer. */
1630: yy_load_buffer_state(yyscanner );
1631: yyg->yy_did_buffer_switch_on_eof = 1;
1632: }
1633:
1634: /** Removes and deletes the top of the stack, if present.
1635: * The next element becomes the new top.
1636: * @param yyscanner The scanner object.
1637: */
1638: void yypop_buffer_state (yyscan_t yyscanner)
1639: {
1640: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1641: if (!YY_CURRENT_BUFFER)
1642: return;
1643:
1644: yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1645: YY_CURRENT_BUFFER_LVALUE = NULL;
1646: if (yyg->yy_buffer_stack_top > 0)
1647: --yyg->yy_buffer_stack_top;
1648:
1649: if (YY_CURRENT_BUFFER) {
1650: yy_load_buffer_state(yyscanner );
1651: yyg->yy_did_buffer_switch_on_eof = 1;
1652: }
1653: }
1654:
1655: /* Allocates the stack if it does not exist.
1656: * Guarantees space for at least one push.
1657: */
1658: static void yyensure_buffer_stack (yyscan_t yyscanner)
1659: {
1660: yy_size_t num_to_alloc;
1661: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1662:
1663: if (!yyg->yy_buffer_stack) {
1664:
1665: /* First allocation is just for 2 elements, since we don't know if this
1666: * scanner will even need a stack. We use 2 instead of 1 to avoid an
1667: * immediate realloc on the next call.
1668: */
1669: num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1670: yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
1671: (num_to_alloc * sizeof(struct yy_buffer_state*)
1672: , yyscanner);
1673: if ( ! yyg->yy_buffer_stack )
1674: YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1675:
1676: memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1677:
1678: yyg->yy_buffer_stack_max = num_to_alloc;
1679: yyg->yy_buffer_stack_top = 0;
1680: return;
1681: }
1682:
1683: if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1684:
1685: /* Increase the buffer to prepare for a possible push. */
1686: yy_size_t grow_size = 8 /* arbitrary grow size */;
1687:
1688: num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1689: yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
1690: (yyg->yy_buffer_stack,
1691: num_to_alloc * sizeof(struct yy_buffer_state*)
1692: , yyscanner);
1693: if ( ! yyg->yy_buffer_stack )
1694: YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1695:
1696: /* zero only the new slots.*/
1697: memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1698: yyg->yy_buffer_stack_max = num_to_alloc;
1699: }
1700: }
1701:
1702: /** Setup the input buffer state to scan directly from a user-specified character buffer.
1703: * @param base the character buffer
1704: * @param size the size in bytes of the character buffer
1705: * @param yyscanner The scanner object.
1706: * @return the newly allocated buffer state object.
1707: */
1708: YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1709: {
1710: YY_BUFFER_STATE b;
1711:
1712: if ( size < 2 ||
1713: base[size-2] != YY_END_OF_BUFFER_CHAR ||
1714: base[size-1] != YY_END_OF_BUFFER_CHAR )
1715: /* They forgot to leave room for the EOB's. */
1716: return 0;
1717:
1718: b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1719: if ( ! b )
1720: YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1721:
1722: b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1723: b->yy_buf_pos = b->yy_ch_buf = base;
1724: b->yy_is_our_buffer = 0;
1725: b->yy_input_file = 0;
1726: b->yy_n_chars = b->yy_buf_size;
1727: b->yy_is_interactive = 0;
1728: b->yy_at_bol = 1;
1729: b->yy_fill_buffer = 0;
1730: b->yy_buffer_status = YY_BUFFER_NEW;
1731:
1732: yy_switch_to_buffer(b ,yyscanner );
1733:
1734: return b;
1735: }
1736:
1737: /** Setup the input buffer state to scan a string. The next call to yylex() will
1738: * scan from a @e copy of @a str.
1739: * @param yystr a NUL-terminated string to scan
1740: * @param yyscanner The scanner object.
1741: * @return the newly allocated buffer state object.
1742: * @note If you want to scan bytes that may contain NUL values, then use
1743: * yy_scan_bytes() instead.
1744: */
1745: YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1746: {
1747:
1748: return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1749: }
1750:
1751: /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1752: * scan from a @e copy of @a bytes.
1753: * @param yybytes the byte buffer to scan
1754: * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1755: * @param yyscanner The scanner object.
1756: * @return the newly allocated buffer state object.
1757: */
1758: YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
1759: {
1760: YY_BUFFER_STATE b;
1761: char *buf;
1762: yy_size_t n;
1763: yy_size_t i;
1764:
1765: /* Get memory for full buffer, including space for trailing EOB's. */
1766: n = _yybytes_len + 2;
1767: buf = (char *) yyalloc(n ,yyscanner );
1768: if ( ! buf )
1769: YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1770:
1771: for ( i = 0; i < _yybytes_len; ++i )
1772: buf[i] = yybytes[i];
1773:
1774: buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1775:
1776: b = yy_scan_buffer(buf,n ,yyscanner);
1777: if ( ! b )
1778: YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1779:
1780: /* It's okay to grow etc. this buffer, and we should throw it
1781: * away when we're done.
1782: */
1783: b->yy_is_our_buffer = 1;
1784:
1785: return b;
1786: }
1787:
1788: #ifndef YY_EXIT_FAILURE
1789: #define YY_EXIT_FAILURE 2
1790: #endif
1791:
1792: static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1793: {
1794: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1795: (void)yyg;
1796: (void) fprintf( stderr, "%s\n", msg );
1797: exit( YY_EXIT_FAILURE );
1798: }
1799:
1800: /* Redefine yyless() so it works in section 3 code. */
1801:
1802: #undef yyless
1803: #define yyless(n) \
1804: do \
1805: { \
1806: /* Undo effects of setting up yytext. */ \
1807: yy_size_t yyless_macro_arg = (n); \
1808: YY_LESS_LINENO(yyless_macro_arg);\
1809: yytext[yyleng] = yyg->yy_hold_char; \
1810: yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1811: yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1812: *yyg->yy_c_buf_p = '\0'; \
1813: yyleng = yyless_macro_arg; \
1814: } \
1815: while ( 0 )
1816:
1817: /* Accessor methods (get/set functions) to struct members. */
1818:
1819: /** Get the user-defined data for this scanner.
1820: * @param yyscanner The scanner object.
1821: */
1822: YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
1823: {
1824: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1825: return yyextra;
1826: }
1827:
1828: /** Get the current line number.
1829: * @param yyscanner The scanner object.
1830: */
1831: int yyget_lineno (yyscan_t yyscanner)
1832: {
1833: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1834:
1835: if (! YY_CURRENT_BUFFER)
1836: return 0;
1837:
1838: return yylineno;
1839: }
1840:
1841: /** Get the current column number.
1842: * @param yyscanner The scanner object.
1843: */
1844: int yyget_column (yyscan_t yyscanner)
1845: {
1846: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1847:
1848: if (! YY_CURRENT_BUFFER)
1849: return 0;
1850:
1851: return yycolumn;
1852: }
1853:
1854: /** Get the input stream.
1855: * @param yyscanner The scanner object.
1856: */
1857: FILE *yyget_in (yyscan_t yyscanner)
1858: {
1859: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1860: return yyin;
1861: }
1862:
1863: /** Get the output stream.
1864: * @param yyscanner The scanner object.
1865: */
1866: FILE *yyget_out (yyscan_t yyscanner)
1867: {
1868: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1869: return yyout;
1870: }
1871:
1872: /** Get the length of the current token.
1873: * @param yyscanner The scanner object.
1874: */
1875: yy_size_t yyget_leng (yyscan_t yyscanner)
1876: {
1877: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1878: return yyleng;
1879: }
1880:
1881: /** Get the current token.
1882: * @param yyscanner The scanner object.
1883: */
1884:
1885: char *yyget_text (yyscan_t yyscanner)
1886: {
1887: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1888: return yytext;
1889: }
1890:
1891: /** Set the user-defined data. This data is never touched by the scanner.
1892: * @param user_defined The data to be associated with this scanner.
1893: * @param yyscanner The scanner object.
1894: */
1895: void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1896: {
1897: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1898: yyextra = user_defined ;
1899: }
1900:
1901: /** Set the current line number.
1902: * @param _line_number line number
1903: * @param yyscanner The scanner object.
1904: */
1905: void yyset_lineno (int _line_number , yyscan_t yyscanner)
1906: {
1907: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1908:
1909: /* lineno is only valid if an input buffer exists. */
1910: if (! YY_CURRENT_BUFFER )
1911: YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
1912:
1913: yylineno = _line_number;
1914: }
1915:
1916: /** Set the current column.
1917: * @param _column_no column number
1918: * @param yyscanner The scanner object.
1919: */
1920: void yyset_column (int _column_no , yyscan_t yyscanner)
1921: {
1922: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1923:
1924: /* column is only valid if an input buffer exists. */
1925: if (! YY_CURRENT_BUFFER )
1926: YY_FATAL_ERROR( "yyset_column called with no buffer" );
1927:
1928: yycolumn = _column_no;
1929: }
1930:
1931: /** Set the input stream. This does not discard the current
1932: * input buffer.
1933: * @param _in_str A readable stream.
1934: * @param yyscanner The scanner object.
1935: * @see yy_switch_to_buffer
1936: */
1937: void yyset_in (FILE * _in_str , yyscan_t yyscanner)
1938: {
1939: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1940: yyin = _in_str ;
1941: }
1942:
1943: void yyset_out (FILE * _out_str , yyscan_t yyscanner)
1944: {
1945: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1946: yyout = _out_str ;
1947: }
1948:
1949: int yyget_debug (yyscan_t yyscanner)
1950: {
1951: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1952: return yy_flex_debug;
1953: }
1954:
1955: void yyset_debug (int _bdebug , yyscan_t yyscanner)
1956: {
1957: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1958: yy_flex_debug = _bdebug ;
1959: }
1960:
1961: /* Accessor methods for yylval and yylloc */
1962:
1963: /* User-visible API */
1964:
1965: /* yylex_init is special because it creates the scanner itself, so it is
1966: * the ONLY reentrant function that doesn't take the scanner as the last argument.
1967: * That's why we explicitly handle the declaration, instead of using our macros.
1968: */
1969:
1970: int yylex_init(yyscan_t* ptr_yy_globals)
1971:
1972: {
1973: if (ptr_yy_globals == NULL){
1974: errno = EINVAL;
1975: return 1;
1976: }
1977:
1978: *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
1979:
1980: if (*ptr_yy_globals == NULL){
1981: errno = ENOMEM;
1982: return 1;
1983: }
1984:
1985: /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1986: memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1987:
1988: return yy_init_globals ( *ptr_yy_globals );
1989: }
1990:
1991: /* yylex_init_extra has the same functionality as yylex_init, but follows the
1992: * convention of taking the scanner as the last argument. Note however, that
1993: * this is a *pointer* to a scanner, as it will be allocated by this call (and
1994: * is the reason, too, why this function also must handle its own declaration).
1995: * The user defined value in the first argument will be available to yyalloc in
1996: * the yyextra field.
1997: */
1998:
1999: int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2000:
2001: {
2002: struct yyguts_t dummy_yyguts;
2003:
2004: yyset_extra (yy_user_defined, &dummy_yyguts);
2005:
2006: if (ptr_yy_globals == NULL){
2007: errno = EINVAL;
2008: return 1;
2009: }
2010:
2011: *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2012:
2013: if (*ptr_yy_globals == NULL){
2014: errno = ENOMEM;
2015: return 1;
2016: }
2017:
2018: /* By setting to 0xAA, we expose bugs in
2019: yy_init_globals. Leave at 0x00 for releases. */
2020: memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2021:
2022: yyset_extra (yy_user_defined, *ptr_yy_globals);
2023:
2024: return yy_init_globals ( *ptr_yy_globals );
2025: }
2026:
2027: static int yy_init_globals (yyscan_t yyscanner)
2028: {
2029: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2030: /* Initialization is the same as for the non-reentrant scanner.
2031: * This function is called from yylex_destroy(), so don't allocate here.
2032: */
2033:
2034: yyg->yy_buffer_stack = 0;
2035: yyg->yy_buffer_stack_top = 0;
2036: yyg->yy_buffer_stack_max = 0;
2037: yyg->yy_c_buf_p = (char *) 0;
2038: yyg->yy_init = 0;
2039: yyg->yy_start = 0;
2040:
2041: yyg->yy_start_stack_ptr = 0;
2042: yyg->yy_start_stack_depth = 0;
2043: yyg->yy_start_stack = NULL;
2044:
2045: /* Defined in main.c */
2046: #ifdef YY_STDINIT
2047: yyin = stdin;
2048: yyout = stdout;
2049: #else
2050: yyin = (FILE *) 0;
2051: yyout = (FILE *) 0;
2052: #endif
2053:
2054: /* For future reference: Set errno on error, since we are called by
2055: * yylex_init()
2056: */
2057: return 0;
2058: }
2059:
2060: /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2061: int yylex_destroy (yyscan_t yyscanner)
2062: {
2063: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2064:
2065: /* Pop the buffer stack, destroying each element. */
2066: while(YY_CURRENT_BUFFER){
2067: yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2068: YY_CURRENT_BUFFER_LVALUE = NULL;
2069: yypop_buffer_state(yyscanner);
2070: }
2071:
2072: /* Destroy the stack itself. */
2073: yyfree(yyg->yy_buffer_stack ,yyscanner);
2074: yyg->yy_buffer_stack = NULL;
2075:
2076: /* Destroy the start condition stack. */
2077: yyfree(yyg->yy_start_stack ,yyscanner );
2078: yyg->yy_start_stack = NULL;
2079:
2080: /* Reset the globals. This is important in a non-reentrant scanner so the next time
2081: * yylex() is called, initialization will occur. */
2082: yy_init_globals( yyscanner);
2083:
2084: /* Destroy the main struct (reentrant only). */
2085: yyfree ( yyscanner , yyscanner );
2086: yyscanner = NULL;
2087: return 0;
2088: }
2089:
2090: /*
2091: * Internal utility routines.
2092: */
2093:
2094: #ifndef yytext_ptr
2095: static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2096: {
2097: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2098: (void)yyg;
2099:
2100: int i;
2101: for ( i = 0; i < n; ++i )
2102: s1[i] = s2[i];
2103: }
2104: #endif
2105:
2106: #ifdef YY_NEED_STRLEN
2107: static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2108: {
2109: int n;
2110: for ( n = 0; s[n]; ++n )
2111: ;
2112:
2113: return n;
2114: }
2115: #endif
2116:
2117: void *yyalloc (yy_size_t size , yyscan_t yyscanner)
2118: {
2119: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2120: (void)yyg;
2121: return (void *) malloc( size );
2122: }
2123:
2124: void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2125: {
2126: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2127: (void)yyg;
2128:
2129: /* The cast to (char *) in the following accommodates both
2130: * implementations that use char* generic pointers, and those
2131: * that use void* generic pointers. It works with the latter
2132: * because both ANSI C and C++ allow castless assignment from
2133: * any pointer type to void*, and deal with argument conversions
2134: * as though doing an assignment.
2135: */
2136: return (void *) realloc( (char *) ptr, size );
2137: }
2138:
2139: void yyfree (void * ptr , yyscan_t yyscanner)
2140: {
2141: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2142: (void)yyg;
2143: free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2144: }
2145:
2146: #define YYTABLES_NAME "yytables"
2147:
2148: #line 171 "lex.l"
2149:
2150:
2151:
Generated by git2html.