Skip to main content

Module parser

Module parser 

Source
Expand description

Parser: converts raw .agm text into an unvalidated AST.

The parser is hand-written and line-oriented. Each line is classified (scalar field, list, block, node declaration, comment, blank) and indentation tracking determines field boundaries.

Re-exports§

pub use lexer::Line;
pub use lexer::LineKind;
pub use lexer::classify_line;
pub use lexer::lex;

Modules§

fields
Shared field-parsing helpers used by both header and node parsers.
header
Header parser: reads the AGM file header and produces a Header struct.
lexer
Lexer: classifies each line of an AGM source file into a LineKind.
mem
Parser for .agm.mem sidecar files.
node
Node parser: reads a single AGM node declaration and its fields.
sidecar
Shared sidecar line classifier and lexer.
state
Parser for .agm.state sidecar files.
structured
Structured field parsers: converts typed sub-fields into model types.

Functions§

parse
Parses raw AGM source text into an unvalidated AgmFile.

Type Aliases§

ParseResult
Result type for parser operations.