Skip to content

Macro combinators #8

Description

@jbearer

It would be nice to be able to define combinators for non-terminals, like writing <symbol> * for the Kleene star operator. Conceptually, this can be implemented as a new non-terminal, defined something like

<symbol> * -> # epsilon
<symbol> * -> <symbol> <symbol> *

However, we would need this definition once (and only once) for each non-terminal with which the * operator is used. For example, we would need another, similar definition if we tried to use <expression> * somewhere else in the program.

Currently this is impossible, because non-terminals must be symbols, and symbols cannot be created dynamically, so there is no way to implement an operator like * whose semantics include dynamically generating new non-terminals.

Depends on #7.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions