Create a new Spoofax Language project with Project name: dummy, Analysis type: None, create x.spt with the following contents:

module x

language dummy

test foo [[ 
]] run id 

The error log shows the following exception:

org.metaborg.core.analysis.AnalysisException: Analysis for eclipse:///dummy/x.spt failed
	at org.metaborg.spoofax.core.analysis.legacy.StrategoAnalyzer.analyze(
	at org.metaborg.spoofax.core.analysis.legacy.StrategoAnalyzer.analyze(
	at org.metaborg.spoofax.core.analysis.legacy.StrategoAnalyzer.analyze(
	at org.metaborg.core.analysis.AnalysisService.analyze(
	at org.metaborg.spoofax.core.analysis.SpoofaxAnalysisService.analyze(
	at org.metaborg.spoofax.core.analysis.SpoofaxAnalysisService.analyze(
	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.analyze(
	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.update(
Caused by: org.metaborg.core.MetaborgException: Invoking Stratego strategy editor-analyze failed unexpectedly
Stratego trace:
org.spoofax.interpreter.core.InterpreterException: Exception during evaluation: null
	at org.metaborg.spoofax.core.stratego.StrategoCommon.handleException(
	at org.metaborg.spoofax.core.stratego.StrategoCommon.invoke(
	at org.metaborg.spoofax.core.analysis.legacy.StrategoAnalyzer.analyze(
	... 9 more

It looks like the “run strategy” test expectation forces analysis, even if the project has no analysis.

Submitted by Martijn on 16 November 2018 at 12:29

On 16 November 2018 at 13:38 Jeff Smits commented:

It would seem that all Spoofax internals around running no analysis are wonky :(
If you have time, can you investigate what Spoofax APIs are currently used by SPT for “run strategy”? I assume something more low-level than the Builder API, but then I wouldn’t expect any issues because you need to handle analysis yourself… Unless it doesn’t check the project settings to see if analysis is available :|

On 16 November 2018 at 18:04 Martijn commented:

If I have time I will do some exploring. For now, I worked around this by adding a dummy legacy analyzer. Might be useful in case anyone finds this through Google.


module Analysis


  observer : editor-analyze
  context  : legacy



  // Add analysis to prevent SPT from crashing (
    (ast, path, project-path) -> (ast, [], [], [])

Log in to post comments