rust-ast-explorer icon indicating copy to clipboard operation
rust-ast-explorer copied to clipboard

Rust AST Explorer

Hosted Live: https://carlkcarlk.github.io/rust-ast-explorer/

Paste Rust code and see the AST (abstract syntax tree) it generates.

Alternative:

  • https://astexplorer.net/ -- fancier, mouse over the language to select Rust

Based on

  • The syn crate provides the Rust parser and the debug formatter.
    • https://docs.rs/syn/latest/syn/struct.File.html
  • WASM allows everything to run in the user's browser.
    • https://developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_wasm