Skip to main content

Module ast

Module ast 

Source
Expand description

AST module for C++20

Converts C++ source code into a structured Abstract Syntax Tree, modeled after the syn crate architecture.

Entry point: parse_file returns a File containing a list of Items.

Re-exports§

pub use error::AstError;
pub use expr::Expr;
pub use stmt::Block;
pub use stmt::Stmt;
pub use ty::Type;
pub use item::*;

Modules§

error
Parse error types with rich diagnostics via miette
expr
Expression AST nodes for C++20
item
Item types for C++20 top-level declarations
punct
Punctuated sequences - lists of syntax tree nodes separated by punctuation tokens
stmt
Statement AST nodes for C++20
ty
Type AST nodes for C++20
visit
Visitor trait for AST traversal

Structs§

File
A complete C++ translation unit, analogous to syn::File.

Functions§

parse_file
Parse a C++ source file into an AST.