https://github.com/conorwilliams/aoc_2024
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.1%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: ConorWilliams
- License: mit
- Language: C++
- Default Branch: main
- Size: 168 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
AoC_2024
KISS principled C++23 (no modules), file == self-contained solution.
sh
make -S . -B build && cmake --build build
Yeti
Many types in yeti use deducing this, these types are marked as final as they are not inheritance proofed.
The yeti library is a parser combinator library that is designed to be simple, efficient and leverage C++23/26 features. With the goal of simplifying the implementation, yeti makes all of its types aggregates. This exposes some internals but saves a lot of boilerplate code.
Yeti is constexpr all the way down.
Yeti tries to have descriptive error messages.
Yeti has first class support for
skipignore/mute/silence/discard/drop
The parser hierarchy
Parser function: parser_fn: P -> S -> T -> E -> bool
- Is a non-throwing move-constructible type.
- If
Pdefines a::typethenX <- ::typeelseX <- void. - If
XandSare both non-void thenXisstd::common_withS. - Can be invoked with an
Sto produce aresult<yeti::strip<S>, T, E>. - Can be invoked with an
Xto produce aresult<yeti::strip<X>, T, E>. - Invocations in 4 and 5 must return the same type.
- Invocations in 4-5 must be valid for all value categories (VC).
- Invocations in 4-5 must return the same type independent of the VC.
If S or X is void the requirements corresponding to their invocation are dropped
and the parser is assumed to be generic.
If T/E is void then the T/E of the result in 4-5 are not required to match void.
The purpose of No. 6-8 is to make static type checking possible for typed parsers before they are invoked.
Parser: parser: P -> S -> T -> E -> bool
- Is a
parser_fn<P, S, T, E> - Has
.skip()and.mute()methods. - The methods in (2) must be valid for all VC.
- The methods in (3) must return the same type (modulo const/volatile/ref) independent of the VC.
- The result of
.skip()is aparser<_, 'S, U, E>. - The result of
.mute()is aparser<_, 'S, T, U>.
In No 5-6, 'S is the static type of P if it is not void otherwise S, similarly U is void
if 'S is void else its is unit.
Similar to parser_fn, the purpose of No 3-4 is to make static type checking
possible for typed parsers before they are invoked.
Combinators
Down-propagating:
- drop
- skip
- mute
Sequencing:
- then
- then_ignore
- ignore_then
Alternation:
- alt
Repetition:
- fold
- many
Descriptive:
- desc
- opaque
Parsers
Generic
trivial:
pureparser that does nothing and always succeeds.failparser that does nothing and always fails.eofparser that matches the end of the input.
ranges requires that the input stream can be constructed from a pair of iterators:
satisfytrue if the condition is met.
The condition must
Return something convertible to bool, optionally an error:
f(token) -> expected
Made from satisfy:
anyparser that matches one token of any input and returns it.litmatch a single literal token of input and returns it.one_ofmatch any token in the other rangeseqmatch a range of tokens and return them.
Over strings
- integer
floating
ws
eol
Owner
- Name: Conor Williams
- Login: ConorWilliams
- Kind: user
- Company: myrtle.ai
- Website: https://conorwilliams.github.io/
- Repositories: 6
- Profile: https://github.com/ConorWilliams
PhD Physicist & Computer-Scientist. Open source enthusiast!
GitHub Events
Total
- Push event: 31
- Create event: 2
Last Year
- Push event: 31
- Create event: 2
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0