In module AnalyzeFlight I’m getting this error when choosing ‘execute’ from the Transform menu:


MetaC: rewriting failed, trace:
editor_execute_multiple_0_0
basec_execute_multiple_0_0
base_c_to_compiledc_multiple_0_0
basec_to_c_h_makefile_multiple_0_0
map_1_0
basec_to_c_0_0
to_c_0_0
map_1_0
[ MetaC | critical ] Internal error: with clause failed unexpectedly in rule ‘basec-to-c’
(Module(Identifier(“AnalyzeFlight”{[Module,“AnalyzeFlight”]}),None,[Declaration(BasicType(“int8”),Init(Identifier(“trackpointCounter”{[Variable,“trackpointCounter”,“AnalyzeFlight”]}),Decimal(“0”))),Declaration(BasicType(“int8”),Init(Identifier(“TAKEOFF”{[Variable,“TAKEOFF”,“AnalyzeFlight”]}),Decimal(“100”))),Declaration(BasicType(“int8”),Init(Identifier(“HIGH_SPEED”{[Variable,“HIGH_SPEED”,“AnalyzeFlight”]}),Decimal(“10”))),Declaration(BasicType(“int8”),Init(Identifier(“VERY_HIGH_SPEED”{[Variable,“VERY_HIGH_SPEED”,“AnalyzeFlight”]}),Decimal(“20”))),Declaration(BasicType(“int8”),Init(Identifier(“LANDING”{[Variable,“LANDING”,“AnalyzeFlight”]}),Decimal(“150”))),Struct(None,Identifier(“Trackpoint”{[Struct,“Trackpoint”,“AnalyzeFlight”]}),[FieldDecl(BasicType(“int16”),Identifier(“id”{[Field,“id”,“Trackpoint”,“AnalyzeFlight”]})),FieldDecl(BasicType(“int16”),Identifier(“alt”{[Field,“alt”,“Trackpoint”,“AnalyzeFlight”]})),FieldDecl(BasicType(“int16”),Identifier(“speed”{[Field,“speed”,“Trackpoint”,“AnalyzeFlight”]}))]),FunDef(None,BasicType(“void”),Identifier(“raiseAlarm”{[Function,“raiseAlarm”,“AnalyzeFlight”]}),ParamList([]),[Exp(FunctionCall(Identifier(“printf”{[Unresolved(Function),“printf”,“AnalyzeFlight”]}),[String(“"CRASHED!!!\n"”)]))]),FunDef(None,Pointer(StructType(Identifier(“Trackpoint”{[Struct,“Trackpoint”,“AnalyzeFlight”]}))),Identifier(“makeTP”{[Function,“makeTP”,“AnalyzeFlight”]}),ParamList([Param(BasicType(“int16”),Identifier(“alt”{[Variable,“alt”,“makeTP”,“AnalyzeFlight”]})),Param(BasicType(“int16”),Identifier(“speed”{[Variable,“speed”,“makeTP”,“AnalyzeFlight”]}))]),[Exp(UnExp(IncPost,Var(Identifier(“trackpointCounter”{[Variable,“trackpointCounter”,“AnalyzeFlight”]})))),Declaration(StructType(Identifier(“Trackpoint”{[Struct,“Trackpoint”,“AnalyzeFlight”]})),NoInit(Identifier(“mem”{[Variable,“mem”,“makeTP”,“AnalyzeFlight”]}))),Exp(Assign(Field(Var(Identifier(“mem”{[Variable,“mem”,“makeTP”,“AnalyzeFlight”]})),Identifier(“id”{[Field,“id”,“Trackpoint”,“AnalyzeFlight”]})),Assign,Var(Identifier(“trackpointCounter”{[Variable,“trackpointCounter”,“AnalyzeFlight”]})))),Exp(Assign(Field(Var(Identifier(“mem”{[Variable,“mem”,“makeTP”,“AnalyzeFlight”]})),Identifier(“alt”{[Field,“alt”,“Trackpoint”,“AnalyzeFlight”]})),Assign,Var(Identifier(“alt”{[Variable,“alt”,“makeTP”,“AnalyzeFlight”]})))),Exp(Assign(Field(Var(Identifier(“mem”{[Variable,“mem”,“makeTP”,“AnalyzeFlight”]})),Identifier(“speed”{[Field,“speed”,“Trackpoint”,“AnalyzeFlight”]})),Assign,Var(Identifier(“speed”{[Variable,“speed”,“makeTP”,“AnalyzeFlight”]})))),Declaration(Pointer(StructType(Identifier(“Trackpoint”{[Struct,“Trackpoint”,“AnalyzeFlight”]}))),Init(Identifier(“tp”{[Variable,“tp”,“makeTP”,“AnalyzeFlight”]}),UnExp(Addr,Var(Identifier(“mem”{[Variable,“mem”,“makeTP”,“AnalyzeFlight”]}))))),Return(Var(Identifier(“tp”{[Variable,“tp”,“makeTP”,“AnalyzeFlight”]})))]),Statemachine(Identifier(“analyzeFlight”{[Statemachine,“analyzeFlight”,“AnalyzeFlight”]}),Identifier(“beforeFlight”{[State,“beforeFlight”,“analyzeFlight”,“AnalyzeFlight”]}),[StateMachineInEvent(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),[Param(Pointer(StructType(Identifier(“Trackpoint”{[Struct,“Trackpoint”,“AnalyzeFlight”]}))),Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]}))]),StateMachineInEvent(Identifier(“reset”{[InEvent,“reset”,“analyzeFlight”,“AnalyzeFlight”]}),[]),StateMachineInEvent(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),[]),StateMachineVarDecl(None,BasicType(“int16”),Identifier(“points”{[Variable,“points”,“analyzeFlight”,“AnalyzeFlight”]}),Decimal(“0”)),StateMachineOutEvent(Identifier(“crashNotification”{[OutEvent,“crashNotification”,“analyzeFlight”,“AnalyzeFlight”]}),[],Binding(Identifier(“raiseAlarm”{[Function,“raiseAlarm”,“AnalyzeFlight”]}))),StateMachineState(Identifier(“beforeFlight”{[State,“beforeFlight”,“analyzeFlight”,“AnalyzeFlight”]}),[StateEntry(Block([Exp(Assign(Var(Identifier(“points”{[Variable,“points”,“analyzeFlight”,“AnalyzeFlight”]})),Assign,Decimal(“0”)))])),StateTransition(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),BinExp(GT,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“alt”{[Field,“alt”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“0”)),Identifier(“airborne”{[State,“airborne”,“analyzeFlight”,“AnalyzeFlight”]}),None),StateTransition(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“beforeFlight”{[State,“beforeFlight”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(FunctionCall(Identifier(“printf”{[Unresolved(Function),“printf”,“AnalyzeFlight”]}),[String(“"STATE: beforeFlight\n"”)]))])),StateExit(Block([Exp(Assign(Var(Identifier(“points”{[Variable,“points”,“analyzeFlight”,“AnalyzeFlight”]})),PlusAssign,Var(Identifier(“TAKEOFF”{[Variable,“TAKEOFF”,“AnalyzeFlight”]}))))]))]),StateMachineState(Identifier(“airborne”{[State,“airborne”,“analyzeFlight”,“AnalyzeFlight”]}),[StateTransition(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),BinExp(LogicAnd,BinExp(Eq,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“alt”{[Field,“alt”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“0”)),BinExp(Eq,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“speed”{[Field,“speed”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“0”))),Identifier(“crashed”{[State,“crashed”,“analyzeFlight”,“AnalyzeFlight”]}),None),StateTransition(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),BinExp(LogicAnd,BinExp(Eq,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“alt”{[Field,“alt”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“0”)),BinExp(GT,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“speed”{[Field,“speed”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“0”))),Identifier(“landing”{[State,“landing”,“analyzeFlight”,“AnalyzeFlight”]}),None),StateTransition(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),BinExp(GT,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“speed”{[Field,“speed”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“200”)),Identifier(“airborne”{[State,“airborne”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(Assign(Var(Identifier(“points”{[Variable,“points”,“analyzeFlight”,“AnalyzeFlight”]})),PlusAssign,Var(Identifier(“VERY_HIGH_SPEED”{[Variable,“VERY_HIGH_SPEED”,“AnalyzeFlight”]}))))])),StateTransition(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),BinExp(GT,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“speed”{[Field,“speed”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“100”)),Identifier(“airborne”{[State,“airborne”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(Assign(Var(Identifier(“points”{[Variable,“points”,“analyzeFlight”,“AnalyzeFlight”]})),PlusAssign,Var(Identifier(“HIGH_SPEED”{[Variable,“HIGH_SPEED”,“AnalyzeFlight”]}))))])),StateTransition(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“airborne”{[State,“airborne”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(FunctionCall(Identifier(“printf”{[Unresolved(Function),“printf”,“AnalyzeFlight”]}),[String(“"STATE: airborne\n"”)]))])),StateTransition(Identifier(“reset”{[InEvent,“reset”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“beforeFlight”{[State,“beforeFlight”,“analyzeFlight”,“AnalyzeFlight”]}),None)]),StateMachineState(Identifier(“landing”{[State,“landing”,“analyzeFlight”,“AnalyzeFlight”]}),[StateTransition(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),BinExp(Eq,FieldViaPointer(Var(Identifier(“tp”{[Variable,“tp”,“analyzeFlight”,“AnalyzeFlight”]})),Identifier(“speed”{[Field,“speed”,“Trackpoint”,“AnalyzeFlight”]})),Decimal(“0”)),Identifier(“landed”{[State,“landed”,“analyzeFlight”,“AnalyzeFlight”]}),None),StateTransition(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“landing”{[State,“landing”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(UnExp(DecPost,Var(Identifier(“points”{[Variable,“points”,“analyzeFlight”,“AnalyzeFlight”]}))))])),StateTransition(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“landing”{[State,“landing”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(FunctionCall(Identifier(“printf”{[Unresolved(Function),“printf”,“AnalyzeFlight”]}),[String(“"STATE: landing\n"”)]))])),StateTransition(Identifier(“reset”{[InEvent,“reset”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“beforeFlight”{[State,“beforeFlight”,“analyzeFlight”,“AnalyzeFlight”]}),None)]),StateMachineState(Identifier(“landed”{[State,“landed”,“analyzeFlight”,“AnalyzeFlight”]}),[StateEntry(Block([Exp(Assign(Var(Identifier(“points”{[Variable,“points”,“analyzeFlight”,“AnalyzeFlight”]})),PlusAssign,Var(Identifier(“LANDING”{[Variable,“LANDING”,“AnalyzeFlight”]}))))])),StateTransition(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“landed”{[State,“landed”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(FunctionCall(Identifier(“printf”{[Unresolved(Function),“printf”,“AnalyzeFlight”]}),[String(“"STATE: landed\n"”)]))])),StateTransition(Identifier(“reset”{[InEvent,“reset”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“beforeFlight”{[State,“beforeFlight”,“analyzeFlight”,“AnalyzeFlight”]}),None)]),StateMachineState(Identifier(“crashed”{[State,“crashed”,“analyzeFlight”,“AnalyzeFlight”]}),[StateEntry(Block([StateMachineSend(Identifier(“crashNotification”{[OutEvent,“crashNotification”,“analyzeFlight”,“AnalyzeFlight”]}),[]),Exp(None)])),StateTransition(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“crashed”{[State,“crashed”,“analyzeFlight”,“AnalyzeFlight”]}),Block([Exp(FunctionCall(Identifier(“printf”{[Unresolved(Function),“printf”,“AnalyzeFlight”]}),[String(“"STATE: crashed\n"”)]))])),StateTransition(Identifier(“reset”{[InEvent,“reset”,“analyzeFlight”,“AnalyzeFlight”]}),None,Identifier(“beforeFlight”{[State,“beforeFlight”,“analyzeFlight”,“AnalyzeFlight”]}),None)])]),FunDef(Exported,BasicType(“int8”),Identifier(“main”{[Function,“main”,“AnalyzeFlight”]}),ParamList([Param(BasicType(“int32”),Identifier(“argc”{[Variable,“argc”,“main”,“AnalyzeFlight”]})),Param(Array(BasicType(“string”),None),Identifier(“argv”{[Variable,“argv”,“main”,“AnalyzeFlight”]}))]),[Declaration(StatemachineType(Identifier(“analyzeFlight”{[Statemachine,“analyzeFlight”,“AnalyzeFlight”]})),NoInit(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]}))),StateMachineInit(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]}))),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),[])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),[FunctionCall(Identifier(“makeTP”{[Function,“makeTP”,“AnalyzeFlight”]}),[Decimal(“100”),Decimal(“100”)])])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),[])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),[FunctionCall(Identifier(“makeTP”{[Function,“makeTP”,“AnalyzeFlight”]}),[Decimal(“300”),Decimal(“150”)])])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),[])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),[FunctionCall(Identifier(“makeTP”{[Function,“makeTP”,“AnalyzeFlight”]}),[Decimal(“0”),Decimal(“90”)])])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),[])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“next”{[InEvent,“next”,“analyzeFlight”,“AnalyzeFlight”]}),[FunctionCall(Identifier(“makeTP”{[Function,“makeTP”,“AnalyzeFlight”]}),[Decimal(“0”),Decimal(“0”)])])),StateMachineTrigger(Var(Identifier(“smvar”{[Variable,“smvar”,“main”,“AnalyzeFlight”]})),EventRef(Identifier(“report”{[InEvent,“report”,“analyzeFlight”,“AnalyzeFlight”]}),[])),Return(Decimal(“0”))])]),“/Users/eelcovisser/spoofax/metac/Statemachine/test/examples/AnalyzeFlight/AnalyzeFlight.mc”)
org.spoofax.interpreter.core.InterpreterException: Exception during evaluation
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:117)
at org.spoofax.interpreter.core.Interpreter.invoke(Interpreter.java:82)
at org.strategoxt.HybridInterpreter.invoke(HybridInterpreter.java:424)
at org.strategoxt.imp.debug.core.str.launching.DebuggableHybridInterpreter.invoke(DebuggableHybridInterpreter.java:150)
at org.strategoxt.imp.runtime.services.StrategoObserver.invoke(StrategoObserver.java:701)
at org.strategoxt.imp.runtime.services.StrategoObserver.invoke(StrategoObserver.java:670)
at org.strategoxt.imp.runtime.services.StrategoBuilder.invokeObserver(StrategoBuilder.java:327)
at org.strategoxt.imp.runtime.services.StrategoBuilder.execute(StrategoBuilder.java:193)
at org.strategoxt.imp.runtime.services.StrategoBuilder.access$1(StrategoBuilder.java:177)
at org.strategoxt.imp.runtime.services.StrategoBuilder$1.run(StrategoBuilder.java:164)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.spoofax.interpreter.core.InterpreterErrorExit: Internal error: with clause failed unexpectedly in rule ‘basec-to-c’
1
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:194)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:183)
at org.strategoxt.lang.InteropSDefT$StrategyBody.evaluate(InteropSDefT.java:245)
at org.strategoxt.lang.InteropSDefT$StrategyBody.eval(InteropSDefT.java:238)
at org.spoofax.interpreter.stratego.Strategy.evaluate(Strategy.java:76)
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:109)
… 10 more
Caused by: org.strategoxt.lang.StrategoErrorExit: Internal error: with clause failed unexpectedly in rule ‘basec-to-c’
1
at org.strategoxt.lang.InteropStrategy.invokeDynamic(InteropStrategy.java:60)
at org.strategoxt.lang.DynamicStrategy.invoke(DynamicStrategy.java:22)
at org.strategoxt.lang.SRTS_all.map(SRTS_all.java:60)
at org.strategoxt.lang.SRTS_all.invoke(SRTS_all.java:21)
at org.strategoxt.lang.parallel.stratego_parallel.ParallelAll.invoke(ParallelAll.java:67)
at org.strategoxt.lang.compat.override.performance_tweaks.map_1_0_override.invoke(map_1_0_override.java)
at org.strategoxt.lang.Strategy.invokeDynamic(Strategy.java:40)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:192)
… 15 more
Caused by: org.spoofax.interpreter.core.InterpreterErrorExit: Internal error: with clause failed unexpectedly in rule ‘basec-to-c’
1
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:194)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:183)
at org.strategoxt.lang.InteropSDefT$StrategyBody.evaluate(InteropSDefT.java:245)
at org.strategoxt.lang.InteropSDefT$StrategyBody.eval(InteropSDefT.java:238)
at org.spoofax.interpreter.stratego.Strategy.evaluate(Strategy.java:76)
at org.spoofax.interpreter.stratego.SDefT.evaluate(SDefT.java:213)
at org.strategoxt.lang.InteropStrategy.invokeDynamic(InteropStrategy.java:57)
… 22 more
Caused by: org.strategoxt.lang.StrategoErrorExit: Internal error: with clause failed unexpectedly in rule ‘basec-to-c’
1
at org.strategoxt.lang.compat.report_failure_compat_1_0.invoke(report_failure_compat_1_0.java:53)
at org.strategoxt.stratego_lib.report_with_failure_0_2.invoke(report_with_failure_0_2.java)
at org.strategoxt.lang.Strategy.invokeDynamic(Strategy.java:32)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:192)
… 28 more

Submitted by Eelco Visser on 23 May 2013 at 04:52

On 30 May 2013 at 12:25 Daco Harkes tagged @mvoda

On 30 May 2013 at 14:27 Daco Harkes commented:

This issue is fixed.


On 30 May 2013 at 14:27 Daco Harkes closed this issue.

Log in to post comments