Closed yossigil closed 3 years ago
This API is documented perhaps?
Not yet. But EBNFTest uses it for FIRST(). Still with a bug, but demonstrating the capability.
The API is in fact a Visitor and a Traverser. I hope it's what you had in mind.
On Fri, 11 Jun 2021 at 20:08 Yossi Gil @.***> wrote:
This API is documented perhaps?
— You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub https://github.com/metormaon/flue-api/issues/1#issuecomment-859722334, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFJ3LLLU2GIBUDXHL44U5TTSI7JJANCNFSM44QYP75A .
You need only one: a visitor.
You may want to apply something a little more tricky, but useful. A visitor should supply a reduce function. The API should apply this reduce function. A reduce is a function from TxT...xT a tuple of T's to T. The API goes over the tree and applies this function bottom up.
Do you mean that when the visitor visits a Multinary, it will use the reduce method?
If so, then:
The client supplies its own reduce function. The API runs reduce on the tree structure. Not crucial, but nice architecture See here: https://gist.github.com/Ad115/fbee7a7a85935888d383f05b7f99e956
https://pkg.go.dev/golang.org/x/exp/ebnf
You may check this out for reference
The regular expression in the rule body must be accessible; perhaps not modifiable, but it should be able to create a rule programmatically so that one can develop and run algorithms such as first and follow on the set of rules.
https://web.eecs.umich.edu/~weimerw/2009-4610/reading/FirstFollowLL.pdf