Xsemantics is a DSL (implemented in Xtext itself) for writing type systems, reduction rules, interpreters (and in general relation rules) for languages implemented in Xtext. It then generates Java code that can be used in your language implemented in Xtext for scoping and validation (it can also generate a validator in Java).
Eclipse Public License 1.0
32
stars
19
forks
source link
Java error when calling an auxiliary from an axiom #174
The generated Java has the error: _trace_ cannot be resolved to a variable.
The problem is that _trace_ is not defined for methods generated from axioms, yet the auxiliary method expects a RuleApplicationTrace to be passed to it. If it doesn't make sense to call an auxiliary from an axiom, then there should be a validation error on the Xsemantics file. If it does make sense, then _trace_ should also be generated for axiom methods.
Thanks for the report!
I guess that generated code for axioms should have a trace parameter, like rules. I think I had never considered this use case.
I'll try to fix this ASAP
If an axiom calls an auxiliary, then the generated Java code will have a compile error. Consider the following Xsemantics snippet:
This produces the following Java method for the axiom:
The generated Java has the error:
_trace_ cannot be resolved to a variable
.The problem is that
_trace_
is not defined for methods generated from axioms, yet the auxiliary method expects aRuleApplicationTrace
to be passed to it. If it doesn't make sense to call an auxiliary from an axiom, then there should be a validation error on the Xsemantics file. If it does make sense, then_trace_
should also be generated for axiom methods.