-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Following the guidelines of Type errors for the IDE with Xtext and Xsemantics of a certain Lorenzo Bettini, I noticed that when I want to implement a typing rule using XSemantics, the rule gets split up in one rule statement for inference and (at least) one checkrule statement for validation. However, currently in XSemantics one must first specify all the rules, and only then all of the checkrules, so these rules/checkrules that belong to each other tend to be far away, which makes it easy to lose overview.
I would suggest to allow mixing rules and checkrules, e.g.,
rule TAddition ... // infer that an addition such as `1 + 2` results in an `integer`
checkrule CheckAddition ... // check that both arguments of an addition are of type `integer`
rule TNot ... // infer that a boolean `not` operator results in a `boolean`
checkrule CheckNot ... // check that the argument of a boolean `not` is of type `boolean`
I guess this would only need a minimal change to the grammar definition.
Metadata
Metadata
Assignees
Labels
No labels