00001 #line 2 "ao-lexer.cpp"
00002
00003 #line 4 "ao-lexer.cpp"
00004
00005 #define YY_INT_ALIGNED short int
00006
00007
00008
00009 #define yy_create_buffer ao_create_buffer
00010 #define yy_delete_buffer ao_delete_buffer
00011 #define yy_flex_debug ao_flex_debug
00012 #define yy_init_buffer ao_init_buffer
00013 #define yy_flush_buffer ao_flush_buffer
00014 #define yy_load_buffer_state ao_load_buffer_state
00015 #define yy_switch_to_buffer ao_switch_to_buffer
00016 #define yyin aoin
00017 #define yyleng aoleng
00018 #define yylex aolex
00019 #define yylineno aolineno
00020 #define yyout aoout
00021 #define yyrestart aorestart
00022 #define yytext aotext
00023 #define yywrap aowrap
00024 #define yyalloc aoalloc
00025 #define yyrealloc aorealloc
00026 #define yyfree aofree
00027
00028 #define FLEX_SCANNER
00029 #define YY_FLEX_MAJOR_VERSION 2
00030 #define YY_FLEX_MINOR_VERSION 5
00031 #define YY_FLEX_SUBMINOR_VERSION 35
00032 #if YY_FLEX_SUBMINOR_VERSION > 0
00033 #define FLEX_BETA
00034 #endif
00035
00036
00037
00038
00039 #include <stdio.h>
00040 #include <string.h>
00041 #include <errno.h>
00042 #include <stdlib.h>
00043
00044
00045
00046
00047
00048 #ifndef FLEXINT_H
00049 #define FLEXINT_H
00050
00051
00052
00053 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
00054
00055
00056
00057
00058 #ifndef __STDC_LIMIT_MACROS
00059 #define __STDC_LIMIT_MACROS 1
00060 #endif
00061
00062 #include <inttypes.h>
00063 typedef int8_t flex_int8_t;
00064 typedef uint8_t flex_uint8_t;
00065 typedef int16_t flex_int16_t;
00066 typedef uint16_t flex_uint16_t;
00067 typedef int32_t flex_int32_t;
00068 typedef uint32_t flex_uint32_t;
00069 #else
00070 typedef signed char flex_int8_t;
00071 typedef short int flex_int16_t;
00072 typedef int flex_int32_t;
00073 typedef unsigned char flex_uint8_t;
00074 typedef unsigned short int flex_uint16_t;
00075 typedef unsigned int flex_uint32_t;
00076
00077
00078 #ifndef INT8_MIN
00079 #define INT8_MIN (-128)
00080 #endif
00081 #ifndef INT16_MIN
00082 #define INT16_MIN (-32767-1)
00083 #endif
00084 #ifndef INT32_MIN
00085 #define INT32_MIN (-2147483647-1)
00086 #endif
00087 #ifndef INT8_MAX
00088 #define INT8_MAX (127)
00089 #endif
00090 #ifndef INT16_MAX
00091 #define INT16_MAX (32767)
00092 #endif
00093 #ifndef INT32_MAX
00094 #define INT32_MAX (2147483647)
00095 #endif
00096 #ifndef UINT8_MAX
00097 #define UINT8_MAX (255U)
00098 #endif
00099 #ifndef UINT16_MAX
00100 #define UINT16_MAX (65535U)
00101 #endif
00102 #ifndef UINT32_MAX
00103 #define UINT32_MAX (4294967295U)
00104 #endif
00105
00106 #endif
00107
00108 #endif
00109
00110 #ifdef __cplusplus
00111
00112
00113 #define YY_USE_CONST
00114
00115 #else
00116
00117
00118 #if defined (__STDC__)
00119
00120 #define YY_USE_CONST
00121
00122 #endif
00123 #endif
00124
00125 #ifdef YY_USE_CONST
00126 #define yyconst const
00127 #else
00128 #define yyconst
00129 #endif
00130
00131
00132 #define YY_NULL 0
00133
00134
00135
00136
00137
00138
00139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00140
00141
00142
00143
00144
00145 #define BEGIN (yy_start) = 1 + 2 *
00146
00147
00148
00149
00150
00151 #define YY_START (((yy_start) - 1) / 2)
00152 #define YYSTATE YY_START
00153
00154
00155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00156
00157
00158 #define YY_NEW_FILE aorestart(aoin )
00159
00160 #define YY_END_OF_BUFFER_CHAR 0
00161
00162
00163 #ifndef YY_BUF_SIZE
00164 #ifdef __ia64__
00165
00166
00167
00168
00169 #define YY_BUF_SIZE 32768
00170 #else
00171 #define YY_BUF_SIZE 16384
00172 #endif
00173 #endif
00174
00175
00176
00177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00178
00179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00180 #define YY_TYPEDEF_YY_BUFFER_STATE
00181 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00182 #endif
00183
00184 extern int aoleng;
00185
00186 extern FILE *aoin, *aoout;
00187
00188 #define EOB_ACT_CONTINUE_SCAN 0
00189 #define EOB_ACT_END_OF_FILE 1
00190 #define EOB_ACT_LAST_MATCH 2
00191
00192
00193
00194
00195
00196
00197
00198
00199 #define YY_LESS_LINENO(n) \
00200 do { \
00201 int yyl;\
00202 for ( yyl = n; yyl < aoleng; ++yyl )\
00203 if ( aotext[yyl] == '\n' )\
00204 --aolineno;\
00205 }while(0)
00206
00207
00208 #define yyless(n) \
00209 do \
00210 { \
00211 \
00212 int yyless_macro_arg = (n); \
00213 YY_LESS_LINENO(yyless_macro_arg);\
00214 *yy_cp = (yy_hold_char); \
00215 YY_RESTORE_YY_MORE_OFFSET \
00216 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00217 YY_DO_BEFORE_ACTION; \
00218 } \
00219 while ( 0 )
00220
00221 #define unput(c) yyunput( c, (yytext_ptr) )
00222
00223 #ifndef YY_TYPEDEF_YY_SIZE_T
00224 #define YY_TYPEDEF_YY_SIZE_T
00225 typedef size_t yy_size_t;
00226 #endif
00227
00228 #ifndef YY_STRUCT_YY_BUFFER_STATE
00229 #define YY_STRUCT_YY_BUFFER_STATE
00230 struct yy_buffer_state
00231 {
00232 FILE *yy_input_file;
00233
00234 char *yy_ch_buf;
00235 char *yy_buf_pos;
00236
00237
00238
00239
00240 yy_size_t yy_buf_size;
00241
00242
00243
00244
00245 int yy_n_chars;
00246
00247
00248
00249
00250
00251 int yy_is_our_buffer;
00252
00253
00254
00255
00256
00257
00258 int yy_is_interactive;
00259
00260
00261
00262
00263
00264 int yy_at_bol;
00265
00266 int yy_bs_lineno;
00267 int yy_bs_column;
00269
00270
00271
00272 int yy_fill_buffer;
00273
00274 int yy_buffer_status;
00275
00276 #define YY_BUFFER_NEW 0
00277 #define YY_BUFFER_NORMAL 1
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288 #define YY_BUFFER_EOF_PENDING 2
00289
00290 };
00291 #endif
00292
00293
00294 static size_t yy_buffer_stack_top = 0;
00295 static size_t yy_buffer_stack_max = 0;
00296 static YY_BUFFER_STATE * yy_buffer_stack = 0;
00298
00299
00300
00301
00302
00303
00304 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
00305 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
00306 : NULL)
00307
00308
00309
00310
00311 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
00312
00313
00314 static char yy_hold_char;
00315 static int yy_n_chars;
00316 int aoleng;
00317
00318
00319 static char *yy_c_buf_p = (char *) 0;
00320 static int yy_init = 0;
00321 static int yy_start = 0;
00322
00323
00324
00325
00326 static int yy_did_buffer_switch_on_eof;
00327
00328 void aorestart (FILE *input_file );
00329 void ao_switch_to_buffer (YY_BUFFER_STATE new_buffer );
00330 YY_BUFFER_STATE ao_create_buffer (FILE *file,int size );
00331 void ao_delete_buffer (YY_BUFFER_STATE b );
00332 void ao_flush_buffer (YY_BUFFER_STATE b );
00333 void aopush_buffer_state (YY_BUFFER_STATE new_buffer );
00334 void aopop_buffer_state (void );
00335
00336 static void aoensure_buffer_stack (void );
00337 static void ao_load_buffer_state (void );
00338 static void ao_init_buffer (YY_BUFFER_STATE b,FILE *file );
00339
00340 #define YY_FLUSH_BUFFER ao_flush_buffer(YY_CURRENT_BUFFER )
00341
00342 YY_BUFFER_STATE ao_scan_buffer (char *base,yy_size_t size );
00343 YY_BUFFER_STATE ao_scan_string (yyconst char *yy_str );
00344 YY_BUFFER_STATE ao_scan_bytes (yyconst char *bytes,int len );
00345
00346 void *aoalloc (yy_size_t );
00347 void *aorealloc (void *,yy_size_t );
00348 void aofree (void * );
00349
00350 #define yy_new_buffer ao_create_buffer
00351
00352 #define yy_set_interactive(is_interactive) \
00353 { \
00354 if ( ! YY_CURRENT_BUFFER ){ \
00355 aoensure_buffer_stack (); \
00356 YY_CURRENT_BUFFER_LVALUE = \
00357 ao_create_buffer(aoin,YY_BUF_SIZE ); \
00358 } \
00359 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00360 }
00361
00362 #define yy_set_bol(at_bol) \
00363 { \
00364 if ( ! YY_CURRENT_BUFFER ){\
00365 aoensure_buffer_stack (); \
00366 YY_CURRENT_BUFFER_LVALUE = \
00367 ao_create_buffer(aoin,YY_BUF_SIZE ); \
00368 } \
00369 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00370 }
00371
00372 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00373
00374
00375
00376 typedef unsigned char YY_CHAR;
00377
00378 FILE *aoin = (FILE *) 0, *aoout = (FILE *) 0;
00379
00380 typedef int yy_state_type;
00381
00382 extern int aolineno;
00383
00384 int aolineno = 1;
00385
00386 extern char *aotext;
00387 #define yytext_ptr aotext
00388
00389 static yy_state_type yy_get_previous_state (void );
00390 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
00391 static int yy_get_next_buffer (void );
00392 static void yy_fatal_error (yyconst char msg[] );
00393
00394
00395
00396
00397 #define YY_DO_BEFORE_ACTION \
00398 (yytext_ptr) = yy_bp; \
00399 aoleng = (size_t) (yy_cp - yy_bp); \
00400 (yy_hold_char) = *yy_cp; \
00401 *yy_cp = '\0'; \
00402 (yy_c_buf_p) = yy_cp;
00403
00404 #define YY_NUM_RULES 23
00405 #define YY_END_OF_BUFFER 24
00406
00407
00408 struct yy_trans_info
00409 {
00410 flex_int32_t yy_verify;
00411 flex_int32_t yy_nxt;
00412 };
00413 static yyconst flex_int16_t yy_accept[62] =
00414 { 0,
00415 0, 0, 24, 23, 2, 2, 16, 17, 18, 19,
00416 23, 5, 14, 20, 21, 6, 22, 14, 7, 14,
00417 14, 14, 14, 14, 3, 4, 15, 16, 14, 14,
00418 14, 14, 14, 14, 14, 0, 1, 14, 14, 14,
00419 14, 14, 14, 14, 14, 14, 14, 11, 13, 14,
00420 14, 8, 14, 14, 9, 14, 14, 10, 14, 12,
00421 0
00422 } ;
00423
00424 static yyconst flex_int32_t yy_ec[256] =
00425 { 0,
00426 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
00427 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
00428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00429 1, 4, 1, 1, 5, 1, 1, 1, 1, 6,
00430 7, 8, 9, 10, 9, 11, 12, 13, 13, 13,
00431 13, 13, 13, 13, 13, 13, 13, 1, 14, 15,
00432 16, 17, 1, 1, 18, 18, 18, 18, 18, 18,
00433 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
00434 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
00435 1, 1, 1, 1, 18, 19, 20, 18, 21, 18,
00436
00437 22, 18, 23, 18, 24, 18, 18, 25, 26, 18,
00438 27, 18, 18, 18, 28, 29, 30, 31, 18, 18,
00439 18, 18, 32, 1, 33, 1, 1, 1, 1, 1,
00440 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00447
00448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00453 1, 1, 1, 1, 1
00454 } ;
00455
00456 static yyconst flex_int32_t yy_meta[34] =
00457 { 0,
00458 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
00459 3, 3, 3, 1, 1, 1, 1, 3, 1, 3,
00460 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00461 3, 1, 1
00462 } ;
00463
00464 static yyconst flex_int16_t yy_base[64] =
00465 { 0,
00466 0, 0, 117, 118, 118, 103, 0, 118, 118, 118,
00467 102, 118, 102, 118, 118, 118, 118, 0, 118, 92,
00468 87, 89, 82, 82, 118, 118, 95, 0, 0, 33,
00469 78, 86, 39, 83, 79, 58, 118, 0, 79, 74,
00470 73, 80, 71, 78, 66, 68, 75, 0, 0, 65,
00471 71, 0, 68, 53, 0, 53, 49, 0, 51, 0,
00472 118, 89, 69
00473 } ;
00474
00475 static yyconst flex_int16_t yy_def[64] =
00476 { 0,
00477 61, 1, 61, 61, 61, 61, 62, 61, 61, 61,
00478 61, 61, 63, 61, 61, 61, 61, 63, 61, 63,
00479 63, 63, 63, 63, 61, 61, 61, 62, 63, 61,
00480 63, 63, 63, 63, 63, 30, 61, 30, 63, 63,
00481 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
00482 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
00483 0, 61, 61
00484 } ;
00485
00486 static yyconst flex_int16_t yy_nxt[152] =
00487 { 0,
00488 4, 5, 5, 6, 7, 8, 9, 10, 11, 12,
00489 4, 13, 4, 14, 15, 16, 17, 18, 19, 20,
00490 21, 18, 18, 18, 18, 22, 18, 18, 18, 23,
00491 24, 25, 26, 36, 36, 37, 36, 36, 36, 36,
00492 36, 36, 36, 38, 38, 38, 36, 36, 36, 36,
00493 38, 36, 38, 38, 38, 38, 38, 38, 38, 38,
00494 38, 38, 38, 38, 36, 36, 41, 42, 36, 36,
00495 36, 29, 60, 59, 58, 36, 57, 36, 36, 36,
00496 36, 36, 36, 36, 36, 36, 36, 36, 36, 28,
00497 56, 28, 55, 54, 53, 52, 51, 50, 49, 48,
00498
00499 47, 46, 45, 44, 43, 40, 39, 27, 35, 34,
00500 33, 32, 31, 30, 27, 27, 61, 3, 61, 61,
00501 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
00502 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
00503 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
00504 61
00505 } ;
00506
00507 static yyconst flex_int16_t yy_chk[152] =
00508 { 0,
00509 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00510 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00511 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00512 1, 1, 1, 30, 30, 30, 30, 30, 30, 30,
00513 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
00514 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
00515 30, 30, 30, 30, 30, 30, 33, 33, 36, 36,
00516 36, 63, 59, 57, 56, 36, 54, 36, 36, 36,
00517 36, 36, 36, 36, 36, 36, 36, 36, 36, 62,
00518 53, 62, 51, 50, 47, 46, 45, 44, 43, 42,
00519
00520 41, 40, 39, 35, 34, 32, 31, 27, 24, 23,
00521 22, 21, 20, 13, 11, 6, 3, 61, 61, 61,
00522 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
00523 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
00524 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
00525 61
00526 } ;
00527
00528
00529 static yyconst flex_int32_t yy_rule_can_match_eol[24] =
00530 { 0,
00531 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00532 0, 0, 0, 0, };
00533
00534 static yy_state_type yy_last_accepting_state;
00535 static char *yy_last_accepting_cpos;
00536
00537 extern int ao_flex_debug;
00538 int ao_flex_debug = 0;
00539
00540
00541
00542
00543 #define REJECT reject_used_but_not_detected
00544 #define yymore() yymore_used_but_not_detected
00545 #define YY_MORE_ADJ 0
00546 #define YY_RESTORE_YY_MORE_OFFSET
00547 char *aotext;
00548 #line 1 "ao-lexer.l"
00549 #line 2 "ao-lexer.l"
00550 #include <stdlib.h>
00551 #include <ctype.h>
00552 #include <assert.h>
00553 #define YYSTYPE char*
00554 #include "ao-syntax.h"
00555 static int read_string(char open, char close);
00556 #line 557 "ao-lexer.cpp"
00557
00558 #define INITIAL 0
00559
00560 #ifndef YY_NO_UNISTD_H
00561
00562
00563
00564
00565 #include <unistd.h>
00566 #endif
00567
00568 #ifndef YY_EXTRA_TYPE
00569 #define YY_EXTRA_TYPE void *
00570 #endif
00571
00572 static int yy_init_globals (void );
00573
00574
00575
00576
00577 int aolex_destroy (void );
00578
00579 int aoget_debug (void );
00580
00581 void aoset_debug (int debug_flag );
00582
00583 YY_EXTRA_TYPE aoget_extra (void );
00584
00585 void aoset_extra (YY_EXTRA_TYPE user_defined );
00586
00587 FILE *aoget_in (void );
00588
00589 void aoset_in (FILE * in_str );
00590
00591 FILE *aoget_out (void );
00592
00593 void aoset_out (FILE * out_str );
00594
00595 int aoget_leng (void );
00596
00597 char *aoget_text (void );
00598
00599 int aoget_lineno (void );
00600
00601 void aoset_lineno (int line_number );
00602
00603
00604
00605
00606
00607 #ifndef YY_SKIP_YYWRAP
00608 #ifdef __cplusplus
00609 extern "C" int aowrap (void );
00610 #else
00611 extern int aowrap (void );
00612 #endif
00613 #endif
00614
00615 static void yyunput (int c,char *buf_ptr );
00616
00617 #ifndef yytext_ptr
00618 static void yy_flex_strncpy (char *,yyconst char *,int );
00619 #endif
00620
00621 #ifdef YY_NEED_STRLEN
00622 static int yy_flex_strlen (yyconst char * );
00623 #endif
00624
00625 #ifndef YY_NO_INPUT
00626
00627 #ifdef __cplusplus
00628 static int yyinput (void );
00629 #else
00630 static int input (void );
00631 #endif
00632
00633 #endif
00634
00635
00636 #ifndef YY_READ_BUF_SIZE
00637 #ifdef __ia64__
00638
00639 #define YY_READ_BUF_SIZE 16384
00640 #else
00641 #define YY_READ_BUF_SIZE 8192
00642 #endif
00643 #endif
00644
00645
00646 #ifndef ECHO
00647
00648
00649
00650 #define ECHO do { if (fwrite( aotext, aoleng, 1, aoout )) {} } while (0)
00651 #endif
00652
00653
00654
00655
00656 #ifndef YY_INPUT
00657 #define YY_INPUT(buf,result,max_size) \
00658 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00659 { \
00660 int c = '*'; \
00661 size_t n; \
00662 for ( n = 0; n < max_size && \
00663 (c = getc( aoin )) != EOF && c != '\n'; ++n ) \
00664 buf[n] = (char) c; \
00665 if ( c == '\n' ) \
00666 buf[n++] = (char) c; \
00667 if ( c == EOF && ferror( aoin ) ) \
00668 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00669 result = n; \
00670 } \
00671 else \
00672 { \
00673 errno=0; \
00674 while ( (result = fread(buf, 1, max_size, aoin))==0 && ferror(aoin)) \
00675 { \
00676 if( errno != EINTR) \
00677 { \
00678 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00679 break; \
00680 } \
00681 errno=0; \
00682 clearerr(aoin); \
00683 } \
00684 }\
00685 \
00686
00687 #endif
00688
00689
00690
00691
00692
00693 #ifndef yyterminate
00694 #define yyterminate() return YY_NULL
00695 #endif
00696
00697
00698 #ifndef YY_START_STACK_INCR
00699 #define YY_START_STACK_INCR 25
00700 #endif
00701
00702
00703 #ifndef YY_FATAL_ERROR
00704 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00705 #endif
00706
00707
00708
00709
00710
00711
00712 #ifndef YY_DECL
00713 #define YY_DECL_IS_OURS 1
00714
00715 extern int aolex (void);
00716
00717 #define YY_DECL int aolex (void)
00718 #endif
00719
00720
00721
00722
00723 #ifndef YY_USER_ACTION
00724 #define YY_USER_ACTION
00725 #endif
00726
00727
00728 #ifndef YY_BREAK
00729 #define YY_BREAK break;
00730 #endif
00731
00732 #define YY_RULE_SETUP \
00733 YY_USER_ACTION
00734
00737 YY_DECL
00738 {
00739 register yy_state_type yy_current_state;
00740 register char *yy_cp, *yy_bp;
00741 register int yy_act;
00742
00743 #line 12 "ao-lexer.l"
00744
00745
00746 #line 747 "ao-lexer.cpp"
00747
00748 if ( !(yy_init) )
00749 {
00750 (yy_init) = 1;
00751
00752 #ifdef YY_USER_INIT
00753 YY_USER_INIT;
00754 #endif
00755
00756 if ( ! (yy_start) )
00757 (yy_start) = 1;
00758
00759 if ( ! aoin )
00760 aoin = stdin;
00761
00762 if ( ! aoout )
00763 aoout = stdout;
00764
00765 if ( ! YY_CURRENT_BUFFER ) {
00766 aoensure_buffer_stack ();
00767 YY_CURRENT_BUFFER_LVALUE =
00768 ao_create_buffer(aoin,YY_BUF_SIZE );
00769 }
00770
00771 ao_load_buffer_state( );
00772 }
00773
00774 while ( 1 )
00775 {
00776 yy_cp = (yy_c_buf_p);
00777
00778
00779 *yy_cp = (yy_hold_char);
00780
00781
00782
00783
00784 yy_bp = yy_cp;
00785
00786 yy_current_state = (yy_start);
00787 yy_match:
00788 do
00789 {
00790 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00791 if ( yy_accept[yy_current_state] )
00792 {
00793 (yy_last_accepting_state) = yy_current_state;
00794 (yy_last_accepting_cpos) = yy_cp;
00795 }
00796 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00797 {
00798 yy_current_state = (int) yy_def[yy_current_state];
00799 if ( yy_current_state >= 62 )
00800 yy_c = yy_meta[(unsigned int) yy_c];
00801 }
00802 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00803 ++yy_cp;
00804 }
00805 while ( yy_base[yy_current_state] != 118 );
00806
00807 yy_find_action:
00808 yy_act = yy_accept[yy_current_state];
00809 if ( yy_act == 0 )
00810 {
00811 yy_cp = (yy_last_accepting_cpos);
00812 yy_current_state = (yy_last_accepting_state);
00813 yy_act = yy_accept[yy_current_state];
00814 }
00815
00816 YY_DO_BEFORE_ACTION;
00817
00818 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
00819 {
00820 int yyl;
00821 for ( yyl = 0; yyl < aoleng; ++yyl )
00822 if ( aotext[yyl] == '\n' )
00823
00824 aolineno++;
00825 ;
00826 }
00827
00828 do_action:
00829
00830 switch ( yy_act )
00831 {
00832 case 0:
00833
00834 *yy_cp = (yy_hold_char);
00835 yy_cp = (yy_last_accepting_cpos);
00836 yy_current_state = (yy_last_accepting_state);
00837 goto yy_find_action;
00838
00839 case 1:
00840
00841 YY_RULE_SETUP
00842 #line 14 "ao-lexer.l"
00843 {}
00844 YY_BREAK
00845 case 2:
00846
00847 YY_RULE_SETUP
00848 #line 15 "ao-lexer.l"
00849 {}
00850 YY_BREAK
00851 case 3:
00852 YY_RULE_SETUP
00853 #line 16 "ao-lexer.l"
00854 return LBRACE;
00855 YY_BREAK
00856 case 4:
00857 YY_RULE_SETUP
00858 #line 17 "ao-lexer.l"
00859 return RBRACE;
00860 YY_BREAK
00861 case 5:
00862 YY_RULE_SETUP
00863 #line 18 "ao-lexer.l"
00864 return COMMA;
00865 YY_BREAK
00866 case 6:
00867 YY_RULE_SETUP
00868 #line 19 "ao-lexer.l"
00869 return INIT;
00870 YY_BREAK
00871 case 7:
00872 YY_RULE_SETUP
00873 #line 20 "ao-lexer.l"
00874 return read_string('`','ī');
00875 YY_BREAK
00876 case 8:
00877 YY_RULE_SETUP
00878 #line 21 "ao-lexer.l"
00879 return CLASS;
00880 YY_BREAK
00881 case 9:
00882 YY_RULE_SETUP
00883 #line 22 "ao-lexer.l"
00884 return ACTIVE;
00885 YY_BREAK
00886 case 10:
00887 YY_RULE_SETUP
00888 #line 23 "ao-lexer.l"
00889 return MESSAGE;
00890 YY_BREAK
00891 case 11:
00892 YY_RULE_SETUP
00893 #line 24 "ao-lexer.l"
00894 return META;
00895 YY_BREAK
00896 case 12:
00897 YY_RULE_SETUP
00898 #line 25 "ao-lexer.l"
00899 return VOLATILE;
00900 YY_BREAK
00901 case 13:
00902 YY_RULE_SETUP
00903 #line 26 "ao-lexer.l"
00904 return USES;
00905 YY_BREAK
00906 case 14:
00907 YY_RULE_SETUP
00908 #line 27 "ao-lexer.l"
00909 {
00910 aolval = strdup(aotext);
00911 return NAME;
00912 }
00913 YY_BREAK
00914 case 15:
00915 YY_RULE_SETUP
00916 #line 31 "ao-lexer.l"
00917 {
00918 aolval = strdup(aotext);
00919 return NUMBER;
00920 }
00921 YY_BREAK
00922 case 16:
00923 YY_RULE_SETUP
00924 #line 35 "ao-lexer.l"
00925 {
00926 aolval = strdup(aotext);
00927 return PRECOMPILER;
00928 }
00929 YY_BREAK
00930 case 17:
00931 YY_RULE_SETUP
00932 #line 39 "ao-lexer.l"
00933 return LPAREN;
00934 YY_BREAK
00935 case 18:
00936 YY_RULE_SETUP
00937 #line 40 "ao-lexer.l"
00938 return RPAREN;
00939 YY_BREAK
00940 case 19:
00941 YY_RULE_SETUP
00942 #line 41 "ao-lexer.l"
00943 return STAR;
00944 YY_BREAK
00945 case 20:
00946 YY_RULE_SETUP
00947 #line 42 "ao-lexer.l"
00948 return SEMICOLON;
00949 YY_BREAK
00950 case 21:
00951 YY_RULE_SETUP
00952 #line 43 "ao-lexer.l"
00953 return TEMPLATE_OPEN;
00954 YY_BREAK
00955 case 22:
00956 YY_RULE_SETUP
00957 #line 44 "ao-lexer.l"
00958 return TEMPLATE_CLOSE;
00959 YY_BREAK
00960 case 23:
00961 YY_RULE_SETUP
00962 #line 45 "ao-lexer.l"
00963 ECHO;
00964 YY_BREAK
00965 #line 966 "ao-lexer.cpp"
00966 case YY_STATE_EOF(INITIAL):
00967 yyterminate();
00968
00969 case YY_END_OF_BUFFER:
00970 {
00971
00972 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
00973
00974
00975 *yy_cp = (yy_hold_char);
00976 YY_RESTORE_YY_MORE_OFFSET
00977
00978 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
00979 {
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
00990 YY_CURRENT_BUFFER_LVALUE->yy_input_file = aoin;
00991 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
00992 }
00993
00994
00995
00996
00997
00998
00999
01000
01001 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01002 {
01003 yy_state_type yy_next_state;
01004
01005 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
01006
01007 yy_current_state = yy_get_previous_state( );
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018 yy_next_state = yy_try_NUL_trans( yy_current_state );
01019
01020 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01021
01022 if ( yy_next_state )
01023 {
01024
01025 yy_cp = ++(yy_c_buf_p);
01026 yy_current_state = yy_next_state;
01027 goto yy_match;
01028 }
01029
01030 else
01031 {
01032 yy_cp = (yy_c_buf_p);
01033 goto yy_find_action;
01034 }
01035 }
01036
01037 else switch ( yy_get_next_buffer( ) )
01038 {
01039 case EOB_ACT_END_OF_FILE:
01040 {
01041 (yy_did_buffer_switch_on_eof) = 0;
01042
01043 if ( aowrap( ) )
01044 {
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
01055
01056 yy_act = YY_STATE_EOF(YY_START);
01057 goto do_action;
01058 }
01059
01060 else
01061 {
01062 if ( ! (yy_did_buffer_switch_on_eof) )
01063 YY_NEW_FILE;
01064 }
01065 break;
01066 }
01067
01068 case EOB_ACT_CONTINUE_SCAN:
01069 (yy_c_buf_p) =
01070 (yytext_ptr) + yy_amount_of_matched_text;
01071
01072 yy_current_state = yy_get_previous_state( );
01073
01074 yy_cp = (yy_c_buf_p);
01075 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01076 goto yy_match;
01077
01078 case EOB_ACT_LAST_MATCH:
01079 (yy_c_buf_p) =
01080 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
01081
01082 yy_current_state = yy_get_previous_state( );
01083
01084 yy_cp = (yy_c_buf_p);
01085 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01086 goto yy_find_action;
01087 }
01088 break;
01089 }
01090
01091 default:
01092 YY_FATAL_ERROR(
01093 "fatal flex scanner internal error--no action found" );
01094 }
01095 }
01096 }
01097
01098
01099
01100
01101
01102
01103
01104
01105 static int yy_get_next_buffer (void)
01106 {
01107 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
01108 register char *source = (yytext_ptr);
01109 register int number_to_move, i;
01110 int ret_val;
01111
01112 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
01113 YY_FATAL_ERROR(
01114 "fatal flex scanner internal error--end of buffer missed" );
01115
01116 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
01117 {
01118 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
01119 {
01120
01121
01122
01123 return EOB_ACT_END_OF_FILE;
01124 }
01125
01126 else
01127 {
01128
01129
01130
01131 return EOB_ACT_LAST_MATCH;
01132 }
01133 }
01134
01135
01136
01137
01138 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
01139
01140 for ( i = 0; i < number_to_move; ++i )
01141 *(dest++) = *(source++);
01142
01143 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01144
01145
01146
01147 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
01148
01149 else
01150 {
01151 int num_to_read =
01152 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01153
01154 while ( num_to_read <= 0 )
01155 {
01156
01157
01158 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01159
01160 int yy_c_buf_p_offset =
01161 (int) ((yy_c_buf_p) - b->yy_ch_buf);
01162
01163 if ( b->yy_is_our_buffer )
01164 {
01165 int new_size = b->yy_buf_size * 2;
01166
01167 if ( new_size <= 0 )
01168 b->yy_buf_size += b->yy_buf_size / 8;
01169 else
01170 b->yy_buf_size *= 2;
01171
01172 b->yy_ch_buf = (char *)
01173
01174 aorealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
01175 }
01176 else
01177
01178 b->yy_ch_buf = 0;
01179
01180 if ( ! b->yy_ch_buf )
01181 YY_FATAL_ERROR(
01182 "fatal error - scanner input buffer overflow" );
01183
01184 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
01185
01186 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01187 number_to_move - 1;
01188
01189 }
01190
01191 if ( num_to_read > YY_READ_BUF_SIZE )
01192 num_to_read = YY_READ_BUF_SIZE;
01193
01194
01195 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01196 (yy_n_chars), (size_t) num_to_read );
01197
01198 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01199 }
01200
01201 if ( (yy_n_chars) == 0 )
01202 {
01203 if ( number_to_move == YY_MORE_ADJ )
01204 {
01205 ret_val = EOB_ACT_END_OF_FILE;
01206 aorestart(aoin );
01207 }
01208
01209 else
01210 {
01211 ret_val = EOB_ACT_LAST_MATCH;
01212 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01213 YY_BUFFER_EOF_PENDING;
01214 }
01215 }
01216
01217 else
01218 ret_val = EOB_ACT_CONTINUE_SCAN;
01219
01220 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
01221
01222 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
01223 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) aorealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
01224 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01225 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
01226 }
01227
01228 (yy_n_chars) += number_to_move;
01229 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
01230 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
01231
01232 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01233
01234 return ret_val;
01235 }
01236
01237
01238
01239 static yy_state_type yy_get_previous_state (void)
01240 {
01241 register yy_state_type yy_current_state;
01242 register char *yy_cp;
01243
01244 yy_current_state = (yy_start);
01245
01246 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
01247 {
01248 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01249 if ( yy_accept[yy_current_state] )
01250 {
01251 (yy_last_accepting_state) = yy_current_state;
01252 (yy_last_accepting_cpos) = yy_cp;
01253 }
01254 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01255 {
01256 yy_current_state = (int) yy_def[yy_current_state];
01257 if ( yy_current_state >= 62 )
01258 yy_c = yy_meta[(unsigned int) yy_c];
01259 }
01260 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01261 }
01262
01263 return yy_current_state;
01264 }
01265
01266
01267
01268
01269
01270
01271 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
01272 {
01273 register int yy_is_jam;
01274 register char *yy_cp = (yy_c_buf_p);
01275
01276 register YY_CHAR yy_c = 1;
01277 if ( yy_accept[yy_current_state] )
01278 {
01279 (yy_last_accepting_state) = yy_current_state;
01280 (yy_last_accepting_cpos) = yy_cp;
01281 }
01282 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01283 {
01284 yy_current_state = (int) yy_def[yy_current_state];
01285 if ( yy_current_state >= 62 )
01286 yy_c = yy_meta[(unsigned int) yy_c];
01287 }
01288 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01289 yy_is_jam = (yy_current_state == 61);
01290
01291 return yy_is_jam ? 0 : yy_current_state;
01292 }
01293
01294 static void yyunput (int c, register char * yy_bp )
01295 {
01296 register char *yy_cp;
01297
01298 yy_cp = (yy_c_buf_p);
01299
01300
01301 *yy_cp = (yy_hold_char);
01302
01303 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01304 {
01305
01306 register int number_to_move = (yy_n_chars) + 2;
01307 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
01308 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
01309 register char *source =
01310 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
01311
01312 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01313 *--dest = *--source;
01314
01315 yy_cp += (int) (dest - source);
01316 yy_bp += (int) (dest - source);
01317 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
01318 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
01319
01320 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01321 YY_FATAL_ERROR( "flex scanner push-back overflow" );
01322 }
01323
01324 *--yy_cp = (char) c;
01325
01326 if ( c == '\n' ){
01327 --aolineno;
01328 }
01329
01330 (yytext_ptr) = yy_bp;
01331 (yy_hold_char) = *yy_cp;
01332 (yy_c_buf_p) = yy_cp;
01333 }
01334
01335 #ifndef YY_NO_INPUT
01336 #ifdef __cplusplus
01337 static int yyinput (void)
01338 #else
01339 static int input (void)
01340 #endif
01341
01342 {
01343 int c;
01344
01345 *(yy_c_buf_p) = (yy_hold_char);
01346
01347 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
01348 {
01349
01350
01351
01352
01353 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01354
01355 *(yy_c_buf_p) = '\0';
01356
01357 else
01358 {
01359 int offset = (yy_c_buf_p) - (yytext_ptr);
01360 ++(yy_c_buf_p);
01361
01362 switch ( yy_get_next_buffer( ) )
01363 {
01364 case EOB_ACT_LAST_MATCH:
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376 aorestart(aoin );
01377
01378
01379
01380 case EOB_ACT_END_OF_FILE:
01381 {
01382 if ( aowrap( ) )
01383 return EOF;
01384
01385 if ( ! (yy_did_buffer_switch_on_eof) )
01386 YY_NEW_FILE;
01387 #ifdef __cplusplus
01388 return yyinput();
01389 #else
01390 return input();
01391 #endif
01392 }
01393
01394 case EOB_ACT_CONTINUE_SCAN:
01395 (yy_c_buf_p) = (yytext_ptr) + offset;
01396 break;
01397 }
01398 }
01399 }
01400
01401 c = *(unsigned char *) (yy_c_buf_p);
01402 *(yy_c_buf_p) = '\0';
01403 (yy_hold_char) = *++(yy_c_buf_p);
01404
01405 if ( c == '\n' )
01406
01407 aolineno++;
01408 ;
01409
01410 return c;
01411 }
01412 #endif
01413
01419 void aorestart (FILE * input_file )
01420 {
01421
01422 if ( ! YY_CURRENT_BUFFER ){
01423 aoensure_buffer_stack ();
01424 YY_CURRENT_BUFFER_LVALUE =
01425 ao_create_buffer(aoin,YY_BUF_SIZE );
01426 }
01427
01428 ao_init_buffer(YY_CURRENT_BUFFER,input_file );
01429 ao_load_buffer_state( );
01430 }
01431
01436 void ao_switch_to_buffer (YY_BUFFER_STATE new_buffer )
01437 {
01438
01439
01440
01441
01442
01443
01444 aoensure_buffer_stack ();
01445 if ( YY_CURRENT_BUFFER == new_buffer )
01446 return;
01447
01448 if ( YY_CURRENT_BUFFER )
01449 {
01450
01451 *(yy_c_buf_p) = (yy_hold_char);
01452 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01453 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01454 }
01455
01456 YY_CURRENT_BUFFER_LVALUE = new_buffer;
01457 ao_load_buffer_state( );
01458
01459
01460
01461
01462
01463
01464 (yy_did_buffer_switch_on_eof) = 1;
01465 }
01466
01467 static void ao_load_buffer_state (void)
01468 {
01469 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01470 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01471 aoin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01472 (yy_hold_char) = *(yy_c_buf_p);
01473 }
01474
01481 YY_BUFFER_STATE ao_create_buffer (FILE * file, int size )
01482 {
01483 YY_BUFFER_STATE b;
01484
01485 b = (YY_BUFFER_STATE) aoalloc(sizeof( struct yy_buffer_state ) );
01486 if ( ! b )
01487 YY_FATAL_ERROR( "out of dynamic memory in ao_create_buffer()" );
01488
01489 b->yy_buf_size = size;
01490
01491
01492
01493
01494 b->yy_ch_buf = (char *) aoalloc(b->yy_buf_size + 2 );
01495 if ( ! b->yy_ch_buf )
01496 YY_FATAL_ERROR( "out of dynamic memory in ao_create_buffer()" );
01497
01498 b->yy_is_our_buffer = 1;
01499
01500 ao_init_buffer(b,file );
01501
01502 return b;
01503 }
01504
01509 void ao_delete_buffer (YY_BUFFER_STATE b )
01510 {
01511
01512 if ( ! b )
01513 return;
01514
01515 if ( b == YY_CURRENT_BUFFER )
01516 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01517
01518 if ( b->yy_is_our_buffer )
01519 aofree((void *) b->yy_ch_buf );
01520
01521 aofree((void *) b );
01522 }
01523
01524 #ifndef __cplusplus
01525 extern int isatty (int );
01526 #endif
01527
01528
01529
01530
01531
01532 static void ao_init_buffer (YY_BUFFER_STATE b, FILE * file )
01533
01534 {
01535 int oerrno = errno;
01536
01537 ao_flush_buffer(b );
01538
01539 b->yy_input_file = file;
01540 b->yy_fill_buffer = 1;
01541
01542
01543
01544
01545
01546 if (b != YY_CURRENT_BUFFER){
01547 b->yy_bs_lineno = 1;
01548 b->yy_bs_column = 0;
01549 }
01550
01551 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01552
01553 errno = oerrno;
01554 }
01555
01560 void ao_flush_buffer (YY_BUFFER_STATE b )
01561 {
01562 if ( ! b )
01563 return;
01564
01565 b->yy_n_chars = 0;
01566
01567
01568
01569
01570
01571 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01572 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01573
01574 b->yy_buf_pos = &b->yy_ch_buf[0];
01575
01576 b->yy_at_bol = 1;
01577 b->yy_buffer_status = YY_BUFFER_NEW;
01578
01579 if ( b == YY_CURRENT_BUFFER )
01580 ao_load_buffer_state( );
01581 }
01582
01589 void aopush_buffer_state (YY_BUFFER_STATE new_buffer )
01590 {
01591 if (new_buffer == NULL)
01592 return;
01593
01594 aoensure_buffer_stack();
01595
01596
01597 if ( YY_CURRENT_BUFFER )
01598 {
01599
01600 *(yy_c_buf_p) = (yy_hold_char);
01601 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01602 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01603 }
01604
01605
01606 if (YY_CURRENT_BUFFER)
01607 (yy_buffer_stack_top)++;
01608 YY_CURRENT_BUFFER_LVALUE = new_buffer;
01609
01610
01611 ao_load_buffer_state( );
01612 (yy_did_buffer_switch_on_eof) = 1;
01613 }
01614
01619 void aopop_buffer_state (void)
01620 {
01621 if (!YY_CURRENT_BUFFER)
01622 return;
01623
01624 ao_delete_buffer(YY_CURRENT_BUFFER );
01625 YY_CURRENT_BUFFER_LVALUE = NULL;
01626 if ((yy_buffer_stack_top) > 0)
01627 --(yy_buffer_stack_top);
01628
01629 if (YY_CURRENT_BUFFER) {
01630 ao_load_buffer_state( );
01631 (yy_did_buffer_switch_on_eof) = 1;
01632 }
01633 }
01634
01635
01636
01637
01638 static void aoensure_buffer_stack (void)
01639 {
01640 int num_to_alloc;
01641
01642 if (!(yy_buffer_stack)) {
01643
01644
01645
01646
01647
01648 num_to_alloc = 1;
01649 (yy_buffer_stack) = (struct yy_buffer_state**)aoalloc
01650 (num_to_alloc * sizeof(struct yy_buffer_state*)
01651 );
01652 if ( ! (yy_buffer_stack) )
01653 YY_FATAL_ERROR( "out of dynamic memory in aoensure_buffer_stack()" );
01654
01655 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01656
01657 (yy_buffer_stack_max) = num_to_alloc;
01658 (yy_buffer_stack_top) = 0;
01659 return;
01660 }
01661
01662 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
01663
01664
01665 int grow_size = 8 ;
01666
01667 num_to_alloc = (yy_buffer_stack_max) + grow_size;
01668 (yy_buffer_stack) = (struct yy_buffer_state**)aorealloc
01669 ((yy_buffer_stack),
01670 num_to_alloc * sizeof(struct yy_buffer_state*)
01671 );
01672 if ( ! (yy_buffer_stack) )
01673 YY_FATAL_ERROR( "out of dynamic memory in aoensure_buffer_stack()" );
01674
01675
01676 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
01677 (yy_buffer_stack_max) = num_to_alloc;
01678 }
01679 }
01680
01687 YY_BUFFER_STATE ao_scan_buffer (char * base, yy_size_t size )
01688 {
01689 YY_BUFFER_STATE b;
01690
01691 if ( size < 2 ||
01692 base[size-2] != YY_END_OF_BUFFER_CHAR ||
01693 base[size-1] != YY_END_OF_BUFFER_CHAR )
01694
01695 return 0;
01696
01697 b = (YY_BUFFER_STATE) aoalloc(sizeof( struct yy_buffer_state ) );
01698 if ( ! b )
01699 YY_FATAL_ERROR( "out of dynamic memory in ao_scan_buffer()" );
01700
01701 b->yy_buf_size = size - 2;
01702 b->yy_buf_pos = b->yy_ch_buf = base;
01703 b->yy_is_our_buffer = 0;
01704 b->yy_input_file = 0;
01705 b->yy_n_chars = b->yy_buf_size;
01706 b->yy_is_interactive = 0;
01707 b->yy_at_bol = 1;
01708 b->yy_fill_buffer = 0;
01709 b->yy_buffer_status = YY_BUFFER_NEW;
01710
01711 ao_switch_to_buffer(b );
01712
01713 return b;
01714 }
01715
01724 YY_BUFFER_STATE ao_scan_string (yyconst char * yystr )
01725 {
01726
01727 return ao_scan_bytes(yystr,strlen(yystr) );
01728 }
01729
01737 YY_BUFFER_STATE ao_scan_bytes (yyconst char * yybytes, int _yybytes_len )
01738 {
01739 YY_BUFFER_STATE b;
01740 char *buf;
01741 yy_size_t n;
01742 int i;
01743
01744
01745 n = _yybytes_len + 2;
01746 buf = (char *) aoalloc(n );
01747 if ( ! buf )
01748 YY_FATAL_ERROR( "out of dynamic memory in ao_scan_bytes()" );
01749
01750 for ( i = 0; i < _yybytes_len; ++i )
01751 buf[i] = yybytes[i];
01752
01753 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
01754
01755 b = ao_scan_buffer(buf,n );
01756 if ( ! b )
01757 YY_FATAL_ERROR( "bad buffer in ao_scan_bytes()" );
01758
01759
01760
01761
01762 b->yy_is_our_buffer = 1;
01763
01764 return b;
01765 }
01766
01767 #ifndef YY_EXIT_FAILURE
01768 #define YY_EXIT_FAILURE 2
01769 #endif
01770
01771 static void yy_fatal_error (yyconst char* msg )
01772 {
01773 (void) fprintf( stderr, "%s\n", msg );
01774 exit( YY_EXIT_FAILURE );
01775 }
01776
01777
01778
01779 #undef yyless
01780 #define yyless(n) \
01781 do \
01782 { \
01783 \
01784 int yyless_macro_arg = (n); \
01785 YY_LESS_LINENO(yyless_macro_arg);\
01786 aotext[aoleng] = (yy_hold_char); \
01787 (yy_c_buf_p) = aotext + yyless_macro_arg; \
01788 (yy_hold_char) = *(yy_c_buf_p); \
01789 *(yy_c_buf_p) = '\0'; \
01790 aoleng = yyless_macro_arg; \
01791 } \
01792 while ( 0 )
01793
01794
01795
01799 int aoget_lineno (void)
01800 {
01801
01802 return aolineno;
01803 }
01804
01808 FILE *aoget_in (void)
01809 {
01810 return aoin;
01811 }
01812
01816 FILE *aoget_out (void)
01817 {
01818 return aoout;
01819 }
01820
01824 int aoget_leng (void)
01825 {
01826 return aoleng;
01827 }
01828
01833 char *aoget_text (void)
01834 {
01835 return aotext;
01836 }
01837
01842 void aoset_lineno (int line_number )
01843 {
01844
01845 aolineno = line_number;
01846 }
01847
01854 void aoset_in (FILE * in_str )
01855 {
01856 aoin = in_str ;
01857 }
01858
01859 void aoset_out (FILE * out_str )
01860 {
01861 aoout = out_str ;
01862 }
01863
01864 int aoget_debug (void)
01865 {
01866 return ao_flex_debug;
01867 }
01868
01869 void aoset_debug (int bdebug )
01870 {
01871 ao_flex_debug = bdebug ;
01872 }
01873
01874 static int yy_init_globals (void)
01875 {
01876
01877
01878
01879
01880
01881 aolineno = 1;
01882
01883 (yy_buffer_stack) = 0;
01884 (yy_buffer_stack_top) = 0;
01885 (yy_buffer_stack_max) = 0;
01886 (yy_c_buf_p) = (char *) 0;
01887 (yy_init) = 0;
01888 (yy_start) = 0;
01889
01890
01891 #ifdef YY_STDINIT
01892 aoin = stdin;
01893 aoout = stdout;
01894 #else
01895 aoin = (FILE *) 0;
01896 aoout = (FILE *) 0;
01897 #endif
01898
01899
01900
01901
01902 return 0;
01903 }
01904
01905
01906 int aolex_destroy (void)
01907 {
01908
01909
01910 while(YY_CURRENT_BUFFER){
01911 ao_delete_buffer(YY_CURRENT_BUFFER );
01912 YY_CURRENT_BUFFER_LVALUE = NULL;
01913 aopop_buffer_state();
01914 }
01915
01916
01917 aofree((yy_buffer_stack) );
01918 (yy_buffer_stack) = NULL;
01919
01920
01921
01922 yy_init_globals( );
01923
01924 return 0;
01925 }
01926
01927
01928
01929
01930
01931 #ifndef yytext_ptr
01932 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
01933 {
01934 register int i;
01935 for ( i = 0; i < n; ++i )
01936 s1[i] = s2[i];
01937 }
01938 #endif
01939
01940 #ifdef YY_NEED_STRLEN
01941 static int yy_flex_strlen (yyconst char * s )
01942 {
01943 register int n;
01944 for ( n = 0; s[n]; ++n )
01945 ;
01946
01947 return n;
01948 }
01949 #endif
01950
01951 void *aoalloc (yy_size_t size )
01952 {
01953 return (void *) malloc( size );
01954 }
01955
01956 void *aorealloc (void * ptr, yy_size_t size )
01957 {
01958
01959
01960
01961
01962
01963
01964
01965 return (void *) realloc( (char *) ptr, size );
01966 }
01967
01968 void aofree (void * ptr )
01969 {
01970 free( (char *) ptr );
01971 }
01972
01973 #define YYTABLES_NAME "yytables"
01974
01975 #line 45 "ao-lexer.l"
01976
01977
01978
01979 void aoerror(const char*)
01980 {
01981 fprintf(stderr,"aoc: parse error at line %d\n",aolineno);
01982 exit(1);
01983 }
01984
01985 static int read_string(char openchar, char closechar)
01986 {
01987 char result[5000];
01988 int i = 0;
01989 char t;
01990 int open_count = 1;
01991 while(true)
01992 {
01993 t=yyinput();
01994 if (t==openchar) open_count++;
01995 if (t==closechar) open_count--;
01996 if (open_count==0)
01997 {
01998 result[i++]=0;
01999 aolval=strdup(result);
02000
02001 return NAME;
02002 }
02003 result[i++]=t;
02004 assert(i<5000);
02005 if (t==EOF) aoerror("eof in external block");
02006 }
02007
02008 unput(t);
02009 }
02010
02011 int aowrap()
02012 {
02013 return 1;
02014 }
02015
02016