VirtualBox

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

Last change on this file was 98190, checked in by vboxsync, 21 months ago

VBoxDTrace: warnings (gcc) [correction of r110010]

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

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