Skip to main content

Crate sim_codec_pratt

Crate sim_codec_pratt 

Source
Expand description

Shared Pratt parser substrate for SIM codecs.

A concrete codec owns its lexer and operator table, then hands a stream of SpannedPrattToken values to PrattCodecParser. The parser applies the shared precedence-climbing driver and returns a sim_kernel::LocatedExprTree with source spans, trivia, and decode-budget checks attached to the parsed expression nodes.

The crate is intentionally language-neutral: token sources decide how source text becomes Pratt tokens, while this crate owns only the common grouping and expression-tree construction rules.

Structs§

PrattCodecParser
Language-neutral Pratt driver: an operator table plus any token source.
SpannedPrattToken
A Pratt token with its source span, produced by a language-specific lexer.

Statics§

RECIPES
Cookbook recipes for this parser substrate, embedded at build time.

Traits§

PrattTokenSource
A lexer that turns source text into Pratt tokens for the shared driver.

Functions§

raw_number_expr
Builds the raw-number expression emitted for Pratt numeric literal tokens.
raw_number_tag
Returns the raw-number tag consumed by Algol number-domain lowering.