Add a package for computing follow sets of a grammar #74
Add a package for computing follow sets of a grammar #74shivansh wants to merge 2 commits intogoccmack:masterfrom
Conversation
|
Is it possible for gocc to also use this package when calculating the FollowSymbol ? |
|
I guess you were referring to |
|
Good point :) Maybe it would be cool to use these follow sets for auto completion and to expose an API that allows hints to be given to language users. If you think this might work, then I would also recommend adding some tests. Or maybe you can think of a better use case to more tightly integrate follow? |
That would be quite cool. I guess I'll figure out a way to design and implement this.
One place where I'm using follow sets is while implementing panic-mode recovery. I guess we can defer merging this until that is ready, so that we'll have atleast one usecase where follow sets are being used. PS. I'm mostly finished with the panic-mode implementation, just a bit of debugging and cleanup left. |
|
Yes either way. With a use case this looks like a nice library :) I would maybe first add some examples / tests before cleaning up. |
Even if #71 is unsuccessful, computing follow sets will be informative along with other generated
*.txtfiles in verbose mode.Tested on calc.bnf - generated follow.txt file.