VirtualBox

source: vbox/trunk/src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c@ 63240

最後變更 在這個檔案從63240是 63135,由 vboxsync 提交於 9 年 前

VBoxDTrace/generate: updated

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette