The JSGLR –implode option causes a ClassCastException in TreeBuilder.reset():

	java.lang.ClassCastException: org.spoofax.jsglr.client.imploder.NullTokenizer cannot be cast to org.spoofax.jsglr.client.imploder.Tokenizer
		at org.spoofax.jsglr.client.imploder.TreeBuilder.reset(TreeBuilder.java:174)
		at org.spoofax.jsglr.client.Disambiguator.yieldTree(Disambiguator.java:289)
		at org.spoofax.jsglr.client.Disambiguator.yieldTreeTop(Disambiguator.java:302)
		at org.spoofax.jsglr.client.Disambiguator.applyFilters(Disambiguator.java:259)
		at org.spoofax.jsglr.client.Disambiguator.applyFilters(Disambiguator.java:226)
		at org.spoofax.jsglr.client.SGLR.sglrParse(SGLR.java:531)
		at org.spoofax.jsglr.client.SGLR.parse(SGLR.java:475)
		at org.spoofax.jsglr.Main.parseFile(Main.java:204)
		at org.spoofax.jsglr.Main.main(Main.java:159)

This was probably introduce in r25615 Diff.

It only became visible now because the modifications to JSGLR were not included in the Stratego/XT-Java build until Dec/Jan.

When run with –implode the TreeBuilder appears to always use NullTokenizer. The first thing that happens is to reset the tokenizer which begins by casting NullTokenizer to Tokenizer which fails, causing the crash.

Submitted by Vlad Vergu on 16 January 2013 at 18:16

On 16 January 2013 at 18:17 Vlad Vergu tagged @maartje

On 16 January 2013 at 18:17 Vlad Vergu tagged parser

On 16 January 2013 at 18:17 Vlad Vergu tagged !vvergu

On 17 January 2013 at 13:42 Maartje commented:

fixed r.25835


On 17 January 2013 at 13:42 Maartje closed this issue.

Log in to post comments