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

Investigate accepting a stream of tokens as input #202

Open
tzlaine opened this issue Oct 24, 2024 · 6 comments
Open

Investigate accepting a stream of tokens as input #202

tzlaine opened this issue Oct 24, 2024 · 6 comments

Comments

@tzlaine
Copy link
Collaborator

tzlaine commented Oct 24, 2024

Not sure exactly how this should work -- should it take some abstract notion of a token, a lexrtl token, something I create, a CTRE-style thing, or what?

But it definitely deserves at least some investigation. Some parsers are very hard to write (or even ambiguous) without lexing first.

tzlaine added a commit that referenced this issue Nov 5, 2024
… external

dependency.  Lots of TODOs, somewhat thin testing, but the basics work.

See #202.
tzlaine added a commit that referenced this issue Nov 5, 2024
detail::make_input_subrange() out into its own header for reuse.

See #202.
tzlaine added a commit that referenced this issue Nov 5, 2024
detail::make_input_subrange() out into its own header for reuse.

See #202.
tzlaine added a commit that referenced this issue Nov 7, 2024
tzlaine added a commit that referenced this issue Nov 7, 2024
advancing past the end of the cache.  Filter out whitespace tokens entirely.
Make tokens_view noncopyable+nonmovable.

See #202.
tzlaine added a commit that referenced this issue Nov 7, 2024
tzlaine added a commit that referenced this issue Nov 8, 2024
… code to

use a bool and a double as its value, repsectively, instead of a string_view.

See #202.
tzlaine added a commit that referenced this issue Nov 8, 2024
tzlaine added a commit that referenced this issue Nov 8, 2024
…ation.

Therer's room for it, since it's in a union with a string_view anyway.

See #202.
tzlaine added a commit that referenced this issue Nov 9, 2024
tzlaine added a commit that referenced this issue Nov 9, 2024
tzlaine added a commit that referenced this issue Nov 9, 2024
tzlaine added a commit that referenced this issue Nov 9, 2024
tzlaine added a commit that referenced this issue Nov 9, 2024
… and

parser_interface.  token_spec is now a variable template that generates a
parser_interface wrapping a token_parser, which parameterized on the
token_spec_t.  This way, a single token_spec use can be used to specify how to
lex, and how to parse.

See #202.
tzlaine added a commit that referenced this issue Nov 9, 2024
tzlaine added a commit that referenced this issue Nov 9, 2024
tzlaine added a commit that referenced this issue Nov 10, 2024
…hpp is

now required to come before parser.hpp.

See #202.
tzlaine added a commit that referenced this issue Nov 10, 2024
…n the

range's value type is a specializtion of token.

See #202.
tzlaine added a commit that referenced this issue Nov 10, 2024
underlying sequence, and change the way that the error handler is invoked, so
that it detects token iterators, and passes iterators into the underlying
range to the error handler, instead of the token iterators.

See #202.
tzlaine added a commit that referenced this issue Nov 10, 2024
…ror, to

ensure that the messge is preserved exactly when translating exceptions in
failed lexer parsing.

See #202.
tzlaine added a commit that referenced this issue Nov 10, 2024
tzlaine added a commit that referenced this issue Dec 2, 2024
… for the

full set of *parse() functions that support token parsing; fix errors.

See #202.
tzlaine added a commit that referenced this issue Dec 3, 2024
tzlaine added a commit that referenced this issue Dec 3, 2024
… for the

full set of *parse() functions that support token parsing; fix errors.

See #202.
tzlaine added a commit that referenced this issue Dec 5, 2024
…f the

character parsers out into a standalone detail:: function; use it in all the
character parsers.

See #202.
tzlaine added a commit that referenced this issue Dec 5, 2024
tzlaine added a commit that referenced this issue Dec 6, 2024
…f the

character parsers out into a standalone detail:: function; use it in all the
character parsers.

See #202.
tzlaine added a commit that referenced this issue Dec 6, 2024
tzlaine added a commit that referenced this issue Dec 6, 2024
tzlaine added a commit that referenced this issue Dec 7, 2024
tzlaine added a commit that referenced this issue Dec 7, 2024
tzlaine added a commit that referenced this issue Dec 7, 2024
tzlaine added a commit that referenced this issue Dec 7, 2024
exercise the token parsing code; fix errors.

See #202.
tzlaine added a commit that referenced this issue Dec 8, 2024
exercise the token parsing code; fix errors.

See #202.
tzlaine added a commit that referenced this issue Dec 8, 2024
…cate

which error handling function apply this function to their inputs and which do
not.

See #202.
tzlaine added a commit that referenced this issue Dec 8, 2024
…lue, and

doing transcoding for the match in detail::token_with_string_view.

See #202.
@tzlaine
Copy link
Collaborator Author

tzlaine commented Dec 8, 2024

Ok, this stuff is pretty much ready to go. I say "pretty much" only because I don't want to merge it quite yet, since I don't really have a big enough use case for it to really try it out.

@jefftrull, that's where you come in. :) Please give it a try and tell me what's under-documented, hard to use, etc. You can find all the code on the ctre branch, and the pre-built updated docs can be found on the ctre_doc branch (just point your browser at parser/doc/html/index.html).

@jefftrull
Copy link

Things are a little crazy right now but I'm very excited to try this. Thanks for taking on this big feature!

@tzlaine
Copy link
Collaborator Author

tzlaine commented Dec 10, 2024

No worries! The branch isn't going anywhere.

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

No branches or pull requests

2 participants