"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/parse.y" between
flex-2.6.3.tar.gz and flex-2.6.4.tar.gz

About: Flex ("Fast Lexical Analyzer") is a tool for generating scanners/tokenizers.

parse.y  (flex-2.6.3):parse.y  (flex-2.6.4)
skipping to change at line 82 skipping to change at line 82
int scon_stk_ptr; int scon_stk_ptr;
static int madeany = false; /* whether we've made the '.' character class */ static int madeany = false; /* whether we've made the '.' character class */
static int ccldot, cclany; static int ccldot, cclany;
int previous_continued_action; /* whether the previous rule's action was '|' */ int previous_continued_action; /* whether the previous rule's action was '|' */
#define format_warn3(fmt, a1, a2) \ #define format_warn3(fmt, a1, a2) \
do{ \ do{ \
char fw3_msg[MAXLINE];\ char fw3_msg[MAXLINE];\
snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\ snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\
warn( fw3_msg );\ lwarn( fw3_msg );\
}while(0) }while(0)
/* Expand a POSIX character class expression. */ /* Expand a POSIX character class expression. */
#define CCL_EXPR(func) \ #define CCL_EXPR(func) \
do{ \ do{ \
int c; \ int c; \
for ( c = 0; c < csize; ++c ) \ for ( c = 0; c < csize; ++c ) \
if ( isascii(c) && func(c) ) \ if ( isascii(c) && func(c) ) \
ccladd( currccl, c ); \ ccladd( currccl, c ); \
}while(0) }while(0)
skipping to change at line 307 skipping to change at line 307
else else
{ {
/* This EOF applies to all start conditions /* This EOF applies to all start conditions
* which don't already have EOF actions. * which don't already have EOF actions.
*/ */
for ( i = 1; i <= lastsc; ++i ) for ( i = 1; i <= lastsc; ++i )
if ( ! sceof[i] ) if ( ! sceof[i] )
scon_stk[++scon_stk_ptr] = i; scon_stk[++scon_stk_ptr] = i;
if ( scon_stk_ptr == 0 ) if ( scon_stk_ptr == 0 )
warn( lwarn(
"all start conditions already have <<EOF>> rules" ); "all start conditions already have <<EOF>> rules" );
else else
build_eof_action(); build_eof_action();
} }
} }
| error | error
{ synerr( _("unrecognized rule") ); } { synerr( _("unrecognized rule") ); }
; ;
skipping to change at line 402 skipping to change at line 402
{ {
/* We need to treat this as variable trailing /* We need to treat this as variable trailing
* context so that the backup does not happen * context so that the backup does not happen
* in the action but before the action switch * in the action but before the action switch
* statement. If the backup happens in the * statement. If the backup happens in the
* action, then the rules "falling into" this * action, then the rules "falling into" this
* one's action will *also* do the backup, * one's action will *also* do the backup,
* erroneously. * erroneously.
*/ */
if ( ! varlength || headcnt != 0 ) if ( ! varlength || headcnt != 0 )
warn( lwarn(
"trailing context made variable due to preceding '|' action" ); "trailing context made variable due to preceding '|' action" );
/* Mark as variable. */ /* Mark as variable. */
varlength = true; varlength = true;
headcnt = 0; headcnt = 0;
} }
if ( lex_compat || (varlength && headcnt == 0) ) if ( lex_compat || (varlength && headcnt == 0) )
{ /* variable trailing context rule */ { /* variable trailing context rule */
skipping to change at line 457 skipping to change at line 457
{ {
synerr( _("trailing context used twice") ); synerr( _("trailing context used twice") );
$$ = mkstate( SYM_EPSILON ); $$ = mkstate( SYM_EPSILON );
} }
else if ( previous_continued_action ) else if ( previous_continued_action )
{ {
/* See the comment in the rule for "re2 re" /* See the comment in the rule for "re2 re"
* above. * above.
*/ */
warn( lwarn(
"trailing context made variable due to preceding '|' action" ); "trailing context made variable due to preceding '|' action" );
varlength = true; varlength = true;
} }
if ( lex_compat || varlength ) if ( lex_compat || varlength )
{ {
/* Again, see the comment in the rule for /* Again, see the comment in the rule for
* "re2 re" above. * "re2 re" above.
*/ */
skipping to change at line 915 skipping to change at line 915
| CCE_NEG_BLANK { CCL_NEG_EXPR(IS_BLANK); } | CCE_NEG_BLANK { CCL_NEG_EXPR(IS_BLANK); }
| CCE_NEG_CNTRL { CCL_NEG_EXPR(iscntrl); } | CCE_NEG_CNTRL { CCL_NEG_EXPR(iscntrl); }
| CCE_NEG_DIGIT { CCL_NEG_EXPR(isdigit); } | CCE_NEG_DIGIT { CCL_NEG_EXPR(isdigit); }
| CCE_NEG_GRAPH { CCL_NEG_EXPR(isgraph); } | CCE_NEG_GRAPH { CCL_NEG_EXPR(isgraph); }
| CCE_NEG_PRINT { CCL_NEG_EXPR(isprint); } | CCE_NEG_PRINT { CCL_NEG_EXPR(isprint); }
| CCE_NEG_PUNCT { CCL_NEG_EXPR(ispunct); } | CCE_NEG_PUNCT { CCL_NEG_EXPR(ispunct); }
| CCE_NEG_SPACE { CCL_NEG_EXPR(isspace); } | CCE_NEG_SPACE { CCL_NEG_EXPR(isspace); }
| CCE_NEG_XDIGIT { CCL_NEG_EXPR(isxdigit); } | CCE_NEG_XDIGIT { CCL_NEG_EXPR(isxdigit); }
| CCE_NEG_LOWER { | CCE_NEG_LOWER {
if ( sf_case_ins() ) if ( sf_case_ins() )
warn(_("[:^lower:] is ambiguous in case i nsensitive scanner")); lwarn(_("[:^lower:] is ambiguous in case insensitive scanner"));
else else
CCL_NEG_EXPR(islower); CCL_NEG_EXPR(islower);
} }
| CCE_NEG_UPPER { | CCE_NEG_UPPER {
if ( sf_case_ins() ) if ( sf_case_ins() )
warn(_("[:^upper:] ambiguous in case inse nsitive scanner")); lwarn(_("[:^upper:] ambiguous in case ins ensitive scanner"));
else else
CCL_NEG_EXPR(isupper); CCL_NEG_EXPR(isupper);
} }
; ;
string : string CHAR string : string CHAR
{ {
if ( $2 == nlch ) if ( $2 == nlch )
rule_has_nl[num_rules] = true; rule_has_nl[num_rules] = true;
skipping to change at line 1014 skipping to change at line 1014
pinpoint_message( str ); pinpoint_message( str );
} }
/* format_warn - write out formatted warning */ /* format_warn - write out formatted warning */
void format_warn( const char *msg, const char arg[] ) void format_warn( const char *msg, const char arg[] )
{ {
char warn_msg[MAXLINE]; char warn_msg[MAXLINE];
snprintf( warn_msg, sizeof(warn_msg), msg, arg ); snprintf( warn_msg, sizeof(warn_msg), msg, arg );
warn( warn_msg ); lwarn( warn_msg );
} }
/* warn - report a warning, unless -w was given */ /* lwarn - report a warning, unless -w was given */
void warn( const char *str ) void lwarn( const char *str )
{ {
line_warning( str, linenum ); line_warning( str, linenum );
} }
/* format_pinpoint_message - write out a message formatted with one string, /* format_pinpoint_message - write out a message formatted with one string,
* pinpointing its location * pinpointing its location
*/ */
void format_pinpoint_message( const char *msg, const char arg[] ) void format_pinpoint_message( const char *msg, const char arg[] )
{ {
 End of changes. 9 change blocks. 
9 lines changed or deleted 9 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS