From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c | 3516 +++++++++++++++++++++++ 1 file changed, 3516 insertions(+) create mode 100644 src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c (limited to 'src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c') diff --git a/src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c new file mode 100644 index 00000000..3d54d443 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c @@ -0,0 +1,3516 @@ +#line 2 "dt_lex.c" +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define 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 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 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 YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *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 ) + * 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 yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, 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 yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int 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 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 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 yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as 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 yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE 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 YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +#define YY_FLEX_LEX_COMPAT +extern int yylineno; +int yylineno = 1; +extern char yytext[]; + + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + if ( yyleng + yy_more_offset >= YYLMAX ) \ + YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ + yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \ + yyleng += yy_more_offset; \ + yy_prev_more_offset = yy_more_offset; \ + yy_more_offset = 0; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 162 +#define YY_END_OF_BUFFER 163 +static yyconst short int yy_acclist[740] = + { 0, + 163, 162, 149, 162, 147, 149, 162, 147, 162, 126, + 149, 162, 149, 162,16469, 149, 162, 124, 149, 162, + 109, 149, 162, 149, 162,16472, 100, 149, 162, 101, + 149, 162, 123, 149, 162, 121, 149, 162, 145, 149, + 162, 122, 149, 162, 129, 149, 162, 99, 149, 162, + 81, 84, 149, 162, 81, 84, 149, 162, 128, 149, + 162, 146, 149, 162, 115, 149, 162, 131, 149, 162, + 117, 149, 162, 127, 149, 162, 80, 149, 162, 78, + 149, 162, 102, 149, 162, 149, 162, 103, 149, 162, + 108, 149, 162, 78, 149, 162, 78, 149, 162, 78, + + 149, 162, 78, 149, 162, 78, 149, 162, 78, 149, + 162, 78, 149, 162, 78, 149, 162, 78, 149, 162, + 78, 149, 162, 78, 149, 162, 78, 149, 162, 78, + 149, 162, 78, 149, 162, 78, 149, 162, 78, 149, + 162, 78, 149, 162, 78, 149, 162, 104, 149, 162, + 107, 149, 162, 106, 149, 162, 125, 149, 162, 147, + 149, 162, 94, 149, 162, 152, 162, 152, 162, 152, + 162, 157, 162, 156, 157, 162, 156, 162, 153, 157, + 162, 155, 157, 162, 154, 157, 162, 82, 157, 162, + 82, 157, 162, 153, 157, 162, 153, 157, 162, 153, + + 157, 162, 153, 157, 162, 153, 157, 162, 153, 157, + 162, 153, 157, 162, 153, 157, 162, 153, 157, 162, + 153, 157, 162, 153, 157, 162, 153, 157, 162, 153, + 157, 162, 105, 157, 162, 156, 157, 162, 95, 157, + 162, 160, 161, 162, 159, 161, 162, 158, 162, 161, + 162,16469, 83, 160, 161, 162, 83, 160, 161, 162, + 97, 162, 98, 162, 97, 162, 96, 97, 162, 114, + 16469, 8277, 86, 75, 77, 136, 110, 137,16472, 8280, + 89, 134, 142, 132, 143, 133, 130, 84, 90, 135, + 84, 81, 84, 84, 81, 84, 81, 119, 116, 113, + + 118, 120, 79, 78, 148, 138, 111, 78, 78, 78, + 78, 78, 78, 9, 78, 78, 78, 78, 78, 78, + 78, 17, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 139, 112, 94, 92, 151, 150, 153, 91, 82, + 82, 82, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 95, 93, 160, 159,16469, 87, 83, + 160, 83, 160, 83, 160, 160, 96, 74, 76, 77, + 144, 84, 84, 81, 81, 81, 140, 141, 79, 78, + + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 15, 78, 78, 78, 78, 20, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 92, 82, 82, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 56, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 93, 83, 160, 83, 160, 76, 1, 78, 78, + 3, 78, 4, 78, 78, 78, 78, 78, 78, 11, + 78, 12, 78, 78, 78, 16, 78, 78, 78, 21, + + 78, 78, 78, 78, 78, 78, 78, 28, 78, 78, + 78, 78, 78, 78, 78, 78, 37, 78, 78, 78, + 78, 78, 42, 78, 78, 78, 78, 46, 153, 47, + 153, 153, 153, 153, 51, 153, 153, 153, 153, 153, + 57, 153, 153, 153, 153, 61, 153, 153, 153, 153, + 153, 153, 67, 153, 153, 153, 153, 153, 72, 153, + 153, 2, 78, 5, 78, 78, 78, 78, 78, 78, + 14, 78, 78, 78, 78, 23, 78, 78, 78, 78, + 78, 29, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 40, 78, 78, 78, 44, 78, 45, 78, 48, + + 153, 153, 153, 153, 53, 153, 153, 153, 153, 153, + 153, 62, 153, 153, 153, 153, 153, 153, 153, 70, + 153, 153, 153, 78, 78, 78, 10, 78, 13, 78, + 18, 78, 19, 78, 78, 78, 78, 78, 27, 78, + 30, 78, 31, 78, 32, 78, 33, 78, 35, 78, + 36, 78, 78, 78, 78, 78, 153, 50, 153, 52, + 153, 54, 153, 55, 153, 153, 153, 153, 63, 153, + 64, 153, 65, 153, 66, 153, 153, 153, 153, 153, + 78, 7, 78, 8, 78, 78, 78, 78, 78, 78, + 78, 39, 78, 78, 78, 49, 153, 153, 153, 153, + + 153, 69, 153, 153, 153, 6, 78, 22, 78, 24, + 78, 25, 78, 26, 78, 34, 78, 78, 41, 78, + 43, 78, 58, 153, 59, 153, 60, 153, 153, 71, + 153, 73, 153, 78, 153, 38, 78, 68, 153 + } ; + +static yyconst short int yy_accept[511] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 3, 5, 8, 10, 13, 16, + 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, + 48, 51, 55, 59, 62, 65, 68, 71, 74, 77, + 80, 83, 86, 88, 91, 94, 97, 100, 103, 106, + 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, + 139, 142, 145, 148, 151, 154, 157, 160, 163, 166, + 168, 170, 172, 174, 177, 179, 182, 185, 188, 191, + 194, 197, 200, 203, 206, 209, 212, 215, 218, 221, + 224, 227, 230, 233, 236, 239, 242, 245, 248, 250, + + 253, 257, 261, 263, 265, 267, 270, 271, 272, 273, + 274, 274, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 282, 283, 284, 285, 286, 287, 288, 288, 289, + 290, 291, 292, 294, 294, 295, 297, 298, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 316, 317, 318, 319, 320, + 321, 322, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 353, 354, 355, 356, 357, 358, 359, + + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 374, 375, 376, 377, 378, + 379, 380, 380, 382, 384, 386, 387, 387, 388, 389, + 390, 391, 392, 393, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 414, 415, 416, 417, 419, 420, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 456, 457, 458, 459, 460, 461, + + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 475, 477, 478, 480, 481, 483, 485, 486, + 487, 488, 489, 490, 492, 494, 495, 496, 498, 499, + 500, 502, 503, 504, 505, 506, 507, 508, 510, 511, + 512, 513, 514, 515, 516, 517, 519, 520, 521, 522, + 523, 525, 526, 527, 528, 530, 532, 533, 534, 535, + 537, 538, 539, 540, 541, 543, 544, 545, 546, 548, + 549, 550, 551, 552, 553, 555, 556, 557, 558, 559, + 561, 562, 564, 566, 567, 568, 569, 570, 571, 573, + 574, 575, 576, 578, 579, 580, 581, 582, 584, 585, + + 586, 587, 588, 589, 590, 591, 592, 594, 595, 596, + 598, 600, 602, 603, 604, 605, 607, 608, 609, 610, + 611, 612, 614, 615, 616, 617, 618, 619, 620, 622, + 623, 624, 625, 626, 627, 629, 631, 633, 635, 636, + 637, 638, 639, 641, 643, 645, 647, 649, 651, 653, + 654, 655, 656, 657, 658, 660, 662, 664, 666, 667, + 668, 669, 671, 673, 675, 677, 678, 679, 680, 681, + 682, 684, 686, 687, 688, 689, 690, 691, 692, 694, + 695, 696, 698, 699, 700, 701, 702, 704, 705, 706, + 708, 710, 712, 714, 716, 718, 719, 721, 723, 725, + + 727, 729, 730, 732, 734, 735, 736, 738, 740, 740 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 29, 29, 29, 30, 31, + 32, 32, 32, 32, 32, 33, 32, 32, 32, 32, + 32, 32, 32, 32, 34, 32, 32, 35, 32, 32, + 36, 37, 38, 39, 32, 40, 41, 42, 43, 44, + + 45, 46, 47, 48, 49, 32, 50, 51, 52, 53, + 54, 55, 32, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 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 yyconst int yy_meta[69] = + { 0, + 1, 2, 3, 1, 4, 2, 1, 5, 1, 1, + 1, 1, 1, 4, 1, 1, 4, 4, 1, 6, + 6, 4, 1, 1, 1, 1, 4, 1, 7, 7, + 7, 8, 8, 8, 8, 4, 4, 4, 1, 9, + 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 1, 1, 1, 1 + } ; + +static yyconst short int yy_base[530] = + { 0, + 0, 0, 0, 67, 56, 57, 76, 143, 145, 150, + 811, 152, 813, 815, 815, 815, 815, 787, 143, 152, + 786, 151, 164, 815, 815, 785, 143, 815, 152, 161, + 149, 184, 122, 815, 815, 48, 784, 160, 815, 0, + 0, 815, 805, 815, 158, 748, 750, 146, 144, 137, + 141, 751, 157, 750, 757, 746, 756, 163, 175, 747, + 745, 750, 746, 815, 166, 815, 815, 218, 791, 815, + 776, 780, 815, 815, 815, 0, 815, 779, 206, 216, + 733, 159, 737, 180, 739, 192, 735, 732, 742, 203, + 199, 733, 731, 815, 251, 779, 0, 781, 815, 253, + + 243, 249, 815, 815, 264, 815, 815, 278, 815, 815, + 779, 252, 259, 0, 815, 815, 815, 282, 815, 815, + 778, 815, 815, 815, 815, 815, 815, 762, 266, 815, + 815, 283, 239, 303, 815, 183, 255, 0, 754, 815, + 815, 815, 753, 0, 0, 815, 815, 815, 719, 731, + 718, 733, 169, 727, 713, 714, 711, 711, 714, 711, + 708, 0, 710, 240, 711, 717, 708, 274, 710, 706, + 245, 254, 710, 709, 716, 701, 273, 113, 706, 713, + 815, 815, 331, 748, 0, 815, 815, 0, 815, 306, + 256, 292, 0, 694, 710, 201, 691, 690, 690, 693, + + 691, 284, 692, 690, 149, 692, 688, 694, 295, 691, + 698, 683, 288, 295, 345, 732, 0, 0, 734, 347, + 815, 732, 328, 308, 321, 368, 353, 815, 343, 0, + 0, 815, 350, 346, 371, 815, 323, 335, 815, 815, + 0, 680, 692, 687, 675, 318, 677, 688, 686, 682, + 674, 680, 683, 0, 669, 668, 672, 0, 673, 662, + 340, 669, 659, 657, 669, 658, 660, 667, 653, 344, + 652, 652, 655, 662, 652, 656, 660, 662, 651, 643, + 0, 815, 372, 646, 643, 641, 644, 654, 643, 649, + 652, 638, 642, 0, 643, 629, 639, 629, 640, 629, + + 631, 625, 359, 625, 628, 635, 625, 629, 633, 635, + 0, 0, 412, 0, 0, 625, 0, 0, 616, 624, + 614, 612, 619, 0, 0, 613, 610, 0, 611, 613, + 0, 620, 619, 614, 605, 605, 604, 0, 601, 613, + 603, 607, 602, 611, 610, 0, 595, 607, 597, 602, + 0, 590, 602, 601, 0, 0, 587, 586, 592, 0, + 586, 583, 584, 586, 0, 589, 580, 580, 0, 577, + 589, 584, 579, 588, 0, 573, 585, 575, 580, 0, + 568, 0, 0, 572, 579, 572, 577, 568, 0, 562, + 574, 560, 0, 573, 558, 566, 561, 0, 569, 566, + + 568, 563, 551, 560, 556, 561, 0, 552, 555, 0, + 0, 0, 558, 557, 548, 0, 542, 554, 554, 529, + 527, 0, 501, 501, 423, 411, 417, 422, 0, 413, + 416, 405, 406, 403, 0, 0, 0, 0, 406, 414, + 407, 408, 0, 0, 0, 0, 396, 0, 0, 408, + 402, 402, 393, 384, 0, 0, 0, 0, 394, 393, + 394, 0, 0, 0, 0, 395, 389, 389, 379, 384, + 0, 0, 382, 371, 370, 367, 378, 363, 0, 376, + 374, 0, 360, 359, 349, 332, 0, 341, 333, 0, + 0, 0, 0, 0, 0, 323, 0, 0, 0, 0, + + 0, 319, 0, 0, 302, 137, 0, 0, 815, 471, + 480, 489, 498, 507, 512, 521, 524, 527, 533, 542, + 551, 555, 559, 563, 565, 573, 577, 584, 588 + } ; + +static yyconst short int yy_def[530] = + { 0, + 510, 510, 509, 3, 511, 511, 509, 7, 512, 512, + 513, 513, 509, 509, 509, 509, 509, 509, 514, 515, + 509, 509, 516, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 32, 509, 509, 509, 509, 509, 509, 517, + 518, 509, 509, 509, 509, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 519, 509, 509, 509, 509, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 509, 509, 509, 520, 509, 509, 521, + + 520, 520, 509, 509, 509, 509, 509, 514, 509, 509, + 514, 522, 509, 523, 509, 509, 509, 516, 509, 509, + 516, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 32, 509, 509, 509, 509, 524, 509, 509, + 509, 509, 509, 525, 518, 509, 509, 509, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 509, 509, 509, 509, 526, 509, 509, 519, 509, 509, + 509, 509, 527, 519, 519, 519, 519, 519, 519, 519, + + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 509, 509, 528, 520, 509, 521, + 509, 521, 520, 520, 520, 520, 509, 509, 509, 529, + 523, 509, 509, 509, 509, 509, 509, 524, 509, 509, + 525, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 526, 509, 527, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 528, 520, 520, 529, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 519, 519, 519, 519, 519, 519, 519, 519, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 519, 519, + + 519, 519, 519, 519, 518, 519, 518, 519, 0, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509 + } ; + +static yyconst short int yy_nxt[884] = + { 0, + 15, 16, 17, 16, 18, 19, 15, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, + 41, 41, 41, 41, 41, 42, 43, 44, 45, 41, + 46, 47, 48, 49, 50, 51, 52, 41, 53, 41, + 54, 41, 41, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 41, 41, 64, 65, 66, 67, 68, 71, + 71, 139, 140, 69, 72, 72, 73, 74, 75, 74, + 76, 73, 73, 76, 73, 73, 73, 73, 73, 76, + 73, 77, 76, 76, 78, 79, 80, 76, 73, 73, + + 73, 73, 76, 73, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 73, 73, 81, 76, 82, 83, + 84, 85, 76, 76, 86, 76, 87, 76, 76, 76, + 88, 89, 90, 91, 92, 93, 76, 76, 76, 76, + 94, 73, 73, 73, 95, 109, 98, 99, 110, 96, + 100, 98, 99, 105, 104, 100, 509, 123, 106, 112, + 116, 277, 130, 278, 101, 102, 119, 124, 125, 101, + 102, 113, 113, 131, 120, 117, 126, 127, 128, 111, + 129, 129, 147, 509, 142, 143, 151, 156, 154, 157, + 181, 159, 508, 152, 160, 297, 148, 155, 158, 153, + + 121, 132, 162, 133, 133, 298, 195, 169, 163, 164, + 170, 171, 196, 134, 135, 236, 136, 137, 138, 183, + 172, 246, 174, 173, 184, 190, 190, 247, 134, 135, + 175, 182, 198, 236, 136, 190, 190, 176, 191, 192, + 193, 199, 137, 201, 202, 138, 210, 206, 191, 192, + 207, 208, 215, 286, 211, 109, 191, 216, 221, 287, + 209, 212, 223, 223, 192, 227, 191, 193, 223, 223, + 228, 229, 229, 509, 192, 224, 225, 226, 113, 113, + 109, 224, 225, 110, 119, 129, 129, 237, 282, 222, + 257, 267, 120, 224, 269, 134, 135, 258, 135, 224, + + 509, 225, 233, 233, 226, 237, 282, 225, 268, 270, + 134, 135, 134, 135, 111, 135, 135, 234, 121, 234, + 262, 275, 235, 235, 191, 190, 190, 134, 135, 276, + 263, 264, 183, 135, 293, 302, 307, 184, 191, 192, + 312, 294, 191, 309, 308, 310, 215, 223, 223, 109, + 303, 216, 221, 224, 227, 236, 191, 507, 312, 228, + 224, 225, 229, 229, 192, 235, 235, 237, 137, 233, + 233, 224, 506, 236, 319, 320, 505, 504, 224, 134, + 135, 333, 135, 222, 503, 237, 225, 313, 313, 502, + 235, 235, 343, 137, 134, 135, 313, 313, 313, 334, + + 135, 135, 344, 135, 191, 192, 501, 373, 313, 313, + 313, 313, 313, 313, 500, 499, 135, 374, 498, 497, + 496, 135, 191, 495, 494, 493, 492, 491, 490, 489, + 192, 313, 313, 488, 487, 486, 485, 484, 483, 482, + 313, 313, 313, 481, 224, 225, 480, 479, 478, 477, + 476, 475, 313, 313, 313, 313, 313, 313, 474, 473, + 472, 471, 224, 470, 469, 468, 467, 466, 465, 464, + 225, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 103, 103, + + 103, 103, 103, 103, 103, 103, 103, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 114, 114, 114, 114, + 114, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 144, 144, 145, 145, 145, 145, 188, 188, 188, 188, + 188, 188, 218, 463, 462, 218, 218, 218, 218, 218, + 218, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 230, 230, 230, 230, 231, 231, 231, 231, 238, 238, + 241, 241, 241, 281, 281, 461, 281, 281, 281, 281, + 281, 281, 283, 283, 311, 311, 460, 311, 311, 311, + 311, 311, 311, 314, 314, 314, 314, 459, 458, 457, + + 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, + 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, + 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, + 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, + 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, + 406, 405, 404, 403, 402, 401, 400, 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, 372, 371, 370, 369, 368, 367, 366, 365, + 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, + + 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, + 342, 341, 340, 339, 338, 337, 336, 335, 332, 331, + 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, + 318, 317, 316, 315, 509, 219, 217, 306, 305, 304, + 301, 300, 299, 296, 295, 292, 291, 290, 289, 288, + 285, 284, 185, 280, 279, 274, 273, 272, 271, 266, + 265, 261, 260, 259, 256, 255, 254, 253, 252, 251, + 250, 249, 248, 245, 244, 243, 242, 240, 239, 232, + 509, 509, 219, 217, 214, 213, 205, 204, 203, 200, + 197, 194, 189, 187, 186, 185, 180, 179, 178, 177, + + 168, 167, 166, 165, 161, 150, 149, 146, 141, 122, + 115, 107, 509, 104, 13, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509 + } ; + +static yyconst short int yy_chk[884] = + { 0, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, + 6, 36, 36, 4, 5, 6, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 8, 19, 9, 9, 19, 8, + 9, 10, 10, 12, 12, 10, 33, 27, 12, 20, + 22, 178, 31, 178, 9, 9, 23, 27, 29, 10, + 10, 20, 20, 31, 23, 22, 29, 29, 30, 19, + 30, 30, 45, 33, 38, 38, 48, 50, 49, 50, + 65, 51, 506, 48, 51, 205, 45, 49, 50, 48, + + 23, 32, 53, 32, 32, 205, 82, 58, 53, 53, + 58, 58, 82, 32, 32, 136, 32, 32, 32, 68, + 58, 153, 59, 58, 68, 79, 79, 153, 32, 32, + 59, 65, 84, 136, 32, 80, 80, 59, 79, 79, + 79, 84, 32, 86, 86, 32, 91, 90, 80, 80, + 90, 90, 95, 196, 91, 100, 79, 95, 100, 196, + 90, 91, 101, 101, 79, 105, 80, 79, 102, 102, + 105, 112, 112, 133, 80, 101, 101, 101, 113, 113, + 108, 102, 102, 108, 118, 129, 129, 137, 191, 100, + 164, 171, 118, 101, 172, 129, 129, 164, 129, 102, + + 133, 101, 132, 132, 101, 137, 191, 102, 171, 172, + 129, 129, 132, 132, 108, 132, 129, 134, 118, 134, + 168, 177, 134, 134, 192, 190, 190, 132, 132, 177, + 168, 168, 183, 132, 202, 209, 213, 183, 190, 190, + 224, 202, 192, 214, 213, 214, 215, 223, 223, 220, + 209, 215, 220, 225, 227, 237, 190, 505, 224, 227, + 223, 223, 229, 229, 190, 234, 234, 238, 238, 233, + 233, 225, 502, 237, 246, 246, 496, 489, 223, 233, + 233, 261, 233, 220, 488, 238, 223, 226, 226, 486, + 235, 235, 270, 238, 233, 233, 226, 226, 226, 261, + + 233, 235, 270, 235, 283, 283, 485, 303, 226, 226, + 226, 226, 226, 226, 484, 483, 235, 303, 481, 480, + 478, 235, 283, 477, 476, 475, 474, 473, 470, 469, + 283, 313, 313, 468, 467, 466, 461, 460, 459, 454, + 313, 313, 313, 453, 313, 313, 452, 451, 450, 447, + 442, 441, 313, 313, 313, 313, 313, 313, 440, 439, + 434, 433, 313, 432, 431, 430, 428, 427, 426, 425, + 313, 510, 510, 510, 510, 510, 510, 510, 510, 510, + 511, 511, 511, 511, 511, 511, 511, 511, 511, 512, + 512, 512, 512, 512, 512, 512, 512, 512, 513, 513, + + 513, 513, 513, 513, 513, 513, 513, 514, 514, 514, + 514, 514, 514, 514, 514, 514, 515, 515, 515, 515, + 515, 516, 516, 516, 516, 516, 516, 516, 516, 516, + 517, 517, 518, 518, 518, 518, 519, 519, 519, 519, + 519, 519, 520, 424, 423, 520, 520, 520, 520, 520, + 520, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 522, 522, 522, 522, 523, 523, 523, 523, 524, 524, + 525, 525, 525, 526, 526, 421, 526, 526, 526, 526, + 526, 526, 527, 527, 528, 528, 420, 528, 528, 528, + 528, 528, 528, 529, 529, 529, 529, 419, 418, 417, + + 415, 414, 413, 409, 408, 406, 405, 404, 403, 402, + 401, 400, 399, 397, 396, 395, 394, 392, 391, 390, + 388, 387, 386, 385, 384, 381, 379, 378, 377, 376, + 374, 373, 372, 371, 370, 368, 367, 366, 364, 363, + 362, 361, 359, 358, 357, 354, 353, 352, 350, 349, + 348, 347, 345, 344, 343, 342, 341, 340, 339, 337, + 336, 335, 334, 333, 332, 330, 329, 327, 326, 323, + 322, 321, 320, 319, 316, 310, 309, 308, 307, 306, + 305, 304, 302, 301, 300, 299, 298, 297, 296, 295, + 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, + + 280, 279, 278, 277, 276, 275, 274, 273, 272, 271, + 269, 268, 267, 266, 265, 264, 263, 262, 260, 259, + 257, 256, 255, 253, 252, 251, 250, 249, 248, 247, + 245, 244, 243, 242, 222, 219, 216, 212, 211, 210, + 208, 207, 206, 204, 203, 201, 200, 199, 198, 197, + 195, 194, 184, 180, 179, 176, 175, 174, 173, 170, + 169, 167, 166, 165, 163, 161, 160, 159, 158, 157, + 156, 155, 154, 152, 151, 150, 149, 143, 139, 128, + 121, 111, 98, 96, 93, 92, 89, 88, 87, 85, + 83, 81, 78, 72, 71, 69, 63, 62, 61, 60, + + 57, 56, 55, 54, 52, 47, 46, 43, 37, 26, + 21, 18, 13, 11, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +static int yy_looking_for_trail_begin = 0; +static int yy_full_lp; +static int *yy_full_state; +#define YY_TRAILING_MASK 0x2000 +#define YY_TRAILING_HEAD_MASK 0x4000 +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ +yy_state_ptr = yy_full_state; /* restore orig. state */ \ +yy_current_state = *yy_state_ptr; /* restore curr. state */ \ +++yy_lp; \ +goto find_rule; \ +} +static int yy_more_offset = 0; +static int yy_prev_more_offset = 0; +#define yymore() (yy_more_offset = yy_flex_strlen( yytext )) +#define YY_NEED_STRLEN +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET \ + { \ + yy_more_offset = yy_prev_more_offset; \ + yyleng -= yy_more_offset; \ + } +#ifndef YYLMAX +#define YYLMAX 8192 +#endif + +char yytext[YYLMAX]; +char *yytext_ptr; +#line 1 "dt_lex.l" +#define INITIAL 0 +#line 2 "dt_lex.l" +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +#ifndef VBOX +#include +#include +#include +#include +#include +#include +#else /* VBOX */ +# ifdef RT_OS_WINDOWS /* No unistd.h on windows, avoid redef warnings of the [U]INTxx_MAX defines caused by no inttypes.h/stdint.h. */ +# define YY_NO_UNISTD_H +# undef INT8_MAX +# undef INT16_MAX +# undef INT32_MAX +# undef INT64_MAX +# undef UINT8_MAX +# undef UINT16_MAX +# undef UINT32_MAX +# undef UINT64_MAX +# endif +# ifdef _MSC_VER +# pragma warning(disable:4668 4131 4255) +# endif +# ifdef __GNUC__ +# if ((__GNUC__ << 16) + __GNUC_MINOR__) >= 0x40002 +# pragma GCC diagnostic ignored "-Wunused-function" +# endif +# endif +# include +# include +# define isdigit(a_ch) RT_C_IS_DIGIT(a_ch) +#endif /* VBOX */ + +#include +#include +#include +#include + +#ifndef USING_FLEX +/* + * We need to undefine lex's input and unput macros so that references to these + * call the functions provided at the end of this source file. + */ +#undef input +#undef unput +#else /* USING_FLEX */ +# define YY_INPUT(buf, result, max_size) \ + do { \ + if (yypcb->pcb_fileptr != NULL) { \ + result = (int)fread(buf, 1, max_size, yypcb->pcb_fileptr); \ + if (!result && ferror(yypcb->pcb_fileptr)) \ + longjmp(yypcb->pcb_jmpbuf, EDT_FIO); \ + /*YY_FATAL_ERROR("input in flex scanner failed");*/ \ + } else { \ + size_t off = yypcb->pcb_strptr - yypcb->pcb_string; \ + if (off < yypcb->pcb_strlen) { \ + off = yypcb->pcb_strlen - off; \ + result = max_size; \ + if ((size_t)result > off) \ + result = (int)off; \ + memcpy(buf, yypcb->pcb_strptr, result); \ + yypcb->pcb_strptr += result; \ + /*fprintf(stderr, "yy_input -> %d '%.*s'\n", result, result, buf);*/ \ + } else { \ + buf[0] = '\0'; \ + result = 0; \ + /*fprintf(stderr, "yy_input -> %d\n", result);*/ \ + } \ + } \ + } while (0) +#endif /* USING_FLEX */ + +static int id_or_type(const char *); +#ifndef USING_FLEX +static int input(void); +static void unput(int); +#endif + +/* + * We first define a set of labeled states for use in the D lexer and then a + * set of regular expressions to simplify things below. The lexer states are: + * + * S0 - D program clause and expression lexing + * S1 - D comments (i.e. skip everything until end of comment) + * S2 - D program outer scope (probe specifiers and declarations) + * S3 - D control line parsing (i.e. after ^# is seen but before \n) + * S4 - D control line scan (locate control directives only and invoke S3) + */ +#define S0 1 +#define S1 2 +#define S2 3 +#define S3 4 +#define S4 5 + +#line 968 "dt_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#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 YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 132 "dt_lex.l" + + + + +/* + * We insert a special prologue into yylex() itself: if the pcb contains a + * context token, we return that prior to running the normal lexer. This + * allows libdtrace to force yacc into one of our three parsing contexts: D + * expression (DT_CTX_DEXPR), D program (DT_CTX_DPROG) or D type (DT_CTX_DTYPE). + * Once the token is returned, we clear it so this only happens once. + */ +if (yypcb->pcb_token != 0) { + int tok = yypcb->pcb_token; + yypcb->pcb_token = 0; + return (tok); +} + + + +#line 1142 "dt_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 510 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_current_state != 509 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + yy_looking_for_trail_begin ) + { + if ( yy_act == yy_looking_for_trail_begin ) + { + yy_looking_for_trail_begin = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; + yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + } + else + { + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + break; + } + ++yy_lp; + goto find_rule; + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; + } + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 151 "dt_lex.l" +return (DT_KEY_AUTO); + YY_BREAK +case 2: +YY_RULE_SETUP +#line 152 "dt_lex.l" +return (DT_KEY_BREAK); + YY_BREAK +case 3: +YY_RULE_SETUP +#line 153 "dt_lex.l" +return (DT_KEY_CASE); + YY_BREAK +case 4: +YY_RULE_SETUP +#line 154 "dt_lex.l" +return (DT_KEY_CHAR); + YY_BREAK +case 5: +YY_RULE_SETUP +#line 155 "dt_lex.l" +return (DT_KEY_CONST); + YY_BREAK +case 6: +YY_RULE_SETUP +#line 156 "dt_lex.l" +return (DT_KEY_CONTINUE); + YY_BREAK +case 7: +YY_RULE_SETUP +#line 157 "dt_lex.l" +return (DT_KEY_COUNTER); + YY_BREAK +case 8: +YY_RULE_SETUP +#line 158 "dt_lex.l" +return (DT_KEY_DEFAULT); + YY_BREAK +case 9: +YY_RULE_SETUP +#line 159 "dt_lex.l" +return (DT_KEY_DO); + YY_BREAK +case 10: +YY_RULE_SETUP +#line 160 "dt_lex.l" +return (DT_KEY_DOUBLE); + YY_BREAK +case 11: +YY_RULE_SETUP +#line 161 "dt_lex.l" +return (DT_KEY_ELSE); + YY_BREAK +case 12: +YY_RULE_SETUP +#line 162 "dt_lex.l" +return (DT_KEY_ENUM); + YY_BREAK +case 13: +YY_RULE_SETUP +#line 163 "dt_lex.l" +return (DT_KEY_EXTERN); + YY_BREAK +case 14: +YY_RULE_SETUP +#line 164 "dt_lex.l" +return (DT_KEY_FLOAT); + YY_BREAK +case 15: +YY_RULE_SETUP +#line 165 "dt_lex.l" +return (DT_KEY_FOR); + YY_BREAK +case 16: +YY_RULE_SETUP +#line 166 "dt_lex.l" +return (DT_KEY_GOTO); + YY_BREAK +case 17: +YY_RULE_SETUP +#line 167 "dt_lex.l" +return (DT_KEY_IF); + YY_BREAK +case 18: +YY_RULE_SETUP +#line 168 "dt_lex.l" +return (DT_KEY_IMPORT); + YY_BREAK +case 19: +YY_RULE_SETUP +#line 169 "dt_lex.l" +return (DT_KEY_INLINE); + YY_BREAK +case 20: +YY_RULE_SETUP +#line 170 "dt_lex.l" +return (DT_KEY_INT); + YY_BREAK +case 21: +YY_RULE_SETUP +#line 171 "dt_lex.l" +return (DT_KEY_LONG); + YY_BREAK +case 22: +YY_RULE_SETUP +#line 172 "dt_lex.l" +return (DT_TOK_OFFSETOF); + YY_BREAK +case 23: +YY_RULE_SETUP +#line 173 "dt_lex.l" +return (DT_KEY_PROBE); + YY_BREAK +case 24: +YY_RULE_SETUP +#line 174 "dt_lex.l" +return (DT_KEY_PROVIDER); + YY_BREAK +case 25: +YY_RULE_SETUP +#line 175 "dt_lex.l" +return (DT_KEY_REGISTER); + YY_BREAK +case 26: +YY_RULE_SETUP +#line 176 "dt_lex.l" +return (DT_KEY_RESTRICT); + YY_BREAK +case 27: +YY_RULE_SETUP +#line 177 "dt_lex.l" +return (DT_KEY_RETURN); + YY_BREAK +case 28: +YY_RULE_SETUP +#line 178 "dt_lex.l" +return (DT_KEY_SELF); + YY_BREAK +case 29: +YY_RULE_SETUP +#line 179 "dt_lex.l" +return (DT_KEY_SHORT); + YY_BREAK +case 30: +YY_RULE_SETUP +#line 180 "dt_lex.l" +return (DT_KEY_SIGNED); + YY_BREAK +case 31: +YY_RULE_SETUP +#line 181 "dt_lex.l" +return (DT_TOK_SIZEOF); + YY_BREAK +case 32: +YY_RULE_SETUP +#line 182 "dt_lex.l" +return (DT_KEY_STATIC); + YY_BREAK +case 33: +YY_RULE_SETUP +#line 183 "dt_lex.l" +return (DT_KEY_STRING); + YY_BREAK +case 34: +YY_RULE_SETUP +#line 184 "dt_lex.l" +return (DT_TOK_STRINGOF); + YY_BREAK +case 35: +YY_RULE_SETUP +#line 185 "dt_lex.l" +return (DT_KEY_STRUCT); + YY_BREAK +case 36: +YY_RULE_SETUP +#line 186 "dt_lex.l" +return (DT_KEY_SWITCH); + YY_BREAK +case 37: +YY_RULE_SETUP +#line 187 "dt_lex.l" +return (DT_KEY_THIS); + YY_BREAK +case 38: +YY_RULE_SETUP +#line 188 "dt_lex.l" +return (DT_KEY_XLATOR); + YY_BREAK +case 39: +YY_RULE_SETUP +#line 189 "dt_lex.l" +return (DT_KEY_TYPEDEF); + YY_BREAK +case 40: +YY_RULE_SETUP +#line 190 "dt_lex.l" +return (DT_KEY_UNION); + YY_BREAK +case 41: +YY_RULE_SETUP +#line 191 "dt_lex.l" +return (DT_KEY_UNSIGNED); + YY_BREAK +case 42: +YY_RULE_SETUP +#line 192 "dt_lex.l" +return (DT_KEY_VOID); + YY_BREAK +case 43: +YY_RULE_SETUP +#line 193 "dt_lex.l" +return (DT_KEY_VOLATILE); + YY_BREAK +case 44: +YY_RULE_SETUP +#line 194 "dt_lex.l" +return (DT_KEY_WHILE); + YY_BREAK +case 45: +YY_RULE_SETUP +#line 195 "dt_lex.l" +return (DT_TOK_XLATE); + YY_BREAK +case 46: +YY_RULE_SETUP +#line 197 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_AUTO); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 198 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_CHAR); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 199 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_CONST); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 200 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_COUNTER); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 201 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_DOUBLE); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 202 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_ENUM); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 203 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_EXTERN); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 204 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_FLOAT); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 205 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_IMPORT); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 206 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_INLINE); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 207 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_INT); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 208 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_LONG); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 209 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_PROVIDER); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 210 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_REGISTER); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 211 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_RESTRICT); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 212 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_SELF); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 213 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_SHORT); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 214 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_SIGNED); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 215 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_STATIC); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 216 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_STRING); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 217 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_STRUCT); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 218 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_THIS); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 219 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_XLATOR); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 220 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_TYPEDEF); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 221 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_UNION); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 222 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_UNSIGNED); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 223 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_VOID); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 224 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_VOLATILE); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 226 "dt_lex.l" +{ + int i = atoi(yytext + 2); + char *v = ""; + + /* + * A macro argument reference substitutes the text of + * an argument in place of the current token. When we + * see $$ we fetch the saved string from pcb_sargv + * (or use the default argument if the option has been + * set and the argument hasn't been specified) and + * return a token corresponding to this string. + */ + if (i < 0 || (i >= yypcb->pcb_sargc && + !(yypcb->pcb_cflags & DTRACE_C_DEFARG))) { + xyerror(D_MACRO_UNDEF, "macro argument %s is " + "not defined\n", yytext); + } + + if (i < yypcb->pcb_sargc) { + v = yypcb->pcb_sargv[i]; /* get val from pcb */ + yypcb->pcb_sflagv[i] |= DT_IDFLG_REF; + } + + if ((yylval.l_str = strdup(v)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + (void) stresc2chr(yylval.l_str); + return (DT_TOK_STRING); + } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 256 "dt_lex.l" +{ + int i = atoi(yytext + 1); + char *p, *v = "0"; + + /* + * A macro argument reference substitutes the text of + * one identifier or integer pattern for another. When + * we see $ we fetch the saved string from pcb_sargv + * (or use the default argument if the option has been + * set and the argument hasn't been specified) and + * return a token corresponding to this string. + */ + if (i < 0 || (i >= yypcb->pcb_sargc && + !(yypcb->pcb_cflags & DTRACE_C_DEFARG))) { + xyerror(D_MACRO_UNDEF, "macro argument %s is " + "not defined\n", yytext); + } + + if (i < yypcb->pcb_sargc) { + v = yypcb->pcb_sargv[i]; /* get val from pcb */ + yypcb->pcb_sflagv[i] |= DT_IDFLG_REF; + } + + /* + * If the macro text is not a valid integer or ident, + * then we treat it as a string. The string may be + * optionally enclosed in quotes, which we strip. + */ + if (strbadidnum(v)) { + size_t len = strlen(v); + + if (len != 1 && *v == '"' && v[len - 1] == '"') + yylval.l_str = strndup(v + 1, len - 2); + else + yylval.l_str = strndup(v, len); + + if (yylval.l_str == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + (void) stresc2chr(yylval.l_str); + return (DT_TOK_STRING); + } + + /* + * If the macro text is not a string an begins with a + * digit or a +/- sign, process it as an integer token. + */ + if (isdigit(v[0]) || v[0] == '-' || v[0] == '+') { +#ifdef VBOX + int rc; +#endif + if (isdigit(v[0])) + yyintprefix = 0; + else + yyintprefix = *v++; + +#ifndef VBOX + errno = 0; + yylval.l_int = strtoull(v, &p, 0); + (void) strncpy(yyintsuffix, p, + sizeof (yyintsuffix)); +#else + rc = RTStrToUInt64Ex(v, &p, 0, &yylval.l_int); + RTStrCopy(yyintsuffix, sizeof(yyintsuffix), p); +#endif + yyintdecimal = *v != '0'; + +#ifndef VBOX + if (errno == ERANGE) +#else + if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED) +#endif + xyerror(D_MACRO_OFLOW, "macro argument" + " %s constant %s results in integer" + " overflow\n", yytext, v); + + return (DT_TOK_INT); + } + + return (id_or_type(v)); + } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 337 "dt_lex.l" +{ + dt_ident_t *idp = dt_idhash_lookup( + yypcb->pcb_hdl->dt_macros, yytext + 2); + + char s[16]; /* enough for UINT_MAX + \0 */ + + if (idp == NULL) { + xyerror(D_MACRO_UNDEF, "macro variable %s " + "is not defined\n", yytext); + } + + /* + * For the moment, all current macro variables are of + * type id_t (refer to dtrace_update() for details). + */ + (void) snprintf(s, sizeof (s), "%u", idp->di_id); + if ((yylval.l_str = strdup(s)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + return (DT_TOK_STRING); + } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 359 "dt_lex.l" +{ + dt_ident_t *idp = dt_idhash_lookup( + yypcb->pcb_hdl->dt_macros, yytext + 1); + + if (idp == NULL) { + xyerror(D_MACRO_UNDEF, "macro variable %s " + "is not defined\n", yytext); + } + + /* + * For the moment, all current macro variables are of + * type id_t (refer to dtrace_update() for details). + */ + yylval.l_int = (intmax_t)(int)idp->di_id; + yyintprefix = 0; + yyintsuffix[0] = '\0'; + yyintdecimal = 1; + + return (DT_TOK_INT); + } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 380 "dt_lex.l" +{ + return (id_or_type(yytext)); + } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 384 "dt_lex.l" +{ + if ((yylval.l_str = strdup(yytext)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + return (DT_TOK_AGG); + } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 390 "dt_lex.l" +{ + if ((yylval.l_str = strdup("@_")) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + return (DT_TOK_AGG); + } + YY_BREAK +case 81: +#line 397 "dt_lex.l" +case 82: +#line 398 "dt_lex.l" +case 83: +YY_RULE_SETUP +#line 398 "dt_lex.l" +{ + char *p; + +#ifndef VBOX + errno = 0; + yylval.l_int = strtoull(yytext, &p, 0); + (void) strncpy(yyintsuffix, p, sizeof (yyintsuffix)); +#else + int rc = RTStrToUInt64Ex(yytext, &p, 0, &yylval.l_int); + RTStrCopy(yyintsuffix, sizeof(yyintsuffix), p); +#endif + yyintprefix = 0; + yyintdecimal = yytext[0] != '0'; + +#ifndef VBOX + if (errno == ERANGE) +#else + if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED) +#endif + xyerror(D_INT_OFLOW, "constant %s results in " + "integer overflow\n", yytext); + + if (*p != '\0' && strchr("uUlL", *p) == NULL) { + xyerror(D_INT_DIGIT, "constant %s contains " + "invalid digit %c\n", yytext, *p); + } + + if ((YYSTATE) != S3) + return (DT_TOK_INT); + + yypragma = dt_node_link(yypragma, + dt_node_int(yylval.l_int)); + } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 431 "dt_lex.l" +yyerror("floating-point constants are not permitted\n"); + YY_BREAK +/* VBOX changed: +\"{RGX_STR}$ | +\"{RGX_STR}$ xyerror(D_STR_NL, "newline encountered in string literal"); + input: */ +case 85: +YY_RULE_SETUP +#line 437 "dt_lex.l" +xyerror(D_STR_NL, "newline encountered in string literal"); + YY_BREAK +case 86: +#line 440 "dt_lex.l" +case 87: +YY_RULE_SETUP +#line 440 "dt_lex.l" +{ + /* + * Quoted string -- convert C escape sequences and + * return the string as a token. + */ + yylval.l_str = strndup(yytext + 1, yyleng - 2); + + if (yylval.l_str == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + (void) stresc2chr(yylval.l_str); + if ((YYSTATE) != S3) + return (DT_TOK_STRING); + + yypragma = dt_node_link(yypragma, + dt_node_string(yylval.l_str)); + } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 458 "dt_lex.l" +xyerror(D_CHR_NL, "newline encountered in character constant"); + YY_BREAK +case 89: +YY_RULE_SETUP +#line 460 "dt_lex.l" +{ + char *s, *p, *q; + size_t nbytes; + + /* + * Character constant -- convert C escape sequences and + * return the character as an integer immediate value. + */ + if (yyleng == 2) + xyerror(D_CHR_NULL, "empty character constant"); + + s = yytext + 1; + yytext[yyleng - 1] = '\0'; + nbytes = stresc2chr(s); + yylval.l_int = 0; + yyintprefix = 0; + yyintsuffix[0] = '\0'; + yyintdecimal = 1; + + if (nbytes > sizeof (yylval.l_int)) { + xyerror(D_CHR_OFLOW, "character constant is " + "too long"); + } +#ifdef _LITTLE_ENDIAN + p = ((char *)&yylval.l_int) + nbytes - 1; + for (q = s; nbytes != 0; nbytes--) + *p-- = *q++; +#else + bcopy(s, ((char *)&yylval.l_int) + + sizeof (yylval.l_int) - nbytes, nbytes); +#endif + return (DT_TOK_INT); + } + YY_BREAK +case 90: +#line 495 "dt_lex.l" +case 91: +YY_RULE_SETUP +#line 495 "dt_lex.l" +{ + yypcb->pcb_cstate = (YYSTATE); + BEGIN(S1); + } + YY_BREAK +case 92: +#line 501 "dt_lex.l" +case 93: +YY_RULE_SETUP +#line 501 "dt_lex.l" +; /* discard any #! lines */ + YY_BREAK +case 94: +#line 504 "dt_lex.l" +case 95: +#line 505 "dt_lex.l" +case 96: +YY_RULE_SETUP +#line 505 "dt_lex.l" +{ + assert(yypragma == NULL); + yypcb->pcb_cstate = (YYSTATE); + BEGIN(S3); + } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 511 "dt_lex.l" +; /* discard */ + YY_BREAK +case 98: +YY_RULE_SETUP +#line 512 "dt_lex.l" +; /* discard */ + YY_BREAK +case 99: +YY_RULE_SETUP +#line 514 "dt_lex.l" +{ + int c, tok; + + /* + * The use of "/" as the predicate delimiter and as the + * integer division symbol requires special lookahead + * to avoid a shift/reduce conflict in the D grammar. + * We look ahead to the next non-whitespace character. + * If we encounter EOF, ";", "{", or "/", then this "/" + * closes the predicate and we return DT_TOK_EPRED. + * If we encounter anything else, it's DT_TOK_DIV. + */ + while ((c = input()) != 0) { + if (strchr("\f\n\r\t\v ", c) == NULL) + break; + } + + if (c == 0 || c == ';' || c == '{' || c == '/') { + if (yypcb->pcb_parens != 0) { + yyerror("closing ) expected in " + "predicate before /\n"); + } + if (yypcb->pcb_brackets != 0) { + yyerror("closing ] expected in " + "predicate before /\n"); + } + tok = DT_TOK_EPRED; + } else + tok = DT_TOK_DIV; + + if (c != EOF) unput(c); + return (tok); + } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 548 "dt_lex.l" +{ + yypcb->pcb_parens++; + return (DT_TOK_LPAR); + } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 553 "dt_lex.l" +{ + if (--yypcb->pcb_parens < 0) + yyerror("extra ) in input stream\n"); + return (DT_TOK_RPAR); + } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 559 "dt_lex.l" +{ + yypcb->pcb_brackets++; + return (DT_TOK_LBRAC); + } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 564 "dt_lex.l" +{ + if (--yypcb->pcb_brackets < 0) + yyerror("extra ] in input stream\n"); + return (DT_TOK_RBRAC); + } + YY_BREAK +case 104: +#line 571 "dt_lex.l" +case 105: +YY_RULE_SETUP +#line 571 "dt_lex.l" +{ + yypcb->pcb_braces++; + return ('{'); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 576 "dt_lex.l" +{ + if (--yypcb->pcb_braces < 0) + yyerror("extra } in input stream\n"); + return ('}'); + } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 582 "dt_lex.l" +return (DT_TOK_BOR); + YY_BREAK +case 108: +YY_RULE_SETUP +#line 583 "dt_lex.l" +return (DT_TOK_XOR); + YY_BREAK +case 109: +YY_RULE_SETUP +#line 584 "dt_lex.l" +return (DT_TOK_BAND); + YY_BREAK +case 110: +YY_RULE_SETUP +#line 585 "dt_lex.l" +return (DT_TOK_LAND); + YY_BREAK +case 111: +YY_RULE_SETUP +#line 586 "dt_lex.l" +return (DT_TOK_LXOR); + YY_BREAK +case 112: +YY_RULE_SETUP +#line 587 "dt_lex.l" +return (DT_TOK_LOR); + YY_BREAK +case 113: +YY_RULE_SETUP +#line 588 "dt_lex.l" +return (DT_TOK_EQU); + YY_BREAK +case 114: +YY_RULE_SETUP +#line 589 "dt_lex.l" +return (DT_TOK_NEQ); + YY_BREAK +case 115: +YY_RULE_SETUP +#line 590 "dt_lex.l" +return (DT_TOK_LT); + YY_BREAK +case 116: +YY_RULE_SETUP +#line 591 "dt_lex.l" +return (DT_TOK_LE); + YY_BREAK +case 117: +YY_RULE_SETUP +#line 592 "dt_lex.l" +return (DT_TOK_GT); + YY_BREAK +case 118: +YY_RULE_SETUP +#line 593 "dt_lex.l" +return (DT_TOK_GE); + YY_BREAK +case 119: +YY_RULE_SETUP +#line 594 "dt_lex.l" +return (DT_TOK_LSH); + YY_BREAK +case 120: +YY_RULE_SETUP +#line 595 "dt_lex.l" +return (DT_TOK_RSH); + YY_BREAK +case 121: +YY_RULE_SETUP +#line 596 "dt_lex.l" +return (DT_TOK_ADD); + YY_BREAK +case 122: +YY_RULE_SETUP +#line 597 "dt_lex.l" +return (DT_TOK_SUB); + YY_BREAK +case 123: +YY_RULE_SETUP +#line 598 "dt_lex.l" +return (DT_TOK_MUL); + YY_BREAK +case 124: +YY_RULE_SETUP +#line 599 "dt_lex.l" +return (DT_TOK_MOD); + YY_BREAK +case 125: +YY_RULE_SETUP +#line 600 "dt_lex.l" +return (DT_TOK_BNEG); + YY_BREAK +case 126: +YY_RULE_SETUP +#line 601 "dt_lex.l" +return (DT_TOK_LNEG); + YY_BREAK +case 127: +YY_RULE_SETUP +#line 602 "dt_lex.l" +return (DT_TOK_QUESTION); + YY_BREAK +case 128: +YY_RULE_SETUP +#line 603 "dt_lex.l" +return (DT_TOK_COLON); + YY_BREAK +case 129: +YY_RULE_SETUP +#line 604 "dt_lex.l" +return (DT_TOK_DOT); + YY_BREAK +case 130: +YY_RULE_SETUP +#line 605 "dt_lex.l" +return (DT_TOK_PTR); + YY_BREAK +case 131: +YY_RULE_SETUP +#line 606 "dt_lex.l" +return (DT_TOK_ASGN); + YY_BREAK +case 132: +YY_RULE_SETUP +#line 607 "dt_lex.l" +return (DT_TOK_ADD_EQ); + YY_BREAK +case 133: +YY_RULE_SETUP +#line 608 "dt_lex.l" +return (DT_TOK_SUB_EQ); + YY_BREAK +case 134: +YY_RULE_SETUP +#line 609 "dt_lex.l" +return (DT_TOK_MUL_EQ); + YY_BREAK +case 135: +YY_RULE_SETUP +#line 610 "dt_lex.l" +return (DT_TOK_DIV_EQ); + YY_BREAK +case 136: +YY_RULE_SETUP +#line 611 "dt_lex.l" +return (DT_TOK_MOD_EQ); + YY_BREAK +case 137: +YY_RULE_SETUP +#line 612 "dt_lex.l" +return (DT_TOK_AND_EQ); + YY_BREAK +case 138: +YY_RULE_SETUP +#line 613 "dt_lex.l" +return (DT_TOK_XOR_EQ); + YY_BREAK +case 139: +YY_RULE_SETUP +#line 614 "dt_lex.l" +return (DT_TOK_OR_EQ); + YY_BREAK +case 140: +YY_RULE_SETUP +#line 615 "dt_lex.l" +return (DT_TOK_LSH_EQ); + YY_BREAK +case 141: +YY_RULE_SETUP +#line 616 "dt_lex.l" +return (DT_TOK_RSH_EQ); + YY_BREAK +case 142: +YY_RULE_SETUP +#line 617 "dt_lex.l" +return (DT_TOK_ADDADD); + YY_BREAK +case 143: +YY_RULE_SETUP +#line 618 "dt_lex.l" +return (DT_TOK_SUBSUB); + YY_BREAK +case 144: +YY_RULE_SETUP +#line 619 "dt_lex.l" +return (DT_TOK_ELLIPSIS); + YY_BREAK +case 145: +YY_RULE_SETUP +#line 620 "dt_lex.l" +return (DT_TOK_COMMA); + YY_BREAK +case 146: +YY_RULE_SETUP +#line 621 "dt_lex.l" +return (';'); + YY_BREAK +case 147: +YY_RULE_SETUP +#line 622 "dt_lex.l" +; /* discard */ + YY_BREAK +case 148: +YY_RULE_SETUP +#line 623 "dt_lex.l" +; /* discard */ + YY_BREAK +case 149: +YY_RULE_SETUP +#line 624 "dt_lex.l" +yyerror("syntax error near \"%c\"\n", yytext[0]); + YY_BREAK +case 150: +YY_RULE_SETUP +#line 626 "dt_lex.l" +yyerror("/* encountered inside a comment\n"); + YY_BREAK +case 151: +YY_RULE_SETUP +#line 627 "dt_lex.l" +BEGIN(yypcb->pcb_cstate); + YY_BREAK +/* VBOX - START */ +case YY_STATE_EOF(S1): +#line 629 "dt_lex.l" +yyerror("end-of-file encountered before matching */\n"); + YY_BREAK +/* VBOX - END */ +case 152: +YY_RULE_SETUP +#line 631 "dt_lex.l" +; /* discard */ + YY_BREAK +case 153: +YY_RULE_SETUP +#line 633 "dt_lex.l" +{ + /* + * S2 has an ambiguity because RGX_PSPEC includes '*' + * as a glob character and '*' also can be DT_TOK_STAR. + * Since lex always matches the longest token, this + * rule can be matched by an input string like "int*", + * which could begin a global variable declaration such + * as "int*x;" or could begin a RGX_PSPEC with globbing + * such as "int* { trace(timestamp); }". If C_PSPEC is + * not set, we must resolve the ambiguity in favor of + * the type and perform lexer pushback if the fragment + * before '*' or entire fragment matches a type name. + * If C_PSPEC is set, we always return a PSPEC token. + * If C_PSPEC is off, the user can avoid ambiguity by + * including a ':' delimiter in the specifier, which + * they should be doing anyway to specify the provider. + */ + if (!(yypcb->pcb_cflags & DTRACE_C_PSPEC) && + strchr(yytext, ':') == NULL) { + + char *p = strchr(yytext, '*'); + char *q = yytext + yyleng - 1; + + if (p != NULL && p > yytext) + *p = '\0'; /* prune yytext */ + + if (dt_type_lookup(yytext, NULL) == 0) { + yylval.l_str = strdup(yytext); + + if (yylval.l_str == NULL) { + longjmp(yypcb->pcb_jmpbuf, + EDT_NOMEM); + } + + if (p != NULL && p > yytext) { + for (*p = '*'; q >= p; q--) + unput(*q); + } + + yybegin(YYS_EXPR); + return (DT_TOK_TNAME); + } + + if (p != NULL && p > yytext) + *p = '*'; /* restore yytext */ + } + + if ((yylval.l_str = strdup(yytext)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + return (DT_TOK_PSPEC); + } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 686 "dt_lex.l" +return (DT_TOK_DIV); + YY_BREAK +case 155: +YY_RULE_SETUP +#line 687 "dt_lex.l" +return (DT_TOK_COMMA); + YY_BREAK +case 156: +YY_RULE_SETUP +#line 689 "dt_lex.l" +; /* discard */ + YY_BREAK +case 157: +YY_RULE_SETUP +#line 690 "dt_lex.l" +yyerror("syntax error near \"%c\"\n", yytext[0]); + YY_BREAK +case 158: +YY_RULE_SETUP +#line 692 "dt_lex.l" +{ + dt_pragma(yypragma); + yypragma = NULL; + BEGIN(yypcb->pcb_cstate); + } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 698 "dt_lex.l" +; /* discard */ + YY_BREAK +case 160: +YY_RULE_SETUP +#line 700 "dt_lex.l" +{ + dt_node_t *dnp; + + if ((yylval.l_str = strdup(yytext)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + /* + * We want to call dt_node_ident() here, but we can't + * because it will expand inlined identifiers, which we + * don't want to do from #pragma context in order to + * support pragmas that apply to the ident itself. We + * call dt_node_string() and then reset dn_op instead. + */ + dnp = dt_node_string(yylval.l_str); + dnp->dn_kind = DT_NODE_IDENT; + dnp->dn_op = DT_TOK_IDENT; + yypragma = dt_node_link(yypragma, dnp); + } + YY_BREAK +/* VBOX - BEGIN */ +case YY_STATE_EOF(S3): +#line 720 "dt_lex.l" +yyerror("end-of-file encountered before end of control line\n"); + YY_BREAK +/* VBOX - END */ +case 161: +YY_RULE_SETUP +#line 722 "dt_lex.l" +yyerror("syntax error near \"%c\"\n", yytext[0]); + YY_BREAK +case 162: +YY_RULE_SETUP +#line 724 "dt_lex.l" +ECHO; + YY_BREAK +#line 2426 "dt_lex.c" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(S0): + case YY_STATE_EOF(S2): + case YY_STATE_EOF(S4): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between 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. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since 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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * 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). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* 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 yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - 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) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 510 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 510 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 509); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* 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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because 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. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + if ( yy_current_buffer->yy_at_bol ) + ++yylineno; + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* 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->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +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 YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 724 "dt_lex.l" + + +/* + * yybegin provides a wrapper for use from C code around the lex BEGIN() macro. + * We use two main states for lexing because probe descriptions use a syntax + * that is incompatible with the normal D tokens (e.g. names can contain "-"). + * yybegin also handles the job of switching between two lists of dt_nodes + * as we allocate persistent definitions, like inlines, and transient nodes + * that will be freed once we are done parsing the current program file. + */ +void +yybegin(yystate_t state) +{ +#if YYDEBUG /* VBOX: ifdef YYDEBUG => if YYDEBUG */ + yydebug = _dtrace_debug; +#endif + if (yypcb->pcb_yystate == state) + return; /* nothing to do if we're in the state already */ + + if (yypcb->pcb_yystate == YYS_DEFINE) { + yypcb->pcb_list = yypcb->pcb_hold; + yypcb->pcb_hold = NULL; + } + + switch (state) { + case YYS_CLAUSE: + BEGIN(S2); + break; + case YYS_DEFINE: + assert(yypcb->pcb_hold == NULL); + yypcb->pcb_hold = yypcb->pcb_list; + yypcb->pcb_list = NULL; + /*FALLTHRU*/ + case YYS_EXPR: + BEGIN(S0); + break; + case YYS_DONE: + break; + case YYS_CONTROL: + BEGIN(S4); + break; + default: + xyerror(D_UNKNOWN, "internal error -- bad yystate %d\n", state); + } + + yypcb->pcb_yystate = state; +} + +void +yyinit(dt_pcb_t *pcb) +{ + yypcb = pcb; + yylineno = 1; + yypragma = NULL; +#ifndef USING_FLEX + yysptr = yysbuf; +#else + yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); +#endif +} + +/* + * Given a lexeme 's' (typically yytext), set yylval and return an appropriate + * token to the parser indicating either an identifier or a typedef name. + * User-defined global variables always take precedence over types, but we do + * use some heuristics because D programs can look at an ever-changing set of + * kernel types and also can implicitly instantiate variables by assignment, + * unlike in C. The code here is ordered carefully as lookups are not cheap. + */ +static int +id_or_type(const char *s) +{ + dtrace_hdl_t *dtp = yypcb->pcb_hdl; + dt_decl_t *ddp = yypcb->pcb_dstack.ds_decl; + int c0, c1, ttok = DT_TOK_TNAME; + dt_ident_t *idp; + + if ((s = yylval.l_str = strdup(s)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + /* + * If the lexeme is a global variable or likely identifier or *not* a + * type_name, then it is an identifier token. + */ + if (dt_idstack_lookup(&yypcb->pcb_globals, s) != NULL || + dt_idhash_lookup(yypcb->pcb_idents, s) != NULL || + dt_type_lookup(s, NULL) != 0) + return (DT_TOK_IDENT); + + /* + * If we're in the midst of parsing a declaration and a type_specifier + * has already been shifted, then return DT_TOK_IDENT instead of TNAME. + * This semantic is necessary to permit valid ISO C code such as: + * + * typedef int foo; + * struct s { foo foo; }; + * + * without causing shift/reduce conflicts in the direct_declarator part + * of the grammar. The result is that we must check for conflicting + * redeclarations of the same identifier as part of dt_node_decl(). + */ + if (ddp != NULL && ddp->dd_name != NULL) + return (DT_TOK_IDENT); + + /* + * If the lexeme is a type name and we are not in a program clause, + * then always interpret it as a type and return DT_TOK_TNAME. + */ + if ((YYSTATE) != S0) + return (DT_TOK_TNAME); + + /* + * If the lexeme matches a type name but is in a program clause, then + * it could be a type or it could be an undefined variable. Peek at + * the next token to decide. If we see ++, --, [, or =, we know there + * might be an assignment that is trying to create a global variable, + * so we optimistically return DT_TOK_IDENT. There is no harm in being + * wrong: a type_name followed by ++, --, [, or = is a syntax error. + */ + while ((c0 = input()) != 0) { + if (strchr("\f\n\r\t\v ", c0) == NULL) + break; + } + + switch (c0) { + case '+': + case '-': + if ((c1 = input()) == c0) + ttok = DT_TOK_IDENT; + if (c1 != EOF) unput(c1); + break; + + case '=': + if ((c1 = input()) != c0) + ttok = DT_TOK_IDENT; + if (c1 != EOF) unput(c1); + break; + case '[': + ttok = DT_TOK_IDENT; + break; + } + + if (ttok == DT_TOK_IDENT) { + idp = dt_idhash_insert(yypcb->pcb_idents, s, DT_IDENT_SCALAR, 0, + 0, _dtrace_defattr, 0, &dt_idops_thaw, NULL, dtp->dt_gen); + + if (idp == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + } + + if (c0 != EOF) unput(c0); + return (ttok); +} + +#ifndef USING_FLEX + +static int +input(void) +{ + int c; + + if (yysptr > yysbuf) + c = *--yysptr; + else if (yypcb->pcb_fileptr != NULL) + c = fgetc(yypcb->pcb_fileptr); + else if (yypcb->pcb_strptr < yypcb->pcb_string + yypcb->pcb_strlen) + c = *(unsigned char *)(yypcb->pcb_strptr++); + else + c = EOF; + + if (c == '\n') + yylineno++; + + if (c != EOF) + return (c); + + if ((YYSTATE) == S1) + yyerror("end-of-file encountered before matching */\n"); + + if ((YYSTATE) == S3) + yyerror("end-of-file encountered before end of control line\n"); + + if (yypcb->pcb_fileptr != NULL && ferror(yypcb->pcb_fileptr)) + longjmp(yypcb->pcb_jmpbuf, EDT_FIO); + + return (0); /* EOF */ +} + +static void +unput(int c) +{ + if (c == '\n') + yylineno--; + + *yysptr++ = c; + yytchar = c; +} + +#endif /* USING_FLEX */ -- cgit v1.2.3