Changeset 462

Show
Ignore:
Timestamp:
04/01/06 18:19:44 (3 years ago)
Author:
dp
Message:

shellcode-signatures

  • improve grammar
  • prevent a buffer overflow when parsing the mapping (respect MAP_MAX.)
  • use yyleng instead of strlen()
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/shellcode-signatures/lex.yy.c

    r437 r462  
    1  
    2 #line 3 "lex.yy.c" 
    3  
    4 #define  YY_INT_ALIGNED short int 
    5  
    61/* A lexical scanner generated by flex */ 
     2 
     3/* Scanner skeleton version: 
     4 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ 
     5 */ 
    76 
    87#define FLEX_SCANNER 
    98#define YY_FLEX_MAJOR_VERSION 2 
    109#define YY_FLEX_MINOR_VERSION 5 
    11 #define YY_FLEX_SUBMINOR_VERSION 31 
    12 #if YY_FLEX_SUBMINOR_VERSION > 0 
    13 #define FLEX_BETA 
    14 #endif 
    15  
    16 /* First, we deal with  platform-specific or compiler-specific issues. */ 
    17  
    18 /* begin standard C headers. */ 
     10 
    1911#include <stdio.h> 
    20 #include <string.h> 
    21 #include <errno.h> 
     12#include <unistd.h> 
     13 
     14 
     15/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 
     16#ifdef c_plusplus 
     17#ifndef __cplusplus 
     18#define __cplusplus 
     19#endif 
     20#endif 
     21 
     22 
     23#ifdef __cplusplus 
     24 
    2225#include <stdlib.h> 
    2326 
    24 /* end standard C headers. */ 
    25  
    26 /* flex integer type definitions */ 
    27  
    28 #ifndef FLEXINT_H 
    29 #define FLEXINT_H 
    30  
    31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 
    32  
    33 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L 
    34 #include <inttypes.h> 
    35 typedef int8_t flex_int8_t; 
    36 typedef uint8_t flex_uint8_t; 
    37 typedef int16_t flex_int16_t; 
    38 typedef uint16_t flex_uint16_t; 
    39 typedef int32_t flex_int32_t; 
    40 typedef uint32_t flex_uint32_t; 
    41 #else 
    42 typedef signed char flex_int8_t; 
    43 typedef short int flex_int16_t; 
    44 typedef int flex_int32_t; 
    45 typedef unsigned char flex_uint8_t;  
    46 typedef unsigned short int flex_uint16_t; 
    47 typedef unsigned int flex_uint32_t; 
    48 #endif /* ! C99 */ 
    49  
    50 /* Limits of integral types. */ 
    51 #ifndef INT8_MIN 
    52 #define INT8_MIN               (-128) 
    53 #endif 
    54 #ifndef INT16_MIN 
    55 #define INT16_MIN              (-32767-1) 
    56 #endif 
    57 #ifndef INT32_MIN 
    58 #define INT32_MIN              (-2147483647-1) 
    59 #endif 
    60 #ifndef INT8_MAX 
    61 #define INT8_MAX               (127) 
    62 #endif 
    63 #ifndef INT16_MAX 
    64 #define INT16_MAX              (32767) 
    65 #endif 
    66 #ifndef INT32_MAX 
    67 #define INT32_MAX              (2147483647) 
    68 #endif 
    69 #ifndef UINT8_MAX 
    70 #define UINT8_MAX              (255U) 
    71 #endif 
    72 #ifndef UINT16_MAX 
    73 #define UINT16_MAX             (65535U) 
    74 #endif 
    75 #ifndef UINT32_MAX 
    76 #define UINT32_MAX             (4294967295U) 
    77 #endif 
    78  
    79 #endif /* ! FLEXINT_H */ 
    80  
    81 #ifdef __cplusplus 
     27/* Use prototypes in function declarations. */ 
     28#define YY_USE_PROTOS 
    8229 
    8330/* The "const" storage-class-modifier is valid. */ 
     
    8835#if __STDC__ 
    8936 
     37#define YY_USE_PROTOS 
    9038#define YY_USE_CONST 
    9139 
     
    9341#endif  /* ! __cplusplus */ 
    9442 
     43#ifdef __TURBOC__ 
     44 #pragma warn -rch 
     45 #pragma warn -use 
     46#include <io.h> 
     47#include <stdlib.h> 
     48#define YY_USE_CONST 
     49#define YY_USE_PROTOS 
     50#endif 
     51 
    9552#ifdef YY_USE_CONST 
    9653#define yyconst const 
    9754#else 
    9855#define yyconst 
     56#endif 
     57 
     58 
     59#ifdef YY_USE_PROTOS 
     60#define YY_PROTO(proto) proto 
     61#else 
     62#define YY_PROTO(proto) () 
    9963#endif 
    10064 
     
    11377 * definition of BEGIN. 
    11478 */ 
    115 #define BEGIN (yy_start) = 1 + 2 * 
     79#define BEGIN yy_start = 1 + 2 * 
    11680 
    11781/* Translate the current start state into a value that can be later handed 
     
    11983 * compatibility. 
    12084 */ 
    121 #define YY_START (((yy_start) - 1) / 2) 
     85#define YY_START ((yy_start - 1) / 2) 
    12286#define YYSTATE YY_START 
    12387 
     
    12690 
    12791/* Special action meaning "start processing a new file". */ 
    128 #define YY_NEW_FILE yyrestart(yyin
     92#define YY_NEW_FILE yyrestart( yyin
    12993 
    13094#define YY_END_OF_BUFFER_CHAR 0 
    13195 
    13296/* Size of default input buffer. */ 
    133 #ifndef YY_BUF_SIZE 
    13497#define YY_BUF_SIZE 16384 
    135 #endif 
    136  
    137 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 
    138 #define YY_TYPEDEF_YY_BUFFER_STATE 
     98 
    13999typedef struct yy_buffer_state *YY_BUFFER_STATE; 
    140 #endif 
    141100 
    142101extern int yyleng; 
    143  
    144102extern FILE *yyin, *yyout; 
    145103 
     
    148106#define EOB_ACT_LAST_MATCH 2 
    149107 
    150     #define YY_LESS_LINENO(n) 
    151      
    152 /* Return all but the first "n" matched characters back to the input stream. */ 
     108/* The funky do-while in the following #define is used to turn the definition 
     109 * int a single C statement (which needs a semi-colon terminator).  This 
     110 * avoids problems with code like: 
     111 * 
     112 *      if ( condition_holds ) 
     113 *              yyless( 5 ); 
     114 *      else 
     115 *              do_something_else(); 
     116 * 
     117 * Prior to using the do-while the compiler would get upset at the 
     118 * "else" because it interpreted the "if" statement as being all 
     119 * done when it reached the ';' after the yyless() call. 
     120 */ 
     121 
     122/* Return all but the first 'n' matched characters back to the input stream. */ 
     123 
    153124#define yyless(n) \ 
    154125        do \ 
    155126                { \ 
    156127                /* Undo effects of setting up yytext. */ \ 
    157         int yyless_macro_arg = (n); \ 
    158         YY_LESS_LINENO(yyless_macro_arg);\ 
    159                 *yy_cp = (yy_hold_char); \ 
     128                *yy_cp = yy_hold_char; \ 
    160129                YY_RESTORE_YY_MORE_OFFSET \ 
    161                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 
     130                yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 
    162131                YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 
    163132                } \ 
    164133        while ( 0 ) 
    165134 
    166 #define unput(c) yyunput( c, (yytext_ptr)
     135#define unput(c) yyunput( c, yytext_ptr
    167136 
    168137/* The following is because we cannot portably get our hands on size_t 
     
    170139 * flex-generated scanners to compile on their own). 
    171140 */ 
    172  
    173 #ifndef YY_TYPEDEF_YY_SIZE_T 
    174 #define YY_TYPEDEF_YY_SIZE_T 
    175141typedef unsigned int yy_size_t; 
    176 #endif 
    177  
    178 #ifndef YY_STRUCT_YY_BUFFER_STATE 
    179 #define YY_STRUCT_YY_BUFFER_STATE 
     142 
     143 
    180144struct yy_buffer_state 
    181145        { 
     
    214178        int yy_at_bol; 
    215179 
    216     int yy_bs_lineno; /**< The line count. */ 
    217     int yy_bs_column; /**< The column count. */ 
    218      
    219180        /* Whether to try to fill the input buffer when we reach the 
    220181         * end of it. 
     
    223184 
    224185        int yy_buffer_status; 
    225  
    226186#define YY_BUFFER_NEW 0 
    227187#define YY_BUFFER_NORMAL 1 
     
    237197         */ 
    238198#define YY_BUFFER_EOF_PENDING 2 
    239  
    240199        }; 
    241 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 
    242  
    243 /* Stack of input buffers. */ 
    244 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 
    245 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 
    246 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 
     200 
     201static YY_BUFFER_STATE yy_current_buffer = 0; 
    247202 
    248203/* We provide macros for accessing buffer states in case in the 
    249204 * future we want to put the buffer states in a more general 
    250205 * "scanner state". 
    251  * 
    252  * Returns the top of the stack, or NULL. 
    253206 */ 
    254 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 
    255                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 
    256                           : NULL) 
    257  
    258 /* Same as previous macro, but useful when we know that the buffer stack is not 
    259  * NULL or when we need an lvalue. For internal use only. 
    260  */ 
    261 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 
     207#define YY_CURRENT_BUFFER yy_current_buffer 
     208 
    262209 
    263210/* yy_hold_char holds the character lost when yytext is formed. */ 
    264211static char yy_hold_char; 
     212 
    265213static int yy_n_chars;          /* number of characters read into yy_ch_buf */ 
     214 
     215 
    266216int yyleng; 
    267217 
     
    276226static int yy_did_buffer_switch_on_eof; 
    277227 
    278 void yyrestart (FILE *input_file  ); 
    279 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  ); 
    280 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  ); 
    281 void yy_delete_buffer (YY_BUFFER_STATE b  ); 
    282 void yy_flush_buffer (YY_BUFFER_STATE b  ); 
    283 void yypush_buffer_state (YY_BUFFER_STATE new_buffer  ); 
    284 void yypop_buffer_state (void ); 
    285  
    286 static void yyensure_buffer_stack (void ); 
    287 static void yy_load_buffer_state (void ); 
    288 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  ); 
    289  
    290 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 
    291  
    292 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  ); 
    293 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  ); 
    294 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  ); 
    295  
    296 void *yyalloc (yy_size_t  ); 
    297 void *yyrealloc (void *,yy_size_t  ); 
    298 void yyfree (void *  ); 
     228void yyrestart YY_PROTO(( FILE *input_file )); 
     229 
     230void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 
     231void yy_load_buffer_state YY_PROTO(( void )); 
     232YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 
     233void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 
     234void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 
     235void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 
     236#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 
     237 
     238YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 
     239YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 
     240YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 
     241 
     242static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 
     243static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 
     244static void yy_flex_free YY_PROTO(( void * )); 
    299245 
    300246#define yy_new_buffer yy_create_buffer 
     
    302248#define yy_set_interactive(is_interactive) \ 
    303249        { \ 
    304         if ( ! YY_CURRENT_BUFFER ){ \ 
    305         yyensure_buffer_stack (); \ 
    306                 YY_CURRENT_BUFFER_LVALUE =    \ 
    307             yy_create_buffer(yyin,YY_BUF_SIZE ); \ 
    308         } \ 
    309         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 
     250        if ( ! yy_current_buffer ) \ 
     251                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 
     252        yy_current_buffer->yy_is_interactive = is_interactive; \ 
    310253        } 
    311254 
    312255#define yy_set_bol(at_bol) \ 
    313256        { \ 
    314         if ( ! YY_CURRENT_BUFFER ){\ 
    315         yyensure_buffer_stack (); \ 
    316                 YY_CURRENT_BUFFER_LVALUE =    \ 
    317             yy_create_buffer(yyin,YY_BUF_SIZE ); \ 
    318         } \ 
    319         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 
    320         } 
    321  
    322 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 
    323  
    324 /* Begin user sect3 */ 
     257        if ( ! yy_current_buffer ) \ 
     258                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 
     259        yy_current_buffer->yy_at_bol = at_bol; \ 
     260        } 
     261 
     262#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 
    325263 
    326264typedef unsigned char YY_CHAR; 
    327  
    328265FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 
    329  
    330266typedef int yy_state_type; 
    331  
    332 extern int yylineno; 
    333  
    334 int yylineno = 1; 
    335  
    336267extern char *yytext; 
    337268#define yytext_ptr yytext 
    338269 
    339 static yy_state_type yy_get_previous_state (void ); 
    340 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ); 
    341 static int yy_get_next_buffer (void ); 
    342 static void yy_fatal_error (yyconst char msg[]  ); 
     270static yy_state_type yy_get_previous_state YY_PROTO(( void )); 
     271static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 
     272static int yy_get_next_buffer YY_PROTO(( void )); 
     273static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 
    343274 
    344275/* Done after the current pattern has been matched and before the 
     
    346277 */ 
    347278#define YY_DO_BEFORE_ACTION \ 
    348         (yytext_ptr) = yy_bp; \ 
    349         yyleng = (size_t) (yy_cp - yy_bp); \ 
    350         (yy_hold_char) = *yy_cp; \ 
     279        yytext_ptr = yy_bp; \ 
     280        yyleng = (int) (yy_cp - yy_bp); \ 
     281        yy_hold_char = *yy_cp; \ 
    351282        *yy_cp = '\0'; \ 
    352         (yy_c_buf_p) = yy_cp; 
     283        yy_c_buf_p = yy_cp; 
    353284 
    354285#define YY_NUM_RULES 57 
    355286#define YY_END_OF_BUFFER 58 
    356 /* This struct is not used in this scanner, 
    357    but its presence is necessary. */ 
    358 struct yy_trans_info 
    359         { 
    360         flex_int32_t yy_verify; 
    361         flex_int32_t yy_nxt; 
    362         }; 
    363 static yyconst flex_int16_t yy_accept[219] = 
     287static yyconst short int yy_accept[219] = 
    364288    {   0, 
    365289       55,   55,   40,   40,   53,   53,   58,   57,   55,   56, 
     
    389313    } ; 
    390314 
    391 static yyconst flex_int32_t yy_ec[256] = 
     315static yyconst int yy_ec[256] = 
    392316    {   0, 
    393317        1,    1,    1,    1,    1,    1,    1,    1,    2,    3, 
     
    421345    } ; 
    422346 
    423 static yyconst flex_int32_t yy_meta[48] = 
     347static yyconst int yy_meta[48] = 
    424348    {   0, 
    425349        1,    1,    2,    1,    1,    3,    1,    1,    4,    1, 
     
    430354    } ; 
    431355 
    432 static yyconst flex_int16_t yy_base[227] = 
     356static yyconst short int yy_base[227] = 
    433357    {   0, 
    434358        0,    0,   45,   46,   44,   45,  263,  264,   54,  264, 
     
    459383    } ; 
    460384 
    461 static yyconst flex_int16_t yy_def[227] = 
     385static yyconst short int yy_def[227] = 
    462386    {   0, 
    463387      218,    1,  219,  219,  220,  220,  218,  218,  218,  218, 
     
    488412    } ; 
    489413 
    490 static yyconst flex_int16_t yy_nxt[312] = 
     414static yyconst short int yy_nxt[312] = 
    491415    {   0, 
    492416        8,    9,   10,    9,    9,   11,   12,   13,    8,   14, 
     
    527451    } ; 
    528452 
    529 static yyconst flex_int16_t yy_chk[312] = 
     453static yyconst short int yy_chk[312] = 
    530454    {   0, 
    531455        1,    1,    1,    1,    1,    1,    1,    1,    1,    1, 
     
    569493static char *yy_last_accepting_cpos; 
    570494 
    571 extern int yy_flex_debug; 
    572 int yy_flex_debug = 0; 
    573  
    574495/* The intent behind this definition is that it'll catch 
    575496 * any uses of REJECT which flex missed. 
     
    581502char *yytext; 
    582503#line 1 "parser.l" 
     504#define INITIAL 0 
    583505/* $Id$ */ 
    584506#line 3 "parser.l" 
     
    596518static int string_cap = 0; 
    597519 
    598  
    599 #line 600 "lex.yy.c" 
    600  
    601 #define INITIAL 0 
    602520#define comment 1 
    603521#define string 2 
    604522 
    605 #ifndef YY_NO_UNISTD_H 
    606 /* Special case for "unistd.h", since it is non-ANSI. We include it way 
    607  * down here because we want the user's section 1 to have been scanned first. 
    608  * The user has a chance to override it with an option. 
    609  */ 
    610 #include <unistd.h> 
    611 #endif 
    612  
    613 #ifndef YY_EXTRA_TYPE 
    614 #define YY_EXTRA_TYPE void * 
    615 #endif 
     523#line 524 "lex.yy.c" 
    616524 
    617525/* Macros after this point can all be overridden by user definitions in 
     
    621529#ifndef YY_SKIP_YYWRAP 
    622530#ifdef __cplusplus 
    623 extern "C" int yywrap (void ); 
    624 #else 
    625 extern int yywrap (void ); 
    626 #endif 
    627 #endif 
    628  
    629     static void yyunput (int c,char *buf_ptr  ); 
    630      
     531extern "C" int yywrap YY_PROTO(( void )); 
     532#else 
     533extern int yywrap YY_PROTO(( void )); 
     534#endif 
     535#endif 
     536 
     537#ifndef YY_NO_UNPUT 
     538static void yyunput YY_PROTO(( int c, char *buf_ptr )); 
     539#endif 
     540 
    631541#ifndef yytext_ptr 
    632 static void yy_flex_strncpy (char *,yyconst char *,int ); 
     542static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 
    633543#endif 
    634544 
    635545#ifdef YY_NEED_STRLEN 
    636 static int yy_flex_strlen (yyconst char * ); 
     546static int yy_flex_strlen YY_PROTO(( yyconst char * )); 
    637547#endif 
    638548 
    639549#ifndef YY_NO_INPUT 
    640  
    641550#ifdef __cplusplus 
    642 static int yyinput (void ); 
    643 #else 
    644 static int input (void ); 
    645 #endif 
    646  
     551static int yyinput YY_PROTO(( void )); 
     552#else 
     553static int input YY_PROTO(( void )); 
     554#endif 
     555#endif 
     556 
     557#if YY_STACK_USED 
     558static int yy_start_stack_ptr = 0; 
     559static int yy_start_stack_depth = 0; 
     560static int *yy_start_stack = 0; 
     561#ifndef YY_NO_PUSH_STATE 
     562static void yy_push_state YY_PROTO(( int new_state )); 
     563#endif 
     564#ifndef YY_NO_POP_STATE 
     565static void yy_pop_state YY_PROTO(( void )); 
     566#endif 
     567#ifndef YY_NO_TOP_STATE 
     568static int yy_top_state YY_PROTO(( void )); 
     569#endif 
     570 
     571#else 
     572#define YY_NO_PUSH_STATE 1 
     573#define YY_NO_POP_STATE 1 
     574#define YY_NO_TOP_STATE 1 
     575#endif 
     576 
     577#ifdef YY_MALLOC_DECL 
     578YY_MALLOC_DECL 
     579#else 
     580#if __STDC__ 
     581#ifndef __cplusplus 
     582#include <stdlib.h> 
     583#endif 
     584#else 
     585/* Just try to get by without declaring the routines.  This will fail 
     586 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 
     587 * or sizeof(void*) != sizeof(int). 
     588 */ 
     589#endif 
    647590#endif 
    648591 
     
    653596 
    654597/* Copy whatever the last rule matched to the standard output. */ 
     598 
    655599#ifndef ECHO 
    656600/* This used to be an fputs(), but since the string might contain NUL's, 
     
    665609#ifndef YY_INPUT 
    666610#define YY_INPUT(buf,result,max_size) \ 
    667         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 
     611        if ( yy_current_buffer->yy_is_interactive ) \ 
    668612                { \ 
    669                 int c = '*'; \ 
    670                 size_t n; \ 
     613                int c = '*', n; \ 
    671614                for ( n = 0; n < max_size && \ 
    672615                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 
     
    678621                result = n; \ 
    679622                } \ 
    680         else \ 
    681                 { \ 
    682                 errno=0; \ 
    683                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 
    684                         { \ 
    685                         if( errno != EINTR) \ 
    686                                 { \ 
    687                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 
    688                                 break; \ 
    689                                 } \ 
    690                         errno=0; \ 
    691                         clearerr(yyin); \ 
    692                         } \ 
    693                 }\ 
    694 
    695  
     623        else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 
     624                  && ferror( yyin ) ) \ 
     625                YY_FATAL_ERROR( "input in flex scanner failed" ); 
    696626#endif 
    697627 
     
    714644#endif 
    715645 
    716 /* end tables serialization structures and prototypes */ 
    717  
    718646/* Default declaration of generated scanner - a define so the user can 
    719647 * easily add parameters. 
    720648 */ 
    721649#ifndef YY_DECL 
    722 #define YY_DECL_IS_OURS 1 
    723  
    724 extern int yylex (void); 
    725  
    726 #define YY_DECL int yylex (void) 
    727 #endif /* !YY_DECL */ 
     650#define YY_DECL int yylex YY_PROTO(( void )) 
     651#endif 
    728652 
    729653/* Code executed at the beginning of each rule, after yytext and yyleng 
     
    742666        YY_USER_ACTION 
    743667 
    744 /** The main scanner function which does all the work. 
    745  */ 
    746668YY_DECL 
    747 
     669       
    748670        register yy_state_type yy_current_state; 
    749         register char *yy_cp, *yy_bp
     671        register char *yy_cp = NULL, *yy_bp = NULL
    750672        register int yy_act; 
    751      
     673 
    752674#line 25 "parser.l" 
    753675 
    754676 
    755677 
    756 #line 757 "lex.yy.c" 
    757  
    758         if ( (yy_init)
     678#line 679 "lex.yy.c" 
     679 
     680        if ( yy_init
    759681                { 
    760                 (yy_init) = 0; 
     682                yy_init = 0; 
    761683 
    762684#ifdef YY_USER_INIT 
     
    764686#endif 
    765687 
    766                 if ( ! (yy_start)
    767                         (yy_start) = 1;       /* first start state */ 
     688                if ( ! yy_start
     689                        yy_start = 1; /* first start state */ 
    768690 
    769691                if ( ! yyin ) 
     
    773695                        yyout = stdout; 
    774696 
    775                 if ( ! YY_CURRENT_BUFFER ) { 
    776                         yyensure_buffer_stack (); 
    777                         YY_CURRENT_BUFFER_LVALUE = 
    778                                 yy_create_buffer(yyin,YY_BUF_SIZE ); 
    779                 } 
    780  
    781                 yy_load_buffer_state( ); 
     697                if ( ! yy_current_buffer ) 
     698                        yy_current_buffer = 
     699                                yy_create_buffer( yyin, YY_BUF_SIZE ); 
     700 
     701                yy_load_buffer_state(); 
    782702                } 
    783703 
    784704        while ( 1 )             /* loops until end-of-file is reached */ 
    785705                { 
    786                 yy_cp = (yy_c_buf_p)
     706                yy_cp = yy_c_buf_p
    787707 
    788708                /* Support of yytext. */ 
    789                 *yy_cp = (yy_hold_char)
     709                *yy_cp = yy_hold_char
    790710 
    791711                /* yy_bp points to the position in yy_ch_buf of the start of 
     
    794714                yy_bp = yy_cp; 
    795715 
    796                 yy_current_state = (yy_start)
     716                yy_current_state = yy_start
    797717yy_match: 
    798718                do 
     
    801721                        if ( yy_accept[yy_current_state] ) 
    802722                                { 
    803                                 (yy_last_accepting_state) = yy_current_state; 
    804                                 (yy_last_accepting_cpos) = yy_cp; 
     723                                yy_last_accepting_state = yy_current_state; 
     724                                yy_last_accepting_cpos = yy_cp; 
    805725                                } 
    806726                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 
     
    819739                if ( yy_act == 0 ) 
    820740                        { /* have to back up */ 
    821                         yy_cp = (yy_last_accepting_cpos)
    822                         yy_current_state = (yy_last_accepting_state)
     741                        yy_cp = yy_last_accepting_cpos
     742                        yy_current_state = yy_last_accepting_state
    823743                        yy_act = yy_accept[yy_current_state]; 
    824744                        } 
     
    826746                YY_DO_BEFORE_ACTION; 
    827747 
     748 
    828749do_action:      /* This label is used only to access EOF actions. */ 
     750 
    829751 
    830752                switch ( yy_act ) 
     
    832754                        case 0: /* must back up */ 
    833755                        /* undo the effects of YY_DO_BEFORE_ACTION */ 
    834                         *yy_cp = (yy_hold_char)
    835                         yy_cp = (yy_last_accepting_cpos)
    836                         yy_current_state = (yy_last_accepting_state)
     756                        *yy_cp = yy_hold_char
     757                        yy_cp = yy_last_accepting_cpos
     758                        yy_current_state = yy_last_accepting_state
    837759                        goto yy_find_action; 
    838760 
     
    1025947YY_RULE_SETUP 
    1026948#line 73 "parser.l" 
    1027 { string_append(yytext, strlen(yytext)); return SC_ID; } 
     949{ string_append(yytext, yyleng); return SC_ID; } 
    1028950        YY_BREAK 
    1029951case 39: 
     
    1048970        YY_BREAK 
    1049971case 43: 
    1050 /* rule 43 can match eol */ 
    1051972YY_RULE_SETUP 
    1052973#line 80 "parser.l" 
     
    11051026        YY_BREAK 
    11061027case 53: 
    1107 /* rule 53 can match eol */ 
    11081028YY_RULE_SETUP 
    11091029#line 97 "parser.l" 
    1110 { string_append(yytext, strlen(yytext)); } 
     1030{ string_append(yytext, yyleng); } 
    11111031        YY_BREAK 
    11121032case 54: 
     
    11211041        YY_BREAK 
    11221042case 56: 
    1123 /* rule 56 can match eol */ 
    11241043YY_RULE_SETUP 
    11251044#line 102 "parser.l" 
     
    11311050ECHO; 
    11321051        YY_BREAK 
    1133 #line 1134 "lex.yy.c" 
     1052#line 1053 "lex.yy.c" 
    11341053case YY_STATE_EOF(INITIAL): 
    11351054case YY_STATE_EOF(comment): 
     
    11401059                { 
    11411060                /* Amount of text matched not including the EOB char. */ 
    1142                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 
     1061                int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 
    11431062 
    11441063                /* Undo the effects of YY_DO_BEFORE_ACTION. */ 
    1145                 *yy_cp = (yy_hold_char)
     1064                *yy_cp = yy_hold_char
    11461065                YY_RESTORE_YY_MORE_OFFSET 
    11471066 
    1148                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 
     1067                if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 
    11491068                        { 
    11501069                        /* We're scanning a new file or input source.  It's 
     
    11521071                         * just pointed yyin at a new source and called 
    11531072                         * yylex().  If so, then we have to assure 
    1154                          * consistency between YY_CURRENT_BUFFER and our 
     1073                         * consistency between yy_current_buffer and our 
    11551074                         * globals.  Here is the right place to do so, because 
    11561075                         * this is the first action (other than possibly a 
    11571076                         * back-up) that will match for the new input source. 
    11581077                         */ 
    1159                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 
    1160                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 
    1161                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 
     1078                        yy_n_chars = yy_current_buffer->yy_n_chars; 
     1079                        yy_current_buffer->yy_input_file = yyin; 
     1080                        yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 
    11621081                        } 
    11631082 
     
    11691088                 * in input(). 
    11701089                 */ 
    1171                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 
     1090                if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 
    11721091                        { /* This was really a NUL. */ 
    11731092                        yy_state_type yy_next_state; 
    11741093 
    1175                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 
    1176  
    1177                         yy_current_state = yy_get_previous_state(  ); 
     1094                        yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 
     1095 
     1096                        yy_current_state = yy_get_previous_state(); 
    11781097 
    11791098                        /* Okay, we're now positioned to make the NUL 
     
    11881107                        yy_next_state = yy_try_NUL_trans( yy_current_state ); 
    11891108 
    1190                         yy_bp = (yytext_ptr) + YY_MORE_ADJ; 
     1109                        yy_bp = yytext_ptr + YY_MORE_ADJ; 
    11911110 
    11921111                        if ( yy_next_state ) 
    11931112                                { 
    11941113                                /* Consume the NUL. */ 
    1195                                 yy_cp = ++(yy_c_buf_p)
     1114                                yy_cp = ++yy_c_buf_p
    11961115                                yy_current_state = yy_next_state; 
    11971116                                goto yy_match; 
     
    12001119                        else 
    12011120                                { 
    1202                                 yy_cp = (yy_c_buf_p)
     1121                                yy_cp = yy_c_buf_p
    12031122                                goto yy_find_action; 
    12041123                                } 
    12051124                        } 
    12061125 
    1207                 else switch ( yy_get_next_buffer(  ) ) 
     1126                else switch ( yy_get_next_buffer() ) 
    12081127                        { 
    12091128                        case EOB_ACT_END_OF_FILE: 
    12101129                                { 
    1211                                 (yy_did_buffer_switch_on_eof) = 0; 
    1212  
    1213                                 if ( yywrap( ) ) 
     1130                                yy_did_buffer_switch_on_eof = 0; 
     1131 
     1132                                if ( yywrap() ) 
    12141133                                        { 
    12151134                                        /* Note: because we've taken care in 
     
    12221141                                         * YY_NULL will get returned. 
    12231142                                         */ 
    1224                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 
     1143                                        yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 
    12251144 
    12261145                                        yy_act = YY_STATE_EOF(YY_START); 
     
    12301149                                else 
    12311150                                        { 
    1232                                         if ( ! (yy_did_buffer_switch_on_eof)
     1151                                        if ( ! yy_did_buffer_switch_on_eof
    12331152                                                YY_NEW_FILE; 
    12341153                                        } 
     
    12371156 
    12381157                        case EOB_ACT_CONTINUE_SCAN: 
    1239                                 (yy_c_buf_p)
    1240                                         (yytext_ptr) + yy_amount_of_matched_text; 
    1241  
    1242                                 yy_current_state = yy_get_previous_state(  ); 
    1243  
    1244                                 yy_cp = (yy_c_buf_p)
    1245                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 
     1158                                yy_c_buf_p
     1159                                        yytext_ptr + yy_amount_of_matched_text; 
     1160 
     1161                                yy_current_state = yy_get_previous_state(); 
     1162 
     1163                                yy_cp = yy_c_buf_p
     1164                                yy_bp = yytext_ptr + YY_MORE_ADJ; 
    12461165                                goto yy_match; 
    12471166 
    12481167                        case EOB_ACT_LAST_MATCH: 
    1249                                 (yy_c_buf_p)
    1250                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 
    1251  
    1252                                 yy_current_state = yy_get_previous_state(  ); 
    1253  
    1254                                 yy_cp = (yy_c_buf_p)
    1255                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 
     1168                                yy_c_buf_p
     1169                                &yy_current_buffer->yy_ch_buf[yy_n_chars]; 
     1170 
     1171                                yy_current_state = yy_get_previous_state(); 
     1172 
     1173                                yy_cp = yy_c_buf_p
     1174                                yy_bp = yytext_ptr + YY_MORE_ADJ; 
    12561175                                goto yy_find_action; 
    12571176                        } 
     
    12641183        } /* end of action switch */ 
    12651184                } /* end of scanning one token */ 
    1266 } /* end of yylex */ 
     1185        } /* end of yylex */ 
     1186 
    12671187 
    12681188/* yy_get_next_buffer - try to read in a new buffer 
     
    12731193 *      EOB_ACT_END_OF_FILE - end of file 
    12741194 */ 
    1275 static int yy_get_next_buffer (void) 
    1276 
    1277         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 
    1278         register char *source = (yytext_ptr); 
     1195 
     1196static int yy_get_next_buffer() 
     1197        { 
     1198        register char *dest = yy_current_buffer->yy_ch_buf; 
     1199        register char *source = yytext_ptr; 
    12791200        register int number_to_move, i; 
    12801201        int ret_val; 
    12811202 
    1282         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 
     1203        if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 
    12831204                YY_FATAL_ERROR( 
    12841205                "fatal flex scanner internal error--end of buffer missed" ); 
    12851206 
    1286         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 
     1207        if ( yy_current_buffer->yy_fill_buffer == 0 ) 
    12871208                { /* Don't try to fill the buffer, so this is an EOF. */ 
    1288                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 
     1209                if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 
    12891210                        { 
    12901211                        /* We matched a single character, the EOB, so 
     
    13061227 
    13071228        /* First move last chars to start of buffer. */ 
    1308         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 
     1229        number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 
    13091230 
    13101231        for ( i = 0; i < number_to_move; ++i ) 
    13111232                *(dest++) = *(source++); 
    13121233 
    1313         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 
     1234        if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 
    13141235                /* don't do the read, it's not guaranteed to return an EOF, 
    13151236                 * just force an EOF 
    13161237                 */ 
    1317                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 
     1238                yy_current_buffer->yy_n_chars = yy_n_chars = 0; 
    13181239 
    13191240        else 
    13201241                { 
    1321                        size_t num_to_read = 
    1322                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 
     1242                int num_to_read = 
     1243                        yy_current_buffer->yy_buf_size - number_to_move - 1; 
    13231244 
    13241245                while ( num_to_read <= 0 ) 
    13251246                        { /* Not enough room in the buffer - grow it. */ 
     1247#ifdef YY_USES_REJECT 
     1248                        YY_FATAL_ERROR( 
     1249"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 
     1250#else 
    13261251 
    13271252                        /* just a shorter name for the current buffer */ 
    1328                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER
     1253                        YY_BUFFER_STATE b = yy_current_buffer
    13291254 
    13301255                        int yy_c_buf_p_offset = 
    1331                                 (int) ((yy_c_buf_p) - b->yy_ch_buf); 
     1256                                (int) (yy_c_buf_p - b->yy_ch_buf); 
    13321257 
    13331258                        if ( b->yy_is_our_buffer ) 
     
    13421267                                b->yy_ch_buf = (char *) 
    13431268                                        /* Include room in for 2 EOB chars. */ 
    1344                                         yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  ); 
     1269                                        yy_flex_realloc( (void *) b->yy_ch_buf, 
     1270                                                         b->yy_buf_size + 2 ); 
    13451271