Skip to content

X4 should provide builtin semantic actions #98

Open

Description

@saki7

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.

Activity

  1. added
    enhancementNew feature or request
    documentationImprovements or additions to documentation
    on Sep 13, 2026
  2. changed the title [-]X4 should provide builting semantic actions[/-] [+]X4 should provide builtin semantic actions[/+] on Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions