Andrew's Digital Garden

Abstract syntax trees

An abstract syntax tree (AST), is a tree representation of the abstract syntactic structure of source code written in a programming language. Each node of the tree denotes a construct occurring in the source code.

ASTs are an object representation of code after being parsed. This is needed for transpilers, linters, etc. which require an AST to act upon. Different tools structure their ASTs differently, but they're usually similar.

They are a great tool in [[staticcodeanalysis]]

https://astexplorer.net/ is a great tool for Javascript

[[codemods]] [[js]]

Abstract syntax trees