Consider the following grammar:
lexer grammar StackoverflowOnClosure;
ClosureEof: EOF*;
It fails with Stackoverflow on empty input:
at org.antlr.v4.runtime.misc.Array2DHashSet.getOrAdd(Array2DHashSet.java:59)
at org.antlr.v4.runtime.atn.ATNConfigSet.add(ATNConfigSet.java:146)
at org.antlr.v4.runtime.atn.ATNConfigSet.add(ATNConfigSet.java:122)
at org.antlr.v4.runtime.atn.LexerATNSimulator.closure(LexerATNSimulator.java:446)
at org.antlr.v4.runtime.atn.LexerATNSimulator.closure(LexerATNSimulator.java:455)
at org.antlr.v4.runtime.atn.LexerATNSimulator.closure(LexerATNSimulator.java:455)
And it's freezing on any not empty input.
The samples is extracted from #1943 (comment)
Consider the following grammar:
It fails with Stackoverflow on empty input:
And it's freezing on any not empty input.
The samples is extracted from #1943 (comment)