Skip to main content

Crate hedl_core

Crate hedl_core 

Source
Expand description

Core parser and data model for HEDL format.

This crate provides the main parsing functionality for HEDL documents, including header directives, body parsing, and reference resolution.

§Lexical Analysis

The lex module provides the complete lexical analysis infrastructure, consolidating functionality from hedl-lex, hedl-row, and hedl-tensor:

  • Token validation (key tokens, type names, ID tokens, references)
  • CSV/matrix row parsing with expression and tensor support
  • Multi-dimensional tensor literal parsing
  • Incremental parsing for IDE integration
  • Source position and span tracking for error reporting

See lex module documentation for more details and examples.

Re-exports§

pub use header::CountValue;
pub use header::ParseMode;
pub use coercion::coerce;
pub use coercion::coerce_with_config;
pub use coercion::CoercionConfig;
pub use coercion::CoercionLevel;
pub use coercion::CoercionMode;
pub use coercion::CoercionResult;
pub use inference::infer_value_synthesize;
pub use inference::infer_value_with_type;
pub use inference::InferenceConfidence;
pub use inference::InferenceContext;
pub use inference::InferenceResult;
pub use preprocess::preprocess;
pub use reference::resolve_references;
pub use reference::resolve_references_with_limits;
pub use reference::ReferenceMode;
pub use schema_version::FieldDef;
pub use schema_version::Schema;
pub use schema_version::SchemaVersion;
pub use traverse::traverse;
pub use traverse::DocumentVisitor;
pub use traverse::StatsCollector;
pub use traverse::VisitorContext;
pub use types::value_to_expected_type;
pub use types::ExpectedType;
pub use types::TensorDtype;
pub use visitor::transform;
pub use visitor::traverse as visitor_traverse;
pub use visitor::traverse_fallible;
pub use visitor::traverse_mut;
pub use visitor::DepthCounter;
pub use visitor::FallibleVisitor;
pub use visitor::NodeCollector;
pub use visitor::PathCollector;
pub use visitor::PathSegment;
pub use visitor::ReferenceCollector;
pub use visitor::Transformer;
pub use visitor::TraversalConfig;
pub use visitor::TraversalMode;
pub use visitor::TraversalOrder;
pub use visitor::TraversalResult;
pub use visitor::TraversalStats;
pub use visitor::VisitDecision;
pub use visitor::Visitor;
pub use visitor::VisitorMut;
pub use lex::ExprLiteral;
pub use lex::Expression;
pub use lex::Reference as ReferenceToken;
pub use lex::Tensor;
pub use parallel::collect_ids_parallel;
pub use parallel::identify_entity_boundaries;
pub use parallel::parse_matrix_rows_parallel;
pub use parallel::validate_references_parallel;
pub use parallel::AtomicSecurityCounters;
pub use parallel::EntityBoundary;
pub use parallel::EntityType;
pub use parallel::MatrixRowBatch;
pub use parallel::ParallelConfig;

Modules§

coercion
Value coercion for HEDL type system. Value coercion for HEDL type system.
convert
Common conversion utilities and traits for HEDL format converters. Common conversion utilities and traits for HEDL format converters.
errors
Error handling utilities and centralized error messages. Error handling utilities and centralized error messages.
header
Header directive parsing for HEDL. Header directive parsing for HEDL.
inference
Value inference ladder for HEDL. Value inference ladder for HEDL.
lex
Lexical analysis subsystem for HEDL. Lexical analysis subsystem for HEDL.
parallel
Parallel parsing infrastructure for hedl-core. Parallel parsing infrastructure for hedl-core.
preprocess
Input preprocessing for HEDL parsing. Input preprocessing for HEDL parsing.
reference
Reference resolution for HEDL. Reference resolution for HEDL.
schema_version
Schema versioning for HEDL types. Schema versioning for HEDL types.
traverse
Document traversal trait for format converters. Document traversal trait for format converters.
types
Type system for bidirectional type checking in HEDL. Type system for bidirectional type checking in HEDL.
validation
Comprehensive validation framework for HEDL documents. Comprehensive validation framework for HEDL documents.
visitor
Comprehensive visitor pattern API for HEDL document traversal. Comprehensive visitor pattern API for HEDL document traversal.

Structs§

Document
A parsed HEDL document.
HedlError
An error that occurred during HEDL parsing.
Limits
Configurable limits for parser security.
MatrixList
A typed matrix list with schema.
Node
A node in a matrix list.
ParseOptions
Parsing options for configuring HEDL document parsing behavior.
ParseOptionsBuilder
Builder for ergonomic construction of ParseOptions.
Reference
A reference to another node.

Enums§

HedlErrorKind
The kind of error that occurred during parsing.
Item
An item in the document body.
Value
A scalar value in HEDL.

Functions§

parse
Parse a HEDL document from bytes.
parse_with_limits
Parse a HEDL document with custom options.

Type Aliases§

HedlResult
Result type for HEDL operations.