Lately I’m getting IndexOutOfBoundsExceptions in getSibblingForwardSuggestions:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(
at java.util.ArrayList.remove(
at org.spoofax.jsglr.NewStructureSkipper.getSibblingForwardSuggestions(
at org.spoofax.jsglr.RegionRecovery.selectErroneousFragment(
at org.spoofax.jsglr.RecoveryConnector.doRecoverSteps(
at org.spoofax.jsglr.RecoveryConnector.recover(
at org.spoofax.jsglr.SGLR.sglrParse(
at org.spoofax.jsglr.SGLR.parse(
at org.strategoxt.imp.runtime.parser.JSGLRI.doParseNoImplode(
at org.strategoxt.imp.runtime.parser.JSGLRI.doParseNoImplode(
at org.strategoxt.imp.runtime.parser.AbstractSGLRI.parseNoImplode(
at org.strategoxt.imp.runtime.parser.SGLRParseController.parseNoImplode(
at org.strategoxt.imp.runtime.parser.SGLRParseController.parse(
at org.strategoxt.imp.runtime.parser.SGLRParseController.parse(
at org.strategoxt.imp.runtime.dynamicloading.DynamicParseController.parse(

Maybe this can be fixed just by looking at the code, but here’s a Stratego example that triggers this:

module test/example


signature constructors

LOCAL : Term
Module : Term * Term -> Term


Module(m, _) -> (m, $[Module name does not correspond to file name])
!(" (")
; {


Submitted by Lennart Kats on 3 March 2010 at 08:49

On 3 March 2010 at 09:15 Lennart Kats commented:

Note that this problem always seems to occur when the syntax error is at the end of the file. Looks like the method is looking for a sibling that isn’t there.

On 17 May 2011 at 22:32 Sverre Rabbelier commented:

On 17 May 2011 at 23:04 Lennart Kats commented:

Sverre: that doesn’t seem to be the same issue. Could you describe in more detail what you’re trying to do and what goes wrong?

Log in to post comments