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

dynamic rule creation #1

Open
ghost opened this issue Nov 30, 2015 · 1 comment
Open

dynamic rule creation #1

ghost opened this issue Nov 30, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 30, 2015

Hi there. Great work! (too many c++only runtime parser generators out there)

Is there any chance to easily create rules at runtime? I mean, earley_parse_grammar(g, description) accepts string as grammar description for now, but I would like to fill some BNF-shaped (recursive) struct and use it in hypothetic earley_load_grammar(g, myBNF). I could create a patch myself, but I'm not sure my parser-generator background is strong enough to just start without any hints. Thanks!

@vnmakarov
Copy link
Owner

Thanks.

You can generate description string at runtime and use earley_parse_grammar.

You can also use function yaep_read_grammar providing functions read_terminals and read_rules. If this interface is still not convenient for you, learning code of yaep_read_grammar could be a start point.

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