X4 should provide these frequently used semantic actions as builtin constexpr CPO functors:
- assign to
x4::get<ID>(ctx)
- assign to
_local_var
- assign to
_rule_var
- assign to
_as_var
- assign to
_attr
- class member pointer overload of above
- tuple index overload of above
The functionalities themselves are quite easy to implement. What it matters the most is the naming. We should name these objects really carefully or the users would get very confused.
For example, x4::assign_to<0> can either mean assign the 0th element of the attribute to the exposed attribute or assign the attribute to the 0th element of the exposed attribute. This kind of confusion frequently occurs in my ad-hoc grammar, so the official version should be designed very carefully.
Also, we need at least some synopsis described in our README.
X4 should provide these frequently used semantic actions as builtin constexpr CPO functors:
x4::get<ID>(ctx)_local_var_rule_var_as_var_attrThe functionalities themselves are quite easy to implement. What it matters the most is the naming. We should name these objects really carefully or the users would get very confused.
For example,
x4::assign_to<0>can either meanassign the 0th element of the attribute to the exposed attributeorassign the attribute to the 0th element of the exposed attribute. This kind of confusion frequently occurs in my ad-hoc grammar, so the official version should be designed very carefully.Also, we need at least some synopsis described in our README.