-
Notifications
You must be signed in to change notification settings - Fork 48
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
Documentation needed #7
Comments
I think in the readme he refers us to a book on parsers. Evidently, the convention of this framework follows what's set out in the book. My guess is that the concept of parsers are so complex that any included documentation wouldn't really do it much justice. |
The answer to your second question can be found in the PKParserFactory class, in particular, the method named defaultAssemblerSelectorNameForParserName. Each production rule in your grammar (except those which start with a '@') have a matching callback. Given the name someSortOfProduction the callback name is formed by prepending didMatch and making the first letter of the production name upper case. So in the previous example, the callback would be didMatchSomeSortOfProduction. Actually, looking in PKGrammarParser, it looks like you can override this by providing your own selector. I haven't tried this yet, but if you had a rule in your grammar as follows:
Then the callback for matching a statement would be handleStatement: As for your first question, looks like you can find most of the info in the PKGrammarParser class. It's late, and my eyes are getting blurry, so I might have missed a few but: Number, Word, LowercaseWord, UppercaseWord, QuotedString, Empty, DelimitedString, oh, and '!' will cause a token to be discarded. |
The intro documentation is great and got me started. But I need more details. The HeaderDoc links are all dead and from the source code it appears that they would not be much help anyway. What I'm looking for:
The text was updated successfully, but these errors were encountered: