Shared parsing and algorithmic utilities which often come in handy
Parsers and evaluators to work with a subset of regular expression in a lexical analysis context.
- Validate and compile regular expression into state machines
- Minimize FSAs into deterministic state machines
- Knit FSAs for multiple tokens into one larger state machine which can match several tokens
- Tokenize input texts with a default single token of lookahead
- Serialize and deserialize state machines
Search for items in 2D space having coordinates within a square search area.
- Optimize searching for an element's closest neighbor
- Optimize searching for elements near the coordinates of a user's interaction
- Find all elements falling within a 2D fenced search area
Execution wrapper for unbound recursion on the heap. Execution frames are allowed to execute work at the time of initial execution, call recursive actions, and push actions for exection after all recursive work is complete.
Define a grammar of tokens and create a matching DFA which will match and identify any token from the language in linear time.
- Generate grammars at runtime
- Generate grammars at development time and load them from file
Define language production rules and top-down parsing logic which will be called in a trampolined execution context for theoretically unlimited push-down.
- Match sequences of tokens based on first and follow sets
- Emit syntax correctness validation messages
- Collect structural and literal content into abstract syntax trees (ASTs) based on the language's data contract
Calculate the stripes A
, B
, P
, and Q
used in data redundancy applications. Restore missing stripes from surviving data.
- Calculate singly-redundant parity
P
from stripesA
andB
- Restore
A
orB
givenP
and one of the other two stripes - Calculate second parity
Q
- Restore up to two missing stripes given any combination of two surviving stripes from
A
,B
,P
, orQ
- Extension functions for inline JSON (de-)serialization
- Extension functions to (de-)serialize FSAs
- Extension functions to create and parse standards-compliant data URIs
- Simple helper to generate random distinct colors