New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Lookahead error [sf#98] #100

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

Comments

Projects
None yet
2 participants
@lsf37
Member

lsf37 commented Feb 15, 2015

Reported by ccleve on 2008-07-14 22:40 UTC
I get the following message when generating a lexer:

java.lang.Error: When inserting lookahead expression: unkown expression type 42 in type = 42
content :
foo

Here's a simplified version of the file that generates the error:

%%
%class Test
%{
%}

foo="<foo>"|":"
bar=([:letter:])+

%%

{bar}/{foo} { return 1; }
(.) { return 0; }

@lsf37 lsf37 changed the title from Lookahead error to [Bug] Lookahead error [sf#98] 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 2008-07-27 06:40 UTC
Logged In: YES
user_id=93534
Originator: NO

Thanks. This is now fixed in revision r378 in the subversion repository.

The bug is triggered for a macro use on the right hand side of a lookahead expression. It is only triggered if this rhs is a choice ("|") expression where all alternatives have the same length (this is one of the optimisation cases). The code fails to expand the macro usage.

A workaround until the next release is to expand the macro usage in these specific cases.

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2008-07-27 06:40 UTC
Logged In: YES
user_id=93534
Originator: NO

Thanks. This is now fixed in revision r378 in the subversion repository.

The bug is triggered for a macro use on the right hand side of a lookahead expression. It is only triggered if this rhs is a choice ("|") expression where all alternatives have the same length (this is one of the optimisation cases). The code fails to expand the macro usage.

A workaround until the next release is to expand the macro usage in these specific cases.

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2008-07-27 06:40 UTC

  • milestone: --> jflex bug
  • status: open --> open-fixed
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2008-07-27 06:40 UTC

  • milestone: --> jflex bug
  • status: open --> open-fixed
@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2009-01-31 13:12 UTC

  • status: open-fixed --> closed
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2009-01-31 13:12 UTC

  • status: open-fixed --> closed

@lsf37 lsf37 added bug and removed bug labels Feb 17, 2015

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

@regisd regisd added this to the 1.4.3 milestone Nov 4, 2017

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