jflex icon indicating copy to clipboard operation
jflex copied to clipboard

NullPointerException from --dot

Open nobrakal opened this issue 3 years ago • 1 comments

Hi there,

I am experimenting with JFlex (copy of the file used here: https://gist.github.com/nobrakal/a532bae3af834ca74e21619483283c2e ) and got this error:

$ jflex --dot blabla.jflex

Reading "blabla.jflex"
Constructing NFA : 
Unexpected exception encountered. This indicates a bug in JFlex.
Please consider filing an issue at http://github.com/jflex-de/jflex/issues/new


Cannot invoke "jflex.state.StateSet.iterator()" because "this.table[i][input]" is null
java.lang.NullPointerException: Cannot invoke "jflex.state.StateSet.iterator()" because "this.table[i][input]" is null
	at jflex.core.NFA.dotFormat(NFA.java:502)
	at jflex.core.NFA.writeDot(NFA.java:478)
	at jflex.generator.LexGenerator.generate(LexGenerator.java:80)
	at jflex.Main.generate(Main.java:320)
	at jflex.Main.main(Main.java:336)

I am using JFlex 1.8.2 on an up-to-data Archlinux.

nobrakal avatar Nov 16 '21 08:11 nobrakal

Thanks for reporting that, it looks like one of the refactors has forgotten to add a null pointer check.

lsf37 avatar Nov 19 '21 03:11 lsf37

Turns out this is a duplicate of #769, fixed in #797. The next release will contain the fix.

lsf37 avatar Jan 01 '23 04:01 lsf37