[Bug] dangerous lookahead check may fail [sf#38] #40

Closed
lsf37 opened this Issue Feb 15, 2015 · 8 comments

Comments

Projects
None yet
1 participant
@lsf37
Member

lsf37 commented Feb 15, 2015

Reported by lsf37 on 2001-05-04 21:15 UTC
for some lookahead expressions JFlex will fail to print a warning that they are dangerous (r1 / r2 is
dangerous if any postfix of r1 matches a prefix r2).

Example:

.+ "a" / "b" .+ { action }

will not produce a warning/error message, but the postfix .+"a" of r1 matches a prefix of r2 (the
whole lookahead).

These lookahead expressions might match some inputs incorrectly. It is guaranteed that the rule
gets chosen if there is a match for the expression r1r2 (concatenation of r1 and r2), and it is
guaranteed that yytext() matches r1. It is not guaranteed that there is an instance of r2 after
yytext() (because too few lookahead characters were put back into the input).

Workaround: check manually if your lookahead expressions are dangerous.

(reported by Robert Hubley)

@lsf37 lsf37 changed the title from dangerous lookahead check may fail to [Bug] dangerous lookahead check may fail [sf#38] Feb 15, 2015

@lsf37 lsf37 added this to the jflex bug milestone Feb 15, 2015

@lsf37 lsf37 closed this Feb 15, 2015

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2001-05-04 21:16 UTC
Logged In: YES
user_id=93534

it is not clear yet wether this bug will be fixed soon

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2001-05-04 21:16 UTC
Logged In: YES
user_id=93534

it is not clear yet wether this bug will be fixed soon

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2001-09-27 13:05 UTC

  • status: open --> open-later
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2001-09-27 13:05 UTC

  • status: open --> open-later
@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2004-11-07 06:05 UTC
Logged In: YES
user_id=93534

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2004-11-07 06:05 UTC
Logged In: YES
user_id=93534

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2004-11-07 06:05 UTC

  • priority: 7 --> 2
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2004-11-07 06:05 UTC

  • priority: 7 --> 2
@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2004-11-07 06:08 UTC
Logged In: YES
user_id=93534

The warning is now safe (version 1.4.1), but very crude (reports
way too many cases as unsafe).

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2004-11-07 06:08 UTC
Logged In: YES
user_id=93534

The warning is now safe (version 1.4.1), but very crude (reports
way too many cases as unsafe).

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2007-11-25 11:53 UTC
Logged In: YES
user_id=93534
Originator: YES

fixed in svn revision 299.

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2007-11-25 11:53 UTC
Logged In: YES
user_id=93534
Originator: YES

fixed in svn revision 299.

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2007-11-25 11:53 UTC

  • status: open-later --> open-fixed
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2007-11-25 11:53 UTC

  • status: open-later --> open-fixed
@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2008-05-27 11:46 UTC

  • status: open-fixed --> closed
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2008-05-27 11:46 UTC

  • status: open-fixed --> closed

@lsf37 lsf37 added the bug label Feb 17, 2015

@lsf37 lsf37 modified the milestone: jflex bug Feb 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment