Skip to content
workflow

Parser State

Translate a textual grammar or staged input contract into explicit phases, flags, or state transitions that determine which characters or tokens are legal next.

Tagged articles

Parser State articles

2 articles in this tag.

Detailed shot of microchips on a circuit board, showcasing electronic technology and precision engineering.
intermediate
10 min read

String to Integer (atoi)

A reliable atoi parser is a small state machine: skip leading spaces, read one optional sign, consume one numeric prefix, and guard every accumulator…

View solution
Two ancient columns stand majestically against a serene hillside backdrop.
advanced
12 min read

Valid Number

A decimal point and an exponent are easy to track. The hard part is proving that every numeric component actually contains the digits the grammar requires.

View solution