Dynamic rules do not work in interpreter in the testing language.

E.g., the test

test dynamic rules
rules(DR := 1)

puts this exception in the error log:


org.spoofax.interpreter.core.InterpreterException: Unknown op ‘GenDynRules/1’
at org.spoofax.interpreter.core.StrategoCoreLoader.parseStrategy(StrategoCoreLoader.java:110)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseSeq(StrategoCoreLoader.java:343)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseStrategy(StrategoCoreLoader.java:83)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseSeq(StrategoCoreLoader.java:339)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseStrategy(StrategoCoreLoader.java:83)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseScope(StrategoCoreLoader.java:357)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseStrategy(StrategoCoreLoader.java:81)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseSDefT(StrategoCoreLoader.java:188)
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:97)
at org.strategoxt.HybridInterpreter.evaluate(HybridInterpreter.java:396)
at org.strategoxt.HybridInterpreter.evaluate(HybridInterpreter.java:414)
at org.strategoxt.imp.testing.strategies.plugin_strategy_evaluate_1_2.invoke(plugin_strategy_evaluate_1_2.java:37)
at trans.check_error_0_0_fragment_0.invoke(check_error_0_0_fragment_0.java:1017)
at trans.check_error_0_0.invoke(check_error_0_0.java:28)
at org.strategoxt.stratego_lib.k_154.invoke(k_154.java)
at org.strategoxt.lang.SRTS_EXT_crush_3_0.invoke(SRTS_EXT_crush_3_0.java:28)
at org.strategoxt.lang.compat.override.performance_tweaks.foldr_3_0_override.invoke(foldr_3_0_override.java)
at org.strategoxt.stratego_lib.k_154.invoke(k_154.java)
at org.strategoxt.lang.SRTS_EXT_crush_3_0.invoke(SRTS_EXT_crush_3_0.java:28)
at org.strategoxt.lang.compat.override.performance_tweaks.foldr_3_0_override.invoke(foldr_3_0_override.java)
at org.strategoxt.stratego_lib.k_154.invoke(k_154.java)
at org.strategoxt.stratego_lib.collect_all_2_0.invoke(collect_all_2_0.java)
at trans.lifted2764.invoke(lifted2764.java:143)
at trans.lifted2686.invoke(lifted2686.java:75)
at org.strategoxt.stratego_lib.dr_scope_1_1.invoke(dr_scope_1_1.java)
at trans.lifted2685.invoke(lifted2685.java:40)
at org.strategoxt.stratego_lib.dr_scope_1_1.invoke(dr_scope_1_1.java)
at trans.scope_paths_1_2.invoke(scope_paths_1_2.java:39)
at trans.editor_analyze_0_0.invoke(editor_analyze_0_0.java:170)
at org.strategoxt.lang.Strategy.invokeDynamic(Strategy.java:30)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:194)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:185)
at org.strategoxt.lang.InteropSDefT$StrategyBody.evaluate(InteropSDefT.java:247)
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:106)
at org.spoofax.interpreter.core.Interpreter.invoke(Interpreter.java:79)
at org.strategoxt.HybridInterpreter.invoke(HybridInterpreter.java:379)
at org.strategoxt.imp.debug.core.str.launching.DebuggableHybridInterpreter.invoke(DebuggableHybridInterpreter.java:149)
at org.strategoxt.imp.runtime.Environment$2.invoke(Environment.java:210)
at org.strategoxt.imp.runtime.services.StrategoObserver.invoke(StrategoObserver.java:690)
at org.strategoxt.imp.runtime.services.StrategoObserver.invokeSilent(StrategoObserver.java:739)
at org.strategoxt.imp.runtime.services.StrategoObserver.update(StrategoObserver.java:486)
at org.strategoxt.imp.runtime.services.StrategoObserverUpdateJob.analyze(StrategoObserverUpdateJob.java:30)
at org.strategoxt.imp.runtime.services.StrategoAnalysisQueue$UpdateJob.run(StrategoAnalysisQueue.java:81)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Version: 0.6.1.4-r23810

Submitted by Tobi Vollebregt on 20 December 2011 at 16:20

On 20 December 2011 at 16:20 Tobi Vollebregt tagged interpreter

On 20 December 2011 at 16:20 Tobi Vollebregt tagged testing

On 20 December 2011 at 18:10 chris melman commented:

Could be the reason why i have similiar problems using the namespace libary and testing


On 20 December 2011 at 18:10 chris melman tagged !chrismelman

On 21 December 2011 at 00:04 Lennart Kats commented:

Dynamic rules don’t work in test expressions right now since they need a more sophisticated compilation scheme. This issue shouldn’t affect any dynamic rules defined in the project under test though.


On 2 March 2012 at 11:56 Lennart Kats tagged shell

On 2 March 2012 at 12:00 Lennart Kats commented:

Note that this issue also applies to the console.

Log in to post comments