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

Best way to include node classes without making one massive .peg file? #91

Open
ejsmith opened this issue Nov 28, 2016 · 3 comments
Open

Comments

@ejsmith
Copy link

ejsmith commented Nov 28, 2016

I have a bunch of node classes that are part of my project and it works great, but sometimes I like to load up my grammar in the language workbench and try things out which doesn't work since my node classes are in different files. Also it seems like a bad idea in general to have one big massive .peg file. What do you recommend?

https://github.com/exceptionless/Foundatio.Parsers/blob/master/src/Foundatio.Parsers.LuceneQueries/LuceneQueryParser.peg

@otac0n
Copy link
Owner

otac0n commented Nov 29, 2016

Pegasus 4.0 added support for composite grammars.

Here's the wiki article:
How do I reference an exported rule from another parser?

You can also look at the Pegasus source code, as we use this to separate the C# parsing from the rest of Pegasus:
https://github.com/otac0n/Pegasus/tree/develop/Pegasus/Parser

@ejsmith
Copy link
Author

ejsmith commented Nov 29, 2016

So that is allowing me to spread the parser out into multiple files, but it wouldn't work from the language workbench because it's not referencing the file it's referencing a type from the current assembly, correct?

@otac0n
Copy link
Owner

otac0n commented Nov 29, 2016

Sorry, I read too quickly. I'll take this as a feature request to support multiple files in the Workbench.

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

No branches or pull requests

2 participants