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 · 3 comments
Open

Investigate accepting a stream of tokens as input #202

tzlaine opened this issue Oct 24, 2024 · 3 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 Nov 29, 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 29, 2024
tzlaine added a commit that referenced this issue Nov 29, 2024
tzlaine added a commit that referenced this issue Nov 29, 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 29, 2024
tzlaine added a commit that referenced this issue Nov 29, 2024
…hpp is

now required to come before parser.hpp.

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

range's value type is a specializtion of token.

See #202.
tzlaine added a commit that referenced this issue Nov 29, 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 29, 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 29, 2024
tzlaine added a commit that referenced this issue Nov 29, 2024
…anslation

in *parse_impl(); add support to the error handlers and their support
functions directly instead.  There are simply too many APIs there that need
the translation to leave it to other code.

Add lex_error exception type, and add support for all the APIs that used to
take a parse_error param to now take either a parse_error or a lex_error.

Throw lex_error from failed parsing of lexed tokens in detail::make_token().

See #202.
tzlaine added a commit that referenced this issue Nov 29, 2024
seq_parser to use the tokens_view pointer from the contet to trim the cache at
an expectation point.

See #202.
tzlaine added a commit that referenced this issue Nov 29, 2024
tzlaine added a commit that referenced this issue Nov 30, 2024
…es. Make

sure not to copy tokens_view within the *parse() call graph.

See #202.
tzlaine added a commit that referenced this issue Nov 30, 2024
detail::token_with_value, just in case.

See #202.
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