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

Provide helper for parser #54

Closed
KazDragon opened this issue Oct 15, 2015 · 2 comments
Closed

Provide helper for parser #54

KazDragon opened this issue Oct 15, 2015 · 2 comments
Assignees

Comments

@KazDragon
Copy link
Owner

At the moment, parser only knows about vectors. And it should stay that way.

It needs a helper, though, since telnetpp will require a stream of (vector | any), and those anys must be passed through.

Therefore, we need a parser helper that accepts the compound type and returns a vector, where all the vectors have been buffered up and parsed into elements, and all the anys have been passed through.

Note: the anys must be passed through as close to their reception point as necessary. It's expected that these will always occur on element boundaries within the streams, but it's not necessarily true.

@KazDragon
Copy link
Owner Author

After some thought, it's probably not for the best that the interface is being weighed down so. It's getting little cumbersome. So it may be better to revert generate to trafficking only in vectors, and to introduce a "telnetpp::session" object, which can encapsulate all of the routing, parsing and generating behind three functions: install(option), receive(vector) ->vector and send(vector) -> vector.

Except even that looks a little lopsided with tokens on one side and elements on the other. Problem is that receiving data returns an immediate response that should be sent to the lower layer. The same isn't true of generating bytes for the lower layer with send.

@KazDragon
Copy link
Owner Author

I don't think I'll be able to get perfect symmetry out of this.

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

1 participant