/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Id: lex.yy.cpp,v 1.2 2003/02/10 16:17:07 sm Exp $ */ #define FLEX_SCANNER #define TAO_YY_FLEX_MAJOR_VERSION 2 #define TAO_YY_FLEX_MINOR_VERSION 5 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include "ace/os_include/os_stdio.h" #include "ace/os_include/os_ctype.h" /* Use prototypes in function declarations. */ #define TAO_YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define TAO_YY_USE_CONST #else /* ! __cplusplus */ #ifdef __STDC__ #define TAO_YY_USE_PROTOS #define TAO_YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #define TAO_YY_USE_CONST #define TAO_YY_USE_PROTOS #endif #ifdef TAO_YY_USE_CONST #define tao_yyconst const #else #define tao_yyconst #endif #ifdef TAO_YY_USE_PROTOS #define TAO_YY_PROTO(proto) proto #else #define TAO_YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define TAO_YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define TAO_YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN tao_yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The TAO_YYSTATE alias is for lex * compatibility. */ #define TAO_YY_START ((tao_yy_start - 1) / 2) #define TAO_YYSTATE TAO_YY_START /* Action number for EOF rule of a given start state. */ #define TAO_YY_STATE_EOF(state) (TAO_YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define TAO_YY_NEW_FILE tao_yyrestart( tao_yyin ) #define TAO_YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define TAO_YY_BUF_SIZE 16384 typedef struct tao_yy_buffer_state *TAO_YY_BUFFER_STATE; extern int tao_yyleng; extern FILE *tao_yyin, *tao_yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * tao_yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the tao_yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define tao_yyless(n) \ do \ { \ /* Undo effects of setting up tao_yytext. */ \ *tao_yy_cp = tao_yy_hold_char; \ TAO_YY_RESTORE_TAO_YY_MORE_OFFSET \ tao_yy_c_buf_p = tao_yy_cp = tao_yy_bp + n - TAO_YY_MORE_ADJ; \ TAO_YY_DO_BEFORE_ACTION; /* set up tao_yytext again */ \ } \ while ( 0 ) #define unput(c) tao_yyunput( c, tao_yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int tao_yy_size_t; struct tao_yy_buffer_state { FILE *tao_yy_input_file; char *tao_yy_ch_buf; /* input buffer */ char *tao_yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ tao_yy_size_t tao_yy_buf_size; /* Number of characters read into tao_yy_ch_buf, not including EOB * characters. */ int tao_yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int tao_yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int tao_yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int tao_yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int tao_yy_fill_buffer; int tao_yy_buffer_status; #define TAO_YY_BUFFER_NEW 0 #define TAO_YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as TAO_YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via tao_yyrestart()), so that the user can continue scanning by * just pointing tao_yyin at a new input file. */ #define TAO_YY_BUFFER_EOF_PENDING 2 }; static TAO_YY_BUFFER_STATE tao_yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define TAO_YY_CURRENT_BUFFER tao_yy_current_buffer /* tao_yy_hold_char holds the character lost when tao_yytext is formed. */ static char tao_yy_hold_char; static int tao_yy_n_chars; /* number of characters read into tao_yy_ch_buf */ int tao_yyleng; /* Points to current character in buffer. */ static char *tao_yy_c_buf_p = (char *) 0; static int tao_yy_init = 1; /* whether we need to initialize */ static int tao_yy_start = 0; /* start state number */ /* Flag which is used to allow tao_yywrap()'s to do buffer switches * instead of setting up a fresh tao_yyin. A bit of a hack ... */ static int tao_yy_did_buffer_switch_on_eof; void tao_yyrestart TAO_YY_PROTO(( FILE *input_file )); void tao_yy_switch_to_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE new_buffer )); void tao_yy_load_buffer_state TAO_YY_PROTO(( void )); TAO_YY_BUFFER_STATE tao_yy_create_buffer TAO_YY_PROTO(( FILE *file, int size )); void tao_yy_delete_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE b )); void tao_yy_init_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE b, FILE *file )); void tao_yy_flush_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE b )); #define TAO_YY_FLUSH_BUFFER tao_yy_flush_buffer( tao_yy_current_buffer ) TAO_YY_BUFFER_STATE tao_yy_scan_buffer TAO_YY_PROTO(( char *base, tao_yy_size_t size )); TAO_YY_BUFFER_STATE tao_yy_scan_string TAO_YY_PROTO(( tao_yyconst char *tao_yy_str )); TAO_YY_BUFFER_STATE tao_yy_scan_bytes TAO_YY_PROTO(( tao_yyconst char *bytes, int len )); static void *tao_yy_flex_alloc TAO_YY_PROTO(( tao_yy_size_t )); static void *tao_yy_flex_realloc TAO_YY_PROTO(( void *, tao_yy_size_t )); static void tao_yy_flex_free TAO_YY_PROTO(( void * )); #define tao_yy_new_buffer tao_yy_create_buffer #define tao_yy_set_interactive(is_interactive) \ { \ if ( ! tao_yy_current_buffer ) \ tao_yy_current_buffer = tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); \ tao_yy_current_buffer->tao_yy_is_interactive = is_interactive; \ } #define tao_yy_set_bol(at_bol) \ { \ if ( ! tao_yy_current_buffer ) \ tao_yy_current_buffer = tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); \ tao_yy_current_buffer->tao_yy_at_bol = at_bol; \ } #define TAO_YY_AT_BOL() (tao_yy_current_buffer->tao_yy_at_bol) typedef unsigned char TAO_YY_CHAR; FILE *tao_yyin = (FILE *) 0, *tao_yyout = (FILE *) 0; typedef int tao_yy_state_type; extern char tao_yytext[]; static tao_yy_state_type tao_yy_get_previous_state TAO_YY_PROTO(( void )); static tao_yy_state_type tao_yy_try_NUL_trans TAO_YY_PROTO(( tao_yy_state_type current_state )); static int tao_yy_get_next_buffer TAO_YY_PROTO(( void )); static void tao_yy_fatal_error TAO_YY_PROTO(( tao_yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up tao_yytext. */ #define TAO_YY_DO_BEFORE_ACTION \ tao_yytext_ptr = tao_yy_bp; \ tao_yyleng = (int) (tao_yy_cp - tao_yy_bp); \ tao_yy_hold_char = *tao_yy_cp; \ *tao_yy_cp = '\0'; \ if ( tao_yyleng >= TAO_YYLMAX ) \ TAO_YY_FATAL_ERROR( "token too large, exceeds TAO_YYLMAX" ); \ tao_yy_flex_strncpy( tao_yytext, tao_yytext_ptr, tao_yyleng + 1 ); \ tao_yy_c_buf_p = tao_yy_cp; #define TAO_YY_NUM_RULES 104 #define TAO_YY_END_OF_BUFFER 105 static tao_yyconst short int tao_yy_accept[551] = { 0, 101, 101, 105, 103, 101, 102, 102, 103, 103, 103, 103, 103, 76, 72, 103, 103, 103, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 101, 103, 102, 101, 0, 77, 0, 0, 0, 0, 75, 71, 69, 100, 0, 69, 76, 0, 0, 0, 72, 67, 65, 66, 68, 68, 0, 0, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 62, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 101, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 79, 0, 79, 0, 0, 75, 0, 71, 0, 69, 0, 99, 99, 69, 0, 70, 74, 68, 0, 78, 0, 0, 0, 68, 68, 68, 1, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 63, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 0, 0, 0, 0, 0, 0, 0, 82, 80, 0, 0, 73, 0, 69, 70, 68, 78, 0, 0, 83, 0, 68, 59, 68, 68, 68, 20, 27, 68, 68, 68, 68, 68, 68, 68, 13, 68, 68, 68, 68, 68, 68, 68, 48, 68, 68, 68, 68, 24, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 57, 68, 31, 68, 68, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 80, 0, 81, 0, 60, 0, 0, 68, 68, 68, 68, 68, 10, 68, 68, 68, 68, 68, 44, 68, 68, 68, 68, 18, 22, 68, 68, 61, 68, 33, 68, 68, 68, 68, 30, 68, 68, 68, 68, 68, 68, 68, 68, 68, 25, 68, 68, 68, 68, 68, 68, 68, 68, 17, 68, 68, 28, 68, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 2, 68, 68, 68, 68, 68, 68, 35, 68, 23, 68, 68, 68, 46, 68, 49, 68, 68, 3, 68, 32, 64, 68, 68, 68, 38, 68, 4, 68, 68, 68, 14, 12, 68, 19, 68, 68, 55, 68, 68, 68, 68, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 68, 29, 68, 68, 8, 21, 68, 68, 36, 68, 68, 58, 68, 68, 37, 68, 68, 68, 68, 68, 68, 68, 11, 68, 68, 68, 15, 0, 0, 87, 87, 0, 0, 93, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 34, 68, 68, 43, 68, 68, 68, 68, 50, 68, 52, 68, 5, 16, 68, 39, 68, 68, 26, 68, 0, 97, 97, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 6, 42, 45, 7, 47, 9, 68, 53, 54, 68, 68, 41, 0, 85, 85, 0, 0, 88, 88, 0, 0, 0, 0, 51, 68, 56, 0, 98, 98, 0, 0, 0, 40, 94, 0, 86, 86, 0 } ; static tao_yyconst int tao_yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 6, 7, 1, 1, 1, 8, 1, 1, 9, 10, 1, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 17, 1, 18, 19, 20, 21, 1, 22, 23, 23, 23, 24, 25, 26, 26, 26, 26, 26, 27, 26, 26, 28, 26, 26, 29, 30, 31, 32, 26, 26, 33, 26, 26, 1, 34, 1, 1, 26, 1, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 26, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static tao_yyconst int tao_yy_meta[60] = { 0, 1, 1, 2, 1, 1, 3, 1, 4, 1, 1, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 3, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 3, 7, 7, 5, 5, 5, 7, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 8, 6, 8, 6, 8, 6, 8, 6 } ; static tao_yyconst short int tao_yy_base[578] = { 0, 0, 58, 1044, 1045, 59, 1045, 1045, 56, 1009, 54, 57, 65, 68, 73, 1025, 1023, 1020, 0, 1017, 69, 1002, 1008, 45, 987, 56, 37, 48, 67, 996, 985, 61, 984, 65, 997, 79, 63, 82, 83, 71, 71, 93, 92, 134, 144, 1010, 130, 97, 148, 0, 1022, 147, 152, 158, 184, 210, 1045, 148, 161, 197, 203, 229, 0, 239, 1045, 1045, 1045, 0, 1002, 137, 994, 983, 994, 972, 965, 969, 973, 968, 985, 109, 966, 978, 962, 973, 960, 975, 976, 975, 130, 962, 956, 962, 958, 132, 96, 959, 968, 959, 950, 949, 963, 947, 136, 964, 956, 963, 138, 948, 944, 945, 951, 938, 942, 140, 952, 944, 946, 946, 933, 199, 0, 174, 1045, 980, 243, 942, 946, 940, 930, 962, 226, 196, 204, 1045, 972, 971, 252, 970, 256, 0, 261, 272, 1045, 258, 1045, 286, 0, 277, 283, 0, 947, 235, 279, 921, 967, 257, 935, 949, 918, 0, 919, 924, 930, 916, 917, 110, 912, 930, 928, 909, 915, 913, 921, 905, 920, 918, 921, 903, 915, 904, 897, 912, 915, 908, 913, 892, 892, 902, 905, 886, 0, 247, 886, 895, 887, 901, 883, 885, 884, 152, 885, 880, 885, 893, 882, 887, 876, 873, 889, 891, 873, 918, 917, 876, 882, 872, 884, 328, 1045, 1045, 301, 910, 0, 303, 310, 1045, 893, 300, 910, 0, 1045, 0, 878, 0, 862, 870, 873, 0, 0, 862, 259, 871, 860, 853, 861, 853, 0, 851, 854, 854, 863, 863, 846, 864, 0, 846, 843, 844, 849, 0, 853, 847, 849, 835, 836, 854, 853, 852, 843, 842, 845, 834, 843, 846, 826, 831, 841, 828, 839, 838, 296, 826, 832, 0, 833, 0, 819, 827, 863, 317, 829, 819, 827, 824, 818, 1045, 290, 348, 820, 824, 818, 808, 1045, 851, 1045, 850, 0, 373, 849, 802, 820, 818, 818, 804, 0, 804, 792, 802, 802, 808, 0, 792, 791, 792, 791, 0, 0, 799, 787, 0, 800, 0, 800, 799, 787, 797, 0, 776, 782, 779, 794, 304, 778, 782, 781, 785, 0, 786, 772, 773, 782, 788, 783, 783, 768, 0, 771, 764, 0, 769, 1045, 378, 299, 762, 370, 768, 808, 807, 766, 772, 762, 774, 400, 1045, 800, 0, 770, 751, 757, 765, 764, 748, 0, 747, 0, 741, 756, 739, 0, 744, 0, 761, 685, 0, 680, 0, 0, 655, 671, 668, 0, 662, 0, 646, 652, 627, 0, 0, 615, 0, 599, 609, 0, 609, 596, 565, 582, 427, 1045, 442, 344, 353, 450, 465, 586, 613, 356, 579, 569, 577, 573, 473, 605, 558, 557, 0, 562, 556, 0, 0, 550, 546, 0, 554, 554, 0, 529, 519, 0, 505, 515, 493, 508, 489, 474, 484, 0, 459, 456, 442, 0, 469, 397, 1045, 399, 430, 472, 1045, 485, 365, 1045, 500, 371, 428, 515, 414, 385, 452, 0, 415, 395, 0, 382, 358, 352, 365, 0, 351, 0, 313, 0, 0, 301, 0, 309, 297, 0, 289, 497, 1045, 503, 305, 519, 522, 530, 1045, 534, 538, 448, 551, 555, 412, 239, 0, 0, 0, 0, 0, 0, 193, 0, 0, 187, 171, 0, 559, 1045, 569, 571, 573, 1045, 575, 578, 216, 197, 457, 0, 55, 0, 580, 1045, 585, 61, 594, 599, 0, 1045, 601, 1045, 604, 1045, 625, 633, 637, 643, 651, 659, 663, 670, 678, 683, 686, 693, 698, 701, 704, 708, 715, 720, 727, 732, 739, 747, 755, 763, 771, 779, 787 } ; static tao_yyconst short int tao_yy_def[578] = { 0, 550, 1, 550, 550, 550, 550, 550, 551, 552, 550, 550, 550, 550, 550, 550, 550, 550, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 550, 550, 550, 550, 551, 550, 554, 550, 555, 550, 550, 550, 550, 550, 556, 55, 550, 550, 550, 557, 550, 550, 550, 550, 553, 553, 558, 559, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 550, 44, 44, 550, 121, 550, 550, 550, 550, 550, 550, 550, 551, 551, 550, 550, 550, 550, 560, 550, 561, 550, 550, 550, 556, 550, 556, 58, 550, 550, 557, 553, 558, 550, 550, 550, 550, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 562, 550, 550, 550, 550, 550, 550, 550, 550, 550, 563, 561, 550, 550, 550, 553, 550, 550, 564, 550, 565, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 562, 550, 550, 550, 550, 550, 217, 550, 217, 550, 550, 550, 550, 550, 550, 550, 550, 550, 553, 558, 566, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 550, 550, 550, 550, 550, 550, 567, 550, 550, 550, 550, 550, 307, 550, 568, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 550, 550, 550, 569, 550, 550, 550, 550, 567, 550, 550, 550, 550, 550, 307, 570, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 550, 569, 550, 569, 571, 550, 550, 572, 550, 550, 550, 550, 550, 550, 550, 558, 550, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 571, 550, 571, 572, 550, 573, 550, 550, 550, 574, 550, 550, 550, 550, 550, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 573, 550, 573, 550, 574, 550, 574, 575, 576, 550, 550, 553, 553, 553, 575, 550, 575, 576, 550, 577, 553, 550, 577, 550, 577, 0, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550 } ; static tao_yyconst short int tao_yy_nxt[1105] = { 0, 4, 5, 6, 7, 5, 8, 4, 9, 4, 4, 10, 11, 12, 13, 14, 14, 15, 16, 4, 17, 7, 18, 18, 18, 19, 18, 20, 21, 18, 18, 22, 18, 18, 4, 23, 24, 25, 26, 27, 28, 29, 30, 31, 18, 18, 32, 33, 34, 35, 36, 18, 37, 38, 39, 40, 41, 42, 18, 18, 43, 46, 48, 43, 46, 44, 52, 543, 53, 54, 54, 55, 55, 55, 56, 69, 81, 70, 57, 45, 58, 73, 59, 59, 60, 58, 82, 63, 63, 63, 49, 77, 61, 74, 545, 83, 84, 61, 78, 75, 95, 62, 87, 48, 85, 79, 86, 61, 92, 93, 88, 80, 61, 89, 96, 102, 99, 104, 103, 113, 97, 105, 106, 111, 114, 107, 62, 100, 115, 117, 112, 49, 46, 182, 101, 46, 119, 108, 109, 119, 110, 120, 116, 152, 183, 118, 121, 122, 122, 123, 130, 144, 145, 130, 131, 135, 164, 165, 124, 124, 124, 136, 136, 240, 241, 122, 55, 55, 55, 145, 58, 153, 138, 138, 60, 146, 146, 146, 174, 191, 137, 180, 61, 204, 125, 192, 181, 126, 175, 196, 127, 139, 197, 205, 128, 275, 58, 61, 140, 140, 140, 119, 48, 533, 119, 137, 120, 276, 61, 58, 48, 59, 59, 60, 550, 58, 139, 60, 60, 60, 550, 61, 543, 61, 55, 55, 55, 61, 130, 538, 49, 130, 131, 537, 141, 142, 61, 142, 49, 147, 147, 152, 61, 148, 148, 148, 122, 122, 212, 141, 142, 58, 536, 63, 63, 63, 142, 124, 124, 124, 219, 144, 145, 61, 122, 230, 220, 220, 58, 153, 138, 138, 60, 58, 535, 140, 140, 140, 61, 145, 61, 227, 223, 223, 227, 61, 224, 224, 224, 144, 145, 148, 148, 148, 266, 61, 366, 148, 148, 148, 61, 420, 227, 267, 420, 227, 228, 145, 225, 302, 225, 502, 231, 314, 315, 303, 303, 224, 224, 224, 360, 360, 361, 225, 224, 224, 224, 228, 524, 225, 294, 295, 295, 296, 352, 142, 550, 142, 360, 353, 523, 400, 297, 297, 297, 522, 354, 463, 464, 295, 142, 295, 295, 367, 521, 465, 142, 401, 465, 470, 470, 471, 297, 297, 297, 464, 520, 503, 298, 295, 503, 299, 422, 507, 300, 422, 507, 470, 301, 152, 417, 418, 418, 417, 423, 423, 423, 372, 372, 372, 519, 152, 419, 419, 419, 372, 372, 372, 372, 418, 463, 464, 463, 464, 518, 517, 516, 153, 372, 372, 372, 372, 372, 372, 431, 431, 431, 534, 464, 153, 464, 515, 431, 431, 431, 431, 511, 511, 511, 417, 418, 418, 417, 499, 500, 431, 431, 431, 431, 431, 431, 461, 461, 461, 417, 418, 418, 417, 418, 514, 532, 500, 422, 532, 513, 422, 419, 419, 419, 544, 373, 512, 544, 418, 423, 423, 423, 466, 467, 467, 466, 468, 418, 418, 466, 467, 467, 466, 468, 423, 423, 423, 508, 461, 461, 461, 467, 476, 476, 476, 418, 502, 497, 467, 496, 476, 476, 476, 476, 495, 499, 500, 504, 505, 505, 504, 499, 500, 476, 476, 476, 476, 476, 476, 506, 506, 506, 509, 500, 494, 510, 505, 467, 467, 500, 526, 527, 493, 492, 511, 511, 511, 504, 505, 505, 504, 504, 505, 505, 504, 467, 530, 531, 527, 528, 528, 528, 491, 506, 506, 506, 505, 490, 509, 489, 505, 510, 509, 488, 531, 510, 533, 526, 527, 487, 511, 511, 511, 486, 511, 511, 511, 526, 527, 505, 505, 530, 531, 530, 531, 527, 540, 541, 540, 541, 528, 528, 528, 540, 541, 527, 485, 505, 484, 531, 483, 531, 546, 546, 541, 482, 541, 548, 549, 548, 549, 541, 548, 549, 481, 480, 479, 478, 373, 475, 546, 474, 473, 472, 426, 549, 469, 549, 460, 459, 549, 47, 47, 47, 47, 47, 47, 47, 47, 50, 458, 50, 50, 50, 50, 50, 50, 67, 67, 67, 67, 132, 132, 457, 456, 132, 132, 134, 455, 134, 134, 134, 134, 134, 134, 143, 143, 143, 143, 143, 143, 143, 143, 149, 454, 149, 151, 151, 151, 151, 151, 151, 151, 151, 154, 453, 154, 154, 154, 154, 154, 154, 221, 221, 452, 221, 222, 451, 222, 288, 288, 288, 288, 288, 288, 288, 288, 305, 305, 450, 305, 307, 449, 307, 308, 448, 308, 374, 374, 447, 374, 425, 425, 425, 425, 425, 425, 425, 425, 432, 432, 446, 432, 462, 462, 462, 462, 462, 462, 462, 462, 477, 477, 445, 477, 498, 498, 498, 498, 498, 498, 498, 498, 501, 501, 501, 501, 501, 501, 501, 501, 525, 525, 525, 525, 525, 525, 525, 525, 529, 529, 529, 529, 529, 529, 529, 529, 539, 539, 539, 539, 539, 539, 539, 539, 542, 542, 542, 542, 542, 542, 542, 542, 547, 547, 547, 547, 547, 547, 547, 547, 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, 373, 430, 429, 428, 427, 366, 426, 424, 421, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, 375, 373, 304, 302, 371, 370, 369, 368, 550, 365, 364, 363, 362, 289, 359, 358, 357, 356, 355, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 313, 312, 311, 310, 309, 69, 306, 304, 293, 292, 291, 290, 211, 289, 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, 274, 273, 272, 271, 270, 269, 268, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 239, 238, 237, 236, 235, 234, 233, 232, 230, 229, 226, 218, 218, 218, 217, 216, 215, 214, 213, 211, 210, 209, 208, 207, 206, 203, 202, 201, 200, 199, 198, 195, 194, 193, 190, 189, 188, 187, 186, 185, 184, 179, 178, 177, 176, 173, 172, 171, 170, 169, 168, 167, 166, 163, 162, 161, 160, 159, 158, 157, 156, 155, 150, 133, 129, 98, 94, 91, 90, 76, 72, 71, 68, 66, 65, 64, 51, 550, 3, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550 } ; static tao_yyconst short int tao_yy_chk[1105] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 8, 2, 5, 2, 10, 542, 10, 10, 10, 11, 11, 11, 12, 20, 26, 20, 12, 2, 13, 23, 13, 13, 13, 14, 26, 14, 14, 14, 8, 25, 13, 23, 537, 27, 27, 14, 25, 23, 33, 13, 28, 47, 27, 25, 27, 13, 31, 31, 28, 25, 14, 28, 33, 36, 35, 37, 36, 40, 33, 37, 38, 39, 40, 38, 13, 35, 41, 42, 39, 47, 46, 94, 35, 46, 43, 38, 38, 43, 38, 43, 41, 69, 94, 42, 44, 44, 44, 44, 48, 57, 57, 48, 48, 51, 79, 79, 44, 44, 44, 51, 51, 165, 165, 44, 52, 52, 52, 57, 53, 69, 53, 53, 53, 58, 58, 58, 88, 102, 51, 93, 53, 113, 44, 102, 93, 44, 88, 106, 44, 53, 106, 113, 44, 199, 54, 53, 54, 54, 54, 119, 131, 534, 119, 51, 119, 199, 54, 59, 132, 59, 59, 59, 121, 60, 53, 60, 60, 60, 121, 59, 533, 54, 55, 55, 55, 60, 130, 523, 131, 130, 130, 522, 55, 55, 59, 55, 132, 61, 61, 151, 60, 61, 61, 61, 124, 124, 124, 55, 55, 63, 519, 63, 63, 63, 55, 124, 124, 124, 136, 143, 143, 63, 124, 155, 136, 136, 138, 151, 138, 138, 138, 140, 512, 140, 140, 140, 63, 143, 138, 152, 141, 141, 152, 140, 141, 141, 141, 145, 145, 147, 147, 147, 191, 138, 296, 148, 148, 148, 140, 362, 227, 191, 362, 227, 152, 145, 148, 220, 148, 501, 155, 240, 240, 220, 220, 223, 223, 223, 289, 289, 289, 148, 224, 224, 224, 227, 497, 148, 217, 217, 217, 217, 280, 224, 296, 224, 289, 280, 495, 341, 217, 217, 217, 494, 280, 420, 420, 217, 224, 297, 297, 297, 492, 421, 224, 341, 421, 426, 426, 426, 297, 297, 297, 420, 489, 469, 217, 297, 469, 217, 364, 472, 217, 364, 472, 426, 217, 307, 361, 361, 361, 361, 364, 364, 364, 307, 307, 307, 487, 476, 361, 361, 361, 307, 307, 307, 307, 361, 462, 462, 464, 464, 485, 484, 483, 307, 307, 307, 307, 307, 307, 307, 372, 372, 372, 511, 462, 476, 464, 482, 372, 372, 372, 372, 511, 511, 511, 417, 417, 417, 417, 465, 465, 372, 372, 372, 372, 372, 372, 417, 417, 417, 419, 419, 419, 419, 417, 480, 508, 465, 422, 508, 479, 422, 419, 419, 419, 535, 477, 475, 535, 419, 422, 422, 422, 423, 423, 423, 423, 423, 461, 461, 466, 466, 466, 466, 466, 423, 423, 423, 473, 461, 461, 461, 423, 431, 431, 431, 461, 468, 459, 466, 458, 431, 431, 431, 431, 457, 498, 498, 471, 471, 471, 471, 500, 500, 431, 431, 431, 431, 431, 431, 471, 471, 471, 474, 498, 455, 474, 471, 502, 502, 500, 503, 503, 454, 453, 474, 474, 474, 504, 504, 504, 504, 506, 506, 506, 506, 502, 507, 507, 503, 504, 504, 504, 452, 506, 506, 506, 504, 451, 509, 450, 506, 509, 510, 449, 507, 510, 510, 525, 525, 447, 509, 509, 509, 446, 510, 510, 510, 527, 527, 528, 528, 529, 529, 531, 531, 525, 532, 532, 539, 539, 528, 528, 528, 541, 541, 527, 444, 528, 443, 529, 441, 531, 543, 543, 532, 440, 539, 544, 544, 547, 547, 541, 549, 549, 437, 436, 434, 433, 432, 430, 543, 429, 428, 427, 425, 544, 424, 547, 416, 415, 549, 551, 551, 551, 551, 551, 551, 551, 551, 552, 414, 552, 552, 552, 552, 552, 552, 553, 553, 553, 553, 554, 554, 413, 411, 554, 554, 555, 410, 555, 555, 555, 555, 555, 555, 556, 556, 556, 556, 556, 556, 556, 556, 557, 408, 557, 558, 558, 558, 558, 558, 558, 558, 558, 559, 405, 559, 559, 559, 559, 559, 559, 560, 560, 404, 560, 561, 403, 561, 562, 562, 562, 562, 562, 562, 562, 562, 563, 563, 401, 563, 564, 399, 564, 565, 398, 565, 566, 566, 397, 566, 567, 567, 567, 567, 567, 567, 567, 567, 568, 568, 394, 568, 569, 569, 569, 569, 569, 569, 569, 569, 570, 570, 392, 570, 571, 571, 571, 571, 571, 571, 571, 571, 572, 572, 572, 572, 572, 572, 572, 572, 573, 573, 573, 573, 573, 573, 573, 573, 574, 574, 574, 574, 574, 574, 574, 574, 575, 575, 575, 575, 575, 575, 575, 575, 576, 576, 576, 576, 576, 576, 576, 576, 577, 577, 577, 577, 577, 577, 577, 577, 391, 389, 387, 386, 385, 383, 381, 380, 379, 378, 377, 376, 374, 371, 370, 369, 368, 367, 366, 365, 363, 359, 357, 356, 354, 353, 352, 351, 350, 349, 348, 347, 345, 344, 343, 342, 340, 339, 338, 337, 335, 334, 333, 332, 330, 328, 327, 324, 323, 322, 321, 319, 318, 317, 316, 315, 313, 312, 311, 310, 309, 308, 305, 303, 301, 300, 299, 298, 294, 293, 292, 291, 290, 288, 287, 286, 284, 282, 281, 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, 260, 258, 257, 256, 255, 253, 252, 251, 250, 249, 248, 247, 245, 244, 243, 242, 241, 239, 236, 235, 234, 232, 228, 226, 221, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 198, 197, 196, 195, 194, 193, 192, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 164, 163, 162, 161, 160, 158, 157, 156, 154, 153, 150, 137, 135, 134, 129, 128, 127, 126, 125, 123, 118, 117, 116, 115, 114, 112, 111, 110, 109, 108, 107, 105, 104, 103, 101, 100, 99, 98, 97, 96, 95, 92, 91, 90, 89, 87, 86, 85, 84, 83, 82, 81, 80, 78, 77, 76, 75, 74, 73, 72, 71, 70, 68, 50, 45, 34, 32, 30, 29, 24, 22, 21, 19, 17, 16, 15, 9, 3, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550 } ; static tao_yy_state_type tao_yy_last_accepting_state; static char *tao_yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define tao_yymore() tao_yymore_used_but_not_detected #define TAO_YY_MORE_ADJ 0 #define TAO_YY_RESTORE_TAO_YY_MORE_OFFSET #ifndef TAO_YYLMAX #define TAO_YYLMAX 8192 #endif char tao_yytext[TAO_YYLMAX]; char *tao_yytext_ptr; #define INITIAL 0 /* $Id: idl.ll,v 1.70 2002/08/26 19:47:28 parsons Exp $ COPYRIGHT Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United States of America. All Rights Reserved. This product is protected by copyright and distributed under the following license restricting its use. The Interface Definition Language Compiler Front End (CFE) is made available for your use provided that you include this license and copyright notice on all media and documentation and the software program in which this product is incorporated in whole or part. You may copy and extend functionality (but may not remove functionality) of the Interface Definition Language CFE without charge, but you are not authorized to license or distribute it to anyone else except as part of a product or program developed by you or with the express written consent of Sun Microsystems, Inc. ("Sun"). The names of Sun Microsystems, Inc. and any of its subsidiaries or affiliates may not be used in advertising or publicity pertaining to distribution of Interface Definition Language CFE as permitted herein. This license is effective until terminated by Sun for failure to comply with this license. Upon termination, you shall destroy or return all code and documentation for the Interface Definition Language CFE. IDL_INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF IDL_ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. IDL_INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT IDL_ANY OBLIGATION ON THE PART OF Sun OR IDL_ANY OF ITS SUBSIDIARIES OR AFFILIATES TO ASSIST IDL_IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. SUN OR IDL_ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR IDL_ANY PATENTS BY IDL_INTERFACE DEFINITION LANGUAGE CFE OR IDL_ANY PART THEREOF. IDL_IN NO EVENT WILL SUN OR IDL_ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR IDL_ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR 52.227-19. Sun, Sun Microsystems and the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. SunSoft, Inc. 2550 Garcia Avenue Mountain View, California 94043 NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. */ /* * idl.ll - Lexical scanner for IDL 1.1 */ #include "utl_strlist.h" #include "utl_exprlist.h" #include "utl_labellist.h" #include "utl_decllist.h" #include "utl_string.h" #include "utl_err.h" #include "ast_union_label.h" #include "ast_field.h" #include "ast_expression.h" #include "ast_argument.h" #include "ast_operation.h" #include "ast_root.h" #include "fe_interface_header.h" #include "global_extern.h" #include "fe_private.h" #include "nr_extern.h" #include "y.tab.h" static char * idl_wstring_escape_reader (char *); static ACE_CDR::WChar idl_wchar_escape_reader (char *); static char idl_escape_reader (char *); static double idl_atof (char *); static long idl_atoi (char *, long); static ACE_UINT64 idl_atoui (char *, long); static void idl_parse_line_and_file (char *); static void idl_store_pragma (char *); static char * idl_get_pragma_string (char *); static idl_bool idl_valid_version (char *); static AST_Decl * idl_find_node (char *); #if 0 /* defined (HPUX) */ // HPUX has tao_yytext typed to unsigned char *. We make sure here that // we'll always use char * static char* __tao_yytext = (char*) tao_yytext; // NOTE: This will not work under flex(1) were tao_yytext is not a fixed // buffer, but a dynamically allocated one. This function should do // the trick for us. inline char *__tao_yytext() { return (char *) tao_yytext; } #define ace_tao_yytext __tao_yytext() #else #define ace_tao_yytext tao_yytext #endif /* 0 */ /* SO we don't choke on files that use \r\n */ #define TAO_YY_NEVER_INTERACTIVE 1 /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef TAO_YY_SKIP_TAO_YYWRAP #ifdef __cplusplus extern "C" int tao_yywrap TAO_YY_PROTO(( void )); #else extern int tao_yywrap TAO_YY_PROTO(( void )); #endif #endif #ifndef TAO_YY_NO_UNPUT static void tao_yyunput TAO_YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef tao_yytext_ptr static void tao_yy_flex_strncpy TAO_YY_PROTO(( char *, tao_yyconst char *, int )); #endif #ifdef TAO_YY_NEED_STRLEN static int tao_yy_flex_strlen TAO_YY_PROTO(( tao_yyconst char * )); #endif #ifndef TAO_YY_NO_INPUT #ifdef __cplusplus static int tao_yyinput TAO_YY_PROTO(( void )); #else static int input TAO_YY_PROTO(( void )); #endif #endif #ifdef TAO_YY_STACK_USED static int tao_yy_start_stack_ptr = 0; static int tao_yy_start_stack_depth = 0; static int *tao_yy_start_stack = 0; #ifndef TAO_YY_NO_PUSH_STATE static void tao_yy_push_state TAO_YY_PROTO(( int new_state )); #endif #ifndef TAO_YY_NO_POP_STATE static void tao_yy_pop_state TAO_YY_PROTO(( void )); #endif #ifndef TAO_YY_NO_TOP_STATE static int tao_yy_top_state TAO_YY_PROTO(( void )); #endif #else #define TAO_YY_NO_PUSH_STATE 1 #define TAO_YY_NO_POP_STATE 1 #define TAO_YY_NO_TOP_STATE 1 #endif #ifdef TAO_YY_MALLOC_DECL TAO_YY_MALLOC_DECL #else #ifdef __STDC__ #ifndef __cplusplus #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef TAO_YY_READ_BUF_SIZE #define TAO_YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef TAO_YY_ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define TAO_YY_ECHO (void) fwrite( tao_yytext, tao_yyleng, 1, tao_yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or TAO_YY_NULL, * is returned in "result". */ #ifndef TAO_YY_INPUT #define TAO_YY_INPUT(buf,result,max_size) \ if ( tao_yy_current_buffer->tao_yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( tao_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( tao_yyin ) ) \ TAO_YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = static_cast ( \ fread( buf, 1, max_size, tao_yyin ))) == 0) \ && ferror( tao_yyin ) ) \ TAO_YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "tao_yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef tao_yyterminate #define tao_yyterminate() return TAO_YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef TAO_YY_START_STACK_INCR #define TAO_YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef TAO_YY_FATAL_ERROR #define TAO_YY_FATAL_ERROR(msg) tao_yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef TAO_YY_DECL #define TAO_YY_DECL int tao_yylex TAO_YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after tao_yytext and tao_yyleng * have been set up. */ #ifndef TAO_YY_USER_ACTION #define TAO_YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef TAO_YY_BREAK #define TAO_YY_BREAK ACE_NOTREACHED (break;) #endif #define TAO_YY_RULE_SETUP \ if ( tao_yyleng > 0 ) \ tao_yy_current_buffer->tao_yy_at_bol = \ (tao_yytext[tao_yyleng - 1] == '\n'); \ TAO_YY_USER_ACTION TAO_YY_DECL { register tao_yy_state_type tao_yy_current_state; register char *tao_yy_cp = 0, *tao_yy_bp = 0; register int tao_yy_act; if ( tao_yy_init ) { tao_yy_init = 0; #ifdef TAO_YY_USER_INIT TAO_YY_USER_INIT; #endif if ( ! tao_yy_start ) tao_yy_start = 1; /* first start state */ if ( ! tao_yyin ) tao_yyin = stdin; if ( ! tao_yyout ) tao_yyout = stdout; if ( ! tao_yy_current_buffer ) tao_yy_current_buffer = tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); tao_yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { tao_yy_cp = tao_yy_c_buf_p; /* Support of tao_yytext. */ *tao_yy_cp = tao_yy_hold_char; /* tao_yy_bp points to the position in tao_yy_ch_buf of the start of * the current run. */ tao_yy_bp = tao_yy_cp; tao_yy_current_state = tao_yy_start; tao_yy_current_state += TAO_YY_AT_BOL(); tao_yy_match: do { register TAO_YY_CHAR tao_yy_c = tao_yy_ec[TAO_YY_SC_TO_UI(*tao_yy_cp)]; if ( tao_yy_accept[tao_yy_current_state] ) { tao_yy_last_accepting_state = tao_yy_current_state; tao_yy_last_accepting_cpos = tao_yy_cp; } while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; if ( tao_yy_current_state >= 551 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; ++tao_yy_cp; } while ( tao_yy_current_state != 550 ); tao_yy_find_action: tao_yy_act = tao_yy_accept[tao_yy_current_state]; if ( tao_yy_act == 0 ) { /* have to back up */ tao_yy_cp = tao_yy_last_accepting_cpos; tao_yy_current_state = tao_yy_last_accepting_state; tao_yy_act = tao_yy_accept[tao_yy_current_state]; } TAO_YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( tao_yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of TAO_YY_DO_BEFORE_ACTION */ *tao_yy_cp = tao_yy_hold_char; tao_yy_cp = tao_yy_last_accepting_cpos; tao_yy_current_state = tao_yy_last_accepting_state; goto tao_yy_find_action; case 1: TAO_YY_RULE_SETUP return IDL_ANY; TAO_YY_BREAK case 2: TAO_YY_RULE_SETUP return IDL_OBJECT; TAO_YY_BREAK case 3: TAO_YY_RULE_SETUP return IDL_MODULE; TAO_YY_BREAK case 4: TAO_YY_RULE_SETUP return IDL_RAISES; TAO_YY_BREAK case 5: TAO_YY_RULE_SETUP return IDL_READONLY; TAO_YY_BREAK case 6: TAO_YY_RULE_SETUP return IDL_ATTRIBUTE; TAO_YY_BREAK case 7: TAO_YY_RULE_SETUP return IDL_EXCEPTION; TAO_YY_BREAK case 8: TAO_YY_RULE_SETUP return IDL_CONTEXT; TAO_YY_BREAK case 9: TAO_YY_RULE_SETUP return IDL_INTERFACE; TAO_YY_BREAK case 10: TAO_YY_RULE_SETUP return IDL_CONST; TAO_YY_BREAK case 11: TAO_YY_RULE_SETUP return IDL_TYPEDEF; TAO_YY_BREAK case 12: TAO_YY_RULE_SETUP return IDL_STRUCT; TAO_YY_BREAK case 13: TAO_YY_RULE_SETUP return IDL_ENUM; TAO_YY_BREAK case 14: TAO_YY_RULE_SETUP return IDL_STRING; TAO_YY_BREAK case 15: TAO_YY_RULE_SETUP return IDL_WSTRING; TAO_YY_BREAK case 16: TAO_YY_RULE_SETUP return IDL_SEQUENCE; TAO_YY_BREAK case 17: TAO_YY_RULE_SETUP return IDL_UNION; TAO_YY_BREAK case 18: TAO_YY_RULE_SETUP return IDL_FIXED; TAO_YY_BREAK case 19: TAO_YY_RULE_SETUP return IDL_SWITCH; TAO_YY_BREAK case 20: TAO_YY_RULE_SETUP return IDL_CASE; TAO_YY_BREAK case 21: TAO_YY_RULE_SETUP return IDL_DEFAULT; TAO_YY_BREAK case 22: TAO_YY_RULE_SETUP return IDL_FLOAT; TAO_YY_BREAK case 23: TAO_YY_RULE_SETUP return IDL_DOUBLE; TAO_YY_BREAK case 24: TAO_YY_RULE_SETUP return IDL_LONG; TAO_YY_BREAK case 25: TAO_YY_RULE_SETUP return IDL_SHORT; TAO_YY_BREAK case 26: TAO_YY_RULE_SETUP return IDL_UNSIGNED; TAO_YY_BREAK case 27: TAO_YY_RULE_SETUP return IDL_CHAR; TAO_YY_BREAK case 28: TAO_YY_RULE_SETUP return IDL_WCHAR; TAO_YY_BREAK case 29: TAO_YY_RULE_SETUP return IDL_BOOLEAN; TAO_YY_BREAK case 30: TAO_YY_RULE_SETUP return IDL_OCTET; TAO_YY_BREAK case 31: TAO_YY_RULE_SETUP return IDL_VOID; TAO_YY_BREAK case 32: TAO_YY_RULE_SETUP return IDL_NATIVE; TAO_YY_BREAK case 33: TAO_YY_RULE_SETUP return IDL_LOCAL; TAO_YY_BREAK case 34: TAO_YY_RULE_SETUP return IDL_ABSTRACT; TAO_YY_BREAK case 35: TAO_YY_RULE_SETUP return IDL_CUSTOM; TAO_YY_BREAK case 36: TAO_YY_RULE_SETUP return IDL_FACTORY; TAO_YY_BREAK case 37: TAO_YY_RULE_SETUP return IDL_PRIVATE; TAO_YY_BREAK case 38: TAO_YY_RULE_SETUP return IDL_PUBLIC; TAO_YY_BREAK case 39: TAO_YY_RULE_SETUP return IDL_SUPPORTS; TAO_YY_BREAK case 40: TAO_YY_RULE_SETUP return IDL_TRUNCATABLE; TAO_YY_BREAK case 41: TAO_YY_RULE_SETUP return IDL_VALUETYPE; TAO_YY_BREAK case 42: TAO_YY_RULE_SETUP return IDL_COMPONENT; TAO_YY_BREAK case 43: TAO_YY_RULE_SETUP return IDL_CONSUMES; TAO_YY_BREAK case 44: TAO_YY_RULE_SETUP return IDL_EMITS; TAO_YY_BREAK case 45: TAO_YY_RULE_SETUP return IDL_EVENTTYPE; TAO_YY_BREAK case 46: TAO_YY_RULE_SETUP return IDL_FINDER; TAO_YY_BREAK case 47: TAO_YY_RULE_SETUP return IDL_GETRAISES; TAO_YY_BREAK case 48: TAO_YY_RULE_SETUP return IDL_HOME; TAO_YY_BREAK case 49: TAO_YY_RULE_SETUP return IDL_IMPORT; TAO_YY_BREAK case 50: TAO_YY_RULE_SETUP return IDL_MULTIPLE; TAO_YY_BREAK case 51: TAO_YY_RULE_SETUP return IDL_PRIMARYKEY; TAO_YY_BREAK case 52: TAO_YY_RULE_SETUP return IDL_PROVIDES; TAO_YY_BREAK case 53: TAO_YY_RULE_SETUP return IDL_PUBLISHES; TAO_YY_BREAK case 54: TAO_YY_RULE_SETUP return IDL_SETRAISES; TAO_YY_BREAK case 55: TAO_YY_RULE_SETUP return IDL_TYPEID; TAO_YY_BREAK case 56: TAO_YY_RULE_SETUP return IDL_TYPEPREFIX; TAO_YY_BREAK case 57: TAO_YY_RULE_SETUP return IDL_USES; TAO_YY_BREAK case 58: TAO_YY_RULE_SETUP return IDL_MANAGES; TAO_YY_BREAK case 59: TAO_YY_RULE_SETUP return IDL_TRUETOK; TAO_YY_BREAK case 60: TAO_YY_RULE_SETUP return IDL_FALSETOK; TAO_YY_BREAK case 61: TAO_YY_RULE_SETUP return IDL_INOUT; TAO_YY_BREAK case 62: TAO_YY_RULE_SETUP return IDL_IN; TAO_YY_BREAK case 63: TAO_YY_RULE_SETUP return IDL_OUT; TAO_YY_BREAK case 64: TAO_YY_RULE_SETUP return IDL_ONEWAY; TAO_YY_BREAK case 65: TAO_YY_RULE_SETUP return IDL_LEFT_SHIFT; TAO_YY_BREAK case 66: TAO_YY_RULE_SETUP return IDL_RIGHT_SHIFT; TAO_YY_BREAK case 67: TAO_YY_RULE_SETUP { tao_yylval.strval = (char *) "::"; return IDL_SCOPE_DELIMITOR; } TAO_YY_BREAK case 68: TAO_YY_RULE_SETUP { // Make sure that this identifier is not a C++ keyword. If it is, // prepend it with a _cxx_. Lookup in the perfect hash table for C++ // keyword and grab the mapping. BTW, the reason for the odd // regular expression is to handle EBCDIC, as well as ASCII. TAO_IDL_CPP_Keyword_Table cpp_key_tbl; const TAO_IDL_CPP_Keyword_Entry *entry = 0; if (!idl_global->preserve_cpp_keywords()) { // This check will ensure that escaped C++ keywords will be // caught and prepended with '_cxx' as non-escaped keywords // are now prepended with '_cxx_'. const char *tmp = ace_tao_yytext[0] == '_' ? ace_tao_yytext + 1 : ace_tao_yytext; entry = cpp_key_tbl.lookup (tmp, static_cast (ACE_OS::strlen (tmp))); } if (entry) { tao_yylval.strval = ACE_OS::strdup (entry->mapping_); } else { tao_yylval.strval = ACE_OS::strdup (ace_tao_yytext); } return IDENTIFIER; } TAO_YY_BREAK case 69: TAO_YY_RULE_SETUP { tao_yylval.dval = idl_atof(ace_tao_yytext); return IDL_FLOATING_PT_LITERAL; } TAO_YY_BREAK case 70: TAO_YY_RULE_SETUP { tao_yylval.dval = idl_atof(ace_tao_yytext); return IDL_FLOATING_PT_LITERAL; } TAO_YY_BREAK case 71: TAO_YY_RULE_SETUP { tao_yylval.ival = idl_atoi(ace_tao_yytext, 10); return IDL_INTEGER_LITERAL; } TAO_YY_BREAK case 72: TAO_YY_RULE_SETUP { tao_yylval.uival = idl_atoui(ace_tao_yytext, 10); return IDL_UINTEGER_LITERAL; } TAO_YY_BREAK case 73: TAO_YY_RULE_SETUP { tao_yylval.ival = idl_atoi(ace_tao_yytext, 16); return IDL_INTEGER_LITERAL; } TAO_YY_BREAK case 74: TAO_YY_RULE_SETUP { tao_yylval.uival = idl_atoui(ace_tao_yytext, 16); return IDL_UINTEGER_LITERAL; } TAO_YY_BREAK case 75: TAO_YY_RULE_SETUP { tao_yylval.ival = idl_atoi(ace_tao_yytext, 8); return IDL_INTEGER_LITERAL; } TAO_YY_BREAK case 76: TAO_YY_RULE_SETUP { tao_yylval.uival = idl_atoui(ace_tao_yytext, 8); return IDL_UINTEGER_LITERAL; } TAO_YY_BREAK case 77: TAO_YY_RULE_SETUP { /* Skip the quotes */ char *tmp = ace_tao_yytext; for(int i = strlen(tmp) - 1; i >= 0; --i) { if (isspace(tmp[i])) { tmp[i] = '\0'; } else { break; } } tmp[strlen (tmp) - 1] = '\0'; ACE_NEW_RETURN (tao_yylval.sval, UTL_String (tmp + 1), IDL_STRING_LITERAL); return IDL_STRING_LITERAL; } TAO_YY_BREAK case 78: TAO_YY_RULE_SETUP { /* Skip the bookends */ char *tmp = ACE_OS::strdup (ace_tao_yytext); tmp[strlen (tmp) - 1] = '\0'; tao_yylval.wsval = idl_wstring_escape_reader(tmp + 2); return IDL_WSTRING_LITERAL; } TAO_YY_BREAK case 79: TAO_YY_RULE_SETUP { tao_yylval.cval = ace_tao_yytext [1]; return IDL_CHARACTER_LITERAL; } TAO_YY_BREAK case 80: TAO_YY_RULE_SETUP { // octal character constant tao_yylval.cval = idl_escape_reader(ace_tao_yytext + 1); return IDL_CHARACTER_LITERAL; } TAO_YY_BREAK case 81: TAO_YY_RULE_SETUP { // hexadecimal character constant tao_yylval.cval = idl_escape_reader(ace_tao_yytext + 1); return IDL_CHARACTER_LITERAL; } TAO_YY_BREAK case 82: TAO_YY_RULE_SETUP { tao_yylval.cval = idl_escape_reader(ace_tao_yytext + 1); return IDL_CHARACTER_LITERAL; } TAO_YY_BREAK case 83: TAO_YY_RULE_SETUP { // wide character constant tao_yylval.wcval = ace_tao_yytext [2]; return IDL_WCHAR_LITERAL; } TAO_YY_BREAK case 84: TAO_YY_RULE_SETUP { // hexadecimal wide character constant tao_yylval.wcval = idl_wchar_escape_reader(ace_tao_yytext + 2); return IDL_WCHAR_LITERAL; } TAO_YY_BREAK case 85: case 86: TAO_YY_RULE_SETUP {/* remember pragma */ idl_global->set_lineno(idl_global->lineno() + 1); idl_store_pragma(ace_tao_yytext); } break; case 87: case 88: TAO_YY_RULE_SETUP {/* ignore file */ idl_global->set_lineno(idl_global->lineno() + 1); } break; case 89: case 90: TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } break; case 91: case 92: TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } break; case 93: case 94: TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } break; case 95: case 96: TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } break; case 97: case 98: TAO_YY_RULE_SETUP { /* ignore cpp ident */ idl_global->set_lineno(idl_global->lineno() + 1); } break; case 99: TAO_YY_RULE_SETUP { /* ignore comments */ idl_global->set_lineno(idl_global->lineno() + 1); } break; case 100: TAO_YY_RULE_SETUP { for(;;) { char c = tao_yyinput(); if (c == '*') { char next = tao_yyinput(); if (next == '/') break; else tao_yyunput(c, NULL); if (c == '\n') idl_global->set_lineno(idl_global->lineno() + 1); } } } break; case 101: TAO_YY_RULE_SETUP ; break; case 102: TAO_YY_RULE_SETUP { idl_global->set_lineno(idl_global->lineno() + 1); } break; case 103: TAO_YY_RULE_SETUP return ace_tao_yytext [0]; break; case 104: TAO_YY_RULE_SETUP TAO_YY_ECHO; break; case TAO_YY_STATE_EOF(INITIAL): tao_yyterminate(); case TAO_YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int tao_yy_amount_of_matched_text = (int) (tao_yy_cp - tao_yytext_ptr) - 1; /* Undo the effects of TAO_YY_DO_BEFORE_ACTION. */ *tao_yy_cp = tao_yy_hold_char; TAO_YY_RESTORE_TAO_YY_MORE_OFFSET if ( tao_yy_current_buffer->tao_yy_buffer_status == TAO_YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed tao_yyin at a new source and called * tao_yylex(). If so, then we have to assure * consistency between tao_yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ tao_yy_n_chars = tao_yy_current_buffer->tao_yy_n_chars; tao_yy_current_buffer->tao_yy_input_file = tao_yyin; tao_yy_current_buffer->tao_yy_buffer_status = TAO_YY_BUFFER_NORMAL; } /* Note that here we test for tao_yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since tao_yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( tao_yy_c_buf_p <= &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars] ) { /* This was really a NUL. */ tao_yy_state_type tao_yy_next_state; tao_yy_c_buf_p = tao_yytext_ptr + tao_yy_amount_of_matched_text; tao_yy_current_state = tao_yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * tao_yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ tao_yy_next_state = tao_yy_try_NUL_trans( tao_yy_current_state ); tao_yy_bp = tao_yytext_ptr + TAO_YY_MORE_ADJ; if ( tao_yy_next_state ) { /* Consume the NUL. */ tao_yy_cp = ++tao_yy_c_buf_p; tao_yy_current_state = tao_yy_next_state; goto tao_yy_match; } else { tao_yy_cp = tao_yy_c_buf_p; goto tao_yy_find_action; } } else switch ( tao_yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { tao_yy_did_buffer_switch_on_eof = 0; if ( tao_yywrap() ) { /* Note: because we've taken care in * tao_yy_get_next_buffer() to have set up * tao_yytext, we can now set up * tao_yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * TAO_YY_NULL, it'll still work - another * TAO_YY_NULL will get returned. */ tao_yy_c_buf_p = tao_yytext_ptr + TAO_YY_MORE_ADJ; tao_yy_act = TAO_YY_STATE_EOF(TAO_YY_START); goto do_action; } else { if ( ! tao_yy_did_buffer_switch_on_eof ) TAO_YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: tao_yy_c_buf_p = tao_yytext_ptr + tao_yy_amount_of_matched_text; tao_yy_current_state = tao_yy_get_previous_state(); tao_yy_cp = tao_yy_c_buf_p; tao_yy_bp = tao_yytext_ptr + TAO_YY_MORE_ADJ; goto tao_yy_match; case EOB_ACT_LAST_MATCH: tao_yy_c_buf_p = &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars]; tao_yy_current_state = tao_yy_get_previous_state(); tao_yy_cp = tao_yy_c_buf_p; tao_yy_bp = tao_yytext_ptr + TAO_YY_MORE_ADJ; goto tao_yy_find_action; } break; } default: TAO_YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of tao_yylex */ /* tao_yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int tao_yy_get_next_buffer() { register char *dest = tao_yy_current_buffer->tao_yy_ch_buf; register char *source = tao_yytext_ptr; register int number_to_move, i; int ret_val; if ( tao_yy_c_buf_p > &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars + 1] ) TAO_YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( tao_yy_current_buffer->tao_yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( tao_yy_c_buf_p - tao_yytext_ptr - TAO_YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (tao_yy_c_buf_p - tao_yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( tao_yy_current_buffer->tao_yy_buffer_status == TAO_YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars = 0; else { int num_to_read = tao_yy_current_buffer->tao_yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef TAO_YY_USES_REJECT TAO_YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ TAO_YY_BUFFER_STATE b = tao_yy_current_buffer; int tao_yy_c_buf_p_offset = (int) (tao_yy_c_buf_p - b->tao_yy_ch_buf); if ( b->tao_yy_is_our_buffer ) { int new_size = b->tao_yy_buf_size * 2; if ( new_size <= 0 ) b->tao_yy_buf_size += b->tao_yy_buf_size / 8; else b->tao_yy_buf_size *= 2; b->tao_yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ tao_yy_flex_realloc( (void *) b->tao_yy_ch_buf, b->tao_yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->tao_yy_ch_buf = 0; if ( ! b->tao_yy_ch_buf ) TAO_YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); tao_yy_c_buf_p = &b->tao_yy_ch_buf[tao_yy_c_buf_p_offset]; num_to_read = tao_yy_current_buffer->tao_yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > TAO_YY_READ_BUF_SIZE ) num_to_read = TAO_YY_READ_BUF_SIZE; /* Read in more data. */ TAO_YY_INPUT( (&tao_yy_current_buffer->tao_yy_ch_buf[number_to_move]), tao_yy_n_chars, num_to_read ); tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars; } if ( tao_yy_n_chars == 0 ) { if ( number_to_move == TAO_YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; tao_yyrestart( tao_yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; tao_yy_current_buffer->tao_yy_buffer_status = TAO_YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; tao_yy_n_chars += number_to_move; tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars] = TAO_YY_END_OF_BUFFER_CHAR; tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars + 1] = TAO_YY_END_OF_BUFFER_CHAR; tao_yytext_ptr = &tao_yy_current_buffer->tao_yy_ch_buf[0]; return ret_val; } /* tao_yy_get_previous_state - get the state just before the EOB char was reached */ static tao_yy_state_type tao_yy_get_previous_state() { register tao_yy_state_type tao_yy_current_state; register char *tao_yy_cp; tao_yy_current_state = tao_yy_start; tao_yy_current_state += TAO_YY_AT_BOL(); for ( tao_yy_cp = tao_yytext_ptr + TAO_YY_MORE_ADJ; tao_yy_cp < tao_yy_c_buf_p; ++tao_yy_cp ) { register TAO_YY_CHAR tao_yy_c = (*tao_yy_cp ? tao_yy_ec[TAO_YY_SC_TO_UI(*tao_yy_cp)] : 1); if ( tao_yy_accept[tao_yy_current_state] ) { tao_yy_last_accepting_state = tao_yy_current_state; tao_yy_last_accepting_cpos = tao_yy_cp; } while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; if ( tao_yy_current_state >= 551 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; } return tao_yy_current_state; } /* tao_yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = tao_yy_try_NUL_trans( current_state ); */ #ifdef TAO_YY_USE_PROTOS static tao_yy_state_type tao_yy_try_NUL_trans( tao_yy_state_type tao_yy_current_state ) #else static tao_yy_state_type tao_yy_try_NUL_trans( tao_yy_current_state ) tao_yy_state_type tao_yy_current_state; #endif { register int tao_yy_is_jam; register char *tao_yy_cp = tao_yy_c_buf_p; register TAO_YY_CHAR tao_yy_c = 1; if ( tao_yy_accept[tao_yy_current_state] ) { tao_yy_last_accepting_state = tao_yy_current_state; tao_yy_last_accepting_cpos = tao_yy_cp; } while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; if ( tao_yy_current_state >= 551 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; tao_yy_is_jam = (tao_yy_current_state == 550); return tao_yy_is_jam ? 0 : tao_yy_current_state; } #ifndef TAO_YY_NO_UNPUT #ifdef TAO_YY_USE_PROTOS static void tao_yyunput( int c, register char *tao_yy_bp ) #else static void tao_yyunput( c, tao_yy_bp ) int c; register char *tao_yy_bp; #endif { register char *tao_yy_cp = tao_yy_c_buf_p; /* undo effects of setting up tao_yytext */ *tao_yy_cp = tao_yy_hold_char; if ( tao_yy_cp < tao_yy_current_buffer->tao_yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = tao_yy_n_chars + 2; register char *dest = &tao_yy_current_buffer->tao_yy_ch_buf[ tao_yy_current_buffer->tao_yy_buf_size + 2]; register char *source = &tao_yy_current_buffer->tao_yy_ch_buf[number_to_move]; while ( source > tao_yy_current_buffer->tao_yy_ch_buf ) *--dest = *--source; tao_yy_cp += (int) (dest - source); tao_yy_bp += (int) (dest - source); tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars = tao_yy_current_buffer->tao_yy_buf_size; if ( tao_yy_cp < tao_yy_current_buffer->tao_yy_ch_buf + 2 ) TAO_YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--tao_yy_cp = (char) c; tao_yytext_ptr = tao_yy_bp; tao_yy_hold_char = *tao_yy_cp; tao_yy_c_buf_p = tao_yy_cp; } #endif /* ifndef TAO_YY_NO_UNPUT */ #ifdef __cplusplus static int tao_yyinput() #else static int input() #endif { int c; *tao_yy_c_buf_p = tao_yy_hold_char; if ( *tao_yy_c_buf_p == TAO_YY_END_OF_BUFFER_CHAR ) { /* tao_yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( tao_yy_c_buf_p < &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars] ) /* This was really a NUL. */ *tao_yy_c_buf_p = '\0'; else { /* need more input */ int offset = tao_yy_c_buf_p - tao_yytext_ptr; ++tao_yy_c_buf_p; switch ( tao_yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because tao_yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ tao_yyrestart( tao_yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( tao_yywrap() ) return EOF; if ( ! tao_yy_did_buffer_switch_on_eof ) TAO_YY_NEW_FILE; #ifdef __cplusplus return tao_yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: tao_yy_c_buf_p = tao_yytext_ptr + offset; break; } } } c = *(unsigned char *) tao_yy_c_buf_p; /* cast for 8-bit char's */ *tao_yy_c_buf_p = '\0'; /* preserve tao_yytext */ tao_yy_hold_char = *++tao_yy_c_buf_p; tao_yy_current_buffer->tao_yy_at_bol = (c == '\n'); return c; } #ifdef TAO_YY_USE_PROTOS void tao_yyrestart( FILE *input_file ) #else void tao_yyrestart( input_file ) FILE *input_file; #endif { if ( ! tao_yy_current_buffer ) tao_yy_current_buffer = tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); tao_yy_init_buffer( tao_yy_current_buffer, input_file ); tao_yy_load_buffer_state(); } #ifdef TAO_YY_USE_PROTOS void tao_yy_switch_to_buffer( TAO_YY_BUFFER_STATE new_buffer ) #else void tao_yy_switch_to_buffer( new_buffer ) TAO_YY_BUFFER_STATE new_buffer; #endif { if ( tao_yy_current_buffer == new_buffer ) return; if ( tao_yy_current_buffer ) { /* Flush out information for old buffer. */ *tao_yy_c_buf_p = tao_yy_hold_char; tao_yy_current_buffer->tao_yy_buf_pos = tao_yy_c_buf_p; tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars; } tao_yy_current_buffer = new_buffer; tao_yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (tao_yywrap()) processing, but the only time this flag * is looked at is after tao_yywrap() is called, so it's safe * to go ahead and always set it. */ tao_yy_did_buffer_switch_on_eof = 1; } #ifdef TAO_YY_USE_PROTOS void tao_yy_load_buffer_state( void ) #else void tao_yy_load_buffer_state() #endif { tao_yy_n_chars = tao_yy_current_buffer->tao_yy_n_chars; tao_yytext_ptr = tao_yy_c_buf_p = tao_yy_current_buffer->tao_yy_buf_pos; tao_yyin = tao_yy_current_buffer->tao_yy_input_file; tao_yy_hold_char = *tao_yy_c_buf_p; } #ifdef TAO_YY_USE_PROTOS TAO_YY_BUFFER_STATE tao_yy_create_buffer( FILE *file, int size ) #else TAO_YY_BUFFER_STATE tao_yy_create_buffer( file, size ) FILE *file; int size; #endif { TAO_YY_BUFFER_STATE b; b = (TAO_YY_BUFFER_STATE) tao_yy_flex_alloc( sizeof( struct tao_yy_buffer_state ) ); if ( ! b ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_create_buffer()" ); b->tao_yy_buf_size = size; /* tao_yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->tao_yy_ch_buf = (char *) tao_yy_flex_alloc( b->tao_yy_buf_size + 2 ); if ( ! b->tao_yy_ch_buf ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_create_buffer()" ); b->tao_yy_is_our_buffer = 1; tao_yy_init_buffer( b, file ); return b; } #ifdef TAO_YY_USE_PROTOS void tao_yy_delete_buffer( TAO_YY_BUFFER_STATE b ) #else void tao_yy_delete_buffer( b ) TAO_YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == tao_yy_current_buffer ) tao_yy_current_buffer = (TAO_YY_BUFFER_STATE) 0; if ( b->tao_yy_is_our_buffer ) tao_yy_flex_free( (void *) b->tao_yy_ch_buf ); tao_yy_flex_free( (void *) b ); } #ifndef TAO_YY_ALWAYS_INTERACTIVE #ifndef TAO_YY_NEVER_INTERACTIVE extern int isatty TAO_YY_PROTO(( int )); #endif #endif #ifdef TAO_YY_USE_PROTOS void tao_yy_init_buffer( TAO_YY_BUFFER_STATE b, FILE *file ) #else void tao_yy_init_buffer( b, file ) TAO_YY_BUFFER_STATE b; FILE *file; #endif { tao_yy_flush_buffer( b ); b->tao_yy_input_file = file; b->tao_yy_fill_buffer = 1; #ifdef TAO_YY_ALWAYS_INTERACTIVE b->tao_yy_is_interactive = 1; #else #ifdef TAO_YY_NEVER_INTERACTIVE b->tao_yy_is_interactive = 0; #else b->tao_yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef TAO_YY_USE_PROTOS void tao_yy_flush_buffer( TAO_YY_BUFFER_STATE b ) #else void tao_yy_flush_buffer( b ) TAO_YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->tao_yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->tao_yy_ch_buf[0] = TAO_YY_END_OF_BUFFER_CHAR; b->tao_yy_ch_buf[1] = TAO_YY_END_OF_BUFFER_CHAR; b->tao_yy_buf_pos = &b->tao_yy_ch_buf[0]; b->tao_yy_at_bol = 1; b->tao_yy_buffer_status = TAO_YY_BUFFER_NEW; if ( b == tao_yy_current_buffer ) tao_yy_load_buffer_state(); } #ifndef TAO_YY_NO_SCAN_BUFFER #ifdef TAO_YY_USE_PROTOS TAO_YY_BUFFER_STATE tao_yy_scan_buffer( char *base, tao_yy_size_t size ) #else TAO_YY_BUFFER_STATE tao_yy_scan_buffer( base, size ) char *base; tao_yy_size_t size; #endif { TAO_YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != TAO_YY_END_OF_BUFFER_CHAR || base[size-1] != TAO_YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (TAO_YY_BUFFER_STATE) tao_yy_flex_alloc( sizeof( struct tao_yy_buffer_state ) ); if ( ! b ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_scan_buffer()" ); b->tao_yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->tao_yy_buf_pos = b->tao_yy_ch_buf = base; b->tao_yy_is_our_buffer = 0; b->tao_yy_input_file = 0; b->tao_yy_n_chars = b->tao_yy_buf_size; b->tao_yy_is_interactive = 0; b->tao_yy_at_bol = 1; b->tao_yy_fill_buffer = 0; b->tao_yy_buffer_status = TAO_YY_BUFFER_NEW; tao_yy_switch_to_buffer( b ); return b; } #endif #ifndef TAO_YY_NO_SCAN_STRING #ifdef TAO_YY_USE_PROTOS TAO_YY_BUFFER_STATE tao_yy_scan_string( tao_yyconst char *tao_yy_str ) #else TAO_YY_BUFFER_STATE tao_yy_scan_string( tao_yy_str ) tao_yyconst char *tao_yy_str; #endif { int len; for ( len = 0; tao_yy_str[len]; ++len ) ; return tao_yy_scan_bytes( tao_yy_str, len ); } #endif #ifndef TAO_YY_NO_SCAN_BYTES #ifdef TAO_YY_USE_PROTOS TAO_YY_BUFFER_STATE tao_yy_scan_bytes( tao_yyconst char *bytes, int len ) #else TAO_YY_BUFFER_STATE tao_yy_scan_bytes( bytes, len ) tao_yyconst char *bytes; int len; #endif { TAO_YY_BUFFER_STATE b; char *buf; tao_yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) tao_yy_flex_alloc( n ); if ( ! buf ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = TAO_YY_END_OF_BUFFER_CHAR; b = tao_yy_scan_buffer( buf, n ); if ( ! b ) TAO_YY_FATAL_ERROR( "bad buffer in tao_yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->tao_yy_is_our_buffer = 1; return b; } #endif #ifndef TAO_YY_NO_PUSH_STATE #ifdef TAO_YY_USE_PROTOS static void tao_yy_push_state( int new_state ) #else static void tao_yy_push_state( new_state ) int new_state; #endif { if ( tao_yy_start_stack_ptr >= tao_yy_start_stack_depth ) { tao_yy_size_t new_size; tao_yy_start_stack_depth += TAO_YY_START_STACK_INCR; new_size = tao_yy_start_stack_depth * sizeof( int ); if ( ! tao_yy_start_stack ) tao_yy_start_stack = (int *) tao_yy_flex_alloc( new_size ); else tao_yy_start_stack = (int *) tao_yy_flex_realloc( (void *) tao_yy_start_stack, new_size ); if ( ! tao_yy_start_stack ) TAO_YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } tao_yy_start_stack[tao_yy_start_stack_ptr++] = TAO_YY_START; BEGIN(new_state); } #endif #ifndef TAO_YY_NO_POP_STATE static void tao_yy_pop_state() { if ( --tao_yy_start_stack_ptr < 0 ) TAO_YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(tao_yy_start_stack[tao_yy_start_stack_ptr]); } #endif #ifndef TAO_YY_NO_TOP_STATE static int tao_yy_top_state() { return tao_yy_start_stack[tao_yy_start_stack_ptr - 1]; } #endif #ifndef TAO_YY_EXIT_FAILURE #define TAO_YY_EXIT_FAILURE 2 #endif #ifdef TAO_YY_USE_PROTOS static void tao_yy_fatal_error( tao_yyconst char msg[] ) #else static void tao_yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( TAO_YY_EXIT_FAILURE ); } /* Redefine tao_yyless() so it works in section 3 code. */ #undef tao_yyless #define tao_yyless(n) \ do \ { \ /* Undo effects of setting up tao_yytext. */ \ tao_yytext[tao_yyleng] = tao_yy_hold_char; \ tao_yy_c_buf_p = tao_yytext + n; \ tao_yy_hold_char = *tao_yy_c_buf_p; \ *tao_yy_c_buf_p = '\0'; \ tao_yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef tao_yytext_ptr #ifdef TAO_YY_USE_PROTOS static void tao_yy_flex_strncpy( char *s1, tao_yyconst char *s2, int n ) #else static void tao_yy_flex_strncpy( s1, s2, n ) char *s1; tao_yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef TAO_YY_NEED_STRLEN #ifdef TAO_YY_USE_PROTOS static int tao_yy_flex_strlen( tao_yyconst char *s ) #else static int tao_yy_flex_strlen( s ) tao_yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef TAO_YY_USE_PROTOS static void *tao_yy_flex_alloc( tao_yy_size_t size ) #else static void *tao_yy_flex_alloc( size ) tao_yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef TAO_YY_USE_PROTOS static void *tao_yy_flex_realloc( void *ptr, tao_yy_size_t size ) #else static void *tao_yy_flex_realloc( ptr, size ) void *ptr; tao_yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef TAO_YY_USE_PROTOS static void tao_yy_flex_free( void *ptr ) #else static void tao_yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #ifdef TAO_YY_MAIN int main() { tao_yylex(); return 0; } #endif /* subroutines */ // Parse a #line statement generated by the C preprocessor static void idl_parse_line_and_file (char *buf) { char *r = buf; char *h = 0; UTL_String *nm = 0; // Skip initial '#'. if (*r != '#') { return; } else { r++; } // Check to see if we're running under the screwy Microsoft scheme // of putting #line num instead of #num. if (ACE_OS::strncmp (r, "line", 4) == 0) { r += 5; } // Find line number. while (isspace (*r)) { r++; } h = r; for (; isdigit (*r); r++) { continue; } *r++ = 0; idl_global->set_lineno ((long) idl_atoui (h, 10)); // Find file name, if present. for (; *r != '"'; r++) { if (*r == '\n' || *r == '\0') { return; } } h = ++r; for (; *r != '"'; r++) { continue; } *r = 0; UTL_String *tmp = 0; if (*h == '\0') { ACE_ERROR ((LM_ERROR, ACE_TEXT ("IDL: No input files\n"))); ACE_OS::exit (99); } else { long i; long j; // Put Microsoft-style pathnames into a canonical form. for (i = 0, j = 0; h[j] != '\0'; i++, j++) { if (h[j] == '\\' && h[j + 1] == '\\') { j++; } h[i] = h[j]; } h[i] = '\0'; ACE_NEW (tmp, UTL_String (h)); idl_global->update_prefix (tmp->get_string ()); idl_global->set_filename (tmp); } UTL_String *fname = idl_global->filename (); idl_bool in_main_file = I_FALSE; idl_bool is_real_filename = fname->compare (idl_global->real_filename ()); idl_bool is_main_filename = I_FALSE; if (!is_real_filename) { is_main_filename = fname->compare (idl_global->main_filename ()); } if (is_real_filename || is_main_filename) { in_main_file = I_TRUE; } idl_global->set_in_main_file (in_main_file); // Strip off any command line -I prefix that may have been added // by the preprocessor. if (!(idl_global->in_main_file ()) && idl_global->import ()) { ACE_NEW ( nm, UTL_String ( idl_global->stripped_preproc_include (fname->get_string ()) ) ); // This call also manages the #pragma prefix. idl_global->store_include_file_name (nm); } } // Store a #pragma line into the list of pragmas static void idl_store_pragma (char *buf) { char *sp = buf + 1; int crunched = 0; // Remove all the blanks between the '#' and the 'pragma'. while (*sp != 'p') { ++sp; ++crunched; } char *tp = buf + 1; // This copies the crunched string back to the original, and // also compensates for the behavior of the Sun preprocessor, // which put spaces around the double colons of a non-quoted // scoped name, a case which is possible in #pragma version. while (*sp != '\n') { if (*sp == ' ' && *(sp + 1) == ':') { ++crunched; } else if (*sp == ':' && *(sp + 1) == ' ') { *tp = *sp; ++crunched; ++sp; ++tp; } else { *tp = *sp; ++tp; } ++sp; } // The '\n' is still spaces too far away, with // garbage characters in between. sp -= crunched; *sp = '\0'; if (ACE_OS::strstr (buf + 8, "import") != 0) { idl_global->set_import (I_TRUE); return; } if (ACE_OS::strstr (buf + 8, "include") != 0) { idl_global->set_import (I_FALSE); return; } if (ACE_OS::strncmp (buf + 8, "prefix", 6) == 0) { char *new_prefix = idl_get_pragma_string (buf); if (new_prefix != 0) { unsigned long depth = idl_global->scopes ().depth (); // At global scope, we always replace the prefix. For all // other scopes, we replace only if there is a prefix already // associated with that scope, otherwise we add the prefix. if (depth == 1 || idl_global->scopes ().top ()->has_prefix ()) { char *trash = 0; idl_global->pragma_prefixes ().pop (trash); delete [] trash; } UTL_Scope *top_scope = idl_global->scopes ().top (); if (depth > 1) { top_scope->has_prefix (I_TRUE); ScopeAsDecl (top_scope)->prefix_scope (top_scope); } idl_global->pragma_prefixes ().push (new_prefix); if (idl_global->in_main_file ()) { idl_global->root ()->prefix (new_prefix); idl_global->root ()->set_imported (I_FALSE); top_scope->has_prefix (I_TRUE); } ACE_CString ext_id; ext_id.set (idl_global->filename ()->get_string (), 0); char *int_id = ACE::strnew (new_prefix); (void) idl_global->file_prefixes ().rebind (ext_id, int_id); } } else if (ACE_OS::strncmp (buf + 8, "version", 7) == 0) { char *tmp = buf + 16; while (*tmp == ' ' || *tmp == '\t') { ++tmp; } char *number = ACE_OS::strchr (tmp, ' '); if (number == 0) { number = ACE_OS::strchr (tmp, '\t'); } while (*number == ' ' || *number == '\t') { ++number; } size_t len = ACE_OS::strlen (number); // For some reason, the SunCC preprocessor adds a trailing space, which // messes with idl_valid_version() below, so we check and remove. while (number[len - 1] == ' ') { number[len - 1] = '\0'; len = ACE_OS::strlen (number); } // This call adds a proper null terminator to tmp, so no need to // do it here. AST_Decl *d = idl_find_node (tmp); if (d == 0) { return; } if (!idl_valid_version (number)) { idl_global->err ()->version_number_error (number); return; } d->version (ACE::strnew (number)); } else if (ACE_OS::strncmp (buf + 8, "ident", 5) == 0) { idl_global->ident_string (buf + 8); } else if (ACE_OS::strncmp (buf + 8, "ID", 2) == 0) { char *tmp = buf + 11; while (*tmp == ' ') { ++tmp; } AST_Decl *d = idl_find_node (tmp); if (d == 0) { return; } char *new_id = idl_get_pragma_string (buf); if (new_id != 0) { if (d->typeid_set ()) { idl_global->err ()->id_reset_error (d->repoID (), new_id); return; } d->repoID (new_id); d->typeid_set (I_TRUE); } } } /* * idl_atoi - Convert a string of digits into a negative integer according to base b */ static long idl_atoi(char *s, long b) { long r = 0; s++; if (b == 8 && *s == '0') { s++; } else if (b == 16 && *s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X')) { s += 2; } for (; *s; ++s) { if (*s <= '9' && *s >= '0') { r = (r * b) + (*s - '0'); } else if (b > 10 && *s <= 'f' && *s >= 'a') { r = (r * b) + (*s - 'a' + 10); } else if (b > 10 && *s <= 'F' && *s >= 'A') { r = (r * b) + (*s - 'A' + 10); } else { break; } } return -r; } /* * idl_atoui - Convert a string of digits into an unsigned integer according to base b */ static ACE_UINT64 idl_atoui(char *s, long b) { ACE_UINT64 r = 0; if (b == 8 && *s == '0') { s++; } else if (b == 16 && *s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X')) { s += 2; } for (; *s; ++s) { if (*s <= '9' && *s >= '0') { r = (r * b) + (*s - '0'); } else if (b > 10 && *s <= 'f' && *s >= 'a') { r = (r * b) + (*s - 'a' + 10); } else if (b > 10 && *s <= 'F' && *s >= 'A') { r = (r * b) + (*s - 'A' + 10); } else { break; } } return r; } /* * Convert a string to a float; atof doesn't seem to work, always. */ static double idl_atof (char *s) { double d = 0.0; double e, k; long neg = 0, negexp = 0; if (*s == '-') { neg = 1; s++; } while (*s >= '0' && *s <= '9') { d = (d * 10) + *s - '0'; s++; } if (*s == '.') { s++; e = 10; while (*s >= '0' && *s <= '9') { d += (*s - '0') / (e * 1.0); e *= 10; s++; } } if (*s == 'e' || *s == 'E') { s++; if (*s == '-') { negexp = 1; s++; } else if (*s == '+') { s++; } e = 0; while (*s >= '0' && *s <= '9') { e = (e * 10) + *s - '0'; s++; } if (e > 0) { for (k = 1; e > 0; k *= 10, e--); if (negexp) { d /= k; } else { d *= k; } } } if (neg) { d *= -1.0; } return d; } /* * Convert (some) escaped characters into their ascii values */ static char idl_escape_reader( char *str ) { if (str[0] != '\\') { return str[0]; } switch (str[1]) { case 'n': return '\n'; case 't': return '\t'; case 'v': return '\v'; case 'b': return '\b'; case 'r': return '\r'; case 'f': return '\f'; case 'a': return '\a'; case '\\': return '\\'; case '\?': return '?'; case '\'': return '\''; case '"': return '"'; case 'x': { int i; // hex value for (i = 2; str[i] != '\0' && isxdigit(str[i]); ++i) { continue; } char save = str[i]; str[i] = '\0'; char out = (char)idl_atoui(&str[2], 16); str[i] = save; return out; } ACE_NOTREACHED (break;) default: // check for octal value if (str[1] >= '0' && str[1] <= '7') { int i; for (i = 1; str[i] >= '0' && str[i] <= '7'; ++i) { continue; } char save = str[i]; str[i] = '\0'; char out = (char)idl_atoui(&str[1], 8); str[i] = save; return out; } else { return str[1] - 'a'; } ACE_NOTREACHED (break;) } } /* * Convert escaped hex digits into a wchar */ static ACE_CDR::WChar idl_wchar_escape_reader (char *str) { if (str[0] != '\\' || str[1] != 'u') { return 0; } int i; // get the hex digits for (i = 2; str[i] != '\0' && isxdigit (str[i]); i++) { continue; } char save = str[i]; str[i] = '\0'; ACE_CDR::WChar out = (ACE_CDR::WChar) idl_atoui (&str[2], 16); str[i] = save; return out; } /* * Checks wstring for validity */ static char * idl_wstring_escape_reader (char *str) { return str; } static char * idl_get_pragma_string (char *pragma) { // Get pointers to each end of the substring between the quotes. const char *start = ACE_OS::strchr (pragma, '"') + 1; const char *end = ACE_OS::strchr (start, '"'); if (end == 0) { idl_global->err ()->syntax_error ( IDL_GlobalData::PS_PragmaPrefixSyntax ); return 0; } int len = end - start; char *retval = 0; ACE_NEW_RETURN (retval, char[len + 1], 0); ACE_OS::strncpy (retval, start, len); retval[len] = '\0'; return retval; } static idl_bool idl_valid_version (char *s) { // Nothing preceding decimal point. if (*s == '.') { return 0; } char *minor = ACE_OS::strchr (s, '.'); int i; if (minor == 0) { // No decimal point. return 0; } if (*(minor + 1) == '\0') { // Nothing following decimal point. return 0; } char *tmp = minor + 1; for (i = 0; tmp[i] != '\0'; ++i) { if (!isdigit (tmp[i])) { return 0; } } int len = minor - s; for (i = 0; i < len; ++i) { if (!isdigit (s[i])) { return 0; } } // Major and minor version numbers must be unsigned shorts. if (ACE_OS::atoi (minor + 1) > ACE_UINT16_MAX || ACE_OS::atoi (s) > ACE_UINT16_MAX) { return 0; } return 1; } static AST_Decl * idl_find_node (char *s) { UTL_ScopedName *node = idl_global->string_to_scoped_name (s); AST_Decl *d = 0; if (node != 0) { d = idl_global->scopes ().top_non_null ()->lookup_by_name (node, I_TRUE); } if (d == 0) { idl_global->err ()->lookup_error (node); node->destroy (); delete node; node = 0; } return d; }