VirtualBox

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

Last change on this file since 58987 was 53986, checked in by vboxsync, 10 years ago

windows build fix.

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