+++ /dev/null
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header$
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include <stdio.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif /* __STDC__ */
-#endif /* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state. The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
- YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
- };
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
- }
-
-#define yy_set_bol(at_bol) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
- }
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- yytext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 180
-#define YY_END_OF_BUFFER 181
-static yyconst short int yy_accept[529] =
- { 0,
- 0, 0, 181, 179, 159, 160, 147, 179, 3, 82,
- 153, 146, 179, 141, 142, 151, 150, 138, 149, 145,
- 152, 97, 97, 139, 135, 154, 140, 155, 158, 179,
- 82, 143, 178, 144, 156, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 136, 157, 137, 148,
- 134, 0, 42, 0, 2, 82, 120, 176, 177, 129,
- 121, 0, 0, 118, 126, 116, 127, 117, 128, 0,
- 110, 1, 119, 113, 90, 0, 99, 98, 0, 97,
- 125, 131, 133, 132, 124, 0, 0, 0, 82, 122,
-
- 82, 82, 82, 82, 82, 82, 82, 82, 9, 82,
- 82, 82, 82, 82, 82, 82, 13, 44, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 123, 130, 0, 0,
- 2, 104, 4, 0, 108, 109, 110, 0, 111, 112,
- 92, 91, 0, 107, 100, 101, 101, 83, 115, 114,
- 166, 167, 164, 169, 174, 165, 175, 170, 173, 168,
- 171, 172, 0, 0, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
-
- 82, 82, 11, 82, 82, 27, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 43, 82, 82, 82,
- 82, 82, 82, 74, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 0, 42, 0, 0, 110,
- 0, 108, 109, 0, 113, 93, 94, 94, 105, 106,
- 103, 102, 84, 86, 163, 0, 0, 82, 82, 82,
- 82, 39, 82, 6, 29, 82, 82, 82, 82, 82,
- 82, 10, 25, 82, 82, 82, 82, 12, 82, 82,
- 82, 51, 82, 31, 82, 82, 52, 82, 82, 68,
-
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 26, 82, 82, 82, 0,
- 110, 96, 95, 85, 87, 87, 0, 162, 82, 82,
- 82, 82, 5, 82, 36, 82, 82, 82, 82, 82,
- 82, 82, 30, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 69, 82, 82, 82, 82, 82, 82,
- 82, 32, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 77, 24, 82, 82, 82, 82, 82, 18,
- 76, 89, 88, 161, 82, 80, 82, 82, 82, 82,
-
- 82, 82, 82, 28, 82, 38, 82, 21, 82, 54,
- 78, 82, 60, 82, 82, 82, 82, 82, 82, 82,
- 58, 82, 14, 75, 34, 15, 82, 41, 22, 17,
- 82, 82, 82, 82, 82, 72, 19, 20, 82, 81,
- 37, 47, 64, 82, 82, 8, 82, 59, 82, 82,
- 82, 62, 53, 82, 82, 82, 45, 82, 82, 57,
- 82, 46, 61, 82, 23, 82, 82, 82, 82, 65,
- 7, 82, 73, 82, 82, 82, 70, 16, 82, 40,
- 82, 55, 82, 33, 35, 82, 71, 56, 82, 82,
- 82, 82, 67, 82, 82, 82, 82, 63, 82, 82,
-
- 82, 82, 82, 82, 82, 82, 48, 82, 82, 82,
- 66, 82, 82, 82, 79, 82, 82, 82, 82, 82,
- 82, 82, 82, 50, 82, 82, 49, 0
- } ;
-
-static yyconst int yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 4, 4, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 30, 32, 33,
- 34, 8, 8, 8, 35, 36, 37, 8, 8, 8,
- 38, 39, 40, 41, 42, 8, 43, 44, 8, 45,
- 46, 47, 48, 49, 50, 1, 51, 52, 53, 54,
-
- 55, 56, 57, 58, 59, 8, 60, 61, 62, 63,
- 64, 65, 8, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
-static yyconst int yy_meta[79] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 2, 1, 1,
- 3, 1, 1, 1, 1, 1, 1, 1, 1, 4,
- 4, 1, 1, 1, 1, 1, 1, 1, 5, 5,
- 5, 5, 5, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 1, 1, 1, 2,
- 5, 5, 5, 5, 5, 5, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 1, 1, 1, 1
- } ;
-
-static yyconst short int yy_base[536] =
- { 0,
- 0, 0, 678, 679, 679, 679, 652, 73, 0, 0,
- 55, 71, 629, 679, 679, 650, 67, 679, 68, 66,
- 74, 80, 85, 679, 679, 65, 649, 82, 679, 91,
- 622, 679, 679, 679, 647, 621, 28, 604, 67, 40,
- 65, 72, 605, 88, 55, 604, 79, 101, 616, 611,
- 103, 90, 602, 51, 606, 604, 679, 113, 679, 679,
- 679, 133, 163, 659, 0, 0, 679, 679, 679, 679,
- 679, 100, 139, 679, 679, 679, 679, 679, 679, 643,
- 155, 679, 679, 162, 172, 164, 160, 142, 0, 204,
- 635, 679, 679, 679, 634, 245, 621, 621, 584, 679,
-
- 602, 581, 585, 597, 584, 122, 587, 141, 580, 581,
- 578, 144, 585, 581, 578, 575, 0, 99, 579, 586,
- 579, 576, 567, 569, 575, 568, 578, 572, 564, 568,
- 564, 174, 573, 135, 158, 573, 154, 568, 564, 556,
- 559, 184, 573, 167, 563, 566, 679, 679, 242, 153,
- 0, 679, 679, 235, 679, 679, 251, 243, 679, 679,
- 233, 230, 241, 272, 165, 679, 234, 261, 679, 679,
- 679, 579, 679, 679, 679, 679, 679, 679, 679, 679,
- 679, 679, 580, 581, 228, 553, 548, 551, 563, 558,
- 546, 558, 231, 559, 554, 556, 552, 544, 541, 549,
-
- 536, 551, 0, 537, 541, 544, 529, 532, 535, 538,
- 528, 530, 531, 536, 523, 516, 0, 533, 519, 533,
- 526, 246, 515, 0, 517, 516, 518, 525, 526, 510,
- 508, 508, 510, 519, 518, 514, 516, 506, 510, 501,
- 203, 513, 515, 504, 503, 271, 308, 560, 295, 299,
- 306, 679, 679, 304, 316, 262, 679, 277, 679, 679,
- 679, 679, 298, 281, 679, 534, 522, 505, 504, 495,
- 484, 0, 496, 0, 0, 495, 486, 494, 483, 488,
- 489, 0, 0, 482, 482, 492, 478, 0, 482, 487,
- 482, 0, 284, 0, 487, 472, 472, 473, 483, 0,
-
- 483, 477, 471, 467, 478, 463, 465, 475, 461, 473,
- 463, 467, 466, 471, 470, 456, 458, 466, 464, 462,
- 454, 459, 460, 448, 460, 0, 444, 456, 456, 323,
- 325, 679, 679, 287, 679, 305, 481, 679, 457, 439,
- 439, 440, 0, 292, 0, 441, 442, 448, 446, 445,
- 436, 435, 0, 442, 430, 434, 440, 438, 436, 430,
- 435, 419, 420, 0, 436, 417, 417, 428, 422, 419,
- 427, 0, 426, 423, 427, 424, 408, 417, 419, 404,
- 417, 418, 0, 0, 407, 415, 411, 406, 407, 0,
- 0, 679, 679, 679, 411, 0, 396, 408, 408, 397,
-
- 391, 391, 403, 0, 403, 405, 386, 0, 403, 0,
- 0, 397, 0, 391, 385, 395, 385, 387, 384, 391,
- 0, 384, 0, 0, 385, 0, 382, 0, 0, 0,
- 386, 380, 384, 379, 383, 0, 0, 0, 376, 0,
- 0, 0, 369, 381, 379, 0, 370, 0, 371, 370,
- 369, 0, 0, 367, 362, 371, 0, 358, 359, 0,
- 361, 0, 0, 362, 0, 367, 367, 365, 351, 0,
- 0, 350, 0, 356, 348, 347, 0, 0, 347, 0,
- 329, 0, 340, 334, 0, 319, 0, 0, 311, 320,
- 328, 325, 0, 316, 319, 311, 324, 0, 317, 305,
-
- 318, 315, 301, 302, 310, 296, 0, 308, 311, 300,
- 0, 299, 290, 282, 0, 233, 245, 176, 186, 174,
- 151, 158, 128, 0, 48, 28, 0, 679, 386, 390,
- 394, 399, 403, 405, 410
- } ;
-
-static yyconst short int yy_def[536] =
- { 0,
- 528, 1, 528, 528, 528, 528, 528, 529, 530, 531,
- 528, 528, 532, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 531, 528, 528, 528, 528, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 528, 528, 528, 528,
- 528, 529, 528, 529, 533, 531, 528, 528, 528, 528,
- 528, 532, 532, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 534, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 531, 528,
-
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 528, 528, 528, 535,
- 533, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 534, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
-
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 535, 528, 535, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
-
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 528, 528, 528, 531, 531, 531, 531, 531, 531,
-
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
-
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 0, 528, 528,
- 528, 528, 528, 528, 528
- } ;
-
-static yyconst short int yy_nxt[758] =
- { 0,
- 4, 5, 6, 5, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 10, 10,
- 10, 10, 10, 10, 10, 10, 31, 10, 10, 10,
- 10, 10, 10, 10, 10, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 10, 44, 45,
- 46, 10, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 10, 56, 10, 57, 58, 59, 60, 63, 67,
- 70, 75, 527, 80, 77, 81, 81, 82, 91, 92,
- 102, 76, 78, 79, 108, 71, 103, 84, 83, 85,
-
- 85, 143, 84, 109, 90, 90, 94, 95, 96, 120,
- 152, 86, 526, 121, 144, 87, 86, 105, 97, 64,
- 87, 88, 113, 89, 106, 110, 88, 111, 98, 68,
- 107, 69, 114, 123, 86, 115, 112, 147, 63, 86,
- 87, 528, 124, 117, 139, 87, 73, 125, 88, 72,
- 118, 89, 126, 88, 119, 140, 127, 133, 247, 205,
- 134, 135, 141, 128, 149, 149, 206, 136, 150, 129,
- 137, 130, 191, 138, 81, 81, 192, 167, 163, 64,
- 163, 157, 157, 164, 164, 225, 154, 155, 148, 84,
- 156, 85, 85, 158, 159, 165, 194, 160, 226, 248,
-
- 525, 166, 167, 86, 230, 195, 261, 161, 199, 154,
- 155, 200, 524, 162, 227, 156, 158, 159, 523, 231,
- 165, 84, 160, 90, 90, 242, 86, 243, 166, 220,
- 221, 228, 161, 261, 222, 86, 236, 237, 522, 87,
- 162, 223, 238, 149, 149, 88, 521, 150, 520, 249,
- 239, 249, 240, 324, 250, 250, 325, 254, 86, 254,
- 164, 164, 255, 255, 87, 258, 268, 269, 256, 262,
- 157, 157, 88, 171, 257, 172, 247, 173, 174, 175,
- 176, 177, 251, 252, 178, 179, 253, 180, 181, 182,
- 258, 164, 164, 256, 262, 519, 263, 277, 278, 305,
-
- 518, 257, 264, 332, 259, 251, 252, 260, 306, 149,
- 149, 253, 333, 150, 250, 250, 336, 248, 250, 250,
- 330, 263, 330, 255, 255, 331, 331, 259, 392, 264,
- 332, 155, 260, 334, 156, 255, 255, 333, 357, 335,
- 393, 336, 331, 331, 331, 331, 399, 517, 159, 358,
- 516, 160, 515, 400, 155, 392, 514, 252, 334, 156,
- 253, 513, 512, 511, 510, 393, 335, 509, 508, 507,
- 506, 159, 505, 504, 503, 502, 160, 501, 500, 499,
- 252, 498, 497, 496, 495, 253, 62, 62, 62, 62,
- 62, 65, 494, 493, 65, 66, 492, 66, 66, 72,
-
- 72, 491, 72, 72, 151, 490, 151, 151, 168, 168,
- 246, 246, 246, 246, 246, 489, 488, 487, 486, 485,
- 484, 483, 482, 481, 480, 479, 478, 477, 476, 475,
- 474, 473, 472, 471, 470, 469, 468, 467, 466, 465,
- 464, 463, 462, 461, 460, 459, 458, 457, 456, 455,
- 454, 453, 452, 451, 450, 449, 448, 447, 446, 445,
- 444, 443, 442, 441, 440, 439, 438, 437, 436, 435,
- 434, 433, 432, 431, 430, 429, 428, 427, 426, 425,
- 424, 423, 422, 421, 420, 419, 418, 417, 416, 415,
- 414, 413, 412, 411, 410, 409, 408, 407, 406, 405,
-
- 404, 403, 402, 401, 398, 397, 396, 395, 394, 391,
- 390, 389, 388, 387, 386, 385, 384, 383, 382, 381,
- 380, 379, 378, 377, 376, 375, 374, 373, 372, 371,
- 370, 369, 368, 367, 366, 365, 364, 363, 362, 361,
- 360, 359, 356, 355, 354, 353, 352, 351, 350, 349,
- 348, 347, 346, 345, 344, 343, 342, 341, 340, 339,
- 338, 337, 528, 329, 328, 327, 326, 323, 322, 321,
- 320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
- 310, 309, 308, 307, 304, 303, 302, 301, 300, 299,
- 298, 297, 296, 295, 294, 293, 292, 291, 290, 289,
-
- 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
- 276, 275, 274, 273, 272, 271, 270, 267, 266, 265,
- 245, 244, 241, 235, 234, 233, 232, 229, 224, 219,
- 218, 217, 216, 215, 214, 213, 212, 211, 210, 209,
- 208, 207, 204, 203, 202, 201, 198, 197, 196, 193,
- 190, 189, 188, 187, 186, 185, 184, 183, 170, 169,
- 153, 528, 146, 145, 142, 132, 131, 122, 116, 104,
- 101, 100, 99, 93, 74, 73, 61, 528, 3, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
-
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528
- } ;
-
-static yyconst short int yy_chk[758] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 8, 11,
- 12, 17, 526, 20, 19, 20, 20, 21, 26, 26,
- 37, 17, 19, 19, 40, 12, 37, 22, 21, 22,
-
- 22, 54, 23, 40, 23, 23, 28, 28, 30, 45,
- 72, 22, 525, 45, 54, 22, 23, 39, 30, 8,
- 23, 22, 42, 22, 39, 41, 23, 41, 30, 11,
- 39, 11, 42, 47, 22, 42, 41, 58, 62, 23,
- 22, 73, 47, 44, 52, 23, 72, 47, 22, 73,
- 44, 22, 48, 23, 44, 52, 48, 51, 150, 118,
- 51, 51, 52, 48, 63, 63, 118, 51, 63, 48,
- 51, 48, 106, 51, 81, 81, 106, 88, 86, 62,
- 86, 84, 84, 86, 86, 134, 81, 81, 58, 85,
- 81, 85, 85, 84, 84, 87, 108, 84, 134, 150,
-
- 523, 87, 88, 85, 137, 108, 165, 85, 112, 81,
- 81, 112, 522, 85, 135, 81, 84, 84, 521, 137,
- 87, 90, 84, 90, 90, 144, 85, 144, 87, 132,
- 132, 135, 85, 165, 132, 90, 142, 142, 520, 90,
- 85, 132, 142, 149, 149, 90, 519, 149, 518, 154,
- 142, 154, 142, 241, 154, 154, 241, 158, 90, 158,
- 163, 163, 158, 158, 90, 162, 185, 185, 161, 167,
- 157, 157, 90, 96, 161, 96, 246, 96, 96, 96,
- 96, 96, 157, 157, 96, 96, 157, 96, 96, 96,
- 162, 164, 164, 161, 167, 517, 168, 193, 193, 222,
-
- 516, 161, 168, 256, 164, 157, 157, 164, 222, 247,
- 247, 157, 258, 247, 249, 249, 264, 246, 250, 250,
- 251, 168, 251, 254, 254, 251, 251, 164, 334, 168,
- 256, 250, 164, 263, 250, 255, 255, 258, 293, 263,
- 336, 264, 330, 330, 331, 331, 344, 514, 255, 293,
- 513, 255, 512, 344, 250, 334, 510, 331, 263, 250,
- 331, 509, 508, 506, 505, 336, 263, 504, 503, 502,
- 501, 255, 500, 499, 497, 496, 255, 495, 494, 492,
- 331, 491, 490, 489, 486, 331, 529, 529, 529, 529,
- 529, 530, 484, 483, 530, 531, 481, 531, 531, 532,
-
- 532, 479, 532, 532, 533, 476, 533, 533, 534, 534,
- 535, 535, 535, 535, 535, 475, 474, 472, 469, 468,
- 467, 466, 464, 461, 459, 458, 456, 455, 454, 451,
- 450, 449, 447, 445, 444, 443, 439, 435, 434, 433,
- 432, 431, 427, 425, 422, 420, 419, 418, 417, 416,
- 415, 414, 412, 409, 407, 406, 405, 403, 402, 401,
- 400, 399, 398, 397, 395, 389, 388, 387, 386, 385,
- 382, 381, 380, 379, 378, 377, 376, 375, 374, 373,
- 371, 370, 369, 368, 367, 366, 365, 363, 362, 361,
- 360, 359, 358, 357, 356, 355, 354, 352, 351, 350,
-
- 349, 348, 347, 346, 342, 341, 340, 339, 337, 329,
- 328, 327, 325, 324, 323, 322, 321, 320, 319, 318,
- 317, 316, 315, 314, 313, 312, 311, 310, 309, 308,
- 307, 306, 305, 304, 303, 302, 301, 299, 298, 297,
- 296, 295, 291, 290, 289, 287, 286, 285, 284, 281,
- 280, 279, 278, 277, 276, 273, 271, 270, 269, 268,
- 267, 266, 248, 245, 244, 243, 242, 240, 239, 238,
- 237, 236, 235, 234, 233, 232, 231, 230, 229, 228,
- 227, 226, 225, 223, 221, 220, 219, 218, 216, 215,
- 214, 213, 212, 211, 210, 209, 208, 207, 206, 205,
-
- 204, 202, 201, 200, 199, 198, 197, 196, 195, 194,
- 192, 191, 190, 189, 188, 187, 186, 184, 183, 172,
- 146, 145, 143, 141, 140, 139, 138, 136, 133, 131,
- 130, 129, 128, 127, 126, 125, 124, 123, 122, 121,
- 120, 119, 116, 115, 114, 113, 111, 110, 109, 107,
- 105, 104, 103, 102, 101, 99, 98, 97, 95, 91,
- 80, 64, 56, 55, 53, 50, 49, 46, 43, 38,
- 36, 35, 31, 27, 16, 13, 7, 3, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
-
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
- 528, 528, 528, 528, 528, 528, 528
- } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "cscanner.l"
-#define INITIAL 0
-/*;-*-C-*-;
-** Copyright (c) Massachusetts Institute of Technology 1994-1998.
-** All Rights Reserved.
-** Unpublished rights reserved under the copyright laws of
-** the United States.
-**
-** THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
-** OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-**
-** This code is distributed freely and may be used freely under the
-** following conditions:
-**
-** 1. This notice may not be removed or altered.
-**
-** 2. Works derived from this code are not distributed for
-** commercial gain without explicit permission from MIT
-** (for permission contact lclint-request@sds.lcs.mit.edu).
-*/
-/*
- * Modified by Herbert 08/19/97:
- * - added #include for IBM's OS/2 compiler.
- * - fixed weird bug with lookup of tmp files (OS/2 and MSDOS only).
- */
-/*
- * Modified by Mike Smith
- * Corrected missing 'line' in scanf() calls in handleSpecial().
- * Without this, I get an error when LCLint hits a '#line' directive
- * in the pre-pre-processed source files. For safety, I have made these
- * conditional on OS2 and MSDOS because I don't understand why noone else
- * has seen this problem.
- *
- * Modified by Mike Smith, 4th June 1997
- * Finally resolved the #line problem. The scanf() calls have been fixed to
- * allow the following #line forms:-
- *
- * #line 123 "filename"
- * #line 123
- * # 123 "filename"
- * # 123
- *
- * The last two are generated by the GNU pre-processor, apparently
- */
-#line 56 "cscanner.l"
-/*
-** based on original C lexer by Nate Osgood
-** from hacrat@catfish.lcs.mit.edu Mon Jun 14 13:06:32 1993
-**
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-# include "cgrammar.h"
-# include "cgrammar_tokens.h"
-
-# include "fileIdList.h"
-# include "portab.h"
-
-# if defined(OS2) && defined(__IBMC__)
- /* needed for isatty()... */
-# include <io.h>
-# endif
-
-static bool lastWasString = FALSE;
-static char savechar = '\0';
-
-/*@notfunction@*/
-# define yyinput() (incColumn (), getc (yyin))
-
-/*@-noparams@*/
-/*@-incondefs@*/
-extern /*@external@*/ int read ();
-/*@=incondefs@*/
-/*@=noparams@*/
-
-static /*@owned@*/ cstring lastidprocessed = cstring_undefined;
-
-static int lminput (void);
-static int tokLength = 0;
-static bool inSpecPart = FALSE;
-static bool continueLine = FALSE;
-
-static int ninput (void);
-static char processChar (void);
-static double processFloat (void);
-static /*@only@*/ exprNode processString (void);
-static long processDec (void);
-static long processHex (void);
-static long processOctal (void);
-static int processIdentifier (/*@only@*/ cstring)
- /*@globals undef lastidprocessed@*/ ;
-static bool processHashIdentifier (/*@only@*/ cstring)
- /*@globals undef lastidprocessed@*/ ;
-
-static int processSpec (int);
-static bool handleSpecial (char *);
-static int handleLlSpecial (void);
-static void handleMacro (void);
-static bool processMacro (void);
-static /*@only@*/ cstring makeIdentifier (char *);
-
-/* yes, this is exported! */
-bool g_expectingTypeName = TRUE; /* beginning of file can be type name! */
-
-static int returnInt (ctype, long);
-static int returnFloat (ctype, double);
-static int returnChar (char);
-static void setTokLength (int) /*@modifies g_currentloc@*/ ;
-static void setTokLengthT (size_t) /*@modifies g_currentloc@*/ ;
-
-static void advanceLine (void)
-{
- tokLength = 0;
- beginLine ();
-}
-
-/*@-allmacros@*/
-# define RETURN_INT(c,i) \
- do { lastWasString = FALSE; \
- return (returnInt (c, i)); } while (FALSE)
-
-# define RETURN_FLOAT(c,f) \
- do { lastWasString = FALSE; \
- return (returnFloat (c, f)); \
- } while (FALSE)
-
-# define RETURN_CHAR(c) \
- do { lastWasString = FALSE; \
- return (returnChar (c)); \
- } while (FALSE)
-
-# define RETURN_TOK(t) \
- do { yylval.tok = lltok_create (t, fileloc_decColumn (g_currentloc, tokLength)); \
- tokLength = 0; \
- lastWasString = FALSE; \
- return (t); } while (FALSE)
-
-# define RETURN_TYPE(t, ct) \
- do { yylval.ctyp = ct; tokLength = 0; return (t); } while (FALSE)
-
-/* don't fileloc_decColumn (g_currentloc, tokLength));
- the string could have \n's in it!
-*/
-
-# define RETURN_STRING(c) \
- do { yylval.expr = exprNode_stringLiteral (c, fileloc_decColumn (g_currentloc, tokLength)); \
- tokLength = 0; \
- lastWasString = TRUE; \
- return (CCONSTANT); } while (FALSE)
-
-# define RETURN_EXPR(e) \
- do { yylval.expr = e; \
- tokLength = 0; \
- lastWasString = TRUE; \
- return (CCONSTANT); } while (FALSE)
-
-/*@=allmacros@*/
-
-static void setTokLength (int len)
-{
- addColumn (len);
- tokLength = len;
-}
-
-static void setTokLengthT (size_t len)
-{
- setTokLength (size_toInt (len));
-}
-
-# include "flex.head"
-#line 877 "lex.yy.c"
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
- { \
- int c = '*', n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
- YY_USER_ACTION
-
-YY_DECL
- {
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
-
-#line 185 "cscanner.l"
-
-
-#line 1031 "lex.yy.c"
-
- if ( yy_init )
- {
- yy_init = 0;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
- if ( ! yy_start )
- yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_load_buffer_state();
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yy_c_buf_p;
-
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yy_start;
-yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 529 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- ++yy_cp;
- }
- while ( yy_base[yy_current_state] != 679 );
-
-yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-
-do_action: /* This label is used only to access EOF actions. */
-
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yy_hold_char;
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
- goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 187 "cscanner.l"
-{ llfatalbug (cstring_makeLiteral ("Comment in pre-processor output")); }
- YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 189 "cscanner.l"
-{
- context_saveLocation ();
- setTokLength (longUnsigned_toInt (mstring_length (yytext)));
-
- if (processHashIdentifier (makeIdentifier (yytext + 1)))
- {
- if (lastWasString)
- {
- ;
- }
- else
- {
- RETURN_STRING (cstring_makeLiteral ("\"\""));
- }
- }
- else
- {
- if (handleSpecial (yytext))
- {
- setTokLength (1);
- RETURN_TOK (0);
- }
- }
- }
- YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 213 "cscanner.l"
-{ if (handleSpecial (yytext))
- {
- setTokLength (1); RETURN_TOK (0);
- }
- }
- YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 218 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (CTOK_ELIPSIS); }
- YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 219 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (BREAK); }
- YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 220 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (CASE); }
- YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 221 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (CONTINUE); }
- YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 222 "cscanner.l"
-{ setTokLength (7); RETURN_TOK (DEFAULT); }
- YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 223 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (DO); }
- YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 224 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (CELSE); }
- YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 225 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (CFOR); }
- YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 226 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (GOTO); }
- YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 227 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (CIF); }
- YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 228 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (RETURN); }
- YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 229 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (CSIZEOF); }
- YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 230 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (COFFSETOF); }
- YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 231 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (SWITCH); }
- YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 232 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (WHILE); }
- YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 233 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (VA_ARG); }
- YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 234 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (VA_DCL); }
- YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 235 "cscanner.l"
-{
- /* gcc extension...this might not be appropriate */
- setTokLength (6); RETURN_TOK (QINLINE); }
- YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 239 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (CSTRUCT); }
- YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 240 "cscanner.l"
-{ setTokLength (7); RETURN_TOK (CTYPEDEF); }
- YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 242 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (CUNION); }
- YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 243 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (CENUM); }
- YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 245 "cscanner.l"
-{ setTokLength (4); RETURN_TYPE (CVOID, ctype_void); }
- YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 246 "cscanner.l"
-{ setTokLength (3); RETURN_TYPE (CINT, ctype_int); }
- YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 247 "cscanner.l"
-{ setTokLength (6); RETURN_TYPE (CDOUBLE, ctype_double); }
- YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 248 "cscanner.l"
-{ setTokLength (4); RETURN_TYPE (CGCHAR, ctype_char); }
- YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 249 "cscanner.l"
-{ setTokLength (5); RETURN_TYPE (CGFLOAT, ctype_float); }
- YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 251 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (QLONG); }
- YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 252 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (QSHORT); }
- YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 253 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (QUNSIGNED); }
- YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 254 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (QSIGNED); }
- YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 256 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (QVOLATILE); }
- YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 257 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (QCONST); }
- YY_BREAK
-/* some systems expect this! [gack!] */
-case 37:
-YY_RULE_SETUP
-#line 260 "cscanner.l"
-{ setTokLength (7); RETURN_TOK (QCONST); }
- YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 262 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (QEXTERN); }
- YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 263 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (QAUTO); }
- YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 264 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (QREGISTER); }
- YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 265 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (QSTATIC); }
- YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 267 "cscanner.l"
-{ RETURN_EXPR (processString ()); }
- YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 268 "cscanner.l"
-{ return (processSpec (QOUT)); }
- YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 269 "cscanner.l"
-{ return (processSpec (QIN)); }
- YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 270 "cscanner.l"
-{ return (processSpec (QPARTIAL)); }
- YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 271 "cscanner.l"
-{ return (processSpec (QSPECIAL)); }
- YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 272 "cscanner.l"
-{ return (processSpec (QANYTYPE)); }
- YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 273 "cscanner.l"
-{ return (processSpec (QINTEGRALTYPE)); }
- YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 274 "cscanner.l"
-{ return (processSpec (QUNSIGNEDINTEGRALTYPE)); }
- YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 275 "cscanner.l"
-{ return (processSpec (QSIGNEDINTEGRALTYPE)); }
- YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 276 "cscanner.l"
-{ return (processSpec (QKEEP)); }
- YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 277 "cscanner.l"
-{ return (processSpec (QNULL)); }
- YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 278 "cscanner.l"
-{ return (processSpec (QNOTNULL)); }
- YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 279 "cscanner.l"
-{ return (processSpec (QISNULL)); }
- YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 280 "cscanner.l"
-{ return (processSpec (QTRUENULL)); }
- YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 281 "cscanner.l"
-{ return (processSpec (QFALSENULL)); }
- YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 282 "cscanner.l"
-{ return (processSpec (QRELNULL)); }
- YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 283 "cscanner.l"
-{ return (processSpec (QRELDEF)); }
- YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 284 "cscanner.l"
-{ return (processSpec (QEXPOSED)); }
- YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 285 "cscanner.l"
-{ return (processSpec (QNEWREF)); }
- YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 286 "cscanner.l"
-{ return (processSpec (QTEMPREF)); }
- YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 287 "cscanner.l"
-{ return (processSpec (QKILLREF)); }
- YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 288 "cscanner.l"
-{ return (processSpec (QREFCOUNTED)); }
- YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 289 "cscanner.l"
-{ return (processSpec (QCHECKED)); }
- YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 290 "cscanner.l"
-{ return (processSpec (QCHECKMOD)); }
- YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 291 "cscanner.l"
-{ return (processSpec (QCHECKEDSTRICT)); }
- YY_BREAK
-case 67:
-YY_RULE_SETUP
-#line 292 "cscanner.l"
-{ return (processSpec (QUNCHECKED)); }
- YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 293 "cscanner.l"
-{ return (processSpec (QONLY)); }
- YY_BREAK
-case 69:
-YY_RULE_SETUP
-#line 294 "cscanner.l"
-{ return (processSpec (QOWNED)); }
- YY_BREAK
-case 70:
-YY_RULE_SETUP
-#line 295 "cscanner.l"
-{ return (processSpec (QOBSERVER)); }
- YY_BREAK
-case 71:
-YY_RULE_SETUP
-#line 296 "cscanner.l"
-{ return (processSpec (QDEPENDENT)); }
- YY_BREAK
-case 72:
-YY_RULE_SETUP
-#line 297 "cscanner.l"
-{ return (processSpec (QUNUSED)); }
- YY_BREAK
-case 73:
-YY_RULE_SETUP
-#line 298 "cscanner.l"
-{ return (processSpec (QEXTERNAL)); }
- YY_BREAK
-case 74:
-YY_RULE_SETUP
-#line 299 "cscanner.l"
-{ return (processSpec (QSEF)); }
- YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 300 "cscanner.l"
-{ return (processSpec (QSHARED)); }
- YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 301 "cscanner.l"
-{ return (processSpec (QYIELD)); }
- YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 302 "cscanner.l"
-{ return (processSpec (QUNDEF)); }
- YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 303 "cscanner.l"
-{ return (processSpec (QKILLED)); }
- YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 304 "cscanner.l"
-{ return (processSpec (QNULLTERMINATED));}
- YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 305 "cscanner.l"
-{ return (processSpec (QMAXSET));}
- YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 306 "cscanner.l"
-{ return (processSpec (QMAXREAD));}
- YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 308 "cscanner.l"
-{ int tok;
- context_saveLocation ();
- setTokLength (longUnsigned_toInt (mstring_length (yytext)));
- tok = processIdentifier (makeIdentifier (yytext));
- if (tok != BADTOK)
- {
- return (tok);
- }
- }
- YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 317 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_int, processHex ()); /* evs 2000-05-17 was ctype_uint */
- }
- YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 320 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_lint, processHex ()); }
- YY_BREAK
-case 85:
-YY_RULE_SETUP
-#line 322 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_llint, processHex ()); }
- YY_BREAK
-case 86:
-YY_RULE_SETUP
-#line 324 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_uint, processHex ()); }
- YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 326 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ulint, processHex ()); }
- YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 328 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ullint, processHex ()); }
- YY_BREAK
-case 89:
-YY_RULE_SETUP
-#line 330 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ullint, processHex ()); }
- YY_BREAK
-case 90:
-YY_RULE_SETUP
-#line 332 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_int, processOctal ()); }
- YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 334 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_uint, processOctal ()); }
- YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 336 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_lint, processOctal ()); }
- YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 338 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_llint, processOctal ()); }
- YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 340 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ulint, processOctal ()); }
- YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 342 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ullint, processOctal ()); }
- YY_BREAK
-case 96:
-YY_RULE_SETUP
-#line 344 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ullint, processOctal ()); }
- YY_BREAK
-case 97:
-YY_RULE_SETUP
-#line 346 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_int, processDec ()); }
- YY_BREAK
-case 98:
-YY_RULE_SETUP
-#line 348 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_uint, processDec ()); }
- YY_BREAK
-case 99:
-YY_RULE_SETUP
-#line 350 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_lint, processDec ()); }
- YY_BREAK
-case 100:
-YY_RULE_SETUP
-#line 352 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_llint, processDec ()); }
- YY_BREAK
-case 101:
-YY_RULE_SETUP
-#line 354 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ulint, processDec ()); }
- YY_BREAK
-case 102:
-YY_RULE_SETUP
-#line 356 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ullint, processDec ()); }
- YY_BREAK
-case 103:
-YY_RULE_SETUP
-#line 358 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_INT (ctype_ullint, processDec ()); }
- YY_BREAK
-case 104:
-YY_RULE_SETUP
-#line 360 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_CHAR (processChar ()); }
- YY_BREAK
-case 105:
-YY_RULE_SETUP
-#line 362 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_float, processFloat ()); }
- YY_BREAK
-case 106:
-YY_RULE_SETUP
-#line 364 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_ldouble, processFloat ()); }
- YY_BREAK
-case 107:
-YY_RULE_SETUP
-#line 366 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_double, processFloat ()); }
- YY_BREAK
-case 108:
-YY_RULE_SETUP
-#line 369 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_float, processFloat ()); }
- YY_BREAK
-case 109:
-YY_RULE_SETUP
-#line 371 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_ldouble, processFloat ()); }
- YY_BREAK
-case 110:
-YY_RULE_SETUP
-#line 373 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_double, processFloat ()); }
- YY_BREAK
-case 111:
-YY_RULE_SETUP
-#line 376 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_float, processFloat ()); }
- YY_BREAK
-case 112:
-YY_RULE_SETUP
-#line 378 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_ldouble, processFloat ()); }
- YY_BREAK
-case 113:
-YY_RULE_SETUP
-#line 380 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext));
- RETURN_FLOAT (ctype_double, processFloat ()); }
- YY_BREAK
-case 114:
-YY_RULE_SETUP
-#line 383 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (RIGHT_ASSIGN); }
- YY_BREAK
-case 115:
-YY_RULE_SETUP
-#line 384 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (LEFT_ASSIGN); }
- YY_BREAK
-case 116:
-YY_RULE_SETUP
-#line 385 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (ADD_ASSIGN); }
- YY_BREAK
-case 117:
-YY_RULE_SETUP
-#line 386 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (SUB_ASSIGN); }
- YY_BREAK
-case 118:
-YY_RULE_SETUP
-#line 387 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (MUL_ASSIGN); }
- YY_BREAK
-case 119:
-YY_RULE_SETUP
-#line 388 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (DIV_ASSIGN); }
- YY_BREAK
-case 120:
-YY_RULE_SETUP
-#line 389 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (MOD_ASSIGN); }
- YY_BREAK
-case 121:
-YY_RULE_SETUP
-#line 390 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (AND_ASSIGN); }
- YY_BREAK
-case 122:
-YY_RULE_SETUP
-#line 391 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (XOR_ASSIGN); }
- YY_BREAK
-case 123:
-YY_RULE_SETUP
-#line 392 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (OR_ASSIGN); }
- YY_BREAK
-case 124:
-YY_RULE_SETUP
-#line 393 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (RIGHT_OP); }
- YY_BREAK
-case 125:
-YY_RULE_SETUP
-#line 394 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (LEFT_OP); }
- YY_BREAK
-case 126:
-YY_RULE_SETUP
-#line 395 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (INC_OP); }
- YY_BREAK
-case 127:
-YY_RULE_SETUP
-#line 396 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (DEC_OP); }
- YY_BREAK
-case 128:
-YY_RULE_SETUP
-#line 397 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (ARROW_OP); }
- YY_BREAK
-case 129:
-YY_RULE_SETUP
-#line 398 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (AND_OP); }
- YY_BREAK
-case 130:
-YY_RULE_SETUP
-#line 399 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (OR_OP); }
- YY_BREAK
-case 131:
-YY_RULE_SETUP
-#line 400 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (LE_OP); }
- YY_BREAK
-case 132:
-YY_RULE_SETUP
-#line 401 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (GE_OP); }
- YY_BREAK
-case 133:
-YY_RULE_SETUP
-#line 402 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (EQ_OP); }
- YY_BREAK
-case 134:
-YY_RULE_SETUP
-#line 403 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (NE_OP); }
- YY_BREAK
-case 135:
-YY_RULE_SETUP
-#line 404 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TSEMI); }
- YY_BREAK
-case 136:
-YY_RULE_SETUP
-#line 405 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLBRACE); }
- YY_BREAK
-case 137:
-YY_RULE_SETUP
-#line 406 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TRBRACE); }
- YY_BREAK
-case 138:
-YY_RULE_SETUP
-#line 407 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TCOMMA); }
- YY_BREAK
-case 139:
-YY_RULE_SETUP
-#line 408 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TCOLON); }
- YY_BREAK
-case 140:
-YY_RULE_SETUP
-#line 409 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TASSIGN); }
- YY_BREAK
-case 141:
-YY_RULE_SETUP
-#line 410 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLPAREN); }
- YY_BREAK
-case 142:
-YY_RULE_SETUP
-#line 411 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TRPAREN); }
- YY_BREAK
-case 143:
-YY_RULE_SETUP
-#line 412 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLSQBR); }
- YY_BREAK
-case 144:
-YY_RULE_SETUP
-#line 413 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TRSQBR); }
- YY_BREAK
-case 145:
-YY_RULE_SETUP
-#line 414 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TDOT); }
- YY_BREAK
-case 146:
-YY_RULE_SETUP
-#line 415 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TAMPERSAND); }
- YY_BREAK
-case 147:
-YY_RULE_SETUP
-#line 416 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TEXCL); }
- YY_BREAK
-case 148:
-YY_RULE_SETUP
-#line 419 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TTILDE); }
- YY_BREAK
-case 149:
-YY_RULE_SETUP
-#line 420 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TMINUS); }
- YY_BREAK
-case 150:
-YY_RULE_SETUP
-#line 421 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TPLUS); }
- YY_BREAK
-case 151:
-YY_RULE_SETUP
-#line 422 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TMULT); }
- YY_BREAK
-case 152:
-YY_RULE_SETUP
-#line 423 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TDIV); }
- YY_BREAK
-case 153:
-YY_RULE_SETUP
-#line 424 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TPERCENT); }
- YY_BREAK
-case 154:
-YY_RULE_SETUP
-#line 425 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLT); }
- YY_BREAK
-case 155:
-YY_RULE_SETUP
-#line 426 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TGT); }
- YY_BREAK
-case 156:
-YY_RULE_SETUP
-#line 427 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TCIRC); }
- YY_BREAK
-case 157:
-YY_RULE_SETUP
-#line 428 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TBAR); }
- YY_BREAK
-case 158:
-YY_RULE_SETUP
-#line 429 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TQUEST); }
- YY_BREAK
-case 159:
-YY_RULE_SETUP
-#line 431 "cscanner.l"
-{ incColumn (); }
- YY_BREAK
-case 160:
-YY_RULE_SETUP
-#line 432 "cscanner.l"
-{ context_incLineno ();
- if (continueLine)
- {
- continueLine = FALSE;
- }
- else
- {
- if (context_inMacro ())
- {
- /* Don't use RETURN_TOK */
- yylval.tok = lltok_create (TENDMACRO, g_currentloc);
- lastWasString = FALSE;
- return (TENDMACRO);
- }
- }
- }
- YY_BREAK
-case 161:
-YY_RULE_SETUP
-#line 448 "cscanner.l"
-{ setTokLength (6);
-
- if (processMacro ()) {
- if (context_inIterDef ())
- {
- RETURN_TOK (LLMACROITER);
- }
- if (context_inIterEnd ())
- {
- RETURN_TOK (LLMACROEND);
- }
- if (context_inMacro ())
- {
- RETURN_TOK (LLMACRO);
- }
- }
- }
- YY_BREAK
-case 162:
-YY_RULE_SETUP
-#line 465 "cscanner.l"
-{ if (context_inHeader () || context_inFunction ())
- {
- handleMacro ();
- }
- else
- {
- int nspchar = ninput ();
- int nspaces;
-
- /*
- ** This is a hack to get the column number correct.
- */
-
- llassert (nspchar >= '0' && nspchar <= '9');
-
- nspaces = nspchar - '0';
-
- setTokLength (5 + nspaces);
-
- if (processMacro ())
- {
- if (context_inIterDef ())
- {
- RETURN_TOK (LLMACROITER);
- }
- if (context_inIterEnd ())
- {
- RETURN_TOK (LLMACROEND);
- }
- if (context_inMacro ())
- {
- RETURN_TOK (LLMACRO);
- }
- }
- }
- }
- YY_BREAK
-case 163:
-YY_RULE_SETUP
-#line 501 "cscanner.l"
-{ setTokLength (4); lldiagmsg (ctype_unparseTable ()); }
- YY_BREAK
-case 164:
-YY_RULE_SETUP
-#line 502 "cscanner.l"
-{ setTokLength (3);
- lldiagmsg (message ("%q: *** marker ***", fileloc_unparse (g_currentloc)));
- }
- YY_BREAK
-case 165:
-YY_RULE_SETUP
-#line 505 "cscanner.l"
-{ setTokLength (3); usymtab_printLocal (); }
- YY_BREAK
-case 166:
-YY_RULE_SETUP
-#line 506 "cscanner.l"
-{ setTokLength (3); lldiagmsg (usymtab_unparseAliases ()); }
- YY_BREAK
-case 167:
-YY_RULE_SETUP
-#line 507 "cscanner.l"
-{ setTokLength (3); lldiagmsg (context_unparse ()); }
- YY_BREAK
-case 168:
-YY_RULE_SETUP
-#line 508 "cscanner.l"
-{ setTokLength (3); lldiagmsg (context_unparseClauses ()); }
- YY_BREAK
-case 169:
-YY_RULE_SETUP
-#line 509 "cscanner.l"
-{ setTokLength (3); usymtab_printGuards (); }
- YY_BREAK
-case 170:
-YY_RULE_SETUP
-#line 510 "cscanner.l"
-{ setTokLength (3); usymtab_printOut (); }
- YY_BREAK
-case 171:
-YY_RULE_SETUP
-#line 511 "cscanner.l"
-{ setTokLength (3); usymtab_printAll (); }
- YY_BREAK
-case 172:
-YY_RULE_SETUP
-#line 512 "cscanner.l"
-{ setTokLength (3); usymtab_printComplete (); }
- YY_BREAK
-case 173:
-YY_RULE_SETUP
-#line 513 "cscanner.l"
-{ setTokLength (3); usymtab_printTypes (); }
- YY_BREAK
-case 174:
-YY_RULE_SETUP
-#line 514 "cscanner.l"
-{ setTokLength (3); lldiagmsg (usymtab_unparseStack ()); }
- YY_BREAK
-case 175:
-YY_RULE_SETUP
-#line 515 "cscanner.l"
-{ setTokLength (3);
- lldiagmsg (message ("Can modify: %q",
- sRefSet_unparse (context_modList ())));
- }
- YY_BREAK
-case 176:
-YY_RULE_SETUP
-#line 519 "cscanner.l"
-{ /* BEFORE_COMMENT_MARKER */
- int tok;
- incColumn (); incColumn ();
- tok = handleLlSpecial ();
- if (tok != BADTOK)
- {
- RETURN_TOK (tok);
- }
- }
- YY_BREAK
-case 177:
-YY_RULE_SETUP
-#line 528 "cscanner.l"
-{ /* AFTER_COMMENT_MARKER */
- setTokLength (2);
- inSpecPart = FALSE;
- RETURN_TOK (QENDMACRO); }
- YY_BREAK
-case 178:
-YY_RULE_SETUP
-#line 532 "cscanner.l"
-{ incColumn (); continueLine = TRUE; }
- YY_BREAK
-case 179:
-YY_RULE_SETUP
-#line 533 "cscanner.l"
-{ incColumn ();
- voptgenerror
- (FLG_SYNTAX,
- message ("Invalid character (ascii: %d), skipping character",
- (int)(*yytext)),
- g_currentloc);
- }
- YY_BREAK
-case 180:
-YY_RULE_SETUP
-#line 540 "cscanner.l"
-ECHO;
- YY_BREAK
-#line 2172 "lex.yy.c"
-case YY_STATE_EOF(INITIAL):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = yytext_ptr + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = yy_c_buf_p;
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yy_did_buffer_switch_on_eof = 0;
-
- if ( yywrap() )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
- } /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr;
- register int number_to_move, i;
- int ret_val;
-
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( yy_current_buffer->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
- else
- {
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
-
- int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = yy_current_buffer->yy_buf_size -
- number_to_move - 1;
-#endif
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
-
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
- return ret_val;
- }
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
- {
- register yy_state_type yy_current_state;
- register char *yy_cp;
-
- yy_current_state = yy_start;
-
- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 529 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
- }
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
- register int yy_is_jam;
- register char *yy_cp = yy_c_buf_p;
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 529 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 528);
-
- return yy_is_jam ? 0 : yy_current_state;
- }
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
-
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
- register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
-
- while ( source > yy_current_buffer->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
-
- yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
-
-
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
- {
- int c;
-
- *yy_c_buf_p = yy_hold_char;
-
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- /* This was really a NUL. */
- *yy_c_buf_p = '\0';
-
- else
- { /* need more input */
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
-
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- yyrestart( yyin );
-
- /* fall through */
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- return EOF;
-
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput();
-#else
- return input();
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
-
-
- return c;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
- return;
-
- if ( yy_current_buffer )
- {
- /* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- yy_init_buffer( b, file );
-
- return b;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
- if ( ! b )
- return;
-
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
-
- if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
- {
- yy_flush_buffer( b );
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
- {
- if ( ! b )
- return;
-
- b->yy_n_chars = 0;
-
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[0];
-
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
- }
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- yy_switch_to_buffer( b );
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
-
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
- b = yy_scan_buffer( buf, n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
-
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
-
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
-
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
-
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
-
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
- BEGIN(new_state);
- }
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
-
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
- }
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
- }
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
- return (void *) malloc( size );
- }
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
- }
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
-
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
-#endif
-#line 540 "cscanner.l"
-
-
-struct skeyword
-{
- /*@null@*/ /*@observer@*/ char *name;
- int token;
-} ;
-
-/*
-** These tokens are followed by syntax that is parsed by the
-** grammar proper.
-*/
-
-struct skeyword s_parsetable[] = {
- { "modifies", QMODIFIES } ,
- { "globals", QGLOBALS } ,
- { "alt", QALT } ,
- { "constant", QCONSTANT } ,
- { "function", QFUNCTION } ,
- { "iter", QITER } ,
- { "defines", QDEFINES } ,
- { "uses", QUSES } ,
- { "allocates", QALLOCATES } ,
- { "sets", QSETS } ,
- { "releases", QRELEASES } ,
- { "pre", QPRECLAUSE } ,
- { "post", QPOSTCLAUSE } ,
- {"setBufferSize", QSETBUFFERSIZE},
- {"bufferConstraint", QBUFFERCONSTRAINT},
- {"ensuresConstraint", QENSURESCONSTRAINT},
- {"setStringLength", QSETSTRINGLENGTH},
- {"testinRange", QTESTINRANGE},
- { NULL, BADTOK }
-} ;
-
-/*
-** These tokens are either stand-alone tokens, or followed by
-** token-specific text.
-*/
-
-struct skeyword s_keytable[] = {
- { "anytype", QANYTYPE } ,
- { "integraltype", QINTEGRALTYPE } ,
- { "unsignedintegraltype", QUNSIGNEDINTEGRALTYPE } ,
- { "signedintegraltype", QSIGNEDINTEGRALTYPE } ,
- { "out", QOUT } ,
- { "in", QIN } ,
- { "only", QONLY } ,
- { "owned", QOWNED } ,
- { "dependent", QDEPENDENT } ,
- { "partial", QPARTIAL } ,
- { "special", QSPECIAL } ,
- { "truenull", QTRUENULL } ,
- { "falsenull", QFALSENULL } ,
- { "keep", QKEEP } ,
- { "kept", QKEPT } ,
- { "notnull", QNOTNULL } ,
- { "abstract", QABSTRACT } ,
- { "concrete", QCONCRETE } ,
- { "mutable", QMUTABLE } ,
- { "immutable", QIMMUTABLE } ,
- { "unused", QUNUSED } ,
- { "external", QEXTERNAL } ,
- { "sef", QSEF } ,
- { "unique", QUNIQUE } ,
- { "returned", QRETURNED } ,
- { "exposed", QEXPOSED } ,
- { "refcounted", QREFCOUNTED } ,
- { "refs", QREFS } ,
- { "newref", QNEWREF } ,
- { "tempref", QTEMPREF } ,
- { "killref", QKILLREF } ,
- { "null", QNULL } ,
- { "relnull", QRELNULL } ,
- { "nullterminated", QNULLTERMINATED },
- { "setBufferSize", QSETBUFFERSIZE },
- { "bufferConstraint", QBUFFERCONSTRAINT },
- { "ensuresConstraint", QENSURESCONSTRAINT },
- { "testInRange", QTESTINRANGE},
- { "MaxSet", QMAXSET},
- { "MaxRead", QMAXREAD},
- { "reldef", QRELDEF } ,
- { "observer", QOBSERVER } ,
- { "exits", QEXITS } ,
- { "mayexit", QMAYEXIT } ,
- { "trueexit", QTRUEEXIT } ,
- { "falseexit", QFALSEEXIT } ,
- { "neverexit", QNEVEREXIT } ,
- { "temp", QTEMP } ,
- { "shared", QSHARED } ,
- { "ref", QREF } ,
- { "unchecked", QUNCHECKED } ,
- { "checked", QCHECKED } ,
- { "checkmod", QCHECKMOD } ,
- { "checkedstrict", QCHECKEDSTRICT } ,
- { "innercontinue", QINNERCONTINUE } ,
- { "innerbreak", QINNERBREAK } ,
- { "loopbreak", QLOOPBREAK } ,
- { "switchbreak", QSWITCHBREAK } ,
- { "safebreak", QSAFEBREAK } ,
- { "fallthrough", QFALLTHROUGH } ,
- { "l_fallthrou", QLINTFALLTHROUGH } ,
- { "l_fallth", QLINTFALLTHRU } ,
- { "notreached", QNOTREACHED } ,
- { "l_notreach", QLINTNOTREACHED } ,
- { "printflike", QPRINTFLIKE } ,
- { "l_printfli", QLINTPRINTFLIKE } ,
- { "scanflike", QSCANFLIKE } ,
- { "messagelike", QMESSAGELIKE } ,
- { "l_argsus", QARGSUSED } ,
- { NULL, BADTOK }
-} ;
-
-/*
-** would be better if these weren't hard coded...
-*/
-
-static bool isArtificial (cstring s)
-{
- return (cstring_equalLit (s, "modifies")
- || cstring_equalLit (s, "globals")
- || cstring_equalLit (s, "alt"));
-}
-
-void swallowMacro (void)
-{
- int i;
- bool skipnext = FALSE;
-
- while ((i = lminput ()) != EOF)
- {
- char c = (char) i;
-
-
- if (c == '\\')
- {
- skipnext = TRUE;
- }
- else if (c == '\n')
- {
- if (skipnext)
- {
- skipnext = FALSE;
- }
- else
- {
- checkUngetc (i, yyin);
- return;
- }
- }
- }
-
- if (i != EOF)
- {
- checkUngetc (i, yyin);
- }
-}
-
-static int commentMarkerToken (cstring s)
-{
- int i = 0;
-
- while (s_parsetable[i].name != NULL)
- {
- if (cstring_equalLit (s, s_parsetable[i].name))
- {
- return s_parsetable[i].token;
- }
-
- i++;
- }
-
- return BADTOK;
-}
-
-static int tokenMacroCode (cstring s)
-{
- int i = 0;
-
- while (s_keytable[i].name != NULL)
- {
- if (cstring_equalLit (s, s_keytable[i].name))
- {
- if (s_keytable[i].token == QLINTFALLTHROUGH)
- {
- voptgenerror
- (FLG_WARNLINTCOMMENTS,
- cstring_makeLiteral
- ("Traditional lint comment /*FALLTHROUGH*/ used. "
- "This is interpreted by "
- "LCLint in the same way as most Unix lints, but it is "
- "preferable to replace it with the /*@fallthrough@*/ "
- "stylized comment"),
- g_currentloc);
- return QFALLTHROUGH;
- }
- else if (s_keytable[i].token == QLINTFALLTHRU)
- {
- voptgenerror
- (FLG_WARNLINTCOMMENTS,
- cstring_makeLiteral
- ("Traditional lint comment /*FALLTHRU*/ used. "
- "This is interpreted by "
- "LCLint in the same way as most Unix lints, but it is "
- "preferable to replace it with the /*@fallthrough@*/ "
- "stylized comment"),
- g_currentloc);
- return QFALLTHROUGH;
- }
- else if (s_keytable[i].token == QLINTNOTREACHED)
- {
- voptgenerror
- (FLG_WARNLINTCOMMENTS,
- cstring_makeLiteral
- ("Traditional lint comment /*NOTREACHED*/ used. "
- "This is interpreted by "
- "LCLint in the same way as most Unix lints, but it is "
- "preferable to replace it with the /*@notreached@*/ "
- "stylized comment."),
- g_currentloc);
-
- return QNOTREACHED;
- }
- else if (s_keytable[i].token == QPRINTFLIKE)
- {
- setSpecialFunction (QU_PRINTFLIKE);
- return SKIPTOK;
- }
- else if (s_keytable[i].token == QLINTPRINTFLIKE)
- {
- voptgenerror
- (FLG_WARNLINTCOMMENTS,
- cstring_makeLiteral
- ("Traditional lint comment /*PRINTFLIKE*/ used. "
- "This is interpreted by "
- "LCLint in the same way as most Unix lints, but it is "
- "preferable to replace it with either /*@printflike@*/, "
- "/*@scanflike@*/ or /*@messagelike@*/."),
- g_currentloc);
-
- setSpecialFunction (QU_PRINTFLIKE);
- return SKIPTOK;
- }
- else if (s_keytable[i].token == QSCANFLIKE)
- {
- setSpecialFunction (QU_SCANFLIKE);
- return SKIPTOK;
- }
- else if (s_keytable[i].token == QMESSAGELIKE)
- {
- setSpecialFunction (QU_MESSAGELIKE);
- return SKIPTOK;
- }
- else if (s_keytable[i].token == QARGSUSED)
- {
- voptgenerror
- (FLG_WARNLINTCOMMENTS,
- cstring_makeLiteral
- ("Traditional lint comment /*ARGSUSED*/ used. "
- "This is interpreted by "
- "LCLint in the same way as most Unix lints, but it is "
- "preferable to use /*@unused@*/ annotations on "
- "the unused parameters."),
- g_currentloc);
-
- setArgsUsed ();
- return SKIPTOK;
- }
-
- return s_keytable[i].token;
- }
-
- i++;
- }
-
- return BADTOK;
-}
-
-static int lminput ()
-{
- if (savechar == '\0')
- {
- incColumn ();
- return (input ());
- }
- else
- {
- int save = (int) savechar;
- savechar = '\0';
- return save;
- }
-}
-
-static void lmsavechar (char c)
-{
- if (savechar == '\0') savechar = c;
- else
- {
- llbuglit ("lmsavechar: override");
- }
-}
-
-static int returnFloat (ctype ct, double f)
-{
- yylval.expr = exprNode_floatLiteral (f, ct, cstring_fromChars (yytext),
- fileloc_decColumn (g_currentloc, tokLength));
- tokLength = 0;
- return (CCONSTANT);
-}
-
-static int returnInt (ctype ct, long i)
-{
- ctype c = ct;
-
- if (ctype_equal (ct, ctype_int))
- {
- if (i == 0)
- {
- c = context_typeofZero ();
- }
- else if (i == 1)
- {
- c = context_typeofOne ();
- }
- }
-
- yylval.expr = exprNode_numLiteral (c, cstring_fromChars (yytext),
- fileloc_decColumn (g_currentloc, tokLength), i);
- tokLength = 0;
- return (CCONSTANT);
-}
-
-static int returnChar (char c)
-{
- yylval.expr = exprNode_charLiteral (c, cstring_fromChars (yytext),
- fileloc_decColumn (g_currentloc, tokLength));
- tokLength = 0;
- return (CCONSTANT);
-}
-
-static int ninput ()
-{
- int c = lminput ();
-
- if (c != EOF && ((char)c == '\n'))
- {
- context_incLineno ();
- }
-
- return c;
-}
-
-static char macro_nextChar ()
-{
- static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE;
- int ic;
- char c;
-
- ic = lminput ();
- c = char_fromInt (ic);
-
- if (!in_quote && !in_char && (c == '\\' || c == BEFORE_COMMENT_MARKER[0]))
- {
- if (c == '\\')
- {
- while ((c = char_fromInt (lminput ())) != '\0' && c != '\n')
- {
- ; /* skip to newline */
- }
-
- context_incLineno ();
-
- if (c != '\0')
- {
- return macro_nextChar ();
- }
- else
- {
- return c;
- }
- }
- else /* if (c == '@') */
- {
- if (handleLlSpecial () != BADTOK)
- {
- llerrorlit (FLG_SYNTAX, "Macro cannot use special syntax");
- }
-
- return macro_nextChar ();
- }
- }
- else if (!in_escape && c == '\"')
- {
- in_quote = !in_quote;
- }
- else if (!in_escape && c == '\'')
- {
- in_char = !in_char;
- }
- else if ((in_quote || in_char) && c == '\\')
- {
- in_escape = !in_escape;
- }
- else if ((in_quote || in_char) && in_escape)
- {
- in_escape = FALSE;
- }
- else if (!in_quote && c == '/')
- {
- char c2;
-
- if ((c2 = char_fromInt (lminput ())) == '*')
- {
- while (c2 != '\0')
- {
- while ((c2 = char_fromInt (lminput ())) != '\0'
- && c2 != '\n' && c2 != '*')
- {
- ;
- }
-
- if (c2 == '*')
- {
- while ((c2 = char_fromInt (lminput ())) != '\0'
- && c2 == '*')
- {
- ;
- }
-
- if (c2 == '/')
- {
- goto outofcomment;
- }
- }
- else
- {
- llfatalerror (cstring_makeLiteral ("Macro: bad comment!"));
- }
- }
- outofcomment:
- return macro_nextChar ();
- }
- else
- {
- /*** putchar does not work! why? puts to stdio...??! ***/
- lmsavechar (c2);
- }
- }
- return c;
-}
-
-/*
-** keeps stylized comments
-*/
-
-static char macro_nextCharC ()
-{
- static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE;
- char c;
-
- c = char_fromInt (lminput ());
-
- if (!in_quote && !in_char && c == '\\')
- {
- while ((c = char_fromInt (lminput ())) != '\0' && c != '\n')
- {
- ; /* skip to newline */
- }
-
- context_incLineno ();
-
- if (c != '\0')
- {
- return macro_nextCharC ();
- }
- else
- {
- return c;
- }
- }
- else if (!in_escape && c == '\"')
- {
- in_quote = !in_quote;
- }
- else if (!in_escape && c == '\'')
- {
- in_char = !in_char;
- }
- else if ((in_quote || in_char) && c == '\\')
- {
- in_escape = !in_escape;
- }
- else if ((in_quote || in_char) && in_escape)
- {
- in_escape = FALSE;
- }
- else if (!in_quote && c == '/')
- {
- char c2;
-
- if ((c2 = char_fromInt (lminput ())) == '*')
- {
- while (c2 != '\0')
- {
- while ((c2 = char_fromInt (lminput ())) != '\0'
- && c2 != '\n' && c2 != '*')
- {
- ;
- }
-
- if (c2 == '*')
- {
- while ((c2 = char_fromInt (lminput ())) != '\0'
- && c2 == '*')
- {
- ;
- }
-
- if (c2 == '/')
- {
- goto outofcomment;
- }
- }
- else
- {
- llfatalerror (cstring_makeLiteral ("Macro: bad comment!"));
- }
- }
- outofcomment:
- return macro_nextCharC ();
- }
- else
- {
- lmsavechar (c2);
- }
- }
- return c;
-}
-
-/*
-** skips whitespace (handles line continuations)
-** returns first non-whitespace character
-*/
-
-static char skip_whitespace ()
-{
- char c;
-
- while ((c = macro_nextChar ()) == ' ' || c == '\t')
- {
- ;
- }
-
- return c;
-}
-
-static void handleMacro ()
-{
- cstring mac = cstring_undefined;
- int macrocode;
- char c;
-
- while (currentColumn () > 2)
- {
- mac = cstring_appendChar (mac, ' ');
- setTokLength (-1);
- }
-
- c = macro_nextCharC ();
-
- if (c >= '0' && c <= '9')
- {
- int i;
-
- for (i = 0; i < ((c - '0') + 1); i++)
- {
- mac = cstring_appendChar (mac, ' ');
- }
- }
- else
- {
- BADBRANCH;
- }
-
- while (((c = macro_nextCharC ()) != '\0') && (c != '\n'))
- {
- mac = cstring_appendChar (mac, c);
- }
-
-
- macrocode = tokenMacroCode (mac);
-
- if (macrocode == BADTOK && !isArtificial (mac))
- {
- DPRINTF (("Add macro: %s", mac));
- context_addMacroCache (mac);
- }
- else
- {
- cstring_free (mac);
- }
-
- if (c == '\n')
- {
- context_incLineno ();
- }
-}
-
-static bool processMacro (void)
-{
- uentry e2;
- ctype ct;
- int noparams = 0;
- cstring fname = cstring_undefined;
- bool res = TRUE;
- bool isspecfcn = FALSE;
- bool isiter = FALSE;
- bool skipparam = FALSE;
- bool isenditer = FALSE;
- bool unknownm = FALSE;
- bool hasParams = FALSE;
- bool emptyMacro = FALSE;
- char c = skip_whitespace ();
- fileloc loc = fileloc_noColumn (g_currentloc);
-
- /* are both of these necessary? what do they mean? */
- uentryList specparams = uentryList_undefined;
- uentryList pn = uentryList_undefined;
-
- context_resetMacroMissingParams ();
-
- if (c == '\0' || c == '\n')
- {
- llcontbug (cstring_makeLiteral ("Bad macro"));
- fileloc_free (loc);
- return FALSE;
- }
-
- fname = cstring_appendChar (fname, c);
-
- while ((c = macro_nextChar ()) != '(' && c != '\0'
- && c != ' ' && c != '\t' && c != '\n')
- {
- fname = cstring_appendChar (fname, c);
- }
-
- if (c == ' ' || c == '\t' || c == '\n')
- {
- char oldc = c;
-
- if (c != '\n')
- {
- while (c == ' ' || c == '\t')
- {
- c = macro_nextChar ();
- }
- unput (c);
- }
-
- if (c == '\n')
- {
- emptyMacro = TRUE;
- unput (c);
- }
-
- c = oldc;
- }
-
- hasParams = (c == '(');
-
-
- if (usymtab_exists (fname))
- {
- e2 = usymtab_lookupExpose (fname);
- ct = uentry_getType (e2);
-
-
- if (uentry_isCodeDefined (e2)
- && fileloc_isUser (uentry_whereDefined (e2)))
- {
- if (optgenerror
- (FLG_MACROREDEF,
- message ("Macro %s already defined", fname),
- loc))
- {
- uentry_showWhereDefined (e2);
- uentry_clearDefined (e2);
- }
-
- if (uentry_isFunction (e2))
- {
- uentry_setType (e2, ctype_unknown);
- ct = ctype_unknown;
- unknownm = TRUE;
- context_enterUnknownMacro (e2);
- }
- else
- {
- context_enterConstantMacro (e2);
- }
- }
- else
- {
- if (uentry_isForward (e2) && uentry_isFunction (e2))
- {
- unknownm = TRUE;
-
- voptgenerror
- (FLG_MACROFCNDECL,
- message
- ("Parameterized macro has no prototype or specification: %s ",
- fname),
- loc);
-
- ct = ctype_unknown;
- uentry_setType (e2, ctype_unknown);
- uentry_setFunctionDefined (e2, loc);
- uentry_setUsed (e2, fileloc_undefined);
- context_enterUnknownMacro (e2);
- }
- else
- {
- if (uentry_isIter (e2))
- {
- isiter = TRUE;
- specparams = uentry_getParams (e2);
- noparams = uentryList_size (specparams);
- uentry_setDefined (e2, loc);
- context_enterIterDef (e2);
- }
- else if (uentry_isEndIter (e2))
- {
- isenditer = TRUE;
- uentry_setDefined (e2, loc);
- context_enterIterEnd (e2); /* don't care about it now */
- /* but should parse like an iter! */
- }
- else if (uentry_isConstant (e2))
- {
- if (hasParams)
- {
- voptgenerror
- (FLG_INCONDEFS,
- message ("Constant %s implemented as parameterized macro",
- fname),
- g_currentloc);
-
- uentry_showWhereSpecified (e2);
- uentry_setType (e2, ctype_unknown);
- uentry_makeVarFunction (e2);
- uentry_setDefined (e2, g_currentloc);
- uentry_setFunctionDefined (e2, g_currentloc);
- context_enterUnknownMacro (e2);
- }
- else
- {
- if (!uentry_isSpecified (e2))
- {
- fileloc oloc = uentry_whereDeclared (e2);
-
- if (fileloc_isLib (oloc))
- {
- ;
- }
- else if (fileloc_isUndefined (oloc)
- || fileloc_isPreproc (oloc))
- {
- if (!emptyMacro)
- {
- voptgenerror
- (FLG_MACROCONSTDECL,
- message
- ("Macro constant %q not declared",
- uentry_getName (e2)),
- loc);
- }
- }
- else if (!fileloc_withinLines (oloc, loc, 2))
- { /* bogus! will give errors if there is too much whitespace */
- voptgenerror
- (FLG_SYNTAX,
- message
- ("Macro constant name %s does not match name in "
- "previous constant declaration. This constant "
- "is declared at %q", fname,
- fileloc_unparse (oloc)),
- loc);
- }
- }
-
- context_enterConstantMacro (e2);
- cstring_free (fname);
- fileloc_free (loc);
- return res;
- }
-
- }
- else if (ctype_isFunction (ct))
- {
- isspecfcn = TRUE;
- specparams = ctype_argsFunction (ct);
- noparams = uentryList_size (specparams);
-
- uentry_setFunctionDefined (e2, loc);
- context_enterMacro (e2);
- }
- else if (uentry_isVar (e2))
- {
- if (hasParams)
- {
- voptgenerror
- (FLG_INCONDEFS,
- message ("Variable %s implemented as parameterized macro",
- fname),
- loc);
-
- uentry_showWhereSpecified (e2);
- uentry_setType (e2, ctype_unknown);
- uentry_makeVarFunction (e2);
- uentry_setDefined (e2, g_currentloc);
- uentry_setFunctionDefined (e2, g_currentloc);
- context_enterUnknownMacro (e2);
- }
- else
- {
- uentry ucons = uentry_makeConstant (fname,
- ctype_unknown,
- loc);
- if (uentry_isExpandedMacro (e2))
- {
- ; /* okay */
- }
- else
- {
- if (optgenerror
- (FLG_INCONDEFS,
- message ("Variable %s implemented by a macro",
- fname),
- loc))
- {
- uentry_showWhereSpecified (e2);
- }
- }
-
- uentry_setDefined (e2, loc);
- uentry_setUsed (ucons, loc);
-
- context_enterConstantMacro (ucons);
- uentry_markOwned (ucons);
- cstring_free (fname);
- return res;
- }
- }
- else
- {
- if (uentry_isDatatype (e2))
- {
- vgenhinterror
- (FLG_SYNTAX,
- message ("Type implemented as macro: %x",
- uentry_getName (e2)),
- message ("A type is implemented using a macro definition. A "
- "typedef should be used instead."),
- g_currentloc);
-
- swallowMacro ();
- /* Must exit scope (not sure why a new scope was entered?) */
- usymtab_quietExitScope (g_currentloc);
- uentry_setDefined (e2, g_currentloc);
- res = FALSE;
- }
- else
- {
- llcontbug
- (message ("Unexpanded macro not function or constant: %q",
- uentry_unparse (e2)));
- uentry_setType (e2, ctype_unknown);
-
- if (hasParams)
- {
- uentry_makeVarFunction (e2);
- uentry_setDefined (e2, g_currentloc);
- uentry_setFunctionDefined (e2, g_currentloc);
- context_enterUnknownMacro (e2);
- }
- }
- }
- }
- }
- }
- else
- {
- uentry ce;
-
- voptgenerror
- (FLG_MACROMATCHNAME,
- message ("Unexpanded macro %s does not match name of a constant "
- "or iter declaration. The name used in the control "
- "comment on the previous line should match. "
- "(Assuming macro defines a constant.)",
- fname),
- loc);
-
-
- ce = uentry_makeConstant (fname, ctype_unknown, fileloc_undefined);
- uentry_setUsed (ce, loc); /* perhaps bogus? */
- e2 = usymtab_supEntryReturn (ce);
-
- context_enterConstantMacro (e2);
- cstring_free (fname);
- fileloc_free (loc);
- return res;
- }
-
- /* in macros, ( must follow immediatetly after name */
-
- if (hasParams)
- {
- int paramno = 0;
-
- c = skip_whitespace ();
-
- while (c != ')' && c != '\0')
- {
- uentry param;
- bool suppress = context_inSuppressRegion ();
- cstring paramname = cstring_undefined;
-
- /*
- ** save the parameter location
- */
-
- decColumn ();
- context_saveLocation ();
- incColumn ();
-
- while (c != ' ' && c != '\t' && c != ',' && c != '\0' && c != ')')
- {
- paramname = cstring_appendChar (paramname, c);
- c = macro_nextChar ();
- }
-
- if (c == ' ' || c == '\t') c = skip_whitespace ();
-
- if (c == ',')
- {
- c = macro_nextChar ();
- if (c == ' ' || c == '\t') c = skip_whitespace ();
- }
-
- if (c == '\0')
- {
- llfatalerror (cstring_makeLiteral
- ("Bad macro syntax: uentryList"));
- }
-
- if ((isspecfcn || isiter) && (paramno < noparams)
- && !uentry_isElipsisMarker (uentryList_getN
- (specparams, paramno)))
- {
- uentry decl = uentryList_getN (specparams, paramno);
- sRef sr;
-
- param = uentry_nameCopy (paramname, decl);
-
-
- uentry_setParam (param);
- sr = sRef_makeParam (paramno, uentry_getType (param));
-
- if (sRef_getNullState (sr) == NS_ABSNULL)
- {
- ctype pt = ctype_realType (uentry_getType (param));
-
- if (ctype_isUser (pt))
- {
- uentry te = usymtab_getTypeEntrySafe (ctype_typeId (pt));
-
- if (uentry_isValid (te))
- {
- sRef_setStateFromUentry (sr, te);
- }
- }
- else
- {
- sRef_setNullState (sr, NS_UNKNOWN, g_currentloc);
- }
- }
-
- uentry_setSref (param, sr);
- uentry_setDeclaredForceOnly (param, context_getSaveLocation ());
-
- skipparam = isiter && uentry_isOut (uentryList_getN (specparams, paramno));
- }
- else
- {
- fileloc sloc = context_getSaveLocation ();
-
- param = uentry_makeVariableSrefParam
- (paramname, ctype_unknown, sRef_makeParam (paramno, ctype_unknown));
- cstring_free (paramname);
-
- sRef_setPosNull (uentry_getSref (param), sloc);
-
- uentry_setDeclaredForce (param, sloc);
-
- skipparam = FALSE;
- fileloc_free (sloc);
- }
-
- if (!skipparam)
- {
- llassert (!uentry_isElipsisMarker (param));
-
- if (!suppress)
- {
- sRef_makeUnsafe (uentry_getSref (param));
- }
-
- pn = uentryList_add (pn, uentry_copy (param));
- usymtab_supEntry (param);
- }
- else
- {
- /* don't add param */
- uentry_free (param);
- }
-
- if (c == ',')
- {
- (void) macro_nextChar ();
- c = skip_whitespace ();
- }
-
- paramno++;
- }
-
- if (c == ')')
- {
- if (isspecfcn || isiter)
- {
- if (paramno != noparams && noparams >= 0)
- {
- advanceLine ();
-
- voptgenerror
- (FLG_INCONDEFS,
- message ("Macro %s specified with %d args, defined with %d",
- fname, noparams, paramno),
- g_currentloc);
-
- uentry_showWhereSpecified (e2);
- uentry_resetParams (e2, pn);
- }
- }
- else
- {
- uentry_resetParams (e2, pn);
- }
- }
- }
- else
- {
- /*
- ** the form should be:
- **
- ** # define newname oldname
- ** where oldname refers to a function matching the specification
- ** of newname.
- */
-
- if (unknownm)
- {
- sRef_setGlobalScope ();
- usymtab_supGlobalEntry (uentry_makeVariableLoc (fname, ctype_unknown));
- sRef_clearGlobalScope ();
- }
- else
- {
- context_setMacroMissingParams ();
- }
- }
-
-
- /* context_setuentryList (pn); */
- usymtab_enterScope ();
-
- fileloc_free (loc);
- cstring_free (fname);
-
- return res;
-}
-
-static bool handleSpecial (char *yyt)
-{
- char *l = mstring_create (MAX_NAME_LENGTH);
- static bool reportcpp = FALSE;
- int lineno = 0;
- char c;
- char *ol;
- cstring olc;
-
- strcpy (l, yyt + 1);
-
- /* Need to safe original l for deallocating. */
- ol = l;
-
- l += strlen (yyt) - 1;
-
- while ((c = char_fromInt (lminput ())) != '\n' && c != '\0')
- {
- *l++ = c;
- }
-
- *l = '\0';
- olc = cstring_fromChars (ol);
-
- if (cstring_equalPrefix (olc, "pragma"))
- {
- char *pname = mstring_create (longUnsigned_fromInt (MAX_PRAGMA_LEN));
- char *opname = pname;
- char *ptr = ol + 6; /* pragma is six characters, plus space */
- int len = 0;
-
-
- /* skip whitespace */
- while (((c = *ptr) != '\0') && isspace (c))
- {
- ptr++;
- }
-
-
- while (((c = *ptr) != '\0') && !isspace (c))
- {
- len++;
-
- if (len > MAX_PRAGMA_LEN)
- {
- break;
- }
-
- ptr++;
- *pname++ = c;
- }
-
- *pname = '\0';
-
- if (len == PRAGMA_LEN_EXPAND
- && mstring_equal (opname, PRAGMA_EXPAND))
- {
- cstring exname = cstring_undefined;
- uentry ue;
-
- ptr++;
- while (((c = *ptr) != '\0') && !isspace (c))
- {
- exname = cstring_appendChar (exname, c);
- ptr++;
- }
-
-
- ue = usymtab_lookupExposeGlob (exname);
-
- if (uentry_isExpandedMacro (ue))
- {
- if (fileloc_isPreproc (uentry_whereDefined (ue)))
- {
- fileloc_setColumn (g_currentloc, 1);
- uentry_setDefined (ue, g_currentloc);
- }
- }
-
- cstring_free (exname);
- }
- }
- else if (cstring_equalPrefix (olc, "ident"))
- {
- /* Some pre-processors will leave these in the code. Ignore rest of line */
- }
- /*
- ** Yuk...Win32 filenames can have spaces in them...we need to read
- ** to the matching end quote.
- */
- else if ((sscanf (ol, "line %d \"", &lineno) == 1)
- || (sscanf (ol, " %d \"", &lineno) == 1))
- {
- char *tmp = ol;
- char *fname;
- fileId fid;
-
- while (*tmp != '\"' && *tmp != '\0')
- {
- tmp++;
- }
-
- llassert (*tmp == '\"');
-
- tmp++;
- fname = tmp;
-
- while (*tmp != '\"' && *tmp != '\0')
- {
- tmp++;
- }
-
- llassert (*tmp == '\"');
-
- *tmp = '\0';
-
- DPRINTF (("fname: %s", fname));
-
-# if defined(OS2) || defined(MSDOS) || defined(WIN32)
-
- /*
- ** DOS-like path delimiters get delivered in pairs, something like
- ** \"..\\\\file.h\", so we have to make it normal again. We do NOT
- ** remove the pre dirs yet as we usually specify tmp paths relative
- ** to the current directory, so tmp files would not get found in
- ** the hash table. If this method fails we try it again later.
- */
-
- {
- char *stmp = fname;
-
- /*
- ** Skip past the drive marker.
- */
-
- DPRINTF (("stmp: %s / %s", stmp, fname));
-
- if (strchr (stmp, ':') != NULL)
- {
- stmp = strchr (stmp, ':') + 1;
- }
-
- DPRINTF (("stmp: %s / %s", stmp, fname));
-
- while ((stmp = strchr (stmp, CONNECTCHAR)) != NULL )
- {
- if (*(stmp+1) == CONNECTCHAR)
- {
- memmove (stmp, stmp+1, strlen (stmp));
- }
-
- stmp++;
- DPRINTF (("stmp: %s / %s", stmp, fname));
- }
-
- DPRINTF (("Now: base = %s", fname));
-
- fid = fileTable_lookupBase (context_fileTable (),
- cstring_fromChars (fname));
- if (!(fileId_isValid (fid)))
- {
- fname = removePreDirs (fname);
- fid = fileTable_lookupBase (context_fileTable (),
- cstring_fromChars (fname));
- }
- }
-# else /* !defined(OS2) && !defined(MSDOS) */
- fname = removePreDirs (fname);
- fid = fileTable_lookupBase (context_fileTable (),
- cstring_fromChars (fname));
-# endif /* !defined(OS2) && !defined(MSDOS) */
-
- if (!(fileId_isValid (fid)))
- {
- if (isHeaderFile (cstring_fromChars (fname)))
- {
- fid = fileTable_addHeaderFile (context_fileTable (),
- cstring_fromChars (fname));
- }
- else
- {
- fid = fileTable_addFile (context_fileTable (),
- cstring_fromChars (fname));
- }
- }
-
- setFileLine (fid, lineno);
- }
- else if ((sscanf (ol, "line %d", &lineno) == 1)
- || (sscanf (ol, " %d", &lineno) == 1))
- {
- setLine (lineno); /* next line is <cr> */
- }
- else
- {
- if (mstring_equal (ol, "")) {
- DPRINTF (("Empty pp command!"));
- /*
- ** evs 2000-05-16: This is a horrible kludge, to get around a bug (well, difficulty) in the pre-processor.
- ** We handle a plain # in the input file, by echoing it, and ignoring it in the post-pp-file.
- */
- mstring_free (ol);
- return FALSE;
- } else {
- if (!reportcpp)
- {
-
- } else {
- llbug (message ("File contains preprocessor command: #%s",
- cstring_fromChars (ol)));
- reportcpp = TRUE;
- }
- }
-
- sfree (ol);
- return TRUE;
- }
-
- sfree (ol);
- return FALSE;
-}
-
-static int handleLlSpecial ()
-{
- int ic;
- char c;
- char *s = mstring_createEmpty ();
- char *os;
- int tok;
- int charsread = 0;
-
- while (((ic = ninput ()) != 0) && isalpha (ic))
- {
- c = (char) ic;
- s = mstring_append (s, c);
- charsread++;
- }
-
- os = s;
-
- if (charsread == 0 && ic == (int) AFTER_COMMENT_MARKER[0])
- {
- ic = ninput ();
-
- llassert (ic == AFTER_COMMENT_MARKER[1]);
-
-
- if (isProcessingGlobMods () && (*s == '\0'))
- {
- sfree (os);
- return QNOMODS; /* special token no modifications token */
- }
- else
- {
- ;
- }
- }
-
- tok = commentMarkerToken (cstring_fromChars (os));
-
- if (tok != BADTOK)
- {
- tokLength = charsread;
- sfree (os);
- inSpecPart = TRUE;
- return tok;
- }
-
- /* Add rest of the comment */
-
- if (ic != 0 && ic != EOF)
- {
- c = (char) ic;
-
-
- s = mstring_append (s, c);
- charsread++;
-
- while (((ic = ninput ()) != 0) && (ic != EOF)
- && (ic != AFTER_COMMENT_MARKER[0]))
- {
- c = (char) ic;
- s = mstring_append (s, c);
- charsread++;
- }
- }
-
- if (ic == AFTER_COMMENT_MARKER[0])
- {
- int nc = ninput ();
- llassert ((char) nc == AFTER_COMMENT_MARKER[1]);
- charsread++;
- }
-
-
- os = s;
-
- while (*s == ' ' || *s == '\t' || *s == '\n')
- {
- s++;
- }
-
- if (*s == '-' || *s == '+' || *s == '=') /* setting flags */
- {
- c = *s;
-
- while (c == '-' || c == '+' || c == '=')
- {
- ynm set = ynm_fromCodeChar (c);
- cstring thisflag;
-
- s++;
-
- thisflag = cstring_fromChars (s);
-
- while ((c = *s) != '\0' && (c != '-') && (c != '=')
- && (c != '+') && (c != ' ') && (c != '\t') && (c != '\n'))
- {
- s++;
- }
-
- *s = '\0';
-
- if (!context_getFlag (FLG_NOCOMMENTS))
- {
- cstring flagname = thisflag;
- flagcode fflag = identifyFlag (flagname);
-
- if (flagcode_isSkip (fflag))
- {
- ;
- }
- else if (flagcode_isInvalid (fflag))
- {
- if (isMode (flagname))
- {
- if (ynm_isMaybe (set))
- {
- llerror
- (FLG_BADFLAG,
- message
- ("Stylized comment attempts to restore flag %s. "
- "A mode flag cannot be restored.",
- flagname));
- }
- else
- {
- context_setMode (flagname);
- }
- }
- else
- {
- llerror
- (FLG_BADFLAG,
- message ("Unrecognized option in stylized comment: %s",
- flagname));
- }
- }
- else if (flagcode_isGlobalFlag (fflag))
- {
- llerror
- (FLG_BADFLAG,
- message
- ("Stylized comment attempts to set global flag %s. "
- "A global flag cannot be set locally.",
- flagname));
- }
- else
- {
- context_fileSetFlag (fflag, set);
-
- if (flagcode_hasArgument (fflag))
- {
- if (ynm_isMaybe (set))
- {
- llerror
- (FLG_BADFLAG,
- message
- ("Stylized comment attempts to restore flag %s. "
- "A flag for setting a value cannot be restored.",
- flagname));
- }
- else
- { /* cut-and-pastied from llmain...blecch */
- cstring extra = cstring_undefined;
- char *rest;
- char *orest;
- char rchar;
-
- *s = c;
- rest = mstring_copy (s);
- orest = rest;
- *s = '\0';
-
- while ((rchar = *rest) != '\0'
- && (isspace (rchar)))
- {
- rest++;
- s++;
- }
-
- while ((rchar = *rest) != '\0'
- && !isspace (rchar))
- {
- extra = cstring_appendChar (extra, rchar);
- rest++;
- s++;
- }
-
- sfree (orest);
-
- if (cstring_isUndefined (extra))
- {
- llerror
- (FLG_BADFLAG,
- message
- ("Flag %s (in stylized comment) must be followed by an argument",
- flagcode_unparse (fflag)));
- }
- else
- {
- s--;
-
- if (flagcode_hasValue (fflag))
- {
- setValueFlag (fflag, extra);
- }
- else if (flagcode_hasString (fflag))
- {
- setStringFlag (fflag, extra);
- }
- else
- {
- BADEXIT;
- }
- }
- }
- }
- }
- }
- else
- {
- ;
- }
-
- *s = c;
- while ((c == ' ') || (c == '\t') || (c == '\n'))
- {
- c = *(++s);
- }
- }
-
- if (context_inHeader () && !isArtificial (cstring_fromChars (os)))
- {
- context_addComment (cstring_fromCharsNew (os));
- }
- else
- {
- ;
- }
- }
- else
- {
- char *t = s;
- int macrocode;
- char tchar = '\0';
-
- while (*s != '\0' && *s != ' ' && *s != '\t' && *s != '\n')
- {
- s++;
- }
-
- if (*s != '\0')
- {
- tchar = *s;
- *s = '\0';
- s++;
- }
-
- t = cstring_toCharsSafe (cstring_downcase (cstring_fromChars (t)));
- macrocode = tokenMacroCode (cstring_fromChars (t));
-
- if (macrocode != BADTOK)
- {
- tokLength = mstring_length (t);
-
-
- sfree (t);
- sfree (os);
-
- if (macrocode == SKIPTOK)
- {
- return BADTOK;
- }
-
- return macrocode;
- }
-
- if (context_inHeader ())
- {
- if (tchar != '\0')
- {
- *(s-1) = tchar;
- }
-
- if ((context_inMacro () || context_inGlobalContext ())
- && macrocode != SKIPTOK
- && !isArtificial (cstring_fromChars (os)))
- {
- context_addComment (cstring_fromCharsNew (os));
- }
- else
- {
- ;
- }
-
- if (tchar != '\0')
- {
- *(s-1) = '\0';
- }
- }
-
- if (mstring_equal (t, "ignore"))
- {
- if (!context_getFlag (FLG_NOCOMMENTS))
- {
- context_enterSuppressRegion ();
- }
- }
- else if ((*t == 'i' || *t == 't')
- && (*(t + 1) == '\0'))
- {
- if (!context_getFlag (FLG_NOCOMMENTS)
- && (*t == 'i' || context_getFlag (FLG_TMPCOMMENTS)))
- {
- context_enterSuppressLine (-1); /* infinite suppression */
- }
- }
- else if (((*t == 'i') || (*t == 't'))
- && ((*(t + 1) >= '0' && *(t + 1) <= '9')))
- {
- bool tmpcomment = (*t == 't');
- int val = -1;
- char *tt = t; /* don't mangle t, since it is free'd */
- char lc = *(++tt);
-
- if (lc >= '0' && lc <= '9')
- {
- val = (int)(lc - '0');
-
- lc = *(++tt);
- while (lc >= '0' && lc <= '9')
- {
- val *= 10;
- val += lc - '0';
- lc = *(++tt);
- }
- }
-
-
- if (!context_getFlag (FLG_NOCOMMENTS)
- && (!tmpcomment || context_getFlag (FLG_TMPCOMMENTS)))
- {
- context_enterSuppressLine (val);
- }
- }
- else if (mstring_equal (t, "end"))
- {
- if (!context_getFlag (FLG_NOCOMMENTS))
- {
- context_exitSuppressRegion ();
- }
- }
- else if (mstring_equal (t, "notfunction"))
- {
- ; /* handled by pcpp */
- }
- else if (mstring_equal (t, "access"))
- {
- cstring tname;
-
- while (TRUE)
- {
- while ((c = *s) && (c == ' ' || c == '\t' || c == '\n'))
- {
- s++;
- }
-
- if (c == '\0')
- {
- break;
- }
-
- tname = cstring_fromChars (s);
-
- while ((c = *s) != '\0' && c != ' '
- && c != '\t' && c != '\n' && c != ',')
- {
- s++;
- }
-
- *s = '\0';
-
-
- if (!context_getFlag (FLG_NOCOMMENTS)
- && !context_getFlag (FLG_NOACCESS))
- {
- if (usymtab_existsType (tname))
- {
- usymId uid = usymtab_getTypeId (tname);
- context_addFileAccessType (uid);
- }
- else
- {
- if (!(context_inSuppressRegion ()
- || context_inSuppressZone (g_currentloc)))
- {
- llmsg
- (message
- ("%q: Unrecognized type %s used in access comment",
- fileloc_unparse (g_currentloc), tname));
- }
- }
- }
-
- if (c != '\0')
- {
- s++;
- }
-
- if (c != ',' && c != ' ')
- {
- break;
- }
- }
- }
- else if (mstring_equal (t, "noaccess"))
- {
- cstring tname;
- char lc;
-
- while (TRUE)
- {
- while ((lc = *s) && (lc == ' ' || lc == '\t' || lc == '\n'))
- {
- s++;
- }
-
- if (lc == '\0')
- {
- break;
- }
-
- tname = cstring_fromChars (s);
-
- while ((lc = *s) != '\0' && lc != ' ' && lc != '\t'
- && lc != '\n' && lc != ',')
- {
- s++;
- }
-
- *s = '\0';
-
- if (!context_getFlag (FLG_NOCOMMENTS)
- && !context_getFlag (FLG_NOACCESS))
- {
- if (usymtab_existsType (tname))
- {
- typeId tuid = usymtab_getTypeId (tname);
-
- if (context_couldHaveAccess (tuid))
- {
- context_removeFileAccessType (tuid);
- }
- else
- {
- if (!(context_inSuppressRegion ()
- || context_inSuppressZone (g_currentloc)))
- {
- uentry ue = usymtab_getTypeEntry (tuid);
-
- if (uentry_isAbstractDatatype (ue))
- {
- llmsg
- (message
- ("%q: Non-accessible abstract type %s used in noaccess comment",
- fileloc_unparse (g_currentloc), tname));
- }
- else
- {
- llmsg
- (message
- ("%q: Non-abstract type %s used in noaccess comment",
- fileloc_unparse (g_currentloc), tname));
- }
- }
- }
- }
- else
- {
- if (!(context_inSuppressRegion ()
- || context_inSuppressZone (g_currentloc)))
- {
- llmsg
- (message
- ("%q: Unrecognized type %s used in noaccess comment",
- fileloc_unparse (g_currentloc), tname));
- }
- }
- }
-
- if (lc != '\0')
- {
- s++;
- }
-
- if (lc != ',' && lc != ' ')
- {
- break;
- }
- }
- }
- else
- {
- setTokLength (- (2 + charsread));
-
- voptgenerror (FLG_UNRECOGCOMMENTS,
- message ("Stylized comment unrecognized: %s",
- cstring_fromChars (os)),
- g_currentloc);
- }
-
- sfree (t);
- }
-
- sfree (os);
- return BADTOK;
-}
-
-static /*@only@*/ cstring makeIdentifier (char *s)
-{
- char *c = mstring_create (size_toInt (strlen (s)) + 1);
- cstring id = cstring_fromChars (c);
-
- while (isalnum (*s) || (*s == '_') || (*s == '$'))
- {
- *c++ = *s++;
- }
-
- *c = '\0';
- return (id);
-}
-
-/*@observer@*/ /*@dependent@*/ uentry coerceId (cstring cn)
-{
- if (!(usymtab_exists (cn)))
- {
- fileloc loc = fileloc_createExternal ();
-
- /*
- ** We need to put this in a global scope, otherwise the sRef will be deallocated.
- */
-
- uentry ce = uentry_makeUnrecognized (cn, loc);
-
- if (!context_inIterEnd ())
- {
- voptgenerror
- (FLG_SYSTEMUNRECOG,
- message ("Unrecognized (possibly system) identifier: %q",
- uentry_getName (ce)),
- g_currentloc);
- }
-
- return ce;
- }
-
- return (usymtab_lookup (cn));
-}
-
-/*
-** like, coerceId, but doesn't supercede for iters
-*/
-
-/*@observer@*/ uentry coerceIterId (cstring cn)
-{
- if (!(usymtab_exists (cn)))
- {
- return uentry_undefined;
- }
-
- return (usymtab_lookup (cn));
-}
-
-/*@observer@*/ cstring LastIdentifier ()
-{
- return (lastidprocessed);
-}
-
-static int processIdentifier (cstring id)
-{
- uentry le;
-
- DPRINTF (("Process identifier: %s", id));
-
- context_clearJustPopped ();
- lastidprocessed = id;
-
- if (context_inFunctionDecl ())
- {
- int tok = commentMarkerToken (id);
-
- if (tok != BADTOK)
- {
- return tok;
- }
- else
- {
- tok = tokenMacroCode (id);
-
- if (tok != BADTOK)
- {
- return tok;
- }
- }
- }
-
- /* Consider handling: Defined by C99 as static const char __func__[] */
-
- if (context_getFlag (FLG_GNUEXTENSIONS))
- {
- int tok = BADTOK;
-
- if (cstring_equalLit (id, "__stdcall")
- || cstring_equalLit (id, "__cdecl")
- || cstring_equalLit (id, "__extension__"))
- {
- return BADTOK;
- }
- else if (cstring_equalLit (id, "__volatile__"))
- {
- tok = QVOLATILE;
- }
- else if (cstring_equalLit (id, "__signed"))
- {
- tok = QSIGNED;
- }
- else if (cstring_equalLit (id, "__unsigned"))
- {
- tok = QUNSIGNED;
- }
- else if (cstring_equalLit (id, "__const__"))
- {
- tok = QCONST;
- }
- else if (cstring_equalLit (id, "__alignof__"))
- {
- tok = CALIGNOF; /* alignof is parsed like sizeof */
- }
- else if (cstring_equalLit (id, "__FUNCTION__")
- || cstring_equalLit (id, "__PRETTY_FUNCTION__"))
- {
- /* These tokens hold the name of the current function as strings */
- yylval.expr = exprNode_stringLiteral (id, fileloc_copy (g_currentloc));
- tokLength = 0;
- lastWasString = TRUE;
- tok = CCONSTANT;
- return tok;
- }
- else if (cstring_equalLit (id, "__attribute__")
- || cstring_equalLit (id, "__asm__")
- || cstring_equalLit (id, "_asm")
- || cstring_equalLit (id, "__asm")
- || cstring_equalLit (id, "__declspec"))
- {
- int depth = 0;
- bool useparens = FALSE;
- bool usebraces = FALSE;
- bool inquote = FALSE;
- bool inescape = FALSE;
- int ic;
-
- while ((ic = input ()) != EOF)
- {
-
- if (inescape)
- {
- inescape = FALSE;
- }
- else if (ic == '\\')
- {
- inescape = TRUE;
- }
- else if (ic == '\"')
- {
- inquote = !inquote;
- }
- else if (!inquote)
- {
- if (ic == '(')
- {
- if (!useparens)
- {
- if (!usebraces)
- {
- useparens = TRUE;
- }
- }
-
- if (useparens)
- {
- depth++;
- }
- }
- else if (ic == '{')
- {
- if (!usebraces)
- {
- if (!useparens)
- {
- usebraces = TRUE;
- }
- }
-
- if (usebraces)
- {
- depth++;
- }
- }
- else if (ic == ')' && useparens)
- {
- depth--;
- if (depth == 0) break;
- }
- else if (ic == '}' && usebraces)
- {
- depth--;
- if (depth == 0) break;
- }
- else if (ic == '}'
- && !usebraces && !useparens
- && cstring_equalLit (id, "__asm"))
- {
- /*
- ** We need this because some MS VC++ include files
- ** have __asm mov ... }
- ** Its a kludge, but otherwise would need to parse
- ** the asm code!
- */
- return TRBRACE;
- }
- }
-
- if (ic == '\n')
- {
- context_incLineno ();
-
- if (cstring_equalLit (id, "__asm")
- && !useparens && !usebraces)
- {
- break;
- }
- }
- }
-
- llassert ((useparens && ic == ')')
- || (usebraces && ic == '}')
- || (!useparens && !usebraces));
-
- return BADTOK;
- }
- else if (cstring_equalLit (id, "inline")
- || cstring_equalLit (id, "__inline")
- || cstring_equalLit (id, "_inline")
- || cstring_equalLit (id, "__inline__"))
- {
- tok = QINLINE;
- }
-
- if (tok != BADTOK)
- {
- RETURN_TOK (tok);
- }
- }
-
- le = usymtab_lookupSafe (id);
-
- /*@-dependenttrans@*/
-
- if (uentry_isIter (le))
- {
- yylval.entry = le;
- return (ITER_NAME);
- }
- else if (uentry_isEndIter (le))
- {
- yylval.entry = le;
- return (ITER_ENDNAME);
- }
- else if (uentry_isUndefined (le))
- {
- yylval.cname = id;
-
- /* avoid parse errors for certain system built ins */
-
- if (g_expectingTypeName && (cstring_firstChar (id) == '_')
- && (cstring_secondChar (id) == '_'))
- {
- return (TYPE_NAME_OR_ID);
- }
-
- return (NEW_IDENTIFIER);
- }
- else if (!uentry_isDeclared (le) && !uentry_isCodeDefined (le))
- {
- if (uentry_isDatatype (le))
- {
- yylval.cname = id;
- return (NEW_IDENTIFIER);
- }
- else
- {
- yylval.entry = le;
- return (IDENTIFIER);
- }
- }
- else if (uentry_isDatatype (le))
- {
- if (!g_expectingTypeName)
- {
- yylval.cname = id;
-
- return (NEW_IDENTIFIER);
- }
- else
- {
- yylval.ctyp = uentry_getAbstractType (le);
-
- uentry_setUsed (le, g_currentloc);
- return (TYPE_NAME);
- }
- }
- else
- {
- yylval.entry = le;
- return (IDENTIFIER);
- }
-
- /*@=dependenttrans@*/
-}
-
-static bool processHashIdentifier (/*@only@*/ cstring id)
-{
- if (context_inMacro () || context_inIterDef () ||
- context_inIterEnd ())
- {
- uentry le;
-
- context_clearJustPopped ();
-
- lastidprocessed = id;
- le = usymtab_lookupSafe (id);
-
- if (uentry_isParam (le) || uentry_isRefParam (le))
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- else
- {
- cstring_free (id);
- return FALSE;
- }
-}
-
-
-static /*@only@*/ exprNode processString ()
-{
- exprNode res;
- fileloc loc;
- char *nl = strchr (yytext, '\n');
- cstring ns = cstring_fromCharsNew (yytext);
-
- if (nl == NULL)
- {
- loc = fileloc_copy (g_currentloc);
- addColumn (cstring_length (ns));
- }
- else
- {
- char *lastnl = nl;
-
- loc = fileloc_copy (g_currentloc);
-
- context_incLineno ();
-
- while ((nl = strchr ((nl + 1), '\n')) != NULL)
- {
- context_incLineno ();
- lastnl = nl;
- }
- }
-
-
- res = exprNode_stringLiteral (ns, loc);
- return (res);
-}
-
-static
-char processChar ()
-{
- char fchar;
- char next;
-
- llassert (*yytext != '\0');
- fchar = *(yytext + 1);
- if (fchar != '\\') return fchar;
-
- next = *(yytext + 2);
-
- switch (next)
- {
- case 'n': return '\n';
- case 't': return '\t';
- case '\"': return '\"';
- case '\'': return '\'';
- case '\\': return '\\';
- default: return '\0';
- }
-}
-
-static
-double processFloat ()
-{
- double ret = atof (yytext);
-
- return (ret);
-}
-
-static
-long processHex ()
-{
- int index = 2;
- long val = 0;
-
- llassert (yytext[0] == '0'
- && (yytext[1] == 'X' || yytext[1] == 'x'));
-
- while (yytext[index] != '\0') {
- int tval;
- char c = yytext[index];
-
- if (c >= '0' && c <= '9') {
- tval = (int) c - (int) '0';
- } else if (c >= 'A' && c <= 'F') {
- tval = (int) c - (int) 'A' + 10;
- } else if (c >= 'a' && c <= 'f') {
- tval = (int) c - (int) 'a' + 10;
- } else if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
- index++;
- while (yytext[index] != '\0') {
- if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
- ;
- } else {
- voptgenerror
- (FLG_SYNTAX,
- message ("Invalid character (%c) following specifier in hex constant: %s",
- c, cstring_fromChars (yytext)),
- g_currentloc);
- }
- index++;
- }
-
- break;
- } else {
- voptgenerror
- (FLG_SYNTAX,
- message ("Invalid character (%c) in hex constant: %s",
- c, cstring_fromChars (yytext)),
- g_currentloc);
- break;
- }
-
- val = (val * 16) + tval;
- index++;
- }
-
- DPRINTF (("Hex constant: %s = %ld", yytext, val));
- return val;
-}
-
-static
-long processOctal ()
-{
- int index = 1;
- long val = 0;
-
- llassert (yytext[0] == '0' && yytext[1] != 'X' && yytext[1] != 'x');
-
- while (yytext[index] != '\0') {
- int tval;
- char c = yytext[index];
-
- if (c >= '0' && c <= '7') {
- tval = (int) c - (int) '0';
- } else {
- voptgenerror
- (FLG_SYNTAX,
- message ("Invalid character (%c) in octal constant: %s",
- c, cstring_fromChars (yytext)),
- g_currentloc);
- break;
- }
-
- val = (val * 8) + tval;
- index++;
- }
-
- DPRINTF (("Octal constant: %s = %ld", yytext, val));
- return val;
-}
-
-static
-long processDec ()
-{
- return (atol (yytext));
-}
-
-static int
-processSpec (int tok)
-{
- size_t length = strlen (yytext);
-
-
- if (inSpecPart)
- {
- setTokLengthT (length);
- RETURN_TOK (tok);
- }
- else
- {
-
- context_saveLocation ();
- setTokLengthT (length);
- return (processIdentifier (makeIdentifier (yytext)));
- }
-}