Skip to content
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
Closed

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

lsf37 opened this issue Feb 15, 2015 · 3 comments
Labels
Milestone

Comments

@lsf37
Copy link
Member

@lsf37 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 Lookahead error [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
Copy link
Member Author

@lsf37 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.

Loading

@lsf37
Copy link
Member Author

@lsf37 lsf37 commented Feb 15, 2015

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

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

Loading

@lsf37
Copy link
Member Author

@lsf37 lsf37 commented Feb 15, 2015

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

  • status: open-fixed --> closed

Loading

@lsf37 lsf37 added bug and removed bug labels Feb 17, 2015
@lsf37 lsf37 removed this from the jflex bug milestone Feb 17, 2015
@lsf37 lsf37 removed this from the jflex bug milestone 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
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants