initscan.c (102412) | initscan.c (179549) |
---|---|
1#line 2 "scan.c" 2/* A lexical scanner generated by flex */ 3 4/* Scanner skeleton version: 5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ 6 */ 7#include <sys/cdefs.h> | 1#line 2 "scan.c" 2/* A lexical scanner generated by flex */ 3 4/* Scanner skeleton version: 5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ 6 */ 7#include <sys/cdefs.h> |
8__FBSDID("$FreeBSD: head/usr.bin/lex/initscan.c 102412 2002-08-25 13:23:09Z charnier $"); | 8__FBSDID("$FreeBSD: head/usr.bin/lex/initscan.c 179549 2008-06-04 19:50:34Z dwmalone $"); |
9 10#define FLEX_SCANNER 11#define YY_FLEX_MAJOR_VERSION 2 12#define YY_FLEX_MINOR_VERSION 5 13 14#include <stdio.h> 15 16 --- 1254 unchanged lines hidden (view full) --- 1271 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 1272 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 1273 */ 1274 1275/* $Header: /home/daffy/u0/vern/flex/RCS/scan.l,v 2.56 95/04/24 12:17:19 vern Exp $ */ 1276 1277#ifndef lint 1278static const char rcsid[] = | 9 10#define FLEX_SCANNER 11#define YY_FLEX_MAJOR_VERSION 2 12#define YY_FLEX_MINOR_VERSION 5 13 14#include <stdio.h> 15 16 --- 1254 unchanged lines hidden (view full) --- 1271 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 1272 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 1273 */ 1274 1275/* $Header: /home/daffy/u0/vern/flex/RCS/scan.l,v 2.56 95/04/24 12:17:19 vern Exp $ */ 1276 1277#ifndef lint 1278static const char rcsid[] = |
1279 "$FreeBSD: head/usr.bin/lex/initscan.c 102412 2002-08-25 13:23:09Z charnier $"; | 1279 "$FreeBSD: head/usr.bin/lex/initscan.c 179549 2008-06-04 19:50:34Z dwmalone $"; |
1280#endif /* not lint */ 1281 1282#include "flexdef.h" 1283#include "parse.h" 1284 1285#define ACTION_ECHO add_action( yytext ) 1286#define ACTION_IFDEF(def, should_define) \ 1287 { \ --- 193 unchanged lines hidden (view full) --- 1481#define YY_RULE_SETUP \ 1482 if ( yyleng > 0 ) \ 1483 yy_current_buffer->yy_at_bol = \ 1484 (yytext[yyleng - 1] == '\n'); \ 1485 YY_USER_ACTION 1486 1487YY_DECL 1488 { | 1280#endif /* not lint */ 1281 1282#include "flexdef.h" 1283#include "parse.h" 1284 1285#define ACTION_ECHO add_action( yytext ) 1286#define ACTION_IFDEF(def, should_define) \ 1287 { \ --- 193 unchanged lines hidden (view full) --- 1481#define YY_RULE_SETUP \ 1482 if ( yyleng > 0 ) \ 1483 yy_current_buffer->yy_at_bol = \ 1484 (yytext[yyleng - 1] == '\n'); \ 1485 YY_USER_ACTION 1486 1487YY_DECL 1488 { |
1489 register yy_state_type yy_current_state; 1490 register char *yy_cp, *yy_bp; 1491 register int yy_act; | 1489 yy_state_type yy_current_state; 1490 char *yy_cp, *yy_bp; 1491 int yy_act; |
1492 1493#line 94 "scan.l" 1494 1495 static int bracelevel, didadef, indented_code; 1496 static int doing_rule_action = false; 1497 static int option_sense; 1498 1499 int doing_codeblock = false; --- 39 unchanged lines hidden (view full) --- 1539 */ 1540 yy_bp = yy_cp; 1541 1542 yy_current_state = yy_start; 1543 yy_current_state += YY_AT_BOL(); 1544yy_match: 1545 do 1546 { | 1492 1493#line 94 "scan.l" 1494 1495 static int bracelevel, didadef, indented_code; 1496 static int doing_rule_action = false; 1497 static int option_sense; 1498 1499 int doing_codeblock = false; --- 39 unchanged lines hidden (view full) --- 1539 */ 1540 yy_bp = yy_cp; 1541 1542 yy_current_state = yy_start; 1543 yy_current_state += YY_AT_BOL(); 1544yy_match: 1545 do 1546 { |
1547 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; | 1547 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
1548 if ( yy_accept[yy_current_state] ) 1549 { 1550 yy_last_accepting_state = yy_current_state; 1551 yy_last_accepting_cpos = yy_cp; 1552 } 1553 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1554 { 1555 yy_current_state = (int) yy_def[yy_current_state]; --- 736 unchanged lines hidden (view full) --- 2292 return '['; 2293 } 2294 } 2295 YY_BREAK 2296case 106: 2297YY_RULE_SETUP 2298#line 435 "scan.l" 2299{ | 1548 if ( yy_accept[yy_current_state] ) 1549 { 1550 yy_last_accepting_state = yy_current_state; 1551 yy_last_accepting_cpos = yy_cp; 1552 } 1553 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1554 { 1555 yy_current_state = (int) yy_def[yy_current_state]; --- 736 unchanged lines hidden (view full) --- 2292 return '['; 2293 } 2294 } 2295 YY_BREAK 2296case 106: 2297YY_RULE_SETUP 2298#line 435 "scan.l" 2299{ |
2300 register Char *nmdefptr; | 2300 Char *nmdefptr; |
2301 Char *ndlookup(); 2302 2303 strcpy( nmstr, yytext + 1 ); 2304 nmstr[yyleng - 2] = '\0'; /* chop trailing brace */ 2305 2306 if ( (nmdefptr = ndlookup( nmstr )) == 0 ) 2307 format_synerr( 2308 _( "undefined definition {%s}" ), --- 582 unchanged lines hidden (view full) --- 2891 * Returns a code representing an action: 2892 * EOB_ACT_LAST_MATCH - 2893 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 2894 * EOB_ACT_END_OF_FILE - end of file 2895 */ 2896 2897static int yy_get_next_buffer() 2898 { | 2301 Char *ndlookup(); 2302 2303 strcpy( nmstr, yytext + 1 ); 2304 nmstr[yyleng - 2] = '\0'; /* chop trailing brace */ 2305 2306 if ( (nmdefptr = ndlookup( nmstr )) == 0 ) 2307 format_synerr( 2308 _( "undefined definition {%s}" ), --- 582 unchanged lines hidden (view full) --- 2891 * Returns a code representing an action: 2892 * EOB_ACT_LAST_MATCH - 2893 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 2894 * EOB_ACT_END_OF_FILE - end of file 2895 */ 2896 2897static int yy_get_next_buffer() 2898 { |
2899 register char *dest = yy_current_buffer->yy_ch_buf; 2900 register char *source = yytext_ptr; 2901 register int number_to_move, i; | 2899 char *dest = yy_current_buffer->yy_ch_buf; 2900 char *source = yytext_ptr; 2901 int number_to_move, i; |
2902 int ret_val; 2903 2904 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 2905 YY_FATAL_ERROR( 2906 "fatal flex scanner internal error--end of buffer missed" ); 2907 2908 if ( yy_current_buffer->yy_fill_buffer == 0 ) 2909 { /* Don't try to fill the buffer, so this is an EOF. */ --- 113 unchanged lines hidden (view full) --- 3023 return ret_val; 3024 } 3025 3026 3027/* yy_get_previous_state - get the state just before the EOB char was reached */ 3028 3029static yy_state_type yy_get_previous_state() 3030 { | 2902 int ret_val; 2903 2904 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 2905 YY_FATAL_ERROR( 2906 "fatal flex scanner internal error--end of buffer missed" ); 2907 2908 if ( yy_current_buffer->yy_fill_buffer == 0 ) 2909 { /* Don't try to fill the buffer, so this is an EOF. */ --- 113 unchanged lines hidden (view full) --- 3023 return ret_val; 3024 } 3025 3026 3027/* yy_get_previous_state - get the state just before the EOB char was reached */ 3028 3029static yy_state_type yy_get_previous_state() 3030 { |
3031 register yy_state_type yy_current_state; 3032 register char *yy_cp; | 3031 yy_state_type yy_current_state; 3032 char *yy_cp; |
3033 3034 yy_current_state = yy_start; 3035 yy_current_state += YY_AT_BOL(); 3036 3037 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 3038 { | 3033 3034 yy_current_state = yy_start; 3035 yy_current_state += YY_AT_BOL(); 3036 3037 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 3038 { |
3039 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | 3039 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
3040 if ( yy_accept[yy_current_state] ) 3041 { 3042 yy_last_accepting_state = yy_current_state; 3043 yy_last_accepting_cpos = yy_cp; 3044 } 3045 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 3046 { 3047 yy_current_state = (int) yy_def[yy_current_state]; --- 15 unchanged lines hidden (view full) --- 3063 3064#ifdef YY_USE_PROTOS 3065static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 3066#else 3067static yy_state_type yy_try_NUL_trans( yy_current_state ) 3068yy_state_type yy_current_state; 3069#endif 3070 { | 3040 if ( yy_accept[yy_current_state] ) 3041 { 3042 yy_last_accepting_state = yy_current_state; 3043 yy_last_accepting_cpos = yy_cp; 3044 } 3045 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 3046 { 3047 yy_current_state = (int) yy_def[yy_current_state]; --- 15 unchanged lines hidden (view full) --- 3063 3064#ifdef YY_USE_PROTOS 3065static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 3066#else 3067static yy_state_type yy_try_NUL_trans( yy_current_state ) 3068yy_state_type yy_current_state; 3069#endif 3070 { |
3071 register int yy_is_jam; 3072 register char *yy_cp = yy_c_buf_p; | 3071 int yy_is_jam; 3072 char *yy_cp = yy_c_buf_p; |
3073 | 3073 |
3074 register YY_CHAR yy_c = 1; | 3074 YY_CHAR yy_c = 1; |
3075 if ( yy_accept[yy_current_state] ) 3076 { 3077 yy_last_accepting_state = yy_current_state; 3078 yy_last_accepting_cpos = yy_cp; 3079 } 3080 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 3081 { 3082 yy_current_state = (int) yy_def[yy_current_state]; --- 4 unchanged lines hidden (view full) --- 3087 yy_is_jam = (yy_current_state == 768); 3088 3089 return yy_is_jam ? 0 : yy_current_state; 3090 } 3091 3092 3093#ifndef YY_NO_UNPUT 3094#ifdef YY_USE_PROTOS | 3075 if ( yy_accept[yy_current_state] ) 3076 { 3077 yy_last_accepting_state = yy_current_state; 3078 yy_last_accepting_cpos = yy_cp; 3079 } 3080 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 3081 { 3082 yy_current_state = (int) yy_def[yy_current_state]; --- 4 unchanged lines hidden (view full) --- 3087 yy_is_jam = (yy_current_state == 768); 3088 3089 return yy_is_jam ? 0 : yy_current_state; 3090 } 3091 3092 3093#ifndef YY_NO_UNPUT 3094#ifdef YY_USE_PROTOS |
3095static void yyunput( int c, register char *yy_bp ) | 3095static void yyunput( int c, char *yy_bp ) |
3096#else 3097static void yyunput( c, yy_bp ) 3098int c; | 3096#else 3097static void yyunput( c, yy_bp ) 3098int c; |
3099register char *yy_bp; | 3099char *yy_bp; |
3100#endif 3101 { | 3100#endif 3101 { |
3102 register char *yy_cp = yy_c_buf_p; | 3102 char *yy_cp = yy_c_buf_p; |
3103 3104 /* undo effects of setting up yytext */ 3105 *yy_cp = yy_hold_char; 3106 3107 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 3108 { /* need to shift things up to make room */ 3109 /* +2 for EOB chars. */ | 3103 3104 /* undo effects of setting up yytext */ 3105 *yy_cp = yy_hold_char; 3106 3107 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 3108 { /* need to shift things up to make room */ 3109 /* +2 for EOB chars. */ |
3110 register int number_to_move = yy_n_chars + 2; 3111 register char *dest = &yy_current_buffer->yy_ch_buf[ | 3110 int number_to_move = yy_n_chars + 2; 3111 char *dest = &yy_current_buffer->yy_ch_buf[ |
3112 yy_current_buffer->yy_buf_size + 2]; | 3112 yy_current_buffer->yy_buf_size + 2]; |
3113 register char *source = | 3113 char *source = |
3114 &yy_current_buffer->yy_ch_buf[number_to_move]; 3115 3116 while ( source > yy_current_buffer->yy_ch_buf ) 3117 *--dest = *--source; 3118 3119 yy_cp += (int) (dest - source); 3120 yy_bp += (int) (dest - source); 3121 yy_current_buffer->yy_n_chars = --- 445 unchanged lines hidden (view full) --- 3567static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 3568#else 3569static void yy_flex_strncpy( s1, s2, n ) 3570char *s1; 3571yyconst char *s2; 3572int n; 3573#endif 3574 { | 3114 &yy_current_buffer->yy_ch_buf[number_to_move]; 3115 3116 while ( source > yy_current_buffer->yy_ch_buf ) 3117 *--dest = *--source; 3118 3119 yy_cp += (int) (dest - source); 3120 yy_bp += (int) (dest - source); 3121 yy_current_buffer->yy_n_chars = --- 445 unchanged lines hidden (view full) --- 3567static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 3568#else 3569static void yy_flex_strncpy( s1, s2, n ) 3570char *s1; 3571yyconst char *s2; 3572int n; 3573#endif 3574 { |
3575 register int i; | 3575 int i; |
3576 for ( i = 0; i < n; ++i ) 3577 s1[i] = s2[i]; 3578 } 3579#endif 3580 3581#ifdef YY_NEED_STRLEN 3582#ifdef YY_USE_PROTOS 3583static int yy_flex_strlen( yyconst char *s ) 3584#else 3585static int yy_flex_strlen( s ) 3586yyconst char *s; 3587#endif 3588 { | 3576 for ( i = 0; i < n; ++i ) 3577 s1[i] = s2[i]; 3578 } 3579#endif 3580 3581#ifdef YY_NEED_STRLEN 3582#ifdef YY_USE_PROTOS 3583static int yy_flex_strlen( yyconst char *s ) 3584#else 3585static int yy_flex_strlen( s ) 3586yyconst char *s; 3587#endif 3588 { |
3589 register int n; | 3589 int n; |
3590 for ( n = 0; s[n]; ++n ) 3591 ; 3592 3593 return n; 3594 } 3595#endif 3596 3597 --- 107 unchanged lines hidden --- | 3590 for ( n = 0; s[n]; ++n ) 3591 ; 3592 3593 return n; 3594 } 3595#endif 3596 3597 --- 107 unchanged lines hidden --- |