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

template arguments, converters, flexibly lexing, and lazy parsing #5

Open
cdunn2001 opened this issue Jul 16, 2017 · 0 comments
Open

Comments

@cdunn2001
Copy link

In my opinion, there should be several pieces:

  1. Json lexer (gason is excellent for this.)
    • One advantage is that the lexer could handle arbitrarily long ints and floats. The parser would later flag an error when data do not fit the datatypes. (Technically, very few Json parsers satisfy the JSON standard, which does not limit numerics.)
    • Also, lazy parsing becomes possible, which in some scenarios leads to much quicker sparse access than with most Json parsers available today.
    • It is also possible to stream the lexer to the parser.
  2. Json parser, templated on <Int, Float, String> and maybe also list and dict types.
    • If list/dict are also template arguments, then STL allocators are automatically included.
  3. An API for providing converters between array-of-char and those template-arg types

Several lexers, specializations, and converters could be provided. There could be obvious defaults, so convenience should not be the issue.

(For the record, I maintain JsonCpp, which is not even close to what I would want in standard C++.)

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

1 participant