VirtualBox

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

最後變更 在這個檔案從72863是 64054,由 vboxsync 提交於 8 年 前

VBoxDTrace: fix

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

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