Lately I’m getting IndexOutOfBoundsExceptions in getSibblingForwardSuggestions:


java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.remove(ArrayList.java:387)
at org.spoofax.jsglr.NewStructureSkipper.getSibblingForwardSuggestions(NewStructureSkipper.java:91)
at org.spoofax.jsglr.RegionRecovery.selectErroneousFragment(RegionRecovery.java:106)
at org.spoofax.jsglr.RecoveryConnector.doRecoverSteps(RecoveryConnector.java:75)
at org.spoofax.jsglr.RecoveryConnector.recover(RecoveryConnector.java:68)
at org.spoofax.jsglr.SGLR.sglrParse(SGLR.java:302)
at org.spoofax.jsglr.SGLR.parse(SGLR.java:232)
at org.strategoxt.imp.runtime.parser.JSGLRI.doParseNoImplode(JSGLRI.java:121)
at org.strategoxt.imp.runtime.parser.JSGLRI.doParseNoImplode(JSGLRI.java:94)
at org.strategoxt.imp.runtime.parser.AbstractSGLRI.parseNoImplode(AbstractSGLRI.java:186)
at org.strategoxt.imp.runtime.parser.SGLRParseController.parseNoImplode(SGLRParseController.java:293)
at org.strategoxt.imp.runtime.parser.SGLRParseController.parse(SGLRParseController.java:237)
at org.strategoxt.imp.runtime.parser.SGLRParseController.parse(SGLRParseController.java:1)
at org.strategoxt.imp.runtime.dynamicloading.DynamicParseController.parse(DynamicParseController.java:153)
at org.eclipse.imp.editor.ParserScheduler.run(ParserScheduler.java:85)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

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


module test/example

imports
libstratego-lib
libstratego-sglr

signature constructors

LOCAL : Term
Module : Term * Term -> Term

strategies

constraint-warning:
Module(m, _) -> (m, $[Module name does not correspond to file name])
where
!Alert();
’map(id);
!(" (")
; {

    }

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