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] unexpected Error: could not match input [sf#107] #109

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

Comments

Projects
None yet
2 participants
@lsf37
Member

lsf37 commented Feb 15, 2015

Reported by kneunert on 2010-03-01 20:56 UTC
I'm using a bit of a trick in the Lexer like this:

<YYINITIAL> {identifier}[ { yybegin(ARRAY1); return someSymbol; }
<ARRAY1> $? { yybegin(ARRAY2); return someSymbol; }
<ARRAY2> $? { yybegin(ARRAY3); return someSymbol; }
<ARRAY3> $? { yybegin(YYINITIAL); return someSymbol; }
<YYINITIAL> ] { yybegin(YYINITIAL); return someSymbol; }

The trick here is, that i use an unconvential optional character. This Character is not there, so no character gets consumed however a series of symbols are returned. This used to work in JLex and it does not seem to work in JFlex anymore.
I get this:

Symbol: [
Exception in thread "main" java.lang.Error: Error: could not match input
at struktor.processor.Yylex.zzScanError(Yylex.java:439)
at struktor.processor.Yylex.next_token(Yylex.java:590)
at struktor.processor.MyMain.main(MyMain.java:19)

I have a simple testcase for this. If needed, i can attach it to this ticket.

Thanks

Kim ( https://sourceforge.net/projects/struktor/ )

@lsf37 lsf37 changed the title from unexpected Error: could not match input to [Bug] unexpected Error: could not match input [sf#107] Feb 15, 2015

@lsf37 lsf37 added this to the jlex incompatibility 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 2010-03-01 22:34 UTC
Hi Kim,

yes, please attach your test file so I can reproduce the problem.

Cheers,
Gerwin

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2010-03-01 22:34 UTC
Hi Kim,

yes, please attach your test file so I can reproduce the problem.

Cheers,
Gerwin

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by kneunert on 2010-03-02 17:42 UTC

Member

lsf37 commented Feb 15, 2015

Commented by kneunert on 2010-03-02 17:42 UTC

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by kneunert on 2010-03-02 17:43 UTC
Hi Gerwin,

i attached a running eclipse-project with ant-file. If you are only interested in the lexer-definition-file, have a look into lexer/processor.lex

cheers

Kim

Member

lsf37 commented Feb 15, 2015

Commented by kneunert on 2010-03-02 17:43 UTC
Hi Gerwin,

i attached a running eclipse-project with ant-file. If you are only interested in the lexer-definition-file, have a look into lexer/processor.lex

cheers

Kim

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by kneunert on 2010-03-27 20:02 UTC
Did you have the chance to look into it? Anything i can do for this issue?

thanks

Kim

Member

lsf37 commented Feb 15, 2015

Commented by kneunert on 2010-03-27 20:02 UTC
Did you have the chance to look into it? Anything i can do for this issue?

thanks

Kim

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2010-04-01 05:44 UTC
Sorry haven't had a chance yet to look at it in more detail. Hope to get there in about two weeks.

Cheers,
Gerwin

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2010-04-01 05:44 UTC
Sorry haven't had a chance yet to look at it in more detail. Hope to get there in about two weeks.

Cheers,
Gerwin

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by kneunert on 2010-05-22 19:05 UTC
Anything new about that?

cheers

Kim

Member

lsf37 commented Feb 15, 2015

Commented by kneunert on 2010-05-22 19:05 UTC
Anything new about that?

cheers

Kim

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by malbrech on 2010-10-16 07:20 UTC
Hello Gerwin,

my students learn to program with Kim’s „Struktor“, which is a very helpful tool. In a few weeks they want to learn about arrays. But there is this problem with the bracket notification in JFLEX. Please forgive me putting pressure on you. I’m sure, that you have to solve a lot of problems which are more important and urgent than this one. But I need to know, if it’s possible to fix this bug within the next two weeks because it will take some time to find another way of teaching this subject.

My students and I will be very grateful, if you succeed in fixing the bug. Good luck.

Best regards
Michael (teacher at Gymnasium Nonnenwerth, Germany)
www.nonnenwerth.de

Member

lsf37 commented Feb 15, 2015

Commented by malbrech on 2010-10-16 07:20 UTC
Hello Gerwin,

my students learn to program with Kim’s „Struktor“, which is a very helpful tool. In a few weeks they want to learn about arrays. But there is this problem with the bracket notification in JFLEX. Please forgive me putting pressure on you. I’m sure, that you have to solve a lot of problems which are more important and urgent than this one. But I need to know, if it’s possible to fix this bug within the next two weeks because it will take some time to find another way of teaching this subject.

My students and I will be very grateful, if you succeed in fixing the bug. Good luck.

Best regards
Michael (teacher at Gymnasium Nonnenwerth, Germany)
www.nonnenwerth.de

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2010-10-17 02:29 UTC
bugfix patch

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2010-10-17 02:29 UTC
bugfix patch

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2010-10-17 02:30 UTC
fixed version of jflex/src/JFlex/Emitter.java

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2010-10-17 02:30 UTC
fixed version of jflex/src/JFlex/Emitter.java

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2010-10-17 02:32 UTC
I've attached a quick fix to the bug tracker. I haven't done any serious testing yet, but it should fix the problem.

I can also attach a new JFlex.jar if you need it. Let me know if you do.

Cheers,
Gerwin

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2010-10-17 02:32 UTC
I've attached a quick fix to the bug tracker. I haven't done any serious testing yet, but it should fix the problem.

I can also attach a new JFlex.jar if you need it. Let me know if you do.

Cheers,
Gerwin

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by kneunert on 2010-10-17 09:56 UTC
Thanks, Gerwin. That looks good. I asked michael to test it with his students. If he is alright, you may put that in SVN?!

cheers

Kim

Member

lsf37 commented Feb 15, 2015

Commented by kneunert on 2010-10-17 09:56 UTC
Thanks, Gerwin. That looks good. I asked michael to test it with his students. If he is alright, you may put that in SVN?!

cheers

Kim

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by lsf37 on 2010-10-19 02:01 UTC
The bug is now fixed in revision 605 in trunk and the jflex-1.4.3-fixes branch.

This fix only works for the %pack (default) and %table code generation methods. The %switch method will still exhibit the problem, but I'd like to deprecate the %switch and %table methods anyway in the future.

Cheers,
Gerwin

Member

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2010-10-19 02:01 UTC
The bug is now fixed in revision 605 in trunk and the jflex-1.4.3-fixes branch.

This fix only works for the %pack (default) and %table code generation methods. The %switch method will still exhibit the problem, but I'd like to deprecate the %switch and %table methods anyway in the future.

Cheers,
Gerwin

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2010-10-19 02:01 UTC

  • status: open --> open-fixed
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2010-10-19 02:01 UTC

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

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Commented by nobody on 2010-10-19 05:17 UTC
Thank you very much, Gerwin. In the next few weeks I will test it with my students.

Cheers,
Michael

Member

lsf37 commented Feb 15, 2015

Commented by nobody on 2010-10-19 05:17 UTC
Thank you very much, Gerwin. In the next few weeks I will test it with my students.

Cheers,
Michael

@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Feb 15, 2015

Member

Updated by lsf37 on 2014-03-01 00:26 UTC

  • status: open-fixed --> closed
Member

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2014-03-01 00:26 UTC

  • status: open-fixed --> closed

@lsf37 lsf37 removed this from the jlex incompatibility milestone Feb 17, 2015

lsf37 added a commit that referenced this issue Feb 21, 2015

Warn about expressions that match the empty string.
There are legitimate cases where you might want to match the empty string
(see issue #109), but it can easily lead to non-termination.

Triggered by issue #133, but is not a fix.

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

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