Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple entry points #28

Open
bendmorris opened this issue May 23, 2018 · 0 comments
Open

Multiple entry points #28

bendmorris opened this issue May 23, 2018 · 0 comments

Comments

@bendmorris
Copy link

bendmorris commented May 23, 2018

Thanks for plex! Would it be feasible to support multiple entry points that reuse the same grammar? As an example, I have something like:

statement: Statement {
    expression[e] TokenSemicolon => ExprStatement(e),
    // other variants...
}

expression: Expr {
    // some variants...
}

and want to expose parser entry points for both Expr and Statement. This might be possible via a single entry point that returns an enum but I'm wondering if there's a cleaner way.

@bendmorris bendmorris changed the title Multiple terminals Multiple entry points May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant